Upload a File

Upload a file and receive an opaque file_<uuid> id that can be referenced by other endpoints.

POST /v1/files

Headers

Header Required Description
X-Api-Key Yes Your API key
Content-Type Yes multipart/form-data

Request Body

Send the file as multipart/form-data with a single form field named file.

Field Type Required Description
file binary Yes The file to upload. Max size 5 MB.

Example Request

curl -X POST "https://api.esca.finance/v1/files" \
  -H "X-Api-Key: your_api_key_here" \
  -F "file=@invoice.pdf"

Example Response

{
  "status": true,
  "message": "File uploaded successfully",
  "data": {
    "id": "file_3f1e0a7c-5b2d-4f9c-8a31-90c8b1f4e2a7"
  }
}

The id is the only value you need to keep. Pass it to any endpoint that accepts a file reference (e.g. paymentPurposeAttachmentId on a fiat payout).

Error Responses

Status Description
400 No file provided in the file form field, or the form-data was malformed
401 Invalid or expired API key
413 File exceeds the 5 MB size limit
429 Rate limit exceeded