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

# セッションの更新

> Forward セッションのタイトルまたはメタデータを更新します。

`POST /api/v1/forward/sessions/{session_id}`

安定したセッションフィールドを更新します。ランタイム構成はセッション作成後に変更できません。

## Headers

| Header            | Required | Description            |
| ----------------- | -------- | ---------------------- |
| `Authorization`   | Yes      | `Bearer <PAT>`         |
| `Content-Type`    | Yes      | `application/json`     |
| `Idempotency-Key` | No       | 安全でないリクエスト向けの任意の冪等性キー。 |

## Path parameters

| Parameter    | Type   | Required | Description |
| ------------ | ------ | -------- | ----------- |
| `session_id` | string | Yes      | Session ID。 |

## Body parameters

| Parameter  | Type   | Required | Description                                    |
| ---------- | ------ | -------- | ---------------------------------------------- |
| `title`    | string | No       | 新しいセッションのタイトル。                                 |
| `metadata` | object | No       | メタデータのマージパッチ。指定したキーは既存のキーを上書きし、省略したキーは変更されません。 |

## Example request

```bash theme={null}
curl -s -X POST 'https://api.qoder.com/api/v1/forward/sessions/sess_xxx' \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Updated session title",
    "metadata": {
      "source": "mobile",
      "biz_id": "ticket_123"
    }
  }'
```

## Example response

**HTTP 200 OK**

```json theme={null}
{
  "id": "sess_xxx",
  "type": "session",
  "identity_id": "idn_xxx",
  "template": {
    "id": "tmpl_support",
    "type": "template",
    "name": "Support assistant",
    "model": "ultimate",
    "version": 3
  },
  "source_type": "api",
  "status": "idle",
  "title": "Updated session title",
  "metadata": {
    "source": "mobile",
    "biz_id": "ticket_123"
  },
  "stats": {
    "active_seconds": 30,
    "duration_seconds": 3600
  },
  "usage": {
    "credits": 12.7
  },
  "archived_at": null,
  "created_at": "2026-06-22T10:00:00Z",
  "updated_at": "2026-06-22T12:00:00Z"
}
```

## Response fields

更新された Session オブジェクトを返します。

## Errors

| HTTP | Type                    | Code                      | Trigger           |
| ---- | ----------------------- | ------------------------- | ----------------- |
| 400  | `invalid_request_error` | `invalid_request`         | 更新ボディが無効。         |
| 401  | `authentication_error`  | `authentication_required` | PAT が無効または期限切れ。   |
| 404  | `not_found_error`       | `session_not_found`       | Session が存在しない。   |
| 409  | `conflict_error`        | `session_archived`        | Session がアーカイブ済み。 |

## Notes

* `config`、`resources`、`incremental_streaming_enabled` は作成時の設定であり、ここでは変更できません。

## Related

<CardGroup cols={2}>
  <Card title="セッションの取得" icon="file-lines" href="/cloud-agents/api/forward/sessions/get" />

  <Card title="セッションのアーカイブ" icon="archive" href="/cloud-agents/api/forward/sessions/archive" />
</CardGroup>
