curl --request POST \
--url https://sandbox.api.afriex.com/api/v1/media/url \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"fileName": "passport.png",
"type": "user"
}
'{
"data": {
"url": "https://s3.amazonaws.com/bucket/key?X-Amz-Algorithm=AWS4-HMAC-SHA256&...",
"key": "64f0c2a1e4b0a1b2c3d4e5f6/invoice.pdf",
"expiresIn": 300
}
}{
"code": "<string>",
"error": "<string>",
"details": {
"errorMessage": "<string>",
"friendlyMessage": "<string>",
"data": {
"customerId": "<string>"
}
}
}{
"code": "<string>",
"error": "<string>",
"details": {
"errorMessage": "<string>",
"friendlyMessage": "<string>",
"data": {
"customerId": "<string>"
}
}
}Generate Upload URL
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.
curl --request POST \
--url https://sandbox.api.afriex.com/api/v1/media/url \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"fileName": "passport.png",
"type": "user"
}
'{
"data": {
"url": "https://s3.amazonaws.com/bucket/key?X-Amz-Algorithm=AWS4-HMAC-SHA256&...",
"key": "64f0c2a1e4b0a1b2c3d4e5f6/invoice.pdf",
"expiresIn": 300
}
}{
"code": "<string>",
"error": "<string>",
"details": {
"errorMessage": "<string>",
"friendlyMessage": "<string>",
"data": {
"customerId": "<string>"
}
}
}{
"code": "<string>",
"error": "<string>",
"details": {
"errorMessage": "<string>",
"friendlyMessage": "<string>",
"data": {
"customerId": "<string>"
}
}
}PUT a file to directly. Use it for KYC documents on customers or for transaction-related files such as SWIFT invoices.
Request a URL
POST /api/v1/media/url with the target fileName and a type (user for identity documents, transaction for transaction files). The response contains a presigned url, the stable object key, and expiresIn (seconds the URL remains valid; typically 300).Upload the file
PUT to the url with the file bytes as the body within the expiresIn window. If the window elapses, request a fresh URL.Reference the file
key to any follow-up request (for example, the invoice field on a SWIFT withdraw, or a document field in SME Registration). Downstream endpoints only accept the object key; the presigned url itself is never accepted.Authorizations
Static business API key issued from the dashboard. A business can provision multiple API keys, each scoped to a configurable set of permissions (e.g. read transactions, create deposits, etc). Permissions are chosen per key at creation time in the dashboard and may be revoked by deleting the key. Requests made with a key that does not include the permission required by the target endpoint is rejected with a 401 Unauthorized response, the same response an unrecognised, malformed or revoked key returns. The API does not distinguish the two cases on the wire. Manage your keys and their permissions under Developer → API keys in the dashboard.
Headers
API version in ISO 8601 format. The only supported version is 2026-05-18, which is also the default when the header is omitted. Any other value is rejected with a 400 Bad Request.
Body
The name of the file to upload.
"document.pdf"
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.
transaction, user Response
Presigned URL generated successfully.
Show child attributes
Show child attributes
