Temporary context window

Temporary context window

Ask questions about a persisted document after extraction with window_context enabled.

Temporary Context Window · Read

Retrieve raw content from a processed document

Endpoint

GEThttps://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_at in the past).

3. How to build the call

  1. Have your API key ready.
  2. Have the document_id (usually returned by an extraction with window_context enabled).
  3. Send a GET to https://claix.dev/window-context/{document_id}, replacing {document_id} with the real UUID.
  4. Add the authentication header.
  5. Do not send a body or query params.
  6. 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": "..."
}
FieldTypeDescription
successbooleanAlways true when HTTP is 200.
document_iduuidDocument identifier, matching the one in the URL.
file_namestringOriginal file name as uploaded during processing.
schema_iduuidSchema used when this document was processed.
processed_atdatetime (ISO 8601)When the document was processed.
contentstringRaw 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)."
}

400document_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

CodeCategoryRetry?
200Success
400Client error (malformed or missing document_id)No — fix the request first
401Authentication errorNo — fix credentials first
404Document not found, foreign, or expiredNo — fix document_id first
405Incorrect HTTP methodNo — fix the method first
500Internal server errorYes, with caution

8. Best practices

  • Always use the public domain claix.dev, not the direct Supabase URL.
  • Store the document_id returned 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 of content.
  • Never put your API key in frontend code or public repos.

Request examples

curl -X GET "https://claix.dev/window-context/d4a1e9d2-8b1c-4f3e-9a02-8b1e9f3c7a4b" \
  -H "x-api-key: <TU_API_KEY>"