Routes · Edit
Edit a route via API
Endpoint
https://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:
| Field | Type | Required | Description |
|---|---|---|---|
| route_id (URL) | uuid | Yes | Route id in /routes/edit/{route_id}. |
| name | string | Yes | New visible name (1–80). |
| description | string | Yes | New description (10–300 characters). |
| rules | string | Yes | New route rules. |
| tables | array | Yes | New 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
- Get the
route_id(from create-route or the dashboard). - Build the URL
https://claix.dev/routes/edit/<route_id>. - Send PUT (or POST) with full name, description, rules, and tables.
- Expect 200 and inspect
route.versionin 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
| HTTP | When |
|---|---|
| 401 | Missing/invalid API key or inactive account. |
| 404 | Route not found or not on your account. |
| 400 | Missing parameter, invalid route_id, or tables/columns outside the Data Map. |
| 405 | Method not allowed. |
| 500 | Internal 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"
}