List sync jobs

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

Returns the sync jobs queued or run for a source, newest first, optionally filtered by status.

Finished jobs are short-lived: a completed or failed job is purged 7 days after it finishes. Sync logs are kept, so use List sync logs for long-term history and this endpoint to watch the queue.

Only the first page is reachable from this endpoint: pagination.page is always 1; raise limit (up to 100) to see more jobs.

An unknown datasetId or sourceId, or a source that belongs to a different dataset, returns 404. A source with no jobs returns an empty list.

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

Path parameters

2
datasetIdstring (uuid)required

The dataset the source belongs to.

sourceIdstring (uuid)required

The source whose jobs to list.

Query parameters

2
statusstring

Return only jobs in this state. Omit or leave empty for all states.

pendingprocessingcompletedfailed
limitinteger

Jobs to return. Must be an integer from 1 to 100; non-numeric and out-of-range values are rejected with 422 rather than clamped.

default: 20min: 1max: 100

Response

200The most recent jobs for the source.
successbooleanrequired

Always true on a 2xx response.

array<SyncJob>required

Jobs newest first. Each includes priority.

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"
SyncJobPaginationrequired

Page metadata returned by List sync jobs. Differs from the shared Pagination shape.

pageintegerrequired

The page that was returned. Currently always 1.

e.g. 1
limitintegerrequired

The limit that was applied.

e.g. 20
totalintegerrequired

Total jobs matching the filter, across all pages.

e.g. 2
totalPagesintegerrequired

total divided by limit, rounded up.

e.g. 1

Errors

21

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

404
Data source not found or access denied

No source with that sourceId belongs to the organization that owns the key, or the source belongs to a different datasetId than the path. Checked after parameter validation.

422
Limit must be between 1 and 100

limit was supplied and is non-numeric, below 1 or above 100, and it is the only invalid parameter.

422
Invalid status. Must be one of: pending, processing, completed, failed

status was supplied and is not one of the four job states, and it is the only invalid parameter.

422
Validation failed.

Both limit and status are invalid. details lists one { path, message } entry per invalid parameter, using the messages above. A single-parameter failure also carries details.

{
  "error": "Validation failed.",
  "details": [
    {
      "path": "limit",
      "message": "Limit must be between 1 and 100"
    },
    {
      "path": "status",
      "message": "Invalid status. Must be one of: pending, processing, completed, failed"
    }
  ]
}
curl -X GET "https://stylor.ai/api/v1/datasets/YOUR_DATASET_ID/sources/YOUR_SOURCE_ID/sync/jobs" \
  -H "Authorization: Bearer $STYLOR_API_KEY"
Response · 200
{
  "success": true,
  "jobs": [
    {
      "jobId": "c2e4a6b8-1d3f-4a5c-9e7b-6d8f0a2c4e6b",
      "sourceId": "8a4d2f1e-3c5b-4e6a-9d7f-2b1c3d4e5f6a",
      "datasetId": "3f1c2a9e-6b7d-4c1e-9a2b-1d4e5f6a7b8c",
      "status": "processing",
      "priority": 0,
      "result": {
        "stats": {
          "retrieved": 0,
          "added": 0,
          "updated": 0,
          "archived": 0,
          "failed": 0
        }
      },
      "worker": {
        "workerId": "v1-sync-9c0f1a2b-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
        "lockedAt": "2026-09-12T09:42:11.204Z",
        "startedAt": "2026-09-12T09:40:03.917Z"
      },
      "retries": {
        "count": 0,
        "maxRetries": 3
      },
      "createdAt": "2026-09-12T09:39:58.110Z",
      "updatedAt": "2026-09-12T09:42:11.204Z"
    },
    {
      "jobId": "7e5c3a1f-9b8d-4c2e-a6f4-1d3b5c7e9a0f",
      "sourceId": "8a4d2f1e-3c5b-4e6a-9d7f-2b1c3d4e5f6a",
      "datasetId": "3f1c2a9e-6b7d-4c1e-9a2b-1d4e5f6a7b8c",
      "status": "completed",
      "priority": 0,
      "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"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 2,
    "totalPages": 1
  }
}