Temporary Context Window · Read
Retrieve raw content from a processed document
Endpoint
https://claix.dev/window-context/{document_id}This endpoint returns the raw content and metadata of a specific document that was previously processed by one of Claix's extraction endpoints (pdf-json, doc-json, img-json, etc.). Unlike those endpoints, which transform a file and return schema-structured data, this endpoint is read-only: it does not process anything — it simply retrieves what was stored from a prior run — the document's raw text/markdown, when it was processed, the original file name, and which schema was used.
It is intended for server-to-server integrations (backends, scripts, n8n/Zapier/Make). Do not call it from an end-user browser because it requires a secret API key.
This call is free: it is not billed and does not consume your extraction quota, exactly like GET /api/schemas.
1. Authentication
Every request must include your API key. It is a personal server credential, distinct from any user 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
The document_id is part of the path — not the body or query string:
GET https://claix.dev/window-context/{document_id}Replace {document_id}with the document's real UUID.
document_id requirements:
- Must be a valid UUID; otherwise the API returns 400.
- Must refer to a document that exists and belongs to the account tied to your API key.
- The document must not have expired (
expires_atin the past).
3. How to build the call
- Have your API key ready.
- Have the
document_id(usually returned by an extraction withwindow_contextenabled). - Send a GET to
https://claix.dev/window-context/{document_id}, replacing{document_id}with the real UUID. - Add the authentication header.
- Do not send a body or query params.
- 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,
"document_id": "d4a1e9d2-8b1c-4f3e-9a02-8b1e9f3c7a4b",
"file_name": "dni_cliente_ana.jpg",
"schema_id": "b980cfe7-61ef-4a5a-9724-881c8a5541e2",
"processed_at": "2026-08-17T13:10:00.000Z",
"content": "..."
}| Field | Type | Description |
|---|---|---|
| success | boolean | Always true when HTTP is 200. |
| document_id | uuid | Document identifier, matching the one in the URL. |
| file_name | string | Original file name as uploaded during processing. |
| schema_id | uuid | Schema used when this document was processed. |
| processed_at | datetime (ISO 8601) | When the document was processed. |
| content | string | Raw stored text/markdown after processing. Not the schema JSON output. |
6. Error codes
{
"error": "Descripción legible del problema.",
"detalle": "Información técnica adicional (solo presente en algunos casos)."
}400 — document_id is missing or not a valid UUID.
401 — Authentication failed: missing, unknown, or disabled key, or suspended account.
404 — Document does not exist, belongs to another account, or has expired (same generic message for security).
405 — Method other than GET. · 500 — Internal error.
7. Status code summary
| Code | Category | Retry? |
|---|---|---|
| 200 | Success | — |
| 400 | Client error (malformed or missing document_id) | No — fix the request first |
| 401 | Authentication error | No — fix credentials first |
| 404 | Document not found, foreign, or expired | No — fix document_id first |
| 405 | Incorrect HTTP method | No — fix the method first |
| 500 | Internal server error | Yes, with caution |
8. Best practices
- Always use the public domain
claix.dev, not the direct Supabase URL. - Store the
document_idreturned by extractions if you may need raw content later — there is no document listing endpoint yet. - This call is not billed and does not consume extraction quota; use it to re-read content, cache locally, or sync your own systems.
- Remember expiration (
expires_at): if you need content long term, keep your own copy ofcontent. - Never put your API key in frontend code or public repos.