---
title: "Create On-Demand Sync"
method: POST
path: "/connections/on-demand-syncs"
tags: ["Auth"]
---

# Create On-Demand Sync

`POST /connections/on-demand-syncs`

## Request

- Base URL: `https://production.trackstarhq.com`
- URL: `https://production.trackstarhq.com/connections/on-demand-syncs`
- Auth: none required

Request a sync for a specific date range. Creates a sync job that is
processed by a scheduler.

## Headers

- `x-trackstar-api-key` string, required
- `x-trackstar-access-token` string, required

## Request body

- DateRangeSyncInputSchema
  - `start_time` string, date-time, required: The start time for the sync range.
  - `end_time` string, date-time, required: The end time for the sync range.
  - `function_name` string, required: The function to sync.

## Response `200`

Successful response

- OnDemandSyncResponseSchema
  - `data` SyncJob, required
    - `id` string, required: The sync job ID.
    - `connection_id` string, required: The connection ID for the sync job.
    - `function_name` string, required: The function being synced.
    - `status` 'open' | 'cancelled' | 'completed' | 'stuck', required: The job status.
    - `requested_start_time` string, required: Start of the sync range.
    - `requested_end_time` string, required: End of the sync range.
    - `created_at` string, required: When the job was created.
    - `completed_at` string, nullable: When the job completed.
    - `cancelled_at` string, nullable: When the job was cancelled.

## Other responses

- `422`: Validation error

## Changes

- **2026-11-03** `f9f948f2a7b3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/trackstarhq/apis/trackstar-api/changes/connections/on-demand-syncs/post.md)

---

[API](https://skmtc.dev/trackstarhq/apis/trackstar-api.md) - [All operations](https://skmtc.dev/trackstarhq/apis/trackstar-api/llms.txt) - [OpenAPI document](https://skmtc.dev/trackstarhq/apis/trackstar-api/revisions/08647f790594?raw)
