---
title: "Close a job"
method: POST
path: "/v1/jobs/{job_id}/actions/close"
tags: ["Jobs"]
---

# Close a job

`POST /v1/jobs/{job_id}/actions/close`

## Request

- Base URL: `https://api.yardstick.team`
- URL: `https://api.yardstick.team/v1/jobs/{job_id}/actions/close`
- Auth: HTTP bearer

Close a job

**Required scopes:** `jobs:write`

Direct Job mutation. Use `Idempotency-Key` for create, update, close, and archive retries; replayed requests with the same key and body return the cached result instead of duplicating lifecycle writes. Jobs are organization and live/test partition scoped. Malformed, cross-org, wrong-mode, and inaccessible ids return `404 not_found` rather than leaking existence. Close and archive affect only the Job row in this slice; job postings, applications, and interview plans are not mutated.

**Example (curl):**

```bash
curl -X POST https://api.yardstick.team/v1/jobs/job_abc123/actions/close \
  -H 'Authorization: Bearer ys_sk_live_…' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: 7c3a…' \
  -d '{}'
```

**Example (TypeScript):**

```ts
await fetch("https://api.yardstick.team/v1/jobs/job_abc123/actions/close", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.YS_API_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({}),
}).then((r) => r.json());
```

## Path parameters

- `job_id` string, required

## Headers

- `Idempotency-Key` string
- `X-Request-Id` string

## Request body

- object

## Response `200`

Job closed.

- Job: Internal hiring Job container. Jobs are separate from candidate-facing Job Postings; jobs:write does not publish or archive postings, mutate applications, or mutate interview plans.
  - `hiring_manager` object, nullable: Hiring manager user display id and name on job detail reads.
    - `id` string, required
    - `name` string, nullable, required
  - `id` string, required: Display id, e.g. `job_<base32>`
  - `object` 'job', required
  - `status` 'draft' | 'open' | 'paused' | 'closed' | 'archived', required
  - `title` string, required
  - `department` string, nullable, required: Legacy free-text department metadata. Preserved for backward compatibility. New integrations should use department_id for authoritative ownership; this field is advisory display text only.
  - `department_id` string, nullable, required: Display ID of the linked Department (internal Group). Use this for authoritative ownership. Null when the Job has no linked Department.
  - `department_name` string, nullable, required: Live name of the linked Department (Group). Null when the Job has no linked Department.
  - `location` string, nullable, required
  - `location_type` 'remote' | 'hybrid' | 'onsite', nullable, required
  - `description` string, nullable, required
  - `linked_artifacts` object, required: Retrieve-by-id may include bounded linked artifact summaries; list responses return null summary fields to avoid per-row query cost.
    - `interview_plans` object, required
      - `ids` string[], nullable, required
      - `count` integer, nullable, required
      - `has_more` boolean, nullable, required
    - `job_postings` object, required
      - `ids` string[], nullable, required
      - `count` integer, nullable, required
      - `has_more` boolean, nullable, required
    - `applications` object, required
      - `count` integer, nullable, required
  - `livemode` boolean, required
  - `created_at` string, nullable, required: ISO-8601 UTC
  - `updated_at` string, nullable, required: ISO-8601 UTC
  - `closed_at` string, nullable, required: ISO-8601 UTC
  - `archived_at` string, nullable, required: ISO-8601 UTC

## Other responses

- `400`: Invalid request
- `401`: Authentication failure
- `403`: Permission denied (scope or feature flag)
- `404`: Resource not found. The error uses the resource-specific code and param names the exact body field or path parameter that referenced it.
- `409`: Conflict (e.g. idempotency key reuse with different body)
- `429`: Rate limited
- `500`: Internal error

---

[API](https://skmtc.dev/yardstick/apis/yardstick-public-api.md) · [All operations](https://skmtc.dev/yardstick/apis/yardstick-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/yardstick/apis/yardstick-public-api/revisions/35b5a6e88b35?raw)
