Core concepts

Resources

Documents
Metadata for documents in the key owner’s library: ID, title, processing status and timestamps. PDFs, annotations and reader answers stay in Focus.
Workspace
The one workspace a workspace application is authorized to read: its ID, name and organization ID.

Requests and responses

Base URL
https://couldfocus.com/api/v1
Method
GET with no request body.
Authorization
Bearer fcs_v1_<key ID>.<secret>, as copied from Developer access. Send one Authorization header. See authentication.
Query
Only the parameters an operation lists, each at most once.
IDs
UUIDs, in either letter case.
Body
JSON in UTF-8. Timestamps are UTC in ISO 8601 with milliseconds. Responses are private and not cacheable.
X-Request-Id
The Idempotency-Key when supplied, otherwise a new UUID.
Link
Points to this documentation and the OpenAPI contract.

The Document object

id
string, UUID, always present
title
string, always present Changes when the reader renames the document or Focus finds its title during preparation.
status
string, always present processing while Focus prepares the document, ready when it opens in the reader, failed when preparation stopped. A failed document returns to processing if Focus prepares it again. Focus can add values within v1. Treat a value you do not recognize as not ready.
createdAt
string, ISO 8601 date-time, always present When the document was added.
updatedAt
string, ISO 8601 date-time, always present When Focus last updated the document, which can happen without a change to its title or status.

The Workspace object

id
string, UUID, always present
name
string, always present
organizationId
string, UUID, always present

Pagination

A list returns up to limit items, 25 by default and at most 100. When more documents remain, next holds a cursor. To read the next page, pass it as after, unchanged. Stop when next is null.

Pages list documents in ascending ID order, comparing IDs as lowercase hexadecimal strings. This order is part of v1. Focus gives each document a random UUID (version 4), so the order is unrelated to when documents were added. Each page starts after the last document of the previous one, so documents deleted in between don’t shift later pages. A document added during a paginated read appears only if its ID sorts after your cursor. Start again from the first page for a complete list.

Retries and idempotency

Generate a UUID before sending a request that may need to be retried. Send it in Idempotency-Key on the first call and every retry, with the same key, URL, and parameters.

  • Retry after a connection failure, a 503, or a 429 that includes Retry-After. Wait at least Retry-After seconds and back off between attempts. Retrying other errors unchanged gets the same answer.
  • Focus records only successful requests. After a failure, retry with the same UUID. For 400 days after a success, a retry with its UUID returns the same response and uses zero units, even when the allowance is used up.
  • Focus reads the data again for each retry and returns it only when the response is identical to the original. If anything changed, such as a title, status, or updatedAt, or a document added to or removed from that page, the retry returns 409 result_changed and uses no unit. Read again with a new UUID. That request uses one unit.
  • The UUID is bound to the key, not to one of its secrets, so a retry can use the key’s new secret after a rotation.
  • Use a new UUID for each new request, such as each page of an export or each status check.

Versioning

The version is part of the URL. Within v1, Focus can add response fields, document status values, and error codes. Ignore fields you don’t use, treat an unfamiliar status as not ready, and handle an unfamiliar error code by its HTTP status. Pages keep their ID order. Any other change is breaking: it comes with a new API version, announced in the changelog before it ships.