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

# Archive a template

> Archive a Forward template.

`POST /api/v1/forward/templates/{template_id}/archive`

Archives a template without deleting historical records.

## Headers

| Header            | Required | Description                                   |
| ----------------- | -------- | --------------------------------------------- |
| `Authorization`   | Yes      | `Bearer <PAT>`                                |
| `Idempotency-Key` | No       | Optional idempotency key for unsafe requests. |

## Path parameters

| Parameter     | Type   | Required | Description          |
| ------------- | ------ | -------- | -------------------- |
| `template_id` | string | Yes      | Forward Template ID. |

## Example request

```bash theme={null}
curl -s -X POST 'https://api.qoder.com/api/v1/forward/templates/tmpl_support/archive' \
  -H "Authorization: Bearer $QODER_PAT"
```

## Example response

**HTTP 200 OK**

```json theme={null}
{
  "type": "template",
  "id": "tmpl_support",
  "name": "Support assistant",
  "description": "Handles pre-sales and after-sales support",
  "status": "archived",
  "model": "ultimate",
  "system": "You are a helpful support assistant.",
  "tools": [],
  "mcp_servers": [],
  "skills": [],
  "multiagent": null,
  "environment_id": "env_support",
  "vault_ids": ["vault_crm"],
  "files": {},
  "environment_variables": {
    "BASE_MODE": "support"
  },
  "metadata": {},
  "created_at": "2026-06-18T10:00:00Z",
  "updated_at": "2026-06-18T10:30:00Z"
}
```

## Response fields

Returns the archived Template object with `status` set to `archived`.

## Errors

| HTTP | Type                   | Trigger                                                  |
| ---- | ---------------------- | -------------------------------------------------------- |
| 401  | `authentication_error` | PAT invalid or expired.                                  |
| 404  | `not_found_error`      | Template does not exist or is not visible to the caller. |
| 409  | `conflict_error`       | Template state does not allow archive.                   |

## Notes

* Archive is a soft lifecycle state.
* Archived templates are excluded from list results unless requested by status.

## Related

<CardGroup cols={2}>
  <Card title="List templates" icon="list" href="/cloud-agents/api/forward/templates/list" />

  <Card title="Clone a template" icon="copy" href="/cloud-agents/api/forward/templates/clone" />
</CardGroup>
