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

# List Contracts

> List contracts on jobs linked by this install, newest first. Filter by project link or status.

Returns contracts whose job is referenced by at least one [project link](/docs/developers/annotation-platforms/project-links) on the calling token's install, newest first. This is the pull-side complement to the [`contract.started` / `contract.ended` webhooks](/docs/developers/annotation-platforms/lifecycle-events) — poll it to reconcile state after downtime, since events are never replayed.

**Requirements:** `contracts:read` scope.

## Request

<ParamField query="projectLinkId" type="string">
  Restrict to contracts on the job linked by this project link. Returns `404` if no link with this ID exists on the install.
</ParamField>

<ParamField query="status" type="string">
  Filter by contract status: `active` or `ended`.
</ParamField>

<ParamField query="limit" type="integer" default="50">
  Maximum number of contracts to return (1–200).
</ParamField>

## Response

<ResponseField name="contracts" type="object[]">
  Array of contracts, newest first.

  <Expandable title="Contract fields">
    <ResponseField name="id" type="string">
      Contract ID. Use it with [`GET /contracts/{contractId}/participants`](/docs/developers/annotation-platforms/api-reference/contracts/participants).
    </ResponseField>

    <ResponseField name="status" type="string">
      `active` or `ended`.
    </ResponseField>

    <ResponseField name="jobId" type="string">
      The OpenTrain job the contract belongs to.
    </ResponseField>

    <ResponseField name="title" type="string | null">
      Contract title.
    </ResponseField>

    <ResponseField name="startDate" type="string | null">
      ISO 8601 start timestamp.
    </ResponseField>

    <ResponseField name="endDate" type="string | null">
      ISO 8601 end timestamp — `null` while the contract is active.
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      ISO 8601 creation timestamp.
    </ResponseField>

    <ResponseField name="projectLinkIds" type="string[]">
      Project links on this install referencing the contract job.
    </ResponseField>
  </Expandable>
</ResponseField>

## Errors

| Status | `code`         | Meaning                                               |
| ------ | -------------- | ----------------------------------------------------- |
| `400`  | `BAD_REQUEST`  | Invalid `status` value or `limit` out of range        |
| `401`  | `UNAUTHORIZED` | Missing, invalid, or revoked token                    |
| `403`  | `FORBIDDEN`    | Token lacks `contracts:read`                          |
| `404`  | `NOT_FOUND`    | `projectLinkId` does not match a link on this install |

<RequestExample>
  ```bash curl theme={null}
  curl -sS "https://app.opentrain.ai/api/partner/v1/contracts?status=active&limit=50" \
    -H "Authorization: Bearer $OT_PARTNER_TOKEN"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "contracts": [
      {
        "id": "<CONTRACT_ID>",
        "status": "active",
        "jobId": "<OPENTRAIN_JOB_ID>",
        "title": "Traffic signs batch 3 — annotation",
        "startDate": "2026-06-12T10:00:00.000Z",
        "endDate": null,
        "createdAt": "2026-06-12T10:00:00.000Z",
        "projectLinkIds": ["<LINK_ID>"]
      }
    ]
  }
  ```
</ResponseExample>
