Connect an agent to a knowledge base
Records which knowledge base an agent works out of, on agents.metadata.brain_knowledge_base_id. Idempotent: connecting an already-connected agent re-points it and refreshes connected_at. This is a default for clients that read it, NOT a permission — every content route already accepts knowledge_base_id and resolves it company-scoped, so this grants and withholds nothing. The AGENT is scoped to the calling tenant_user, not to the company: a brain is shared by the company (brain_knowledge_bases has no tenant column) but an agents row is not, so an agent belonging to another tenant_user answers 404 resource_not_found — the same answer /v1/employees gives for it. Tenant-scoped mount of the identical company route.
Authorizations
Workspace API key. Create one via the dashboard or POST /v1/auth/keys.
Headers
Act inside this project. The header form of the /v1/projects/{project_id}/... prefix, for clients that cannot rewrite their base path. Lower precedence than the path, higher than the key's pinned project; omitted resolves to the organization's default project.
Path Parameters
Tenant user id, or default for the caller`s own.
Body
Response
The connection. 200 rather than 201: the binding is a property of the agent.