API reference · v1
Fyless API
Send a document, get machine-readable text and metadata back. The API is plain HTTPS: requests are
multipart form uploads and responses are JSON. Everything lives under the /v1
prefix; breaking changes will ship as a new version.
The examples use $FYLESS_URL for the API address you were given and
$FYLESS_KEY for your API key. The API is in beta, and limits and
schemas on this page are provisional.
Quickstart
Create an API key in the dashboard, then send a file.
curl
curl -X POST "$FYLESS_URL/v1/extract" \
-H "Authorization: Bearer $FYLESS_KEY" \
-F "file=@invoice.pdf"
A small file answers immediately:
200 OK
{
"mime_type": "application/pdf",
"text": "Invoice 2026-0412\nBill to: ...",
"truncated": false,
"metadata": { "page_count": 2, "title": "Invoice 2026-0412" }
}
Authentication
Send your API key as a bearer token in the Authorization header.
Keys look like fyl_<12 characters>_<40 characters>.
- A key is shown once, when you create it. Only a hash is stored, so a lost key cannot be recovered; create a new one.
- A key can be revoked at any time, and stops working immediately.
- Every key carries scopes, and an endpoint refuses a key without its scope (403
insufficient_scope).
| Scope | Allows |
| detect | POST /v1/detect |
| metadata | POST /v1/metadata |
| extract | POST /v1/extract |
| ocr | POST /v1/ocr |
| jobs | GET and DELETE /v1/jobs/{id}, GET /v1/jobs/{id}/result |
| usage | GET /v1/quota |
Making requests
Sending a file
Upload the file as multipart/form-data in a field named
file. The type is always detected from the bytes: the file name and
any content type you declare are ignored, and a file name is never stored.
Supported formats
PDF, RTF, plain text, CSV, HTML; Word, Excel and PowerPoint (OOXML and legacy); OpenDocument text,
spreadsheet and presentation; JPEG, PNG and TIFF images (metadata, and text through
OCR). Archives and containers
are not accepted. Anything else answers 415 unsupported_file_type and uses no quota.
Idempotency
Send an Idempotency-Key header (1 to 64 characters: letters, digits and
_ . : -) on billed requests to retry safely. An asynchronous repeat returns the
same job; a synchronous repeat is processed again but billed only once. The same key with a different file
answers 409 idempotency_conflict.
Billing
A document counts one unit of your quota when it succeeds. A failed request releases the quota it reserved, so
you pay for results. Detect and the job endpoints are not billed.
Rate limits
Each key may make 120 requests a minute. Responses carry X-RateLimit-Limit
and X-RateLimit-Remaining; beyond the limit the answer is 429 with a
Retry-After header.
Asynchronous jobs
Large files, and every OCR request, return 202 Accepted with a job and a
Location header. Poll the job, then fetch the result.
| Status | Meaning |
| queued | Accepted and waiting for a worker. |
| processing | A worker is extracting the document. |
| succeeded | The result is ready until expires_at. |
| failed | Processing failed; error.code says why. Quota is released. |
| expired | The result is no longer available. |
| deleted | You deleted the result. |
Documents and results are temporary. An uploaded file is deleted as soon as the job ends, and a result is kept
for 60 minutes after completion unless you delete it sooner. A failed job reports one of
page_limit_exceeded, unprocessable_document,
engine_unavailable, input_missing,
input_expired or processing_failed.
Endpoints
GET
/v1/ping
Verify a key
Scope: none · Not billed
Checks that an API key is valid and shows which organization and scopes it carries.
Request
curl "$FYLESS_URL/v1/ping" \
-H "Authorization: Bearer $FYLESS_KEY"
Response
{
"status": "ok",
"organization_id": "01KB3Z8M2V9Q4T7R1X6C5D0HNE",
"scopes": ["extract", "metadata", "detect", "jobs", "usage"]
}
POST
/v1/detect
Detect a file type
Scope: detect · Not billed
Identifies the real type of a file from its content. The file name and any declared content type are ignored. Returns application/octet-stream when the type is unknown. Synchronous only, up to 2 MB.
Request
curl -X POST "$FYLESS_URL/v1/detect" \
-H "Authorization: Bearer $FYLESS_KEY" \
-F "file=@invoice.pdf"
Response
{
"mime_type": "application/pdf"
}
POST
/v1/metadata
Extract metadata
Scope: metadata · One standard unit, on success
Returns normalized metadata without generating text. Fields the document does not carry are null. Accepts an Idempotency-Key header.
Request
curl -X POST "$FYLESS_URL/v1/metadata" \
-H "Authorization: Bearer $FYLESS_KEY" \
-F "file=@invoice.pdf"
Response
{
"mime_type": "application/pdf",
"metadata": {
"mime_type": "application/pdf",
"title": "Invoice 2026-0412",
"author": null,
"created_at": "2026-11-02T09:14:00Z",
"modified_at": null,
"page_count": 2,
"application": "LibreOffice 24.2"
}
}
POST
/v1/ocr
Beta
OCR scanned pages
Scope: ocr · One OCR unit per document, on success
Extracts text from scanned PDFs and images (JPEG, PNG, TIFF) in English and Indonesian. Always asynchronous: the answer is a job (202). A page takes about eight seconds, so a document takes minutes. Limits: 5 MB and 10 pages; a longer PDF is refused with page_limit_exceeded before any quota is used. OCR is in beta: it answers 503 ocr_unavailable until enabled, and 429 quota_exceeded on a plan without OCR quota.
Request
curl -X POST "$FYLESS_URL/v1/ocr" \
-H "Authorization: Bearer $FYLESS_KEY" \
-F "file=@scan.pdf"
Response
{
"id": "01KB3Z8M2V9Q4T7R1X6C5D0HNE",
"type": "ocr",
"status": "queued",
"created_at": "2026-11-29T02:00:00Z",
"completed_at": null,
"expires_at": "2026-11-29T04:00:00Z",
"error": null
}
GET
/v1/jobs/{id}
Read a job
Scope: jobs · Not billed
Returns the state of a job. A job that belongs to another organization is indistinguishable from one that does not exist (404).
Request
curl "$FYLESS_URL/v1/jobs/01KB3Z8M2V9Q4T7R1X6C5D0HNE" \
-H "Authorization: Bearer $FYLESS_KEY"
Response
{
"id": "01KB3Z8M2V9Q4T7R1X6C5D0HNE",
"type": "extract",
"status": "succeeded",
"created_at": "2026-11-29T02:00:00Z",
"completed_at": "2026-11-29T02:00:07Z",
"expires_at": "2026-11-29T03:00:07Z",
"error": null
}
GET
/v1/jobs/{id}/result
Fetch a job result
Scope: jobs · Not billed
Returns the result of a succeeded job, in the same shape as a synchronous extract. Available until expires_at (60 minutes after completion), then 410 result_expired. While the job is queued or processing the answer is 409 job_not_ready with a Retry-After header; a failed job answers 422 job_failed. Results are never cached.
Request
curl "$FYLESS_URL/v1/jobs/01KB3Z8M2V9Q4T7R1X6C5D0HNE/result" \
-H "Authorization: Bearer $FYLESS_KEY"
Response
{
"mime_type": "application/pdf",
"text": "...",
"truncated": false,
"metadata": { "page_count": 12 }
}
DELETE
/v1/jobs/{id}
Delete a job result
Scope: jobs · Not billed, quota is not refunded
Deletes the stored result of a finished job (succeeded, failed or expired) ahead of its expiry. A job that is still queued or processing answers 409 job_not_terminal. Deleting twice is allowed.
Request
curl -X DELETE "$FYLESS_URL/v1/jobs/01KB3Z8M2V9Q4T7R1X6C5D0HNE" \
-H "Authorization: Bearer $FYLESS_KEY"
GET
/v1/quota
Read your quota
Scope: usage · Not billed
Shows what you have used and what remains in the current period, per unit. The period is a calendar month in UTC. Reserved counts documents in progress.
Request
curl "$FYLESS_URL/v1/quota" \
-H "Authorization: Bearer $FYLESS_KEY"
Response
{
"period_start": "2026-11-01",
"resets_at": "2026-12-01",
"units": {
"standard": { "limit": 500, "used": 12, "reserved": 0, "remaining": 488 },
"ocr": { "limit": 0, "used": 0, "reserved": 0, "remaining": 0 }
}
}
Errors
Errors use the HTTP status and a JSON body with a stable, machine-readable code.
Match on the code, not on the message. The message never contains any part of your document.
422 Unprocessable Content
{
"error": {
"code": "unprocessable_document",
"message": "The document could not be processed. It may be corrupt, encrypted or unsupported."
}
}
A validation_failed error adds a fields object naming each invalid field.
| Code | HTTP | Meaning |
| missing_api_key |
401 |
No Authorization header, or it is not a Bearer token. |
| invalid_api_key |
401 |
The key is not recognised. |
| api_key_revoked |
401 |
The key was revoked. |
| api_key_expired |
401 |
The key has expired. |
| organization_suspended |
403 |
The organization is suspended. Contact support; nothing is lost and other requests resume once it is reinstated. |
| insufficient_scope |
403 |
The key lacks the scope this endpoint requires. |
| forbidden |
403 |
The action is not allowed. |
| not_found |
404 |
The resource does not exist, or belongs to another organization. |
| method_not_allowed |
405 |
The endpoint does not support this HTTP method. |
| validation_failed |
422 |
The request is invalid. The fields object lists what to fix. |
| file_required |
422 |
No file was sent in the file field. |
| empty_file |
422 |
The file is empty. |
| file_unreadable |
422 |
The upload could not be read. |
| invalid_mode |
422 |
mode must be auto, sync or async. |
| invalid_idempotency_key |
422 |
The Idempotency-Key is not 1 to 64 characters of letters, digits and _ . : - |
| unsupported_file_type |
415 |
The detected type is not supported. No quota is used. |
| unprocessable_document |
422 |
The document is corrupt, encrypted or cannot be parsed. Quota is released. |
| payload_too_large |
413 |
The file is larger than the limit for this endpoint. |
| page_limit_exceeded |
413 |
The document has more pages than allowed. |
| rate_limited |
429 |
Too many requests. Wait for the Retry-After header. |
| quota_exceeded |
429 |
Your plan has no remaining quota for this unit. There is no Retry-After: wait for the reset or upgrade. |
| idempotency_conflict |
409 |
The Idempotency-Key was already used with a different request. |
| request_in_progress |
409 |
A request with this Idempotency-Key is still being processed. |
| too_many_attempts |
409 |
This Idempotency-Key was retried too many times after failures. |
| job_not_ready |
409 |
The job has not finished. Retry after the Retry-After header. |
| job_not_terminal |
409 |
A queued or processing job cannot be deleted. |
| job_failed |
422 |
The job failed; the message names the reason. |
| result_expired |
410 |
The result is no longer available. |
| engine_busy |
503 |
At capacity. Retry after the Retry-After header. |
| engine_unavailable |
503 |
The processing engine is temporarily unavailable. Retry later. |
| ocr_unavailable |
503 |
OCR is not available (beta). |
| storage_unavailable |
503 |
Temporary storage is unavailable. Retry later. |
| internal_error |
500 |
An unexpected error. Retry; contact support if it persists. |
Retry the 503 errors, and 429 rate_limited, after the number of seconds in the Retry-After header.
Limits
These are provisional beta limits and may change before launch.
| Synchronous upload | Up to 2 MB |
| Asynchronous upload | Up to 10 MB |
| Pages per document | Up to 50 |
| Text returned | Up to 1,000,000 characters; truncated is true beyond that |
| OCR upload | Up to 5 MB and 10 pages |
| Requests per key | 120 a minute |
| Result retention | 60 minutes after completion |
The machine-readable contract is available as an OpenAPI file.