Upload a file
Send the file's bytes as the request body and its name in file_name. The body is the file itself, not multipart: it is streamed to storage without being held in memory, so Content-Length is required. Any Content-Type is accepted; the extension of file_name decides how the file is read. Reads PDF, Word, PowerPoint, Excel, OpenDocument, CSV, Markdown, HTML, text and images (scans and photos through OCR), up to 50 MB depending on the format (GET /v1/account lists the formats and their limits); a format Lookio does not read (.doc, .ppt, .odp, .rtf, .pages, .key, .epub, .zip, .heic) is refused with what to convert it to. By default the resource comes back queued and is read and indexed in the background (seconds for a short text, file or page, minutes for a site). Pass ?wait=true to wait up to 15 seconds for it to finish in one call, or poll GET /v1/resources/{id} (?wait=true works there too) until status is ready or failed. Importing costs no credits.
POST/v1/resources/file
Requires resources:write.
Send the file’s bytes as the request body, with a Content-Length header, and its name in the file_name query parameter. The body is the file itself, not multipart. The extension of the name decides how the file is read.
curl "https://api.lookio.app/v1/resources/file?file_name=handbook.pdf&tags=hr" \
-H "Authorization: Bearer $LOOKIO_API_KEY" \
-H "Content-Type: application/pdf" \
--data-binary @handbook.pdfUse --data-binary, not -d: -d alters the bytes. The body is streamed, never held in memory. tags is a comma-separated list.
Each format has its own size limit, from 5 MB for text to 50 MB for a PDF, and GET /v1/account lists the formats and their limits. An unsupported or legacy format is refused with invalid_parameter and advice on what to convert it to, and a file over its limit is refused with request_too_large. See File formats. An upload that ends before all its bytes arrive is refused and creates nothing.
The resource comes back queued. Importing is free. Poll Get a resource until it is ready or failed.
A retried upload with the same Idempotency-Key is recognised by its name, size and query, not by its bytes.
Authorizations
Authorizationbearerin headerrequiredQuery parameters
file_namestringrequiredlength: 1–255 charsThe file's name with its extension, which decides how it is read (PDF, Word, Excel, CSV, images, Markdown, HTML…).
titlestringlength: 1–200 charsDefaults to the file name without its extension.
tagsstringlength: ≤ 2000 charsComma-separated tags.
sourcestringlength: ≤ 500 charsWhere this resource comes from, shown with every citation of it: a URL or a mention such as "Employee handbook, 2026 edition". Up to 500 characters; an empty string clears it.
waitboolean | enum<string>Wait up to 15 seconds for reading and indexing to finish before returning. Short texts, files and pages usually come back ready (or failed) in one call; larger imports return their current status (queued or processing) when the window ends, never an error.
Header parameters
Idempotency-Keystringlength: 1–255 charsA unique key for this request, such as a UUID, 1 to 255 visible ASCII characters. Send the same key when you retry: the first response is returned (with Idempotent-Replayed: true) instead of running the request again, for 24 hours, per credential. The same key on a different request is a 409 conflict. A streamed answer is not recorded.
Body
application/octet-streamrequiredThe file's bytes, unencoded. Content-Length is required.
The raw bytes of the file.
Response
Add a file
dataobjectrequiredrequest_idstringrequiredPossible codes: invalid_request, unknown_field, invalid_parameter, invalid_cursor
errorobjectrequiredrequest_idstringrequiredPossible codes: authentication_required, invalid_api_key, api_key_expired, api_key_revoked, invalid_access_key
errorobjectrequiredrequest_idstringrequiredPossible codes: insufficient_scope, feature_not_available, admin_required, permission_denied
errorobjectrequiredrequest_idstringrequiredPossible codes: conflict, assistant_has_no_resources
errorobjectrequiredrequest_idstringrequiredPossible codes: request_too_large
errorobjectrequiredrequest_idstringrequiredPossible codes: request_too_large_for_plan
errorobjectrequiredrequest_idstringrequiredPossible codes: rate_limited
errorobjectrequiredrequest_idstringrequiredPossible codes: internal_error
errorobjectrequiredrequest_idstringrequiredPossible codes: service_unavailable
errorobjectrequiredrequest_idstringrequired