Claix Retrieve

Agent Actions

Create, edit, and pause or resume Retrieve agents via API.

Agents · Edit

Edit an agent via API

Endpoint

PUThttps://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:

FieldTypeRequiredDescription
agent_id (URL)uuidYesIn /agents/edit/{agent_id}.
namestringYesVisible name.
slugstringYesUnique slug 3–20 (a-z0-9).
descriptionstringYesDescription.
promptstringYesBusiness instructions.
routesuuid[]YesRoutes on your account.
response_modestringYesbruto | razonada.
call_limit_periodstringNoday, 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_limitintegerWhen the period is day, week, or monthSuccessful queries in the period (1–1000000). Required unless the period is unlimited. calls_limit is also accepted.
scopeobject | nullNoReplaces 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

HTTPWhen
401Invalid API key.
404Agent missing or not on your account.
400Missing or invalid parameter.
500Internal 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"
}

Request examples

curl -X PUT "https://claix.dev/agents/edit/9d8e7f6a-5b4c-3d2e-1f0a-9b8c7d6e5f4a" \
  -H "x-api-key: <TU_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{  "name": "Asistente de agenda",  "slug": "agenda",  "description": "Responde preguntas sobre citas y pacientes de la clínica.",  "prompt": "Eres el asistente de la clínica. Prioriza horarios próximos. No inventes datos.",  "routes": [    "7c2f9a1e-4b8d-4e6a-9f21-0a1b2c3d4e5f"  ],  "response_mode": "bruto",  "call_limit_period": "day",  "call_limit": 50,  "scope": {    "rules": [      {        "tables": ["customers"],        "any_of": [{ "id": 42 }]      },      {        "tables": ["orders", "invoices"],        "any_of": [          { "customer_id": 42 },          { "team_id": [7, 8] }        ]      }    ]  }}'