← Documentation home
POST
/hyax-api/v1/media/uploadUpload image (multipart)
Uploads a raw image file via `multipart/form-data`. Only `image/*` MIME types are accepted; max file size is 10 MB. Returns the public CDN URL. Use the optional `type` field to classify the file (default: `Image`).
Base URL: https://platform.hyax.com · Replace YOUR_API_KEY with your team API key.
Request body
| Field | Required | Description |
|---|---|---|
| file | Yes | Image file (multipart field, `image/*` only, max 10 MB) |
| type | No | `Image` (default) | `Post` | `Product` | `Tmp` |
Request examples
Same request in cURL, Node.js (fetch), and PHP (ext-curl).
curl -X POST 'https://platform.hyax.com/hyax-api/v1/media/upload' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '"multipart/form-data — use -F \"[email protected]\" with curl"'Example response
Shape varies by data; values are illustrative.
{
"success": true,
"data": {
"id": "clx…",
"url": "https://cdn.hyax.com/team_id/images/image.jpg",
"mimeType": "image/jpeg",
"size": 204800,
"type": "Image"
}
}