---
title: "Cancel On-Demand Sync"
method: POST
path: "/connections/on-demand-syncs/{sync_id}/cancel"
tags: ["Auth"]
---

# Cancel On-Demand Sync

`POST /connections/on-demand-syncs/{sync_id}/cancel`

## Request

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

Cancel a pending on-demand sync job.

## Path parameters

- `sync_id` string, required

## Headers

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

## 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

- `404`: Not found
- `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/:sync_id/cancel/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)
