Retrieve a sync log

get/v1/datasets/{datasetId}/sources/{sourceId}/logs/{logId}

Returns one sync run with its full entry list. Use the logId from a finished job, or from List sync logs.

A log with status: running belongs to a job that is still processing; its stats and logs grow as the run progresses, so it is safe to poll.

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

Path parameters

3
datasetIdstring (uuid)required

The dataset the source belongs to.

sourceIdstring (uuid)required

The source the log belongs to.

logIdstring (uuid)required

The log to retrieve.

Response

200The log.
successbooleanrequired

Always true on a 2xx response.

SyncLogrequired

The record of one sync run. Created when a worker starts fetching (running), then finalised as completed or failed with counters and, on failure, an error. Logs are retained indefinitely and are the durable history of a source; jobs are purged after 7 days.

logIdstring (uuid)required

Unique identifier of the log. Referenced by SyncJob.logId.

e.g. "d9f1b3a5-7c2e-4d6f-8a1b-3c5e7f9a1b2d"
sourceIdstring (uuid)required

The source that was synced.

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

The organization that owns the source.

e.g. "5b7e9c1a-2d4f-4a6b-8c1d-9e2f3a4b5c6d"
datasetIdstring (uuid)required

The dataset the source feeds.

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

running while the worker is still fetching or diffing; completed or failed once finished.

One ofrunningcompletedfailed
SyncStatsrequired

Counters for one sync run. retrieved is how many products the store returned; the other four describe what the run did with them in the dataset's ingest queue. Items are processed asynchronously afterwards, so added and updated count queued changes rather than items that are already searchable.

errorstring

The failure reason. Present only when status is failed.

e.g. "Shopify API access forbidden (403)"
startedAtstring (date-time)required

When the run began. Lists are sorted by this field, newest first.

e.g. "2026-09-11T02:58:40.005Z"
completedAtstring (date-time)

When the run finished. Absent while running.

e.g. "2026-09-11T03:00:12.418Z"
createdAtstring (date-time)required

When the log record was created.

e.g. "2026-09-11T02:58:40.006Z"
updatedAtstring (date-time)required

When the log last changed.

e.g. "2026-09-11T03:00:12.418Z"
array<SyncLogEntry>required

Chronological entries written during the run. Empty array if none.

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 log not found or access denied

No log with that logId belongs to the organization that owns the key under the datasetId and sourceId in the path.

curl -X GET "https://stylor.ai/api/v1/datasets/YOUR_DATASET_ID/sources/YOUR_SOURCE_ID/logs/YOUR_LOG_ID" \
  -H "Authorization: Bearer $STYLOR_API_KEY"
Response · 200
{
  "success": true,
  "log": {
    "logId": "d9f1b3a5-7c2e-4d6f-8a1b-3c5e7f9a1b2d",
    "sourceId": "8a4d2f1e-3c5b-4e6a-9d7f-2b1c3d4e5f6a",
    "organizationId": "5b7e9c1a-2d4f-4a6b-8c1d-9e2f3a4b5c6d",
    "datasetId": "3f1c2a9e-6b7d-4c1e-9a2b-1d4e5f6a7b8c",
    "status": "completed",
    "stats": {
      "retrieved": 1284,
      "added": 12,
      "updated": 37,
      "archived": 3,
      "failed": 0
    },
    "startedAt": "2026-09-11T02:58:40.005Z",
    "completedAt": "2026-09-11T03:00:12.418Z",
    "createdAt": "2026-09-11T02:58:40.006Z",
    "updatedAt": "2026-09-11T03:00:12.418Z",
    "logs": [
      {
        "timestamp": "2026-09-11T02:58:40.005Z",
        "level": "info",
        "message": "Sync started by worker v1-sync-9c0f1a2b-3d4e-4f5a-8b6c-7d8e9f0a1b2c"
      },
      {
        "timestamp": "2026-09-11T02:59:31.880Z",
        "level": "info",
        "message": "Retrieved 1284 products"
      },
      {
        "timestamp": "2026-09-11T03:00:01.412Z",
        "level": "info",
        "message": "Processing batch 1/3 (500/1284 ops)"
      },
      {
        "timestamp": "2026-09-11T03:00:12.417Z",
        "level": "info",
        "message": "Sync completed: 12 added, 37 updated, 3 archived, 0 failed"
      }
    ]
  }
}