Jobs

Archive a job

Archive 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):

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

Example (TypeScript):

await fetch("https://api.yardstick.team/v1/jobs/job_abc123/actions/archive", {
  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());
post/v1/jobs/{job_id}/actions/archive

Request

  • Base URL: https://api.yardstick.team
  • URL: https://api.yardstick.team/v1/jobs/{job_id}/actions/archive
  • Auth: HTTP bearer

Path parameters

job_idstring required

Headers

Idempotency-Keystring

Supported for safe retry. Reuse the same key to receive the cached response without repeating the operation.

X-Request-Idstring

Optional caller-supplied request identifier. Values must match ^[A-Za-z0-9_-]{1,128}$; a valid value is echoed in the response X-Request-Id header, otherwise the API generates one.

Request body

object required

Response

Job archived.

idstring required

Display id, e.g. job_<base32>

object'job' required
status'draft' | 'open' | 'paused' | 'closed' | 'archived' required
titlestring required
departmentstring 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_idstring nullable required

Display ID of the linked Department (internal Group). Use this for authoritative ownership. Null when the Job has no linked Department.

department_namestring nullable required

Live name of the linked Department (Group). Null when the Job has no linked Department.

locationstring nullable required
location_type'remote' | 'hybrid' | 'onsite' nullable required
descriptionstring nullable required
livemodeboolean required
created_atstring nullable required

ISO-8601 UTC

updated_atstring nullable required

ISO-8601 UTC

closed_atstring nullable required

ISO-8601 UTC

archived_atstring nullable required

ISO-8601 UTC

Changes

No recorded changes to this operation across all 1 revision of this API.