Retrieve a sync job

get/v1/datasets/{datasetId}/sources/{sourceId}/sync/jobs/{jobId}

Returns the current state of one job. Poll this after Create sync job until status is completed or failed, then read result.stats or result.error. logId, when present, points at the sync log with the run's line-by-line entries.

This response omits priority; everything else in the job schema is included. Remember that finished jobs are purged 7 days after completion, after which this endpoint returns 404.

Private keyapi.v1.datasets.sources.syncJobs.retrieveNo demo

Path parameters

3
datasetIdstring (uuid)required

The dataset the source belongs to.

sourceIdstring (uuid)required

The source the job belongs to.

jobIdstring (uuid)required

The job to retrieve.

Response

200The job.
successbooleanrequired

Always true on a 2xx response.

SyncJobrequired

A queued or finished sync run. Lifecycle: pending → processing → completed | failed. See Create sync job for the full state machine. Finished jobs are deleted 7 days after result.completedAt; the linked sync log is kept. organizationId is not returned.

jobIdstring (uuid)required

Unique identifier of the job.

e.g. "c2e4a6b8-1d3f-4a5c-9e7b-6d8f0a2c4e6b"
sourceIdstring (uuid)required

The source being synced.

e.g. "8a4d2f1e-3c5b-4e6a-9d7f-2b1c3d4e5f6a"
datasetIdstring (uuid)required

The dataset the source feeds.

e.g. "3f1c2a9e-6b7d-4c1e-9a2b-1d4e5f6a7b8c"
statusstringrequired

pending — waiting for a worker. processing — a worker holds the job. completed — finished; see result.stats. failed — errored or cancelled; see result.error.

One ofpendingprocessingcompletedfailed
priorityinteger

Workers claim higher values first, then older jobs. Jobs created through the API always have 0. Only present on list responses.

default: 0e.g. 0
logIdstring (uuid)

The sync log for this run. Set when the job finishes; absent while pending, and on jobs that were cancelled or failed before a log was started.

e.g. "d9f1b3a5-7c2e-4d6f-8a1b-3c5e7f9a1b2d"
objectrequired

Outcome of the run. stats is present from creation (all zeros until completion).

object

Lock information. Absent until a worker claims the job; workerId and lockedAt are cleared when it finishes, startedAt remains.

objectrequired

Retry bookkeeping. Informational only; stale-lock re-queues do not increment count.

createdAtstring (date-time)required

When the job was enqueued.

e.g. "2026-09-12T09:39:58.110Z"
updatedAtstring (date-time)required

When the job last changed, including worker heartbeats.

e.g. "2026-09-12T09:42:11.204Z"

Errors

18

Every error is JSON with a single error string unless noted. Match on the status code; the message is for humans.

404
Sync job not found

No job with that jobId belongs to the organization that owns the key under the datasetId and sourceId in the path, or the job finished more than 7 days ago and has been purged.

curl -X GET "https://stylor.ai/api/v1/datasets/YOUR_DATASET_ID/sources/YOUR_SOURCE_ID/sync/jobs/YOUR_JOB_ID" \
  -H "Authorization: Bearer $STYLOR_API_KEY"
Response · 200
{
  "success": true,
  "job": {
    "jobId": "7e5c3a1f-9b8d-4c2e-a6f4-1d3b5c7e9a0f",
    "sourceId": "8a4d2f1e-3c5b-4e6a-9d7f-2b1c3d4e5f6a",
    "datasetId": "3f1c2a9e-6b7d-4c1e-9a2b-1d4e5f6a7b8c",
    "status": "completed",
    "logId": "d9f1b3a5-7c2e-4d6f-8a1b-3c5e7f9a1b2d",
    "result": {
      "stats": {
        "retrieved": 1284,
        "added": 12,
        "updated": 37,
        "archived": 3,
        "failed": 0
      },
      "completedAt": "2026-09-11T03:00:12.418Z"
    },
    "worker": {
      "startedAt": "2026-09-11T02:58:40.005Z"
    },
    "retries": {
      "count": 0,
      "maxRetries": 3
    },
    "createdAt": "2026-09-11T02:58:31.772Z",
    "updatedAt": "2026-09-11T03:00:12.419Z"
  }
}