v1

latestOpenAPI 3.0.0Apache 2.02026-07-2410185524.2 KB
Media

media

Add an image to the campaign media library. Accepts either a multipart/form-data upload or an application/json body with a url to fetch server-side. Accepted formats: PNG, JPG, GIF, WebP, SVG (max 20 MB). SVG files are sanitised before upload. An optional folder field (default: "uploads") organises the upload; only lowercase letters, numbers, hyphens, and underscores are accepted. On success the new item is prepended to the campaign media library.

For custom components:

RaiselyComponents.api.one('campaigns', '{campaign}').all('media').post(data = {}, params = {}, headers = {}) => Promise<{result}>

:fa-gears: See Restie Response Data for a more detailed overview of responses through the client wrapper

post/campaigns/{campaign}/media

Path parameters

campaignstring required

The uuid, path or domain of the campaign to associate with the request

Headers

Authorizationstring

A valid HTTP Bearer token, required to access private records.

Request body

urlstring required

Public URL of the image to fetch

folderstring

Organising folder for the upload (optional, default "uploads")

Example request

{
  "url": "https://example.com/banner.png",
  "folder": "hero-images"
}

Response

Successfully uploaded media item

Example response

{
  "data": {
    "uuid": "a1b2c3d4-0000-0000-0000-000000000000",
    "url": "https://raisely-images.imgix.net/my-campaign/hero-images/banner-4a2f91.png",
    "file": "banner-4a2f91.png",
    "type": "image/png",
    "folder": "hero-images"
  }
}