Add a document
POST/pipelines/:pipeline_id/documents
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.
Permissions. Execute on the pipeline, execute on the text splitter that processes the document, and the document's classification itself in the classification allow-list of the key.
Documents, versions and fragments describes the request fields, processing and versions.
Request
Responses
- 201
- 400
- 401
- 403
- 404
- 413
- 422
The version was accepted. The body is the new version, with the status pending, or failed when the processing job could not be queued.
The metadata does not satisfy the pipeline's metadata schema (Invalid metadata), a new version names a classification that differs from the classification of the existing document (Classification mismatch), the body holds a field that the request does not define (Unknown field `<name>` , with the accepted fields in details.expected), or the body is not valid JSON.
The authentication headers are missing or invalid, or the API key is inactive or expired. Errors lists the messages.
The license does not permit the operation (Invalid license: ...), or the key's classification allow-list for the pipeline does not contain the classification (Unauthorized: <permissions> access to Pipeline required).
No pipeline with this identifier exists or the key lacks execute permission on the pipeline (Pipeline not found), or the pipeline does not define the classification (Classification not found). The text splitter does not exist or the key lacks execute permission on the text splitter (Text Splitter not found).
The body is larger than the request body limit of the API server, 10 MiB unless the configuration key app.max_body_bytes sets another value (Failed to buffer the request body: length limit exceeded).
A required field such as contents is missing, a field has the wrong type, or path is not a valid document path. The message names the field (Failed to deserialize the JSON body: ...), except for an invalid path, where the message names the value, as in Failed to deserialize the JSON body: Invalid parameter: Invalid path `kb.Billing`: expected labels of lowercase letters, digits, `-` and `_` separated by periods.