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

# 有効な構成を取得する

> Identity と Template に対してコンパイルされたランタイム構成を取得します。

`GET /api/v1/forward/identities/{identity_id}/templates/{template_id}/effective`

Template のベースラインに Identity Config のオーバーライドを適用した後の有効な構成を返します。このレスポンスはランタイム実行向けに設計されており、`enabled` や `op` といった Forward DSL フィールドは含まれません。

## Headers

| Header          | Required | Description    |
| --------------- | -------- | -------------- |
| `Authorization` | Yes      | `Bearer <PAT>` |

## Path parameters

| Parameter     | Type   | Required | Description          |
| ------------- | ------ | -------- | -------------------- |
| `identity_id` | string | Yes      | Forward Identity ID。 |
| `template_id` | string | Yes      | Forward Template ID。 |

## Example request

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

## Example response

**HTTP 200 OK**

```json theme={null}
{
  "type": "effective_spec",
  "id": "config_123",
  "identity_id": "idn_019eabc123",
  "template_id": "tmpl_support",
  "agent_effective_hash": "sha256:...",
  "session_effective_hash": "sha256:...",
  "effective_hash": "sha256:...",
  "agent": {
    "model": "ultimate",
    "system": "You are a support assistant.\nPrefer CRM data when answering.",
    "tools": [
      {
        "type": "agent_toolset_20260401",
        "configs": [
          { "name": "Read", "enabled": true },
          { "name": "Grep", "enabled": true },
          { "name": "WebSearch", "enabled": false },
          { "name": "WebFetch", "enabled": true }
        ]
      }
    ],
    "mcp_servers": [
      {
        "name": "mcp_crm",
        "type": "http",
        "url": "https://crm.example.com/mcp"
      }
    ],
    "skills": [
      {
        "type": "custom",
        "skill_id": "skill_customer_reply",
        "version": "1"
      }
    ]
  },
  "session": {
    "environment_id": "env_support",
    "vault_ids": ["vault_crm"],
    "resources": [
      {
        "type": "file",
        "file_id": "file_019eXXXX",
        "mount_path": "/data/policy.md"
      }
    ]
  }
}
```

## Response fields

| Field                    | Type   | Description                  |
| ------------------------ | ------ | ---------------------------- |
| `type`                   | string | 常に `effective_spec`。         |
| `identity_id`            | string | Forward Identity ID。         |
| `template_id`            | string | Forward Template ID。         |
| `agent_effective_hash`   | string | コンパイルされた agent セクションのハッシュ。   |
| `session_effective_hash` | string | コンパイルされた session セクションのハッシュ。 |
| `effective_hash`         | string | 有効な構成全体のハッシュ。                |
| `agent`                  | object | コンパイルされた agent 構成。           |
| `session`                | object | コンパイルされた session のデフォルト値。    |

## Errors

| HTTP | Type                    | Trigger                        |
| ---- | ----------------------- | ------------------------------ |
| 400  | `invalid_request_error` | 有効な構成をコンパイルできません。              |
| 401  | `authentication_error`  | PAT が無効または期限切れです。              |
| 404  | `not_found_error`       | Identity または Template が存在しません。 |
| 422  | `invalid_request_error` | ランタイム構成が無効です。                  |

## Notes

* Identity Config は、フィールド固有のマージルールによって Template フィールドをオーバーライドします。
* Identity Config が存在しない場合は、空のオーバーライドレイヤーとして扱われます。
* デフォルトのメモリストアの注入は Session 作成フローによって処理されます。

## Related

<CardGroup cols={2}>
  <Card title="アイデンティティ構成を取得する" icon="file-lines" href="/cloud-agents/api/forward/identities/get-config" />

  <Card title="セッションを作成する" icon="comment" href="/cloud-agents/api/forward/sessions/create" />
</CardGroup>
