Upload file

Upload file

POST https://api.ocamba.com/v2/adex/media-library
Uploads a file to the Adex media library. The caller sends only the file. The server sets app_id.

Tip
Upload uses multipart/form-data. The file name comes from the upload.
Note
Do not send app_id. A file that is already stored comes back as 201 with the existing object.

Rate limits:

  • Burst: 10/s
  • Steady: 150/m

Request schema

body

Response schemas

curl -X POST \
 "https://api.ocamba.com/v2/adex/media-library" \
  -H "Authorization: Bearer {TOKEN}"
const url = 'https://api.ocamba.com/v2/adex/media-library';
const options = {
  method: 'POST',
  headers: {
    Authorization: `Bearer {TOKEN}`
  }
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
$ch = curl_init("https://api.ocamba.com/v2/adex/media-library");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

201 Created

{
  "id": "167",
  "app_id": "1001",
  "company_id": "200",
  "user_id": "1000077",
  "location": "https://cdn.example/share/200/adex/media/99-logo.png",
  "name": "logo.png",
  "size": 20480,
  "mime_type": "image/png",
  "width": 120,
  "height": 40,
  "create_time": "2026-03-10 12:00:00",
  "update_time": "2026-03-10 12:00:00"
}

400 Bad Request

{
  "code": 400,
  "title": "Bad request.",
  "message": "The request is not valid.",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}

500 Internal Server Error

{
  "code": 500,
  "title": "Internal server error.",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
Responses