Claix Retrieve

Routes Actions

Create, edit, and delete Retrieve routes via API. Tables and columns must match your published Data Map.

Routes · Edit

Edit a route via API

Endpoint

PUThttps://claix.dev/routes/edit/{route_id}

Updates an existing route on your account: name, description, rules, and table/column selection. Everything is validated against the published Data Map. If a draft version exists it is updated; otherwise a new draft version is created.

Replace {route_id} with the route UUID. POST with the same body is also accepted.

This call is free: it is not billed.

1. Authentication

Same authentication as create route:

x-api-key: <YOUR_API_KEY>

or

Authorization: Bearer <YOUR_API_KEY>

You can only edit routes on the API key account. If the UUID is missing or belongs to another account, the API returns 404.

2. Request format

Method: PUT (also POST) · Content-Type: application/json

route_id goes in the URL. The body uses the same required fields as POST /routes:

FieldTypeRequiredDescription
route_id (URL)uuidYesRoute id in /routes/edit/{route_id}.
namestringYesNew visible name (1–80).
descriptionstringYesNew description (10–300 characters).
rulesstringYesNew route rules.
tablesarrayYesNew table and column selection from the Data Map.

If any body field is missing, the 400 error names it explicitly.

3. How to build the call

  1. Get the route_id (from create-route or the dashboard).
  2. Build the URL https://claix.dev/routes/edit/<route_id>.
  3. Send PUT (or POST) with full name, description, rules, and tables.
  4. Expect 200 and inspect route.version in the response.

4. Call examples

Use the panel on the right for cURL, JavaScript, Node.js, Python, PHP, and n8n examples.

5. Successful response

200 OK · Content-Type: application/json

{
  "success": true,
  "route": {
    "route_id": "7c2f9a1e-4b8d-4e6a-9f21-0a1b2c3d4e5f",
    "name": "Agenda de citas",
    "slug": "agenda_de_citas",
    "description": "Consulta la agenda de la clínica: pacientes, horarios y estado de la cita.",
    "status": "draft",
    "updated_at": "2026-10-19T18:00:00.000Z",
    "version": {
      "version_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "version": 2,
      "status": "draft",
      "rules": "Solo SELECT. Filtra por clínica del usuario. No expongas teléfonos ni emails.",
      "definition": {
        "schema_version": 1,
        "tables": [
          {
            "name": "appointments",
            "description": "Citas de la clínica",
            "columns": [
              {
                "name": "id",
                "type": "uuid",
                "nullable": false,
                "is_primary_key": true,
                "description": "Identificador de la cita",
                "sensitivity_hint": "none"
              }
            ]
          }
        ]
      },
      "validation": {
        "valid": true,
        "errors": [],
        "warnings": [],
        "validated_at": "2026-10-19T17:00:00.000Z"
      }
    }
  },
  "warnings": []
}

The version stays draft. Publish it from the dashboard when you want agents to use the changes in production.

6. Common errors

HTTPWhen
401Missing/invalid API key or inactive account.
404Route not found or not on your account.
400Missing parameter, invalid route_id, or tables/columns outside the Data Map.
405Method not allowed.
500Internal error while saving.

Error example:

{
  "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/routes/edit/7c2f9a1e-4b8d-4e6a-9f21-0a1b2c3d4e5f" \
  -H "x-api-key: <TU_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{  "name": "Agenda de citas",  "description": "Consulta la agenda de la clínica: pacientes, horarios y estado de la cita.",  "rules": "Solo SELECT. Filtra por clínica del usuario. Incluye el estado de la cita.",  "tables": [    {      "name": "appointments",      "columns": ["id", "patient_id", "starts_at", "status", "notes"]    },    {      "name": "patients",      "columns": ["id", "full_name"]    }  ]}'