Documents
Documents, document versions, fragments and the document paths of a pipeline. Documents, versions and fragments describes the lifecycle of a document, and Document paths describes paths.
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`: the optional `path` field places the version at a document path, 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 that has not expired, and an expired document returns HTTP 404 unless the request sets `include_expired=true`. With `version`, the response is that version, whether or not the 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. The array omits versions whose classification the key's classification allow-list does not cover. A document identifier that was never used, or whose versions were all deleted, returns HTTP 404. A document whose versions have all expired, or were all created after `as_of`, 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, by path and by metadata, and the `status` filter finds versions whose processing is not complete or has failed. Without `path`, the list contains only the documents without a path; `path=>` lists every document that has a path. No single request lists the documents with and without a path together.
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. The optional `path` field places the version at a document path, and a new version does not inherit the path of the previous version. 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`, `failed` or `canceled`.
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 ends with `success`, `failed` or `canceled`. `as_of` returns the version that was current at a given time, and `include_expired=true` also considers expired versions, so an expired document returns HTTP 404 without the parameter.
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 current version of the document, or the latest version created at or before `as_of` that had not expired at that time. An expired document returns HTTP 404 unless the request sets `include_expired=true`, which also considers expired versions. 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, with the decrypted text in `page_content`, as a JSON array without the list envelope, in the order of the identifiers in the request. The array omits identifiers that match no fragment, fragments whose classification is outside the key's classification allow-list for the pipeline and, unless the request sets `include_expired=true`, fragments of expired document versions. A request names at most 1,000 identifiers.
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 and with the `include_expired` field of the body in place of the query parameter.
List document paths
Returns the paths of the documents in a pipeline that match the `path` pattern, with the number of documents at each path, ordered by the bytes of the path. The list counts the current document versions, or the versions that were current at the time given in `as_of`, and omits paths without such a version. The response does not use the list envelope: `first` sets the page size, from 1 to 1,000 with a default of 100, and `next` holds the last path of a full page, which the request for the next page passes in `after`.