v1

latestOpenAPI 3.0.02026-07-2464438356.8 KB
Documents

Get an upload URL for a document

Returns a one-time upload URL plus the form fields you need to attach. Send a multipart/form-data POST to the URL with each uploadUrlFormFields entry as a form field, then the file field last. The URL is valid for 60 minutes. Maximum file size is 10 MB.

post/api/documents/generate-upload-url

Headers

on-behalf-ofstring

Organization ID to act on behalf of

idempotency-keystring uuid required

Required UUID to safely retry requests without creating duplicate operations. Subsequent requests with the same key and identical body return the original cached response with an idempotency-replayed: true response header. Keys expire after 24 hours.

Request body

contentType'image/jpeg' | 'image/jpg' | 'image/png' | 'application/pdf' required

The MIME type of the document

filenamestring required

Human-readable filename for the document

Example request

{
  "contentType": "application/pdf",
  "filename": "passport_scan.pdf"
}

Response

Upload URL generated.

documentIdstring uuid required

Unique identifier for the document. Use this ID to reference the document in subsequent API calls.

expiresAtstring date-time required

Timestamp when the presigned upload URL expires.

uploadUrlstring required

The URL to send the multipart/form-data POST request to.

uploadUrlFormFieldsobject required

Key-value pairs that must be included as form fields in the multipart POST request. The file field must be the last field in the request. These fields carry the upload signature and policy.

Example response

{
  "uploadUrlFormFields": {
    "Content-Type": "application/pdf",
    "Policy": "<base64-encoded policy>",
    "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
    "X-Amz-Credential": "AKIA.../us-east-1/s3/aws4_request",
    "X-Amz-Date": "20260409T120000Z",
    "X-Amz-Signature": "<signature>",
    "bucket": "my-bucket",
    "key": "documents/org-id/doc-id/filename.pdf"
  }
}