Create a document
POST/api/v1/documents
Creates a document from a JSON body, or from a multipart request carrying a document JSON part and the file parts that it references. A file part is attached only when primaryFile.contentPart in the document JSON names it; every part other than document must be referenced, and a part name must not repeat. Either variant can instead take the primary file from a ready upload of the caller with primaryFile.uploadId; a successful creation consumes the upload, and a failed one leaves it usable until it expires. See Uploading files. By default, a JSON body and the document part are limited to 1 MiB, a file part to 24 MiB, and a multipart body to 32 MiB; an environment can configure different limits.
Request
Responses
- 201
- 400
- 401
- 403
- 404
- 406
- 413
- 415
- 422
- 500
- 503
Document created.
Response Headers
Path of the created document, such as /api/v1/documents/1234.
The request is invalid (invalid_request): the body or a parameter failed validation, or the multipart body or a request header is malformed. A body that is not valid JSON uses invalid_json.
The authentication credential is invalid or has expired (unauthorized).
The request has no authentication credential, or the user is not allowed to use the API (forbidden).
The addressed resource does not exist, or no route matches the request method and path (not_found).
The request does not accept any representation the operation can produce (not_acceptable).
The request content exceeds a size limit (payload_too_large).
The request's Content-Type is not supported by this operation (unsupported_media_type).
The request was well-formed but could not be processed (unprocessable_content).
An unexpected server error occurred (internal_error).
The service is temporarily unavailable, for example while it restarts (service_unavailable). Retry the request later.