---
title: "Create Agent Binding"
method: POST
path: "/api/v1/agents/{agent_id}/bindings"
tags: ["agents"]
---

# Create Agent Binding

`POST /api/v1/agents/{agent_id}/bindings`

## Request

- Base URL: `https://memory.kagura-ai.com` (the document declares no server; this is the origin it was published from)
- URL: `https://memory.kagura-ai.com/api/v1/agents/{agent_id}/bindings`
- Auth: none declared

Bind an agent to a context (owner/admin only, purely subtractive).

## Path parameters

- `agent_id` string, uuid, required

## Headers

- `authorization` string, nullable

## Request body

- BindingCreate: Request model for binding an agent to a context (subtractive scoping).
  - `context_id` string, uuid, required
  - `can_read` boolean
  - `write_policy` 'deny' | 'direct'
  - `is_default` boolean: Bootstrap default binding (max one per agent)
  - `allowed_memory_types` string[], nullable: Per-memory type filter (#1299): null = all types, [] = deny-all, else the memory types this binding may read (enforce-mode only). Applies to the memory-read lanes; enumeration/aggregate surfaces still use the context-level gate until #1301
  - `allowed_source_types` string[], nullable: Per-memory source filter (#1299): null = all sources, [] = deny-all, else values from the memories.source_type set. Applies to the memory-read lanes; enumeration/aggregate surfaces still use the context-level gate until #1301

## Response `201`

Successful Response

- BindingResponse: Response model for one binding row.
  - `id` unknown, required
  - `agent_id` unknown, required
  - `context_id` unknown, required
  - `can_read` unknown, required
  - `write_policy` unknown, required
  - `is_default` unknown, required
  - `allowed_memory_types` unknown
  - `allowed_source_types` unknown
  - `created_by` unknown, required
  - `created_at` unknown, required
  - `updated_at` unknown, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud.md) · [All operations](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/revisions/aa9df1a21db9?raw)
