Upload a file
curl --request POST \
--url https://api.global.direct.reap.global/2026-11-05/files \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form purpose=card_receipt \
--form file=@example-fileconst form = new FormData();
form.append('purpose', 'card_receipt');
form.append('file', '<string>');
const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
options.body = form;
fetch('https://api.global.direct.reap.global/2026-11-05/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.global.direct.reap.global/2026-11-05/files"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "purpose": "card_receipt" }
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text){
"id": "8f14e45f-ceea-4e67-a1b2-0f3c9d7a1b11",
"purpose": "card_receipt",
"filename": null,
"size": 48213,
"contentType": "application/pdf",
"status": "checking",
"createdAt": "2026-10-29T01:00:00.000Z"
}Files
Upload a file
Required API-key scope: depends on purpose.
Uploads a file you can use in another request, such as a receipt for a card transaction. Send multipart/form-data with purpose first, then file.
purpose | Use it for | Scope | File types | Max size |
|---|---|---|---|---|
card_receipt | Attach a receipt to a card transaction | card_activities:write | PDF, JPEG, PNG, GIF, HEIC | 10 MB |
After you upload
- The file starts with
status: checkingwhile we scan it for malware. - Call Retrieve a file every 2 to 5 seconds until
statusisready. This can take up to 5 minutes. - Attach it within 24 hours.
| Error | When |
|---|---|
400 | There is no file, the file is empty, or there is more than one file. |
413 | The file is over 10 MB. |
FILE_TYPE_NOT_SUPPORTED | The file isn’t an allowed type. We check the content, not the file name. |
503 | We couldn’t store the file right now. Wait a few seconds, then upload it again. If you retry automatically, back off exponentially with jitter and stop after a few tries. |
You don’t need an Idempotency-Key. Uploading twice, including after a 503, can create a second file, which expires on its own. Only attach the id from a successful upload.
POST
/
2026-11-05
/
files
Upload a file
curl --request POST \
--url https://api.global.direct.reap.global/2026-11-05/files \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form purpose=card_receipt \
--form file=@example-fileconst form = new FormData();
form.append('purpose', 'card_receipt');
form.append('file', '<string>');
const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
options.body = form;
fetch('https://api.global.direct.reap.global/2026-11-05/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.global.direct.reap.global/2026-11-05/files"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "purpose": "card_receipt" }
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text){
"id": "8f14e45f-ceea-4e67-a1b2-0f3c9d7a1b11",
"purpose": "card_receipt",
"filename": null,
"size": 48213,
"contentType": "application/pdf",
"status": "checking",
"createdAt": "2026-10-29T01:00:00.000Z"
}Body
multipart/form-data
Response
When the file was uploaded, in UTC.
Pattern:
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$