Skip to main content

Create document

POST 

/documents/

Upload a Document for Analysis.

This endpoint allows the authenticated user to upload a document for analysis associated with a specific applicant. Supported document formats include PDF and image formats (JPEG, PNG), and the uploaded file is stored for processing.

Apple's HEIC format is not supported

Authentication:​

  • Requires a valid OAuth access token with the following scopes:
    • document:write
    • Or one of the internal scopes: org:staff, org:admin, admin
    • Public scopes may also be included.

Parameters:​

  • file (required, form): The document file to upload. Supported formats:
    • application/pdf
    • image/jpeg
    • image/png
  • applicant (required, form): The unique identifier (UUID) of the applicant to whom the document is associated.
  • document_type (required, form): The unique identifier (UUID) representing the type of document being uploaded.

Response:​

  • 201 Created: Returns the details of the uploaded document, including its storage reference and metadata.
  • 404 Not Found: If the applicant or the document type associated with the provided ID cannot be found.
  • 400 Bad Request: If the uploaded file is of an unsupported format or if any of the required parameters are missing.
  • 413 Payload Too Large: If the uploaded file exceeds the maximum size limit of 50 MB.
  • 403 Forbidden: If the user does not have the necessary permissions to upload the document.

🔒 Authentication​

This endpoint require a valid OAuth2 Bearer

It supports account impersonation within Organization's sub-accounts using X-Eaz-Account-Id Header.

  • If the X-Eaz-Account-Id header is provided and the user has access rights to that sub-account, the impersonation context is applied.
  • Otherwise, the user's own account context is used.

Scopes :​

User must provide one of the following scopes:

  • admin
  • staff
  • user
  • org:admin
  • org:staff
  • org:user
  • document:write

Request​

Responses​

Successful Response