Prudai Developer API: dossiers
LEO projects (dossiers) of the token user and their documents (upload, text, original, delete). Personal tokens only; never issuable to a service key.
Basis-URL https://api.prudai.com/v1. Inloggen staat in Inloggen, scopes in Scopes en rechten, fouten in Fouten. Overzicht.
| Methode | Pad | Wat het doet | Stand |
|---|---|---|---|
GET | /v1/projects | List the LEO projects (dossiers) you can read | Binnenkort |
GET | /v1/projects/{project_id} | Get one project (dossier) | Binnenkort |
GET | /v1/projects/{project_id}/documents | List the documents of a project | Binnenkort |
POST | /v1/projects/{project_id}/documents | Upload one file into a project | Binnenkort |
GET | /v1/projects/{project_id}/documents/{document_id} | Get one document with its processing status | Binnenkort |
DELETE | /v1/projects/{project_id}/documents/{document_id} | Move a document to the trash (soft delete, restorable) | Binnenkort |
GET | /v1/projects/{project_id}/documents/{document_id}/original | Download the original file of a document (raw bytes) | Binnenkort |
POST | /v1/projects/{project_id}/documents/{document_id}/purge | Delete a document from the trash for good | Binnenkort |
POST | /v1/projects/{project_id}/documents/{document_id}/restore | Restore a document from the trash | Binnenkort |
GET | /v1/projects/{project_id}/documents/{document_id}/text | Get the extracted text (or transcript) of a document | Binnenkort |
POST | /v1/projects/{project_id}/drafts/import | Import Word into a new editable project concept | Binnenkort |
List the LEO projects (dossiers) you can read
GET /v1/projects
Personal tokens only (403 personal_token_required for a service key): a project is user
data and the rights are exactly the token user’s rights in LEO. Lists the projects the user
owns plus the projects whose knowledge base is shared with them, never another user’s ORDO
dossier project and never an IRMA environment project; only products the user’s account
has. role is owner, editor (may add and remove documents) or reader. q is a
case-insensitive substring of the name (the CLI resolves a project name with it, exactly).
Sorted newest first. When the shared projects cannot be fetched, the page holds only owned
projects, completeness.total is null and notIncluded says so.
On by default; the server can switch it off with DEVELOPER_API_PROJECTS_ENABLED=false, and then personal tokens lack
prudai:projects:read (403 insufficient_scope).
- Stand: binnenkort, nog niet op productie.
- Scope:
prudai:projects:read - Goedkeuring:
none, geen extra stap.
Parameters
q
max. lengte 255include_archived
Een van:true,falselimit
standaard:20· min. 1 · max. 100cursor
max. lengte 200
Antwoorden
| Status | Betekenis |
|---|---|
200 | One page of projects. |
401 | Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment. |
403 | Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution). |
422 | Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body). |
429 | Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded. |
503 | Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged. |
curl -s "https://api.prudai.com/v1/projects" \ -H "Authorization: Bearer $PRUDAI_TOKEN"prudai leo projects list[ { "id": "00000000-0000-4000-8000-000000000000", "name": "string", "description": "string", "kind": "dossier", "product": "string", "archived": false, "role": "owner", "created_at": "2026-11-05T09:30:00.000Z", "updated_at": "2026-11-05T09:30:00.000Z" }]Get one project (dossier)
GET /v1/projects/{project_id}
Personal tokens only. An unknown project and a project you may not read both answer
404 project_not_found: no existence leak through status code or envelope in normal
operation. During an outage of the document service (503 service_unavailable) and through
response timing an existing project can be told apart from an unknown id; project ids are
random UUIDs. 403 product_not_entitled when your account does not have the project’s product.
- Stand: binnenkort, nog niet op productie.
- Scope:
prudai:projects:read - Goedkeuring:
none, geen extra stap.
Parameters
project_idverplicht
The LEO project (dossier) id. Anything that is not a UUID answers404 project_not_found.
Antwoorden
| Status | Betekenis |
|---|---|
200 | The project. |
401 | Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment. |
403 | Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution). |
404 | project_not_found (unknown project, or one you may not read: the same answer), document_not_found (not in this project), or original_unavailable (the original file is no longer stored). |
429 | Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded. |
502 | The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on. |
503 | Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged. |
Velden in data (200)
idnamedescription
kannullzijnkind
Een van:dossier,tableproduct
The product the project belongs to (leo,zia,vera,bever, …).archivedrole
Your role;ownerandeditormay upload and delete documents. Een van:owner,editor,readercreated_atupdated_at
curl -s "https://api.prudai.com/v1/projects/<project_id>" \ -H "Authorization: Bearer $PRUDAI_TOKEN"prudai leo projects get{ "id": "00000000-0000-4000-8000-000000000000", "name": "string", "description": "string", "kind": "dossier", "product": "string", "archived": false, "role": "owner", "created_at": "2026-11-05T09:30:00.000Z", "updated_at": "2026-11-05T09:30:00.000Z"}List the documents of a project
GET /v1/projects/{project_id}/documents
Personal tokens only. The documents in the project’s knowledge base, newest first, with their
processing status. Audio memos (kind: audio) and transcripts (kind: transcript, .vtt/.srt)
carry audio and subtitles metadata once processed; uploaded_by is who uploaded the file.
q filters on the filename (case-insensitive substring). Filtering on kind is left to the
client. completeness.total is the total under the filters.
- Stand: binnenkort, nog niet op productie.
- Scope:
prudai:projects:read - Goedkeuring:
none, geen extra stap.
Parameters
project_idverplicht
The LEO project (dossier) id. Anything that is not a UUID answers404 project_not_found.status
Processing status;completed= searchable and its text is readable. Een van:pending,processing,chunking,embedding,indexing,completed,failedq
max. lengte 200limit
standaard:50· min. 1 · max. 200cursor
max. lengte 200deleted
truelists the trash (documents moved there withdeleteProjectDocument) instead of the live documents. Een van:true,false
Antwoorden
| Status | Betekenis |
|---|---|
200 | One page of documents. |
401 | Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment. |
403 | Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution). |
404 | project_not_found (unknown project, or one you may not read: the same answer), document_not_found (not in this project), or original_unavailable (the original file is no longer stored). |
422 | Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body). |
429 | Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded. |
502 | The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on. |
503 | Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged. |
curl -s "https://api.prudai.com/v1/projects/<project_id>/documents" \ -H "Authorization: Bearer $PRUDAI_TOKEN"prudai leo projects-documents list[ { "id": "00000000-0000-4000-8000-000000000000", "project_id": "00000000-0000-4000-8000-000000000000", "filename": "string", "kind": "audio", "content_type": "string", "status": "pending", "size_bytes": 1, "chunk_count": 1, "original_available": false, "uploaded_by": { "name": "string", "email": "string" }, "subtitles": { "format": "string", "duration_seconds": 1, "speakers": [ "string" ] }, "audio": { "language_code": "string", "provider": "string", "duration_seconds": 1 }, "created_at": "2026-11-05T09:30:00.000Z", "updated_at": "2026-11-05T09:30:00.000Z", "deleted_at": "2026-11-05T09:30:00.000Z" }]Upload one file into a project
POST /v1/projects/{project_id}/documents
Personal tokens only; you must be the owner or an editor of the project
(403 project_write_required otherwise, also for an ORDO dossier: upload there).
multipart/form-data with exactly ONE part, the field file; any other field (such as
uploaded_by) is refused with 422. The uploader recorded in uploaded_by is always the
token’s user, never a value from the request. Accepted: the file types of the LEO upload
except archives (no .zip), including audio memos (.m4a, .webm, .mp3, .wav, …) and
transcripts (.vtt, .srt); maximum size as the LEO upload (413 request_too_large).
403 uploads_restricted when your organisation has disabled uploads for the project’s product.
Processing is asynchronous: the answer is the document with status: pending; poll
getProjectDocument (in next) until completed or failed.
Idempotency. Idempotency-Key is required (8 to 255 printable ASCII characters) and
belongs to the project. The same key with the same file (sha256 and size) returns the same
document with 200 (the first answer was 201); with a different file
422 idempotency_key_reused; while the first request still runs
409 idempotency_request_in_progress. A failed upload frees the key. Deleting the document
frees its keys too.
?dryRun=true checks everything (rights, type, size, key) and returns what would be uploaded
(id: null, sha256, would_upload) without storing anything.
Waits for a human (confirm): the first call answers 202 with an approval request (the
uploaded bytes are part of what is approved); repeat the exact call with
x-prudai-approval: apr_… once a human approved it. A caller without the right gets the
error (404/403), never an approval request.
- Stand: binnenkort, nog niet op productie.
- Scope:
prudai:projects:write - Goedkeuring:
confirm, de gebruiker bevestigt precies deze aanroep. - Dry run:
?dryRun=truelaat zien wat er zou gebeuren en slaat niets op. - Idempotentie: stuur
Idempotency-Keymee; dezelfde sleutel met dezelfde body voert de actie niet twee keer uit.
Parameters
project_idverplicht
The LEO project (dossier) id. Anything that is not a UUID answers404 project_not_found.Idempotency-Keyverplicht
min. lengte 8 · max. lengte 255 · patroon^[\x21-\x7E]+$dryRun
Validate and show the effect without changing anything. Een van:true,false
Body
Formaat: multipart/form-data.
Antwoorden
| Status | Betekenis |
|---|---|
200 | Replay of the same Idempotency-Key and file, or a dry run. |
201 | Uploaded; processing started. |
202 | Waiting for human approval (ApprovalRequest). |
401 | Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment. |
403 | Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution). |
404 | project_not_found (unknown project, or one you may not read: the same answer), document_not_found (not in this project), or original_unavailable (the original file is no longer stored). |
409 | The same Idempotency-Key is still running (idempotency_request_in_progress), the project has no document store yet (project_not_ready, open it once in LEO), or the document service refuses the change right now (document_conflict, retry later). |
413 | File too large (request_too_large). |
422 | Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body). |
429 | Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded. |
502 | The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on. |
503 | Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged. |
curl -s -X POST "https://api.prudai.com/v1/projects/<project_id>/documents" \ -H "Authorization: Bearer $PRUDAI_TOKEN" \ -H "Idempotency-Key: $(uuidgen)"prudai leo projects-documents create{ "id": "00000000-0000-4000-8000-000000000000", "project_id": "00000000-0000-4000-8000-000000000000", "filename": "string", "kind": "audio", "content_type": "string", "status": "pending", "size_bytes": 1, "chunk_count": 1, "original_available": false, "uploaded_by": { "name": "string", "email": "string" }, "subtitles": { "format": "string", "duration_seconds": 1, "speakers": [ "string" ] }, "audio": { "language_code": "string", "provider": "string", "duration_seconds": 1 }, "created_at": "2026-11-05T09:30:00.000Z", "updated_at": "2026-11-05T09:30:00.000Z", "deleted_at": "2026-11-05T09:30:00.000Z"}Get one document with its processing status
GET /v1/projects/{project_id}/documents/{document_id}
Personal tokens only. Metadata and live status of one document of the project. A failed
document says status: failed without the error text (it can quote content).
original_available: false when the original file is no longer stored (the text may still be).
- Stand: binnenkort, nog niet op productie.
- Scope:
prudai:projects:read - Goedkeuring:
none, geen extra stap.
Parameters
project_idverplicht
The LEO project (dossier) id. Anything that is not a UUID answers404 project_not_found.document_idverplicht
The document id. Anything that is not a UUID answers404 document_not_found.
Antwoorden
| Status | Betekenis |
|---|---|
200 | The document. |
401 | Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment. |
403 | Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution). |
404 | project_not_found (unknown project, or one you may not read: the same answer), document_not_found (not in this project), or original_unavailable (the original file is no longer stored). |
429 | Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded. |
502 | The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on. |
503 | Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged. |
curl -s "https://api.prudai.com/v1/projects/<project_id>/documents/<document_id>" \ -H "Authorization: Bearer $PRUDAI_TOKEN"prudai leo projects-documents get{ "id": "00000000-0000-4000-8000-000000000000", "project_id": "00000000-0000-4000-8000-000000000000", "filename": "string", "kind": "audio", "content_type": "string", "status": "pending", "size_bytes": 1, "chunk_count": 1, "original_available": false, "uploaded_by": { "name": "string", "email": "string" }, "subtitles": { "format": "string", "duration_seconds": 1, "speakers": [ "string" ] }, "audio": { "language_code": "string", "provider": "string", "duration_seconds": 1 }, "created_at": "2026-11-05T09:30:00.000Z", "updated_at": "2026-11-05T09:30:00.000Z", "deleted_at": "2026-11-05T09:30:00.000Z"}Move a document to the trash (soft delete, restorable)
DELETE /v1/projects/{project_id}/documents/{document_id}
Personal tokens only; owner or editor of the project. A soft delete: the document goes
to the trash. It disappears from every document list, from search and from LEO chat (its
search fragments are removed), but the record and the original stay, so
restoreProjectDocument brings it back, as long as the original file is still stored
(restorable says so; without a stored original the trash is a one-way door and only
purgeProjectDocument remains). listProjectDocuments?deleted=true shows the
trash. Final removal happens only with purgeProjectDocument (from the trash) or after
the trash retention period. ?dryRun=true shows what would be moved (would_delete,
restorable and irreversible follow original_available) and changes nothing. Waits for a human
(review): the first call answers 202 with an approval request; repeat
the exact call with x-prudai-approval: apr_… once a human approved it. A caller without
the right gets the error (404/403), never an approval request.
- Stand: binnenkort, nog niet op productie.
- Scope:
prudai:projects:delete - Goedkeuring:
review, een tweede persoon of rol keurt goed. - Dry run:
?dryRun=truelaat zien wat er zou gebeuren en slaat niets op. - Verwijderen is zacht; zie Conventies.
Parameters
project_idverplicht
The LEO project (dossier) id. Anything that is not a UUID answers404 project_not_found.document_idverplicht
The document id. Anything that is not a UUID answers404 document_not_found.dryRun
Show what would be deleted without changing anything. Een van:true,false
Antwoorden
| Status | Betekenis |
|---|---|
200 | In the trash ({id, deleted: true, restorable, deleted_at}; restorable is false when the original is no longer stored), or a dry run ({id, would_delete: true, restorable, irreversible, original_available, ...}). |
202 | Waiting for human approval (ApprovalRequest). |
401 | Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment. |
403 | Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution). |
404 | project_not_found (unknown project, or one you may not read: the same answer), document_not_found (not in this project), or original_unavailable (the original file is no longer stored). |
409 | The project has no document store yet (project_not_ready), or the document service refuses the change right now (document_conflict, the document is still being processed or its store is being removed; retry later). |
429 | Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded. |
502 | The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on. |
503 | Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged. |
curl -s -X DELETE "https://api.prudai.com/v1/projects/<project_id>/documents/<document_id>" \ -H "Authorization: Bearer $PRUDAI_TOKEN"prudai leo projects-documents delete{ "id": "00000000-0000-4000-8000-000000000000", "deleted": true, "restorable": true, "deleted_at": "2026-11-05T09:30:00.000Z"}Download the original file of a document (raw bytes)
GET /v1/projects/{project_id}/documents/{document_id}/original
Personal tokens only. Not the task envelope on success: the body is the file itself,
Content-Type: application/octet-stream, Content-Disposition: attachment with the
filename (filename*=UTF-8''…), X-Content-Type-Options: nosniff, Cache-Control: no-store
and Content-Length when known. Save it to a file; never render it. Errors are the normal
envelope: 404 original_unavailable when the original is no longer stored (purged by the
retention policy or missing; the text may still be readable), 413 request_too_large above
the upload size limit. A transfer that breaks after the first byte ends in a cut connection
(compare Content-Length), never in a file with an error appended.
- Stand: binnenkort, nog niet op productie.
- Scope:
prudai:projects:read - Goedkeuring:
none, geen extra stap.
Parameters
project_idverplicht
The LEO project (dossier) id. Anything that is not a UUID answers404 project_not_found.document_idverplicht
The document id. Anything that is not a UUID answers404 document_not_found.
Antwoorden
| Status | Betekenis |
|---|---|
200 | The original file. |
401 | Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment. |
403 | Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution). |
404 | project_not_found (unknown project, or one you may not read: the same answer), document_not_found (not in this project), or original_unavailable (the original file is no longer stored). |
413 | The original is larger than the download limit (request_too_large). |
429 | Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded. |
502 | The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on. |
503 | Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged. |
Formaat van het antwoord: application/octet-stream.
curl -s "https://api.prudai.com/v1/projects/<project_id>/documents/<document_id>/original" \ -H "Authorization: Bearer $PRUDAI_TOKEN"prudai leo projects-documents originalDelete a document from the trash for good
POST /v1/projects/{project_id}/documents/{document_id}/purge
Personal tokens only; owner or editor of the project. Irreversible: removes a document
that is already in the trash completely (record, text, search fragments, audio side files,
original). A live document is refused (409 document_not_in_trash): delete it first.
?dryRun=true shows what would disappear (would_purge, irreversible: true) and changes
nothing. Waits for a human (review): the first call answers 202 with an approval request;
repeat the exact call with x-prudai-approval: apr_… once a human approved it (the approver
gives a reason). A caller without the right gets the error (404/403), never an approval request.
- Stand: binnenkort, nog niet op productie.
- Scope:
prudai:projects:delete - Goedkeuring:
review, een tweede persoon of rol keurt goed. - Dry run:
?dryRun=truelaat zien wat er zou gebeuren en slaat niets op.
Parameters
project_idverplicht
The LEO project (dossier) id. Anything that is not a UUID answers404 project_not_found.document_idverplicht
The document id. Anything that is not a UUID answers404 document_not_found.dryRun
Show what would happen without changing anything. Een van:true,false
Antwoorden
| Status | Betekenis |
|---|---|
200 | Purged ({id, purged: true, restorable: false}), or a dry run ({id, would_purge: true, irreversible: true, ...}). |
202 | Waiting for human approval (ApprovalRequest; once the approval flow exists). |
401 | Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment. |
403 | Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution). |
404 | project_not_found (unknown project, or one you may not read: the same answer), document_not_found (not in this project), or original_unavailable (the original file is no longer stored). |
409 | The document is not in the trash (document_not_in_trash), the document service refuses the change right now (document_conflict), or the project has no document store yet (project_not_ready). |
429 | Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded. |
502 | The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on. |
503 | Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged. |
curl -s -X POST "https://api.prudai.com/v1/projects/<project_id>/documents/<document_id>/purge" \ -H "Authorization: Bearer $PRUDAI_TOKEN"prudai leo projects-documents purgeRestore a document from the trash
POST /v1/projects/{project_id}/documents/{document_id}/restore
Personal tokens only; owner or editor of the project. Takes a document out of the trash; the
document service processes it again from the stored original (status pending until it is
completed). ?dryRun=true shows the document and changes nothing (200). Waits for a human
(confirm): the first call answers 202 with an approval request; repeat the exact call with
x-prudai-approval: apr_… once a human approved it. A caller without the right gets the
error (404/403), never an approval request.
- Stand: binnenkort, nog niet op productie.
- Scope:
prudai:projects:write - Goedkeuring:
confirm, de gebruiker bevestigt precies deze aanroep. - Dry run:
?dryRun=truelaat zien wat er zou gebeuren en slaat niets op.
Parameters
project_idverplicht
The LEO project (dossier) id. Anything that is not a UUID answers404 project_not_found.document_idverplicht
The document id. Anything that is not a UUID answers404 document_not_found.dryRun
Show what would happen without changing anything. Een van:true,false
Antwoorden
| Status | Betekenis |
|---|---|
200 | Restored: the document (status pending, deleted_at: null); processing is queued. Or a dry run (would_restore: true); nothing changed. |
202 | Waiting for human approval (ApprovalRequest). |
401 | Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment. |
403 | Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution). |
404 | project_not_found (unknown project, or one you may not read: the same answer), document_not_found (not in this project), or original_unavailable (the original file is no longer stored). |
409 | The document is not in the trash (document_not_in_trash), its original is no longer stored (original_unavailable, it stays in the trash), or the project has no document store yet (project_not_ready). |
429 | Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded. |
502 | The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on. |
503 | Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged. |
curl -s -X POST "https://api.prudai.com/v1/projects/<project_id>/documents/<document_id>/restore" \ -H "Authorization: Bearer $PRUDAI_TOKEN"prudai leo projects-documents restoreGet the extracted text (or transcript) of a document
GET /v1/projects/{project_id}/documents/{document_id}/text
Personal tokens only. Plain text as the document service extracted it; for an audio memo
the transcript, for a .vtt/.srt the normalised transcript. completeness counts text
fragments (total and returned) when the document service reports them, and
truncated: true when the text is not complete; otherwise total is null and notIncluded
says so. Before processing has finished the text can be empty.
- Stand: binnenkort, nog niet op productie.
- Scope:
prudai:projects:read - Goedkeuring:
none, geen extra stap.
Parameters
project_idverplicht
The LEO project (dossier) id. Anything that is not a UUID answers404 project_not_found.document_idverplicht
The document id. Anything that is not a UUID answers404 document_not_found.
Antwoorden
| Status | Betekenis |
|---|---|
200 | The text. |
401 | Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment. |
403 | Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution). |
404 | project_not_found (unknown project, or one you may not read: the same answer), document_not_found (not in this project), or original_unavailable (the original file is no longer stored). |
429 | Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded. |
502 | The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on. |
503 | Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged. |
Velden in data (200)
document_idfilenameformat
text/plaintextcharacters
min. 0
curl -s "https://api.prudai.com/v1/projects/<project_id>/documents/<document_id>/text" \ -H "Authorization: Bearer $PRUDAI_TOKEN"prudai leo projects-documents text{ "document_id": "00000000-0000-4000-8000-000000000000", "filename": "string", "format": "text/plain", "text": "string", "characters": 1}Import Word into a new editable project concept
POST /v1/projects/{project_id}/drafts/import
Imports one .docx upload or one accessible document from a project or knowledge base into
a new document concept. Headings, lists, tables and emphasis are preserved. Footnotes become
endnotes. tracked_changes selects accept or mark; omitted elements are counted in warnings.
The source and destination are checked before a human approval request is created.
The exact multipart bytes are bound to the normal approval grant. Repeat the same request
with x-prudai-approval after approval. Maximum upload 15 MiB. ?dryRun=true returns parsed structure statistics and warnings without creating a concept.
Idempotency-Key is required for creation; retries with the same caller, key and inputs return the same concept for 24 hours.
Creation is reversible through the existing concept deletion route; the source remains unchanged.
- Stand: binnenkort, nog niet op productie.
- Scope:
prudai:word_import:write - Goedkeuring:
confirm, de gebruiker bevestigt precies deze aanroep. - Dry run:
?dryRun=truelaat zien wat er zou gebeuren en slaat niets op. - Idempotentie: stuur
Idempotency-Keymee; dezelfde sleutel met dezelfde body voert de actie niet twee keer uit.
Parameters
project_idverplicht
The LEO project (dossier) id. Anything that is not a UUID answers404 project_not_found.dryRun
Een van:true,falseIdempotency-Key
Required when creating a concept; optional for dryRun. max. lengte 255
Body
JSON, verplicht.
document_idverplichtknowledge_base_idtitle
max. lengte 200conversation_idtracked_changes
Een van:accept,markdoc_type
Een van:brief,memo,advies,overeenkomst,processtuk,email,overig
Antwoorden
| Status | Betekenis |
|---|---|
200 | Parsed read-only preview, or the same concept returned for an idempotent retry. |
201 | A new editable concept plus import warnings, counts and retained structure. |
202 | Waiting for human approval; no concept has been created. |
401 | Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment. |
403 | Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution). |
404 | project_not_found (unknown project, or one you may not read: the same answer), document_not_found (not in this project), or original_unavailable (the original file is no longer stored). |
409 | An import with this Idempotency-Key is already running. |
413 | File exceeds the import size limit. |
422 | Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body). |
429 | Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded. |
503 | Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged. |
curl -s -X POST "https://api.prudai.com/v1/projects/<project_id>/drafts/import" \ -H "Authorization: Bearer $PRUDAI_TOKEN" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "document_id": "00000000-0000-4000-8000-000000000000", "knowledge_base_id": "00000000-0000-4000-8000-000000000000", "title": "string", "conversation_id": "00000000-0000-4000-8000-000000000000", "tracked_changes": "accept", "doc_type": "brief" }'prudai leo projects-drafts import