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. 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.
Permissions. Read and execute on the pipeline, execute on the text splitter that processes the document, and the document's classification in the allow-list.
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), or a new version names a classification that differs from the classification of the existing document (Classification mismatch).
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 does not permit the classification (Unauthorized: access level ... required for Pipeline with id ...).
No pipeline with this identifier exists or the key lacks execute permission on the pipeline (Pipeline with id <id> not found), or the pipeline does not define the classification or the key's allow-list excludes the classification (Classification not found). The text splitter does not exist or the key lacks execute permission on the text splitter (Text Splitter with id <id> not found).
The body is larger than 2 megabytes, counted in bytes. The response body is plain text (Failed to buffer the request body: length limit exceeded).
A required field such as contents is missing, or a field has the wrong type. The response body is plain text and names the field (Failed to deserialize the JSON body into the target type: missing field ...).