Agents · Edit
Edit an agent via API
Endpoint
https://claix.dev/agents/edit/{agent_id}Updates name, slug, description, prompt, routes, response mode, and the optional multi-tenant configuration for an agent on your account. Same required body as create. POST is also accepted.
This call is free.
1. Authentication
x-api-key: <YOUR_API_KEY>
2. Request format
agent_id goes in the URL. The body includes every create field:
| Field | Type | Required | Description |
|---|---|---|---|
| agent_id (URL) | uuid | Yes | In /agents/edit/{agent_id}. |
| name | string | Yes | Visible name. |
| slug | string | Yes | Unique slug 3–20 (a-z0-9). |
| description | string | Yes | Description. |
| prompt | string | Yes | Business instructions. |
| routes | uuid[] | Yes | Routes on your account. |
| response_mode | string | Yes | bruto | razonada. |
| call_limit_period | string | No | day, week, month, or unlimited. Omit both period and count to keep the current limit. The week runs Monday through Sunday (UTC). calls_limit_period is also accepted. |
| call_limit | integer | When the period is day, week, or month | Successful queries in the period (1–1000000). Required unless the period is unlimited. calls_limit is also accepted. |
| scope | object | null | No | Replaces the multi-tenant configuration. Omit the field to keep the current one. Null or { "rules": [] } removes it. |
3. Multi-tenant configuration
scope says which rows the agent may read in each table. Omit the field to keep the current configuration. null or { "rules": [] } removes it, and the agent can again read every row on its routes.
It is an object with a rules list (1 to 20 rules). Each rule names the tables it applies to and one or more conditions in any_of. Conditions in the same rule are combined with OR: a row only has to match one of them.
A condition is a field name and the value that is allowed. A single value requires an exact match. A list allows any of those values. The same fact can have a different name in each table: customer 42 is id on customers and customer_id on orders and invoices.
A table that is not named in any rule cannot be queried. A row that matches none of its rule's conditions is not returned. Limits: 20 rules, 40 tables per rule, 20 conditions per rule, and 64 values per field. A table name may include its schema, for example shop.orders. Values are text or numbers; text is 1 to 200 characters.
{
"rules": [
{
"tables": ["customers"],
"any_of": [{ "id": 42 }]
},
{
"tables": ["orders", "invoices"],
"any_of": [
{ "customer_id": 42 },
{ "team_id": [7, 8] }
]
}
]
}4. Examples
Right panel with ready-to-run examples.
5. Successful response
200 OK
{
"success": true,
"agent": {
"agent_id": "9d8e7f6a-5b4c-3d2e-1f0a-9b8c7d6e5f4a",
"name": "Asistente de agenda",
"slug": "agenda",
"description": "Responde preguntas sobre citas y pacientes de la clínica.",
"status": "active",
"prompt": "Eres el asistente de la clínica. Solo usas las rutas asignadas. No inventes datos.",
"routes": ["7c2f9a1e-4b8d-4e6a-9f21-0a1b2c3d4e5f"],
"response_mode": "bruto",
"call_limit_period": "day",
"call_limit": 50,
"call_limit_reached": false,
"scope": {
"rules": [
{
"tables": ["customers"],
"any_of": [{ "id": 42 }]
},
{
"tables": ["orders", "invoices"],
"any_of": [
{ "customer_id": 42 },
{ "team_id": [7, 8] }
]
}
]
},
"retrieve_url": "https://claix.dev/retrieve/agenda",
"updated_at": "2026-10-19T19:00:00.000Z"
}
}6. Errors
| HTTP | When |
|---|---|
| 401 | Invalid API key. |
| 404 | Agent missing or not on your account. |
| 400 | Missing or invalid parameter. |
| 500 | Internal error. |
{
"error": "Descripción legible del problema.",
"detalle": "Información técnica adicional (solo presente en algunos casos).",
"log_id": "7c2e1a90-4b3d-4f8a-9e21-6d5c8b0a1f34"
}