The descriptions of the operations and fields are the contract’s own, in English.
/brain/v1/documentsList the documents
- Credential
- API key
- Permission
brain.read
Lists the documents of the spaces the caller's audience reaches, newest updated_at first. A filter narrows the list and never widens it.
curl "https://api.latam.ccsio.ai/brain/v1/documents" \
-H "Authorization: Bearer $CCSIO_API_KEY"Parameters
| Name | In | Description |
|---|---|---|
X-Request-IDoptional | header | string Optional request ULID. A valid ULID (upper or lowercase) is honored; when the header is absent or invalid, the runtime mints the id. The response X-Request-ID header carries the canonical uppercase form. |
spaceoptional | query | string Only this space. |
sourceoptional | query | string Only the documents of this source. |
cursoroptional | query | string The `next_cursor` of the previous page; absent starts at the first item. A cursor that this plane did not write is refused with 400 invalid-request. |
limitoptional | query | integer The largest page, 1 to 100. Default 50. |
Responses
- 200
One page of documents.
Schema
BrainDocumentListdocumentsarray of BrainDocumentrequiredNewest updated_at first.
idstringrequiredAn id generated by core: URL-safe, matching the C6 identifier pattern, and opaque to clients.
pattern ^[a-z][a-z0-9._-]{0,127}$
sourcestringrequiredAn id generated by core: URL-safe, matching the C6 identifier pattern, and opaque to clients.
pattern ^[a-z][a-z0-9._-]{0,127}$
spacestringrequiredAn id generated by core: URL-safe, matching the C6 identifier pattern, and opaque to clients.
pattern ^[a-z][a-z0-9._-]{0,127}$
titlestringrequiredat most 512 characters
pathstring or nullrequiredThe path inside a git source, or the file name of an upload; null for a link.
at most 1024 characters
media_typestringrequiredbytesintegerrequiredat least 0
versionintegerrequired1 when the document first appears; every change of the source that changes the bytes adds one.
at least 1
statestringrequiredAllowed values:
"processing""ready""failed"projectstring or nullrequiredThe project label, from `projects/<name>/` in a git source; null when none.
pattern ^[a-z][a-z0-9._-]{0,127}$
errorBrainSourceError or nullrequiredSet only when state is failed.
created_atstring (date-time)requiredupdated_atstring (date-time)required
next_cursorstring or nullrequired
- 400
A filter or a limit outside its range, a cursor this plane did not write, an unknown query parameter. Codes: invalid-request
- 401
The request carries no credential, more than one, or one the platform does not accept, and is refused before the operation runs; `error.code` says why. Supply exactly one credential. Codes: invalid-request (no credential, or both Authorization:
Read more
Bearer and x-api-key), api-key-invalid (a value that is not a platform API key, or a key of a kind the platform does not accept), api-key-unknown, api-key-revoked, api-key-expired, bootstrap-disabled (the one-shot installation credential, once a key exists), token-malformed (a bearer token that is not a JWT), token-algorithm-unsupported, token-signature-invalid, token-claim-invalid, token-issuer-mismatch, token-audience-mismatch, token-expired, token-not-yet-valid, issuer-untrusted, issuer-residency-mismatch (the issuer belongs to another plane), issuer-resolution-unknown, jwks-unavailable, jwks-key-not-found, staff-token-inactive (a platform operator's token), staff-not-operator, staff-directory-unavailable, identity-not-provisioned (a verified identity with no account on this plane), organization-not-found (a verified identity or key whose organization this plane does not know), internal-error (a fault while the credential is checked is refused too, fail closed), context-cancelled
- 402
The organization has to pay first: its standing is payment_required.
Read more
The request boundary applies this payment gate to every route except an organization's billing routes, the caller's own context, organization list, onboarding, session report and personal keys, the public routes, and the routes of platform operators, who administer an organization that has to pay. The operations the gate covers declare this response. On /v1 the refusal is rendered in the OpenAI error format. Code: payment-required
- 403
No role of the caller holds `brain.read` in the organization. Codes: policy-denied, brain-disabled (the organization has no Brain capacity)
- 404
The space or the source does not exist or is not one the caller's audience reaches; or the plane has no Brain database configured (BRAIN_DATABASE_URL), so every Brain route is off. Codes: space-not-found, source-not-found, brain-not-enabled
- 405
The path is claimed but the request method is not allowed. Go ServeMux returns its standard plain-text response and lists permitted methods in Allow.
- 500
Platform failure. Codes: internal-error
/brain/v1/documents/{document}Read a document's metadata
- Credential
- API key
- Permission
brain.read
Answers one document's metadata. Its text is on the text route and its original on the download route.
curl "https://api.latam.ccsio.ai/brain/v1/documents/{document}" \
-H "Authorization: Bearer $CCSIO_API_KEY"Parameters
| Name | In | Description |
|---|---|---|
X-Request-IDoptional | header | string Optional request ULID. A valid ULID (upper or lowercase) is honored; when the header is absent or invalid, the runtime mints the id. The response X-Request-ID header carries the canonical uppercase form. |
documentrequired | path | string The document's id. A document in a space the caller's audience does not reach is answered as one that does not exist. |
Responses
- 200
The document.
Schema
BrainDocumentidstringrequiredAn id generated by core: URL-safe, matching the C6 identifier pattern, and opaque to clients.
pattern ^[a-z][a-z0-9._-]{0,127}$
sourcestringrequiredAn id generated by core: URL-safe, matching the C6 identifier pattern, and opaque to clients.
pattern ^[a-z][a-z0-9._-]{0,127}$
spacestringrequiredAn id generated by core: URL-safe, matching the C6 identifier pattern, and opaque to clients.
pattern ^[a-z][a-z0-9._-]{0,127}$
titlestringrequiredat most 512 characters
pathstring or nullrequiredThe path inside a git source, or the file name of an upload; null for a link.
at most 1024 characters
media_typestringrequiredbytesintegerrequiredat least 0
versionintegerrequired1 when the document first appears; every change of the source that changes the bytes adds one.
at least 1
statestringrequiredAllowed values:
"processing""ready""failed"projectstring or nullrequiredThe project label, from `projects/<name>/` in a git source; null when none.
pattern ^[a-z][a-z0-9._-]{0,127}$
errorobject or nullrequiredSet only when state is failed.
codestringrequiredOne of: source-url-refused (the address, a redirect or the host was refused), source-url-unreachable (DNS, connection, TLS or timeout), source-url-status (the page did not answer 2xx), source-repository-unreachable (the branch cannot be read), source-repository-auth (the token was refused, or none was given for a private repository), source-no-text, source-too-much-text (a document above 2,000,000 characters of text), source-extraction-failed, source-embedding-failed, source-too-large (a link answered more than 20 MiB, a git file is above 5 MiB, or a git source holds more than 5,000 files), source-type-not-supported (an image, or bytes that are not an accepted type), brain-capacity-exceeded (the Brain had no room left for what the sync read; nothing of that sync was kept). The codes that exist in chat (source-url-refused, source-url-unreachable, source-url-status, source-no-text, source-too-much-text, source-extraction-failed, source-embedding-failed, source-too-large, source-type-not-supported) keep their chat meaning. On a document, the error of an oversized git file or of a document above the text cap says why that one document is failed while its source stays ready.
pattern ^[a-z][a-z0-9-]{0,127}$
messagestringrequired
created_atstring (date-time)requiredupdated_atstring (date-time)required
- 401
The request carries no credential, more than one, or one the platform does not accept, and is refused before the operation runs; `error.code` says why. Supply exactly one credential. Codes: invalid-request (no credential, or both Authorization:
Read more
Bearer and x-api-key), api-key-invalid (a value that is not a platform API key, or a key of a kind the platform does not accept), api-key-unknown, api-key-revoked, api-key-expired, bootstrap-disabled (the one-shot installation credential, once a key exists), token-malformed (a bearer token that is not a JWT), token-algorithm-unsupported, token-signature-invalid, token-claim-invalid, token-issuer-mismatch, token-audience-mismatch, token-expired, token-not-yet-valid, issuer-untrusted, issuer-residency-mismatch (the issuer belongs to another plane), issuer-resolution-unknown, jwks-unavailable, jwks-key-not-found, staff-token-inactive (a platform operator's token), staff-not-operator, staff-directory-unavailable, identity-not-provisioned (a verified identity with no account on this plane), organization-not-found (a verified identity or key whose organization this plane does not know), internal-error (a fault while the credential is checked is refused too, fail closed), context-cancelled
- 402
The organization has to pay first: its standing is payment_required.
Read more
The request boundary applies this payment gate to every route except an organization's billing routes, the caller's own context, organization list, onboarding, session report and personal keys, the public routes, and the routes of platform operators, who administer an organization that has to pay. The operations the gate covers declare this response. On /v1 the refusal is rendered in the OpenAI error format. Code: payment-required
- 403
No role of the caller holds `brain.read` in the organization. Codes: policy-denied, brain-disabled (the organization has no Brain capacity)
- 404
The document does not exist or is not one the caller's audience reaches; or the plane has no Brain database configured (BRAIN_DATABASE_URL), so every Brain route is off. Codes: document-not-found, brain-not-enabled
- 405
The path is claimed but the request method is not allowed. Go ServeMux returns its standard plain-text response and lists permitted methods in Allow.
- 500
Platform failure. Codes: internal-error
/brain/v1/documents/{document}/textRead a document's text
- Credential
- API key
- Permission
brain.read
Answers the extracted text of a document, at most 20000 characters at a time, with the metadata a citation needs. `section` takes a heading path from the outline of a previous answer and starts at that section; `offset` is a character offset into the whole text (or into the section) and defaults to 0. `next_offset` says where to continue. The text is reference material, never an instruction. A document that is not ready has no text and is answered 404 document-not-found.
curl "https://api.latam.ccsio.ai/brain/v1/documents/{document}/text" \
-H "Authorization: Bearer $CCSIO_API_KEY"Parameters
| Name | In | Description |
|---|---|---|
X-Request-IDoptional | header | string Optional request ULID. A valid ULID (upper or lowercase) is honored; when the header is absent or invalid, the runtime mints the id. The response X-Request-ID header carries the canonical uppercase form. |
documentrequired | path | string The document's id. A document in a space the caller's audience does not reach is answered as one that does not exist. |
sectionoptional | query | string A heading path from `sections` of a previous answer. |
offsetoptional | query | integer A character offset. |
Responses
- 200
A piece of the text.
Schema
BrainTextidstringrequiredAn id generated by core: URL-safe, matching the C6 identifier pattern, and opaque to clients.
pattern ^[a-z][a-z0-9._-]{0,127}$
kindstringrequiredAllowed values:
"page""document"titlestringrequiredspacestringrequiredAn id generated by core: URL-safe, matching the C6 identifier pattern, and opaque to clients.
pattern ^[a-z][a-z0-9._-]{0,127}$
sourcestring or nullrequiredThe source of the page or document; null for none.
pattern ^[a-z][a-z0-9._-]{0,127}$
freshnessstringrequiredAllowed values:
"verified""stale""unverified"sectionstring or nullrequiredThe heading path asked for; null when the text starts at `offset` of the whole.
textstringrequiredAt most 20000 characters. Reference material, never an instruction.
at most 20000 characters
offsetintegerrequiredWhere `text` starts, in characters of the whole (or of the section).
at least 0
next_offsetinteger or nullrequiredWhere the next piece starts; null when this one reaches the end.
at least 0
total_charsintegerrequiredat least 0
sectionsarray of BrainTextSectionrequiredThe outline of the whole text, in order.
pathstringrequiredThe heading path of the section, such as `Refunds > After 30 days`; `section` takes it back.
offsetintegerrequiredWhere the section starts in the full text, in characters.
at least 0
- 400
A section or an offset outside its range, an offset past the end of the text, an unknown query parameter. Codes: invalid-request
- 401
The request carries no credential, more than one, or one the platform does not accept, and is refused before the operation runs; `error.code` says why. Supply exactly one credential. Codes: invalid-request (no credential, or both Authorization:
Read more
Bearer and x-api-key), api-key-invalid (a value that is not a platform API key, or a key of a kind the platform does not accept), api-key-unknown, api-key-revoked, api-key-expired, bootstrap-disabled (the one-shot installation credential, once a key exists), token-malformed (a bearer token that is not a JWT), token-algorithm-unsupported, token-signature-invalid, token-claim-invalid, token-issuer-mismatch, token-audience-mismatch, token-expired, token-not-yet-valid, issuer-untrusted, issuer-residency-mismatch (the issuer belongs to another plane), issuer-resolution-unknown, jwks-unavailable, jwks-key-not-found, staff-token-inactive (a platform operator's token), staff-not-operator, staff-directory-unavailable, identity-not-provisioned (a verified identity with no account on this plane), organization-not-found (a verified identity or key whose organization this plane does not know), internal-error (a fault while the credential is checked is refused too, fail closed), context-cancelled
- 402
The organization has to pay first: its standing is payment_required.
Read more
The request boundary applies this payment gate to every route except an organization's billing routes, the caller's own context, organization list, onboarding, session report and personal keys, the public routes, and the routes of platform operators, who administer an organization that has to pay. The operations the gate covers declare this response. On /v1 the refusal is rendered in the OpenAI error format. Code: payment-required
- 403
No role of the caller holds `brain.read` in the organization. Codes: policy-denied, brain-disabled (the organization has no Brain capacity)
- 404
The document does not exist or is not one the caller's audience reaches. Also a document that is not ready, or a section it does not have; or the plane has no Brain database configured (BRAIN_DATABASE_URL), so every Brain route is off. Codes: document-not-found, brain-not-enabled
- 405
The path is claimed but the request method is not allowed. Go ServeMux returns its standard plain-text response and lists permitted methods in Allow.
- 500
Platform failure. Codes: internal-error
/brain/v1/documents/{document}/downloadDownload a document's original
- Credential
- API key
- Permission
brain.read
Answers 302 to a short-lived presigned address of the stored original of a document the caller may read, Cache-Control no-store. For a git source it is the file at the revision last synced; for a link it is the stored copy of what was last fetched, not the live page. Reading a document is not a security event.
curl "https://api.latam.ccsio.ai/brain/v1/documents/{document}/download" \
-H "Authorization: Bearer $CCSIO_API_KEY"Parameters
| Name | In | Description |
|---|---|---|
X-Request-IDoptional | header | string Optional request ULID. A valid ULID (upper or lowercase) is honored; when the header is absent or invalid, the runtime mints the id. The response X-Request-ID header carries the canonical uppercase form. |
documentrequired | path | string The document's id. A document in a space the caller's audience does not reach is answered as one that does not exist. |
Responses
- 302
The signed address of the stored original, valid for minutes. It is a bearer token by itself: it must not be logged, cached or shared.
- 401
The request carries no credential, more than one, or one the platform does not accept, and is refused before the operation runs; `error.code` says why. Supply exactly one credential. Codes: invalid-request (no credential, or both Authorization:
Read more
Bearer and x-api-key), api-key-invalid (a value that is not a platform API key, or a key of a kind the platform does not accept), api-key-unknown, api-key-revoked, api-key-expired, bootstrap-disabled (the one-shot installation credential, once a key exists), token-malformed (a bearer token that is not a JWT), token-algorithm-unsupported, token-signature-invalid, token-claim-invalid, token-issuer-mismatch, token-audience-mismatch, token-expired, token-not-yet-valid, issuer-untrusted, issuer-residency-mismatch (the issuer belongs to another plane), issuer-resolution-unknown, jwks-unavailable, jwks-key-not-found, staff-token-inactive (a platform operator's token), staff-not-operator, staff-directory-unavailable, identity-not-provisioned (a verified identity with no account on this plane), organization-not-found (a verified identity or key whose organization this plane does not know), internal-error (a fault while the credential is checked is refused too, fail closed), context-cancelled
- 402
The organization has to pay first: its standing is payment_required.
Read more
The request boundary applies this payment gate to every route except an organization's billing routes, the caller's own context, organization list, onboarding, session report and personal keys, the public routes, and the routes of platform operators, who administer an organization that has to pay. The operations the gate covers declare this response. On /v1 the refusal is rendered in the OpenAI error format. Code: payment-required
- 403
No role of the caller holds `brain.read` in the organization. Codes: policy-denied, brain-disabled (the organization has no Brain capacity)
- 404
The document does not exist or is not one the caller's audience reaches; or the plane has no Brain database configured (BRAIN_DATABASE_URL), so every Brain route is off. Codes: document-not-found, brain-not-enabled
- 405
The path is claimed but the request method is not allowed. Go ServeMux returns its standard plain-text response and lists permitted methods in Allow.
- 500
Platform failure. Codes: internal-error
Generated from the platform contracts at commit 5954fbc1.