Aller au contenu

Importer un document source

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.

Fenêtre de terminal
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."}'
Rôle dans l’organisationCe point de terminaison
ownerAutorisé
adminAutorisé
editorAutorisé
viewerNon autorisé

Une clé porte le rôle que son propriétaire détient dans l’organisation. Voir Authentification.

Portée de clé d’API : aip:write

ParamètreTypeDescription
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.
ChampTypeDescription
textstringObligatoire. A pasted policy document, verbatim.
ChampTypeDescription
dataobjectObligatoire. `201 for a paste or an upload` — the text is already canonical.
data.char_countintegerObligatoire.
data.idstringObligatoire.
data.kindstringObligatoire.
data.page_countinteger or null
{
"data": {
"char_count": 3,
"id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"kind": "string",
"page_count": 3
}
}