Media

Generate a presigned URL for file upload

Generates a presigned S3 URL that the caller can use to upload a file (e.g. a KYC document) directly to Afriex's secure storage. The returned URL is time-limited and scoped to the requested operation. The file name is sanitised before it is used: any directory part is dropped, characters outside A-Z a-z 0-9 . _ - become _, and the result is cut to 200 characters. The object is stored as {businessId}/{sanitisedName}, so always use the returned key, not the name you sent, when you reference the file in a later request.

post/api/v1/media/url

Request

Request body

fileNamestring required

The name of the file to upload. It is sanitised (directory parts removed, characters outside A-Z a-z 0-9 . _ - replaced with _, cut to 200 characters), so the stored name can differ from this value; use the returned key.

type'transaction' | 'user'

The category of the file being uploaded. Use transaction for transaction-related files (e.g. a transactions CSV) and user for user identity documents. Defaults to user when omitted.

Example request

{
  "fileName": "document.pdf"
}

Response

Presigned URL generated successfully.

Example response

{
  "data": {
    "url": "https://s3.amazonaws.com/bucket/key?X-Amz-Algorithm=AWS4-HMAC-SHA256&...",
    "key": "64f0c2a1e4b0a1b2c3d4e5f6/invoice.pdf",
    "expiresIn": 300
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.