> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List background jobs for a tenant

> Jobs for this tenant

### Path parameters

<ParamField path="tenant_id" type="string" required>
  Tenant identifier
</ParamField>

### Query parameters

<ParamField query="page" type="integer (int32)">
  Page number (1-indexed)
</ParamField>

<ParamField query="page_size" type="integer (int32)">
  Items per page (max 100)
</ParamField>

<ParamField query="state" type="string">
  Filter by job state (queued, running, succeeded, failed, retry\_pending)
</ParamField>

<ParamField query="job_type" type="string">
  Filter by job type (e.g. shopify\_sync)
</ParamField>

### Response

`object`

<ResponseField name="items" type="JobInfo[]" required>
  The items on this page

  <Expandable title="JobInfo">
    <ResponseField name="claimedBy" type="string" />

    <ResponseField name="createdAt" type="string (date-time)" required />

    <ResponseField name="error" type="string" />

    <ResponseField name="finishedAt" type="string (date-time)" />

    <ResponseField name="jobId" type="string (uuid)" required />

    <ResponseField name="jobType" type="JobKind" required />

    <ResponseField name="leaseExpiresAt" type="string (date-time)" />

    <ResponseField name="maxRetries" type="integer (int32)" required />

    <ResponseField name="nextRetryAt" type="string (date-time)" />

    <ResponseField name="result" type="object" />

    <ResponseField name="retryCount" type="integer (int32)" required />

    <ResponseField name="scheduleId" type="string (uuid)" />

    <ResponseField name="startedAt" type="string (date-time)" />

    <ResponseField name="state" type="JobState" required />

    <ResponseField name="tenantId" type="string" required />
  </Expandable>
</ResponseField>

<ResponseField name="pagination" type="object" required>
  Pagination metadata

  <Expandable title="pagination">
    <ResponseField name="page" type="integer" required>
      Current page number
    </ResponseField>

    <ResponseField name="pageSize" type="integer" required>
      Number of items per page
    </ResponseField>

    <ResponseField name="totalItems" type="integer">
      Total number of items across all pages
    </ResponseField>

    <ResponseField name="totalPages" type="integer">
      Total number of pages
    </ResponseField>

    <ResponseField name="hasNext" type="boolean" required>
      Whether there is a next page
    </ResponseField>

    <ResponseField name="hasPrevious" type="boolean" required>
      Whether there is a previous page
    </ResponseField>
  </Expandable>
</ResponseField>

### Status codes

| Code  | Meaning              |
| ----- | -------------------- |
| `200` | Jobs for this tenant |
| `401` | Unauthorized         |

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.sync.stateset.com/v1/tenants/{tenant_id}/jobs' \
    --header 'x-stateset-api-key: YOUR_API_KEY'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "items": [
      {
        "claimedBy": "string",
        "createdAt": "2026-08-31T14:22:05Z",
        "error": "string",
        "finishedAt": "2026-08-31T14:22:05Z",
        "jobId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "jobType": null,
        "leaseExpiresAt": "2026-08-31T14:22:05Z",
        "maxRetries": 1,
        "nextRetryAt": "2026-08-31T14:22:05Z",
        "result": null,
        "retryCount": 1,
        "scheduleId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "startedAt": "2026-08-31T14:22:05Z",
        "state": null,
        "tenantId": "acme-outdoors"
      }
    ],
    "pagination": {
      "page": 1,
      "pageSize": 20,
      "totalItems": 1,
      "totalPages": 1,
      "hasNext": true,
      "hasPrevious": true
    }
  }
  ```
</ResponseExample>
