Skip to content
On this page

Create Media ​

Upload a new image to your store.

Endpoint ​

POST /api/images/create

Request Body ​

FieldTypeRequiredDescription
srcstringYesImage URL or base64 string
titlestringNoImage title
widthintNoImage width (optional)
heightintNoImage height (optional)

If you provide a url field, it will be used as src.
If you provide a base64 string in src, 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
  }
}

Released under the MIT License.