Documents
Documents, document versions and fragments. Documents, versions and fragments describes the lifecycle of a document.
Add a document with pipeline ID in body
Adds a document, or a new version of an existing document, to the pipeline named in the `pipeline_id` field of the body. The operation behaves as `POST /pipelines/{pipeline_id}/documents`: processing is asynchronous, and the response returns the new version with the status `pending`, or `failed` when the processing job cannot be queued.
Get a document version
Returns one version of a document, found by the document identifier alone. Without the `version` query parameter, the response is the latest version of the document, whether or not that version has expired. The `status` field of the response shows whether processing of the version is complete.
Delete or expire a document by ID
Deletes or expires a document found by the document identifier alone, without the pipeline identifier. Without `expire`, the operation permanently removes every version and every fragment of the document and returns status 204. With `expire=true`, the operation marks every current version as expired and returns status 200, and the version history remains readable.
List document versions
Returns the versions of a document as a JSON array, newest first, without the list envelope. By default the array contains only current versions, and `include_expired=true` adds the expired versions. A document identifier that matches no version returns an empty array.
List documents
Returns one page of the document versions in a pipeline that are current, or that were current at the time given in `as_of`. A document with several current versions appears once for each version. Query parameters filter the list by document fields and by metadata, and the `status` filter finds versions whose processing is not complete.
Add a document
Adds a document to a pipeline, or a new version of the document that has the same `external_identifier` in the pipeline. Processing is asynchronous: the response returns the new version with the status `pending`, or `failed` when the processing job cannot be queued. The client application retrieves the document until the status is `success`.
Delete or expire all documents
Deletes or expires every document in a pipeline. Without `expire`, the operation permanently removes every version and every fragment and returns status 204. With `expire=true`, the operation marks every current version as expired and returns status 200.
Get a document
Returns the latest current version of a document in a pipeline, with the processing status in the `status` field. A client application retrieves the document after adding the document to find out when processing is complete. `as_of` returns the version that was current at a given time, and `include_expired=true` also considers expired versions.
Delete or expire a document
Deletes or expires a document in a pipeline. Without `expire`, the operation permanently removes every version and every fragment of the document and returns status 204. With `expire=true`, the operation marks every current version as expired and returns status 200, and the version history remains readable.
List document fragments
Returns one page of the fragments of one document version, in the order of the fragments within the version. The version is the latest version of the document, or the latest version created at or before `as_of`, including an expired version. The fragment text is included in `page_content` only when the request sets `contents=true`.
Get fragments by ID
Returns the fragments of a pipeline that have the given identifiers, as a JSON array without the list envelope. The array omits identifiers that match no fragment and fragments whose classification is outside the key's classification allow-list for the pipeline, and includes expired fragments. The order of the array is not defined. Each fragment holds the identifier, classification, metadata, version and position, but not the text: the fragment list of the document version returns the text when the request sets `contents=true`.
Get fragments by ID (deprecated)
This operation is deprecated. `GET /pipelines/{pipeline_id}/fragments` with one `id` query parameter for each fragment replaces the operation. The operation returns the same fragments as the `GET` operation, for the identifiers in the `ids` field of the body.