Skip to content

Ingest a source document

POST/api/public/v1/aip/sources beta

A paste, an uploaded pdf / docx / md / txt, or audio/*. A paste and an upload answer 201 with the canonical text's char_count; audio answers 202: the aip_sources row exists immediately and job_id is the transcribe job to poll. Wait for the transcript before creating a draft. 413 over 5 MiB, 415 for anything outside the list above.

Terminal window
curl --fail-with-body -X POST 'https://app.openlatch.ai/api/public/v1/aip/sources' \
-H "Authorization: Bearer $OPENLATCH_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"text":"Never push directly to main without a review."}'
Role in the organizationThis endpoint
ownerAllowed
adminAllowed
editorAllowed
viewerNot allowed

A key carries the role its owner holds in the organization. See Authentication.

API key scope: aip:write

ParameterTypeDescription
Idempotency-Keystring or nullOptional. Makes this request safe to retry. Depending on the request, the same key with the same request either joins the job the first one queued (409 JOB_ALREADY_EXISTS, the job id in details) or replays the first answer (Idempotent-Replayed: true; 409 IDEMPOTENCY_IN_PROGRESS while it runs). The same key with another request is 422 IDEMPOTENCY_KEY_REUSED.
FieldTypeDescription
textstringRequired. A pasted policy document, verbatim.
FieldTypeDescription
dataobjectRequired. `201 for a paste or an upload` — the text is already canonical.
data.char_countintegerRequired.
data.idstringRequired.
data.kindstringRequired.
data.page_countinteger or null
{
"data": {
"char_count": 3,
"id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"kind": "string",
"page_count": 3
}
}