The request body should specify the URL from where Waives can download the contents of the document's file. The
Content-Type header must be set to
application/json; if it is excluded, the request will be treated as an upload request rather than an import.
Only HTTP and HTTPS schemes are allowed (HTTPS is strongly recommended).
The download of the file must succeed within 10 seconds, otherwise a
422 Unprocessable Entity is returned. The 422 response is returned in a few cases, such as when the download fails or the JSON body does not match the required schema. The reason for the 422 response is provided in the response body.
The newly created document resource is returned, along with a
201 Created status. The document resource includes the document's ID, which can then be used with the Get, Read, Classify, Extract Document Data, Get Redacted PDF and Delete endpoints.
The Supported File Types article contains details of all file types supported by Waives, and the maximum file size.
The document resource contains an embedded
files resource which includes details of the file that the document was created from.
The properties are as follows:
id: A unique identifier for this file.
file_type: The type of the file as determined by the API by examining the contents of the file. This will have one of the values listed in the table below.
size: The size of the file in bytes.
sha256: The SHA-256 hash of the file contents.
It is best practice to calculate your own values for
file_type (which in most cases will be a static value) of the file you are submitting and compare these to the values in the response in order to ensure that the file was not corrupted during transmission.
Content-Type header is returned in the response when downloading the specified file, Waives will analyse the contents of file and validate that the file type matches the MIME-type in the header. The valid
Content-Type and file type combinations are specified in the table below.
If the file type does not match the header value then the request will be rejected with a 415 response.
201 The Document was created
400 The request is badly formed or invalid
401 There is no Authorization header or the access token is invalid
403 You have reached your maximum number of simultaneous documents
415 The Content-Type is specified and not set to
422 There was a problem downloading the specified file (see the error in the response for details of the specific error).