> ## 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

> Forward テンプレートをアーカイブします。

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

履歴レコードを削除せずに、テンプレートをアーカイブします。

## Headers

| Header            | Required | Description             |
| ----------------- | -------- | ----------------------- |
| `Authorization`   | Yes      | `Bearer <PAT>`          |
| `Idempotency-Key` | No       | 安全でないリクエストに対する任意の冪等性キー。 |

## 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

`status` が `archived` に設定された、アーカイブ済みの Template オブジェクトを返します。

## Errors

| HTTP | Type                   | Trigger                       |
| ---- | ---------------------- | ----------------------------- |
| 401  | `authentication_error` | PAT が無効または期限切れ。               |
| 404  | `not_found_error`      | テンプレートが存在しない、または呼び出し元に表示されない。 |
| 409  | `conflict_error`       | テンプレートの状態がアーカイブを許可していない。      |

## Notes

* アーカイブはソフトなライフサイクル状態です。
* アーカイブ済みのテンプレートは、ステータスで明示的に要求しない限り一覧結果から除外されます。

## Related

<CardGroup cols={2}>
  <Card title="テンプレートの一覧取得" icon="list" href="/cloud-agents/api/forward/templates/list" />

  <Card title="テンプレートのクローン" icon="copy" href="/cloud-agents/api/forward/templates/clone" />
</CardGroup>
