List images

List the banners and billboards this rooftop can use in a promotion. Each image has an id that you send as assetId when you create a promotion.

Returns the rooftop's own images plus the images shared across its enterprise, sorted by priority, then by id.

GEThttps://api.spyne.ai/api/pv1/branding-assets
AuthBearer tokenRate limit120 reads / min per rooftop

Before you call it

This step is optional. A promotion also accepts public image links directly, so you only need saved images when you want to reuse the same banner or billboard in several promotions. To save a new one, see Add an image.

Counts toward the 120 reads a minute per rooftop.


Query parameters

Optionalcan be left out
ParameterTypeRequiredDescription
typestringOptionalReturn only banner or only billboard images. Any other value returns 400 INVALID_REQUEST.
pageintegerOptionalPage number, starting at 1. Default: 1.
perPageintegerOptionalImages per page, 1 to 200. Default: 50.

Sample request

curl --request GET \
  --url 'https://api.spyne.ai/api/pv1/branding-assets?type=banner' \
  --header 'Authorization: Bearer YOUR_API_KEY'
import requests

url = "https://api.spyne.ai/api/pv1/branding-assets"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
params = {"type": "banner"}

response = requests.get(url, headers=headers, params=params)
print(response.status_code, response.json())
const response = await fetch("https://api.spyne.ai/api/pv1/branding-assets?type=banner", {
  method: "GET",
  headers: {
    Authorization: "Bearer YOUR_API_KEY",
  },
});
console.log(response.status, await response.json());

Sample response

{
  "success": true,
  "statusCode": 200,
  "data": {
    "total": 1,
    "page": 1,
    "perPage": 50,
    "assets": [
      {
        "id": "1584",
        "type": "banner",
        "url": "https://example.com/fall-offer.png",
        "isDefault": false,
        "priority": 1
      }
    ]
  }
}

Response parameters (200)

ParameterTypeDescription
data.totalintegerNumber of images that match, across all pages.
data.pageintegerThe page returned.
data.perPageintegerImages per page.
data.assets[].idstringThe image id. Send it as assetId in a promotion.
data.assets[].typestringbanner or billboard.
data.assets[].urlstringWhere the image is stored.
data.assets[].isDefaultbooleantrue if this is a default image for the rooftop.
data.assets[].priorityintegerSort order. Left out when the image has none.

Errors

StatusCodeWhen it happens
400INVALID_REQUESTA query parameter is invalid. details.errors lists every problem.
400TEAM_NOT_RESOLVEDThe API key isn't linked to a rooftop.
401UNAUTHORIZEDThe API key is missing or wrong.
429RATE_LIMITEDMore than 120 reads this minute. Wait the seconds in Retry-After.
502 / 503SERVICE_UNAVAILABLEA Spyne service is briefly unavailable. Retry shortly.

Every code is explained in Errors and FAQs.

What happens next

Use an id from the list as assetId when you check and create a promotion.


Did this page help you?