Files
Every request goes to https://api.lemak.cash. About the reference.
Create a file
POST /v1/files
Uploads a file as multipart/form-data. A file is a PDF, a JPEG or a PNG of at most 5 MB, and its type is read from its contents. Name the file in dispute evidence by its ID. You read the file back as an object; its contents stay with the platform.
Authentication
Bearer key. Your secret API key, which starts with sk_test_ or sk_live_. Send it as Authorization: Bearer <key>. A test key works as soon as your account exists. A production key returns 403 live_not_enabled until your account is activated.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key required | header | string | A unique key you generate for this request, up to 255 characters. A retry with the same key and body returns the original response. Without it, the request returns 400 idempotency_key_required. At most 255 characters. |
Api-Version optional | header | string | The API version for this request, as a date in YYYY-MM-DD format. When omitted, your account's version applies, which is set to the latest version on your first request. An unknown version returns 400 invalid_api_version. Pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. |
Request body
multipart/form-data
FileUpload
| Field | Type | Description |
|---|---|---|
file required | string (binary) | The file. A PDF, a JPEG or a PNG of at most 5 MB. |
purpose required | string | Why the file was uploaded. One of dispute_evidence. |
Responses
201
Returns the file.
application/json
File
| Field | Type | Description |
|---|---|---|
id required | string | Unique identifier for the file. |
object required | file | |
purpose required | string | Why the file was uploaded. One of dispute_evidence. |
type required | string | The type of the file, read from its contents. One of pdf, jpg, png. |
filename required | string | The name the file was uploaded with. |
size required | integer (int64) | The size of the file in bytes. |
created_at required | string (date-time) | The time the file was uploaded. |
Errors
Every error answers with the error object.
| Status | When |
|---|---|
| Other | An error. The status tells you the kind: 400 invalid request, 401 invalid API key, 402 payment could not be placed, 403 forbidden, 404 not found, 409 conflict, 413 body over 64 KiB, 422 idempotency key reused, 429 too many requests, 5xx server error. A test mode key takes at most 5 requests a second. |
Example
curl -X POST https://api.lemak.cash/v1/files \
-H "Authorization: Bearer sk_test_..." \
-H "Idempotency-Key: <Idempotency-Key>" \
-H "Api-Version: 2026-12-01"
Retrieve a file
GET /v1/files/{id}
Retrieves a file you uploaded by its ID.
Authentication
Bearer key. Your secret API key, which starts with sk_test_ or sk_live_. Send it as Authorization: Bearer <key>. A test key works as soon as your account exists. A production key returns 403 live_not_enabled until your account is activated.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The ID of the file. Pattern ^file_[0-9A-Za-z]+$. |
Api-Version optional | header | string | The API version for this request, as a date in YYYY-MM-DD format. When omitted, your account's version applies, which is set to the latest version on your first request. An unknown version returns 400 invalid_api_version. Pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. |
Responses
200
Returns the file.
application/json
File
| Field | Type | Description |
|---|---|---|
id required | string | Unique identifier for the file. |
object required | file | |
purpose required | string | Why the file was uploaded. One of dispute_evidence. |
type required | string | The type of the file, read from its contents. One of pdf, jpg, png. |
filename required | string | The name the file was uploaded with. |
size required | integer (int64) | The size of the file in bytes. |
created_at required | string (date-time) | The time the file was uploaded. |
Errors
Every error answers with the error object.
| Status | When |
|---|---|
| Other | An error. The status tells you the kind: 400 invalid request, 401 invalid API key, 402 payment could not be placed, 403 forbidden, 404 not found, 409 conflict, 413 body over 64 KiB, 422 idempotency key reused, 429 too many requests, 5xx server error. A test mode key takes at most 5 requests a second. |
Example
curl https://api.lemak.cash/v1/files/file_123 \
-H "Authorization: Bearer sk_test_..." \
-H "Api-Version: 2026-12-01"