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

# Archive Case

> Archive or unarchive a case

Archive or unarchive a case. Set `archived` to `true` to archive the case, or `false` to restore (unarchive) it.

<Warning>
  Templates cannot be archived. Calling this endpoint on a case template returns a `400` error.
</Warning>

#### Path Parameters

<ParamField path="id" type="string" required>
  The UUID of the case to archive or unarchive.
</ParamField>

#### Body

<ParamField body="archived" type="boolean" required>
  Set to `true` to archive the case, or `false` to unarchive (restore) it.
</ParamField>

#### Response

Returns the updated case, including its steps and schema. The `archived_at` timestamp is set when the case is archived, and `null` when it is restored.

<ResponseField name="id" type="string">
  The case UUID.
</ResponseField>

<ResponseField name="archived_at" type="string | null">
  ISO 8601 timestamp set when the case was archived, or `null` if the case is not archived.
</ResponseField>

<RequestExample>
  ```bash Archive theme={null}
  curl --request POST \
    --url https://connect.penbox.io/v1/cases/{id} \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{ "archived": true }'
  ```

  ```bash Unarchive theme={null}
  curl --request POST \
    --url https://connect.penbox.io/v1/cases/{id} \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{ "archived": false }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "title": "Onboarding - Acme Corp",
    "status": "in_progress",
    "archived_at": "2026-06-30T10:00:00.000Z"
  }
  ```

  ```json 400 theme={null}
  {
    "errors": [
      {
        "status": "400",
        "title": "Bad Request",
        "detail": "Cannot archive a template"
      }
    ]
  }
  ```
</ResponseExample>
