Create Media
Upload a new image to your store.
Endpoint
POST /api/images/createRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
| src | string | Yes | Image URL or base64 string |
| title | string | No | Image title |
| width | int | No | Image width (optional) |
| height | int | No | Image height (optional) |
If you provide a
urlfield, it will be used assrc.
If you provide a base64 string insrc, the API will upload it and return the CDN URL.
Example
json
{
"src": "https://cdn.example.com/image.jpg",
"title": "Banner"
}or
json
{
"src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"title": "Logo"
}Example Response
json
{
"status": "success",
"data": {
"_id": "string",
"src": "https://cdn.example.com/image.jpg",
"title": "Banner",
"width": 1200,
"height": 600
}
}