Ga naar inhoud

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.

MethodePadWat het doetStand
GET/v1/projectsList the LEO projects (dossiers) you can readBinnenkort
GET/v1/projects/{project_id}Get one project (dossier)Binnenkort
GET/v1/projects/{project_id}/documentsList the documents of a projectBinnenkort
POST/v1/projects/{project_id}/documentsUpload one file into a projectBinnenkort
GET/v1/projects/{project_id}/documents/{document_id}Get one document with its processing statusBinnenkort
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}/originalDownload the original file of a document (raw bytes)Binnenkort
POST/v1/projects/{project_id}/documents/{document_id}/purgeDelete a document from the trash for goodBinnenkort
POST/v1/projects/{project_id}/documents/{document_id}/restoreRestore a document from the trashBinnenkort
GET/v1/projects/{project_id}/documents/{document_id}/textGet the extracted text (or transcript) of a documentBinnenkort
POST/v1/projects/{project_id}/drafts/importImport Word into a new editable project conceptBinnenkort

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 query · string
    max. lengte 255
  • include_archived query · string
    Een van: true, false
  • limit query · integer
    standaard: 20 · min. 1 · max. 100
  • cursor query · string
    max. lengte 200

Antwoorden

StatusBetekenis
200One page of projects.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, 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).
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s "https://api.prudai.com/v1/projects" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo projects list
Antwoord 200
[
{
"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_id path · string (uuid) verplicht
    The LEO project (dossier) id. Anything that is not a UUID answers 404 project_not_found.

Antwoorden

StatusBetekenis
200The project.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, 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).
404project_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).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
502The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.

Velden in data (200)

  • id string (uuid)
  • name string
  • description string
    kan null zijn
  • kind string
    Een van: dossier, table
  • product string
    The product the project belongs to (leo, zia, vera, bever, …).
  • archived boolean
  • role string
    Your role; owner and editor may upload and delete documents. Een van: owner, editor, reader
  • created_at string (date-time)
  • updated_at string (date-time)
curl
curl -s "https://api.prudai.com/v1/projects/<project_id>" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo projects get
Antwoord 200
{
"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_id path · string (uuid) verplicht
    The LEO project (dossier) id. Anything that is not a UUID answers 404 project_not_found.
  • status query · string
    Processing status; completed = searchable and its text is readable. Een van: pending, processing, chunking, embedding, indexing, completed, failed
  • q query · string
    max. lengte 200
  • limit query · integer
    standaard: 50 · min. 1 · max. 200
  • cursor query · string
    max. lengte 200
  • deleted query · string
    true lists the trash (documents moved there with deleteProjectDocument) instead of the live documents. Een van: true, false

Antwoorden

StatusBetekenis
200One page of documents.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, 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).
404project_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).
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
502The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s "https://api.prudai.com/v1/projects/<project_id>/documents" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo projects-documents list
Antwoord 200
[
{
"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=true laat zien wat er zou gebeuren en slaat niets op.
  • Idempotentie: stuur Idempotency-Key mee; dezelfde sleutel met dezelfde body voert de actie niet twee keer uit.

Parameters

  • project_id path · string (uuid) verplicht
    The LEO project (dossier) id. Anything that is not a UUID answers 404 project_not_found.
  • Idempotency-Key header · string verplicht
    min. lengte 8 · max. lengte 255 · patroon ^[\x21-\x7E]+$
  • dryRun query · string
    Validate and show the effect without changing anything. Een van: true, false

Body

Formaat: multipart/form-data.

Antwoorden

StatusBetekenis
200Replay of the same Idempotency-Key and file, or a dry run.
201Uploaded; processing started.
202Waiting for human approval (ApprovalRequest).
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, 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).
404project_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).
409The 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).
413File too large (request_too_large).
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
502The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s -X POST "https://api.prudai.com/v1/projects/<project_id>/documents" \
-H "Authorization: Bearer $PRUDAI_TOKEN" \
-H "Idempotency-Key: $(uuidgen)"
CLI (binnenkort)
prudai leo projects-documents create
Antwoord 200
{
"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_id path · string (uuid) verplicht
    The LEO project (dossier) id. Anything that is not a UUID answers 404 project_not_found.
  • document_id path · string (uuid) verplicht
    The document id. Anything that is not a UUID answers 404 document_not_found.

Antwoorden

StatusBetekenis
200The document.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, 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).
404project_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).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
502The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s "https://api.prudai.com/v1/projects/<project_id>/documents/<document_id>" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo projects-documents get
Antwoord 200
{
"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=true laat zien wat er zou gebeuren en slaat niets op.
  • Verwijderen is zacht; zie Conventies.

Parameters

  • project_id path · string (uuid) verplicht
    The LEO project (dossier) id. Anything that is not a UUID answers 404 project_not_found.
  • document_id path · string (uuid) verplicht
    The document id. Anything that is not a UUID answers 404 document_not_found.
  • dryRun query · string
    Show what would be deleted without changing anything. Een van: true, false

Antwoorden

StatusBetekenis
200In 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, ...}).
202Waiting for human approval (ApprovalRequest).
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, 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).
404project_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).
409The 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).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
502The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s -X DELETE "https://api.prudai.com/v1/projects/<project_id>/documents/<document_id>" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo projects-documents delete
Antwoord 200
{
"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_id path · string (uuid) verplicht
    The LEO project (dossier) id. Anything that is not a UUID answers 404 project_not_found.
  • document_id path · string (uuid) verplicht
    The document id. Anything that is not a UUID answers 404 document_not_found.

Antwoorden

StatusBetekenis
200The original file.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, 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).
404project_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).
413The original is larger than the download limit (request_too_large).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
502The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.

Formaat van het antwoord: application/octet-stream.

curl
curl -s "https://api.prudai.com/v1/projects/<project_id>/documents/<document_id>/original" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo projects-documents original

Delete 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=true laat zien wat er zou gebeuren en slaat niets op.

Parameters

  • project_id path · string (uuid) verplicht
    The LEO project (dossier) id. Anything that is not a UUID answers 404 project_not_found.
  • document_id path · string (uuid) verplicht
    The document id. Anything that is not a UUID answers 404 document_not_found.
  • dryRun query · string
    Show what would happen without changing anything. Een van: true, false

Antwoorden

StatusBetekenis
200Purged ({id, purged: true, restorable: false}), or a dry run ({id, would_purge: true, irreversible: true, ...}).
202Waiting for human approval (ApprovalRequest; once the approval flow exists).
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, 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).
404project_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).
409The 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).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
502The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s -X POST "https://api.prudai.com/v1/projects/<project_id>/documents/<document_id>/purge" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo projects-documents purge

Restore 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=true laat zien wat er zou gebeuren en slaat niets op.

Parameters

  • project_id path · string (uuid) verplicht
    The LEO project (dossier) id. Anything that is not a UUID answers 404 project_not_found.
  • document_id path · string (uuid) verplicht
    The document id. Anything that is not a UUID answers 404 document_not_found.
  • dryRun query · string
    Show what would happen without changing anything. Een van: true, false

Antwoorden

StatusBetekenis
200Restored: the document (status pending, deleted_at: null); processing is queued. Or a dry run (would_restore: true); nothing changed.
202Waiting for human approval (ApprovalRequest).
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, 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).
404project_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).
409The 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).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
502The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s -X POST "https://api.prudai.com/v1/projects/<project_id>/documents/<document_id>/restore" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo projects-documents restore

Get 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_id path · string (uuid) verplicht
    The LEO project (dossier) id. Anything that is not a UUID answers 404 project_not_found.
  • document_id path · string (uuid) verplicht
    The document id. Anything that is not a UUID answers 404 document_not_found.

Antwoorden

StatusBetekenis
200The text.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, 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).
404project_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).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
502The document service gave an unexpected answer (upstream_error); nothing of its answer is passed on.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.

Velden in data (200)

  • document_id string (uuid)
  • filename string
  • format string
    text/plain
  • text string
  • characters integer
    min. 0
curl
curl -s "https://api.prudai.com/v1/projects/<project_id>/documents/<document_id>/text" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo projects-documents text
Antwoord 200
{
"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=true laat zien wat er zou gebeuren en slaat niets op.
  • Idempotentie: stuur Idempotency-Key mee; dezelfde sleutel met dezelfde body voert de actie niet twee keer uit.

Parameters

  • project_id path · string (uuid) verplicht
    The LEO project (dossier) id. Anything that is not a UUID answers 404 project_not_found.
  • dryRun query · string
    Een van: true, false
  • Idempotency-Key header · string
    Required when creating a concept; optional for dryRun. max. lengte 255

Body

JSON, verplicht.

  • document_id string (uuid) verplicht
  • knowledge_base_id string (uuid)
  • title string
    max. lengte 200
  • conversation_id string (uuid)
  • tracked_changes string
    Een van: accept, mark
  • doc_type string
    Een van: brief, memo, advies, overeenkomst, processtuk, email, overig

Antwoorden

StatusBetekenis
200Parsed read-only preview, or the same concept returned for an idempotent retry.
201A new editable concept plus import warnings, counts and retained structure.
202Waiting for human approval; no concept has been created.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, 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).
404project_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).
409An import with this Idempotency-Key is already running.
413File exceeds the import size limit.
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
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"
}'
CLI (binnenkort)
prudai leo projects-drafts import