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

# Resume Job

> Resume a paused or interrupted job

<Callout icon="clock" color="#3064E3" iconType="solid">
  Requires [version 1.1.5](/release-notes/1.1.x#v1-1-5) or later of the Archetype platform.
</Callout>

## Overview

This endpoint resumes a job identified by its job ID. Per the job status lifecycle, a
job in the `PAUSED` or `INTERRUPTED` state transitions back to `PENDING` when resumed.

On success the endpoint returns the job ID and its new status.

## Request

<ParamField path="id" type="string" required>
  Job identifier. A TypeID-encoded identifier with the `job_` prefix.
</ParamField>

## Response

On success, returns the resumed job record.

<ResponseField name="id" type="string">
  The identifier of the resumed job (a TypeID-encoded `JobId`).
</ResponseField>

<ResponseField name="status" type="string">
  The job's status after the transition: `PENDING`.
</ResponseField>

<RequestExample>
  ```bash cURL theme={"system"}
  curl -X POST https://api.u1.archetypeai.app/v0.5/batch/jobs/job-2512078e5c9ce4d312a6681e771542/resume \
    -H "Authorization: Bearer $ATAI_API_KEY"
  ```

  ```python Python theme={"system"}
  import requests
  import os

  api_key = os.environ.get("ATAI_API_KEY")
  job_id = "job-2512078e5c9ce4d312a6681e771542"

  response = requests.post(
      f"https://api.u1.archetypeai.app/v0.5/batch/jobs/{job_id}/resume",
      headers={"Authorization": f"Bearer {api_key}"}
  )

  result = response.json()
  print(f"Job {result['id']} status: {result['status']}")
  ```

  ```javascript JavaScript theme={"system"}
  const jobId = 'job-2512078e5c9ce4d312a6681e771542';

  const response = await fetch(
    `https://api.u1.archetypeai.app/v0.5/batch/jobs/${jobId}/resume`,
    {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
      }
    }
  );

  const result = await response.json();
  console.log(`Job ${result.id} status: ${result.status}`);
  ```
</RequestExample>

<ResponseExample>
  ```json 201 - Job resumed theme={"system"}
  {
    "id": "job-2512078e5c9ce4d312a6681e771542",
    "status": "PENDING"
  }
  ```

  ```json 404 - Job not found theme={"system"}
  {
    "code": "job_not_found",
    "message": "Job {id} not found",
    "suggestion": null,
    "error_uid": "err-xxxxxxxx"
  }
  ```

  ```json 409 - Invalid state transition theme={"system"}
  {
    "code": "invalid_state_transition",
    "message": "Cannot resume job in {status} state; only PAUSED or INTERRUPTED jobs can be resumed.",
    "suggestion": null,
    "error_uid": "err-xxxxxxxx"
  }
  ```
</ResponseExample>
