Skip to main content

Upload files

Several APIs require document attachments, and some document types accept multiple files. For example, submit the front and back of an EMIRATES_ID as separate JPEG files.

The Upload document API returns a unique identifier for each uploaded file. Use that identifier when submitting the related business document, person or account request.

Files must be submitted as multipart/form-data including the binary file. Supported formats include PDF, JPG, and PNG.

Different upload endpoint for RFI documents

POST /v1/account/documents/upload is reserved for onboarding-stage uploads: it will reject requests from accounts that have completed onboarding. If you are uploading a document to satisfy an RFI document request, use the RFI-scoped upload endpoint instead: POST /v1/rfi/{rfiId}/documents/upload. See the Responding to RFI guide for the full attach flow.

Usage

  • Each file must be uploaded separately.
  • A valid bearer token is required in the Authorization header.
  • This API only performs storage: document classification or linking must be handled via the related business or person APIs using the returned id.

Example

curl -L 'https://sandbox-api.hubpay.io/v1/account/documents/upload' \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'AccountId: 058a2d45-139c-436b-8d1f-eec265e0f418' \
-H 'Authorization: Bearer <token>' \
-F 'file=@"/path/to/file"'

Refer to the API Reference for more details.