API keysBind a key to an agent or roles

Bind a key to an agent or roles

Bind a key to a registered agent and/or restrict it to specific roles. Both fields are optional and independent.

curl -X PATCH "https://api.autopil.ai/v1/keys/example_string/binding" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "bound_agent_id": "fraud-analyst-prod-01",
  "permitted_roles": [
    "transaction_analyst",
    "account_profiler"
  ]
}'
{
  "status": "ok"
}
PATCH
/v1/keys/{key_id}/binding
PATCH
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: X-API-Key)
X-API-Keystring
Required

API key with admin, read, or evaluate scope. Missing key → 401; invalid or revoked key → 403.

API key with admin, read, or evaluate scope. Missing key → 401; invalid or revoked key → 403.
Content-Typestring
Required

The media type of the request body

Options: application/json
bound_agent_idstring

The key will only accept evaluate calls that present this exact agent_id. Mismatched or missing → denied with policy_name="key_agent_binding".

permitted_rolesarray

The key will only accept evaluate calls that claim a role in this list.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-API-Keystring
Required

API Key for authentication. API key with admin, read, or evaluate scope. Missing key → 401; invalid or revoked key → 403.

Path Parameters

Body

application/json
bound_agent_idstring

The key will only accept evaluate calls that present this exact agent_id. Mismatched or missing → denied with policy_name="key_agent_binding".

permitted_rolesarray

The key will only accept evaluate calls that claim a role in this list.

Responses

statusstring