Temporary Context Window
Ask questions about a persisted document
Endpoint
https://www.claix.dev/window-context/{document_id}This endpoint answers questions about a document already extracted with window_context enabled. The document_id is in the URL (returned by the extraction call) and the questions go in a simple JSON body.
Public URL: POST https://www.claix.dev/window-context/{document_id}. Never expose the raw Supabase URL.
Designed for server-to-server integrations. Requires a secret API key.
1. Authentication
Every request must include your API key.
Option A — Dedicated header (recommended):
x-api-key: <YOUR_API_KEY>
Option B — Standard Authorization header:
Authorization: Bearer <YOUR_API_KEY>
The system checks that the key exists and is active, and that the account is not suspended. Failures return 401.
2. Request format
HTTP method: POST · Content-Type: application/json
document_id (UUID) is part of the path. The body has a single field:
| Field | Type | Required | Description |
|---|---|---|---|
| questions | array of strings | Yes | Questions to answer using only the persisted markdown. Max 5 per turn. Max 400 characters per question. |
{
"questions": [
"What is the exact penalty for early cancellation?",
"Which company is listed as the tenant, and what is its tax ID?"
]
}- At least 1 question; at most 5.
- Each string must have content (not whitespace only).
- The document must belong to the API key account and must not have expired.
3. Step-by-step request
- Extract a file with
window_context: trueand save thedocument_idfrom the response. - Obtain your API key.
- POST to
https://www.claix.dev/window-context/<document_id>. - Send
{ "questions": ["..."] }as JSON. - Check HTTP 200 and read
ia_response.
4. Request examples
See the right-hand panel for cURL, JavaScript, Node.js, Python, PHP, and n8n examples.
5. Successful response
Status: 200 OK · Content-Type: application/json
{
"user_ask": [
"¿Cuál es la penalización exacta por cancelación anticipada?",
"¿Qué empresa figura como arrendataria y cuál es su CIF?"
],
"ia_response": [
"El 15 % del importe restante del contrato.",
"Inversiones Delta S.L., CIF B12345678"
]
}| Field | Type | Description |
|---|---|---|
| user_ask | array of strings | The questions you sent, in the same order. |
| ia_response | array of string or null | Answers aligned 1:1 with user_ask. If the fact is not in the document, the value is JSON null — not a sentence. |
6. Error codes
{
"error": "Descripción legible del problema.",
"detalle": "Información técnica adicional (solo presente en algunos casos)."
}400 — Invalid document_id, malformed JSON, missing questions, empty array, more than 5 items, or a question longer than 400 characters.
401 — Missing, invalid, or inactive API key, or suspended account.
404 — Document does not exist, does not belong to the account, or has expired.
502 — AI service failure. 405 — Method other than POST. 500 — Unexpected server error.
7. Error code summary
| Código | Categoría | ¿Reintentar? |
|---|---|---|
| 200 | Éxito | — |
| 400 | Error del cliente (documento o datos mal formados) | No, corrige la petición primero |
| 401 | Error de autenticación | No, corrige las credenciales primero |
| 404 | Recurso no encontrado | No, corrige el schema_id primero |
| 405 | Método HTTP incorrecto | No, corrige el método primero |
| 413 | Archivo o texto extraído demasiado grande | No, reduce el tamaño primero |
| 422 | Sin datos extraíbles | No, revisa el documento/schema primero |
| 500 | Error interno del servidor | Sí, con precaución |
| 502 | Fallo del servicio de IA | Sí, recomendado con backoff |