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
Path parameters
The uuid, path or domain of the campaign to associate with the request
Headers
A valid HTTP Bearer token, required to access private records.
Request body
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"
}
}