> ## 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.

# Close Job

> Close an open job to new proposals.

Closes a job — it leaves the public marketplace and stops accepting proposals. Existing contracts on the job are unaffected (end those separately via [`POST /contracts/{id}/end`](/docs/developers/api-reference/contracts/end)). Idempotent: closing an already-closed job returns `200` with `alreadyClosed: true`.

**Requirements:** `jobs:write` scope + the `public_api_job_publishing` feature. The job must be yours.

## Request

<ParamField path="id" type="string" required>
  The job ID.
</ParamField>

No body.

## Response

<ResponseField name="ok" type="boolean">
  `true` on success.
</ResponseField>

<ResponseField name="jobId" type="string">
  The job ID.
</ResponseField>

<ResponseField name="status" type="string">
  `ARCHIVED`.
</ResponseField>

<ResponseField name="alreadyClosed" type="boolean">
  `true` when the job was already closed (no-op).
</ResponseField>

## Errors

| Status | `code`         | Meaning                                        |
| ------ | -------------- | ---------------------------------------------- |
| `401`  | `UNAUTHORIZED` | Missing or invalid token                       |
| `403`  | `FORBIDDEN`    | Missing `jobs:write` scope or feature disabled |
| `404`  | `NOT_FOUND`    | No such job, or not yours                      |

<RequestExample>
  ```bash curl theme={null}
  curl -sS -X POST https://app.opentrain.ai/api/public/v1/jobs/<JOB_ID>/close \
    -H "Authorization: Bearer $OT_API_TOKEN"
  ```

  ```bash CLI theme={null}
  opentrain jobs close --job-id <JOB_ID> --json
  ```

  ```json MCP: opentrain_close_job theme={null}
  {
    "jobId": "<JOB_ID>"
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "ok": true,
    "jobId": "<JOB_ID>",
    "status": "ARCHIVED",
    "alreadyClosed": false
  }
  ```
</ResponseExample>
