> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trackstarhq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync Connection

> Manually trigger a sync for the connection associated with your access token.

Note - this does not sync historical data. Rather, it syncs data from the last sync time to the current time. To sync historical data, use the on-demand syncs endpoint.



## OpenAPI

````yaml post /connections/sync
openapi: 3.1.0
info:
  description: >

    Trackstar is a Unified API that provides standard endpoints for Supply Chain
    Logistics. We currently offer an API for Warehouse Management Systems (WMS).
  title: Trackstar API
  version: 0.1.0
servers:
  - description: Trackstar API
    url: https://production.trackstarhq.com
security: []
tags: []
externalDocs:
  description: Trackstar API Documentation
  url: https://docs.trackstarhq.com
paths:
  /connections/sync:
    post:
      tags:
        - Auth
      summary: Sync Connection
      description: >-
        Manually trigger a sync for the connection associated with your access
        token.


        Note - this does not sync historical data. Rather, it syncs data from
        the last sync time to the current time. To sync historical data, use the
        on-demand syncs endpoint.
      operationId: post_sync_connection
      parameters:
        - in: header
          name: x-trackstar-api-key
          description: Your organization-level Trackstar API key.
          schema:
            type: string
            example: <x-trackstar-api-key>
          required: true
        - in: header
          name: x-trackstar-access-token
          description: >-
            Your user's access token for a specific integration (ShipHero,
            Extensiv, etc).
          schema:
            type: string
            example: <x-trackstar-access-token>
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectionResourceSyncSchema'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncConnectionResponseSchema'
          description: Successful response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: Validation error
components:
  schemas:
    ConnectionResourceSyncSchema:
      type: object
      properties:
        functions_to_sync:
          type: array
          description: >-
            The specific functions to force sync. Make sure to use one
            compatible with the connection's type.
          example:
            - get_inventory
            - get_orders
          items:
            type: string
            enum:
              - get_inventory
              - get_products
              - get_inbound_shipments
              - get_orders
              - get_warehouses
              - get_shipping_methods
              - get_returns
              - get_bills
              - get_warehouse_customers
              - get_warehouse_locations
              - get_inventory_ledger
              - populate_customer_order_trackstar_tags
              - get_shipments
              - redact_cart_orders
              - get_invoice_line_items
              - get_sales_orders
              - get_sales_order_shipments
              - get_locations
              - get_items
              - get_customers
              - get_vendors
              - get_employees
              - get_purchase_orders
              - get_purchase_order_receipts
            description: Function to sync
      additionalProperties: false
      title: ConnectionResourceSyncSchema
    SyncConnectionResponseSchema:
      type: object
      properties:
        id:
          type: string
          description: The id of the connection synced.
          example: 07b344db-0304-4866-9ae1-ac8af5292a28
        syncing:
          type: boolean
          description: Whether or not the connection is syncing.
          example: true
        functions_to_sync:
          type: array
          description: >-
            The functions that are being synced. Returns empty if all are being
            synced.
          example:
            - get_inventory
            - get_orders
          items:
            type: string
            description: ''
      required:
        - functions_to_sync
        - id
        - syncing
      additionalProperties: false
      title: SyncConnectionResponseSchema
    ValidationError:
      properties:
        error:
          type: string
        detail:
          type: object
          properties:
            <location>:
              type: object
              properties:
                <field_name>:
                  type: array
                  items:
                    type: string
      required:
        - error
      type: object
      title: ValidationError

````