Airwallex logo
Airwallex logoAirwallex logo

File Service

Copy for LLMView as Markdown

Represents files uploaded to Airwallex for secure storage and retrieval via download links. Each file can be referenced in other API endpoints using its unique file identifier.

Endpoints
POST /api/v1/files/download_links
POST /api/v1/files/upload

Upload a file

POST /api/v1/files/upload

Upload a file to Airwallex using this endpoint of the files.airwallex.com subdomain. The max size of upload file is up to 20MB. When you upload a file, the API responds with a file_id. This file unique identifier can then be referenced as required as part of the attachments object in our other endpoints.

Parameters
notesstring

The notes of the uploaded file, max length is 50 characters

Request body
filerequiredstring

The file to upload, max length of filename is 50 characters

Response body - 201 Created
createdinteger

created time of file

file_idstring

Unique identifier of file, to be referenced in other endpoints

filenamestring

Name of file

notesstring

notes of file

object_typestring

type of object. Can be file or list

sizeinteger

Size in bytes

Errors
Error statusDescription
400

Possible errors: field_required, invalid_argument

401

Possible errors: credentials_invalid, credentials_expired

429

Too many requests

500

Service unavailable

POST /api/v1/files/upload
$curl --request POST \
> --url 'https://files-demo.airwallex.com/api/v1/files/upload' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: multipart/form-data' \
> --data '{
> "file": "@your_file.pdf"
>}'
Response (201 Created)
1{
2 "created": 0,
3 "file_id": "<string>",
4 "filename": "<string>",
5 "notes": "<string>",
6 "object_type": "<string>",
7 "size": 0
8}
Was this section helpful?