Get presigned URL to upload supporting document
Payouts
Get Document Upload URL
Get a presigned URL to upload an invoice directly to S3 before or after creating a payout.
POST
Get presigned URL to upload supporting document
Overview
Returns a presigned PUT URL so your server can upload an invoice directly to Yala’s private S3 bucket. Yala does not accept file bytes on this endpoint—only metadata (filename, contentType).
After uploading to S3, use the returned documentUrl on:
POST /initiateassupportingDocument, orPATCH /:id/documentsin thedocumentsarray
Read Uploading Supporting Documents for the full 3-step flow: call Yala, upload to S3, then call Yala again with
documentUrl.Upload flow (3 steps)
| Step | Where | Action |
|---|---|---|
| 1 | Yala API | POST /documents/upload-url returns uploadUrl and documentUrl |
| 2 | Amazon S3 | PUT file bytes to uploadUrl (not Yala) |
| 3 | Yala API | POST /initiate or PATCH /:id/documents with documentUrl |
Request
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
filename | string | Yes | Original filename (basename only, e.g. invoice.pdf) |
contentType | string | Yes | MIME type: application/pdf, image/jpeg, image/jpg, or image/png |
Response
Response Fields
| Field | Type | Description |
|---|---|---|
documentId | string (UUID) | Document identifier (embedded in S3 key) |
uploadUrl | string | Presigned URL for one-time PUT to S3 (~15 min TTL) |
documentUrl | string | Stable HTTPS URL — pass this to initiate/PATCH after upload succeeds |
expiresAt | string (ISO 8601) | When uploadUrl expires |
method | string | Always PUT |
headers | object | Headers required on the PUT request (e.g. Content-Type) |
Upload the file to S3
Error Responses
400 Bad Request
Invalid filename or unsupportedcontentType.