Cancel a sync job
/v1/datasets/{datasetId}/sources/{sourceId}/sync/jobs/{jobId}/cancelRemoves a job from the queue before a worker picks it up. The request has no body.
Only pending jobs can be cancelled. A cancelled job is recorded as failed
with result.error set to Job cancelled by user and result.completedAt set
to the cancellation time; it is purged 7 days later like any other finished job.
No sync log is created.
Jobs that are already processing cannot be interrupted — wait for them to
finish. Calling cancel on a processing, completed or failed job returns
409.
Path parameters
3The dataset the source belongs to.
The source the job belongs to.
The pending job to cancel.
Response
Always true on a 2xx response.
Always Sync job cancelled successfully.
Errors
19Every error is JSON with a single error string unless noted. Match on the status code; the message is for humans.
Sync job not foundNo job with that jobId belongs to the organization that owns the key under the datasetId and sourceId in the path, or it has already been purged.
Cannot cancel job with status '<status>'. Only pending jobs can be cancelled.The job is processing, completed or failed. The message names the job's current status.
curl -X POST "https://stylor.ai/api/v1/datasets/YOUR_DATASET_ID/sources/YOUR_SOURCE_ID/sync/jobs/YOUR_JOB_ID/cancel" \
-H "Authorization: Bearer $STYLOR_API_KEY"{
"success": true,
"message": "Sync job cancelled successfully"
}