API Documentation

Schema endpoints

List, create, and delete schemas in your account with the same API key used for extraction.

Schemas · List

List account schemas

Endpoint

GEThttps://www.claix.dev/api/schemas

This endpoint returns every schema attached to the API key, including the full definition. It is read-only: it does not process files and does not write to usage_logs.

Always call https://www.claix.dev/api/schemas. Do not use the internal Supabase URL (/functions/v1/...).

It is intended for server-to-server integrations (backends, scripts, n8n/Make). Do not call it from an end-user browser because it requires a secret API key.

1. Authentication

Every request must include your API key. It is a personal server credential, distinct from any session token.

Option A — Dedicated header (recommended):

x-api-key: <YOUR_API_KEY>

Option B — Standard Authorization header:

Authorization: Bearer <YOUR_API_KEY>

Either one is sufficient. If you send both, x-api-key takes priority.

Before returning data, the system validates that:

  • The API key exists and is active.
  • The associated account is active (not suspended).

If validation fails, the request is rejected with 401.

2. Request format

Method: GET · Body: none · Query params: none

Do not send schema_id or filters: the response includes every schema in the account, newest first.

3. How to build the call

  1. Have your server API key ready.
  2. Send a GET to https://www.claix.dev/api/schemas.
  3. Add the authentication header.
  4. Check the HTTP status: only 200 means success.

4. Request 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,
  "total_schemas": 2,
  "schemas": [
    {
      "id": "b980cfe7-61ef-4a5a-9724-881c8a5541e2",
      "name": "DNI cliente",
      "type": "img-json",
      "schema_definition": {
        "nombre_dni": {
          "type": "string",
          "description": "nombre de la persona del dni"
        },
        "numero_dni": {
          "type": "string",
          "description": "numero de dni"
        }
      },
      "is_agent_mode": true,
      "agent_definition": {
        "es_mayor_edad": {
          "type": "boolean",
          "description": "Es mayor de edad actualmente la persona del dni?"
        }
      },
      "resumen_agent": null,
      "created_at": "2026-08-17T13:10:00.000Z"
    }
  ]
}
FieldTypeDescription
successbooleanAlways true when HTTP is 200.
total_schemasnumberNumber of schemas returned.
schemasarrayAccount schema list.
schemas[].iduuidSchema identifier.
schemas[].namestringVisible schema name.
schemas[].typestringexcel-json, json-excel, pdf-json, doc-json, or img-json.
schemas[].schema_definitionobjectFields to extract: each key has type and description.
schemas[].is_agent_modebooleanIf true, the schema can be used with /agent/*-json.
schemas[].agent_definitionobject | nullAgent mode parameters (when enabled).
schemas[].resumen_agentstring | nullOptional instruction for the agent phase.
schemas[].created_atdatetimeISO 8601 creation timestamp.

6. Error codes

{
  "error": "Descripción legible del problema.",
  "detalle": "Información técnica adicional (solo presente en algunos casos)."
}

401 — Authentication failed: missing, unknown, or disabled key, or suspended account.

405 — Method other than GET. · 500 — Internal error.

7. Status code summary

CodeCategoryRetry?
200Success
400Client error (malformed data)No — fix the request first
401Authentication errorNo — fix credentials first
405Incorrect HTTP methodNo — fix the method first
500Internal server errorYes, with caution

8. Best practices

  • Always use the public domain www.claix.dev, not the Supabase Edge Function URL.
  • Store each schema id for extraction calls or /api/delete-schema.
  • This GET is not billed; you can sync catalogs freely.
  • Never put your API key in frontend code or public repos.

Request examples

curl -X GET "https://www.claix.dev/api/schemas" \
  -H "x-api-key: <TU_API_KEY>"