Upload Document

Upload a file to an entity's documents. Send a multipart/form-data body
with exactly one part named file that has a filename in its
Content-Disposition. The file may be at most 50 MiB (52,428,800 bytes),
and the whole request at most 51 MiB.

The file part must not set Content-Encoding. Markup and script types
(text/html, text/xml, application/xml, text/xsl, any +xml type
such as SVG, and JavaScript) are rejected with 415, whether declared or
detected.

To skip uploading a file Digits already has, send its hex SHA-256 hash in
If-None-Match. If the entity already has a document with that content,
the existing document is returned with 200 (or 412 without the
documents:read scope) and the body is not read. A new upload returns 201.

Requires scope: documents:write.

Query Params
string

Your ID for the document, returned as externalId.

string

Entity's Digits-assigned ID, obtained from entity discovery. Required unless
external_id is supplied or the token already identifies the entity.

string

Entity's caller-assigned ID in the authorizing organization's namespace.
Alternative to id for organization-level tokens; not a source or transaction ID.

Body Params
file
required

The file, with a filename. At most 50 MiB.

Headers
string

The file's hex SHA-256 hash, quoted or not. If the entity already has a document with this content, it is returned instead of uploading again.

Responses

412

A document matching If-None-Match already exists, but the token lacks the documents:read scope to return it. Nothing is uploaded.

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json