API Reference
Upload Document [POST]

Upload Document

https://sandboxapi.onbrails.com/api/v2/document-upload (opens in a new tab)

Upload a file and receive a key that references it. Use the key as:

  • destination.sender.complianceDocument.proofOfIdentity when adding a beneficiary (sender identity or business registration document), or
  • receiptRef when initiating a payout (invoice, contract or receipt).

See the Documents & Compliance guide for which document is required when.

Body Parameters

This endpoint accepts multipart/form-data with a single file part.

ParameterTypeRequiredDescription
filefile✅The document. Accepted types: pdf, png, jpeg/jpg, doc, docx. Maximum size 10 MB.
📘

Send the request with Content-Type: multipart/form-data, not application/json. Documents forwarded to payout partners must be pdf, jpg, jpeg or png and no larger than 5 MB; stay within those limits for compliance documents and invoices.

Request

Documents/Upload Document [POST]
curl --request POST \
     --url https://sandboxapi.onbrails.com/api/v2/document-upload \
     --header 'Authorization: Bearer YOUR_SECRET_KEY' \
     --form 'file=@"/Users/files/Downloads/passport.pdf"'

Responses

🟢 201 - Result example
{
"status": true,
"message": "File uploaded successfully",
"data": {
  "key": "documents/45422f21-9a0e-479e-9e10-615556448a78/7b1c6e2a-3f0d-4c8e-9a51-2d6f8e4b9c10.pdf",
  "url": "https://brails-documents.s3.amazonaws.com/documents/45422f21-9a0e-479e-9e10-615556448a78/7b1c6e2a-3f0d-4c8e-9a51-2d6f8e4b9c10.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=10800&X-Amz-Signature=...",
  "expiresAt": "2026-09-22T15:04:05Z"
}
}

Response Fields

FieldTypeDescription
keystringDurable reference to the uploaded file. Store this value. It is what you pass as complianceDocument.proofOfIdentity or receiptRef.
urlstringSigned link for checking what was uploaded. It stops working at expiresAt (3 hours). Do not persist it.
expiresAtstringISO 8601 time at which url expires.
⚠️

Keys are scoped to your business. A key passed in a beneficiary or payout request is verified to exist and to belong to you; an unknown or foreign key is rejected with Upload does not belong to this company (403) or a 400 naming the missing object.

Errors

StatusMessageCause / what to do
400file is requiredNo file part in the multipart body.
400this endpoint does not accept <type> filesUnsupported content type. Send pdf, png, jpeg, doc or docx.
401UnauthorizedMissing or invalid secret key.
413file exceeds the maximum allowed sizeFile larger than 10 MB. Compress or split the document and retry.
503Storage is not availableTemporary storage outage. Retry later.