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.
GET
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
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Optional | Return only banner or only billboard images. Any other value returns 400 INVALID_REQUEST. |
page | integer | Optional | Page number, starting at 1. Default: 1. |
perPage | integer | Optional | Images 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)
| Parameter | Type | Description |
|---|---|---|
data.total | integer | Number of images that match, across all pages. |
data.page | integer | The page returned. |
data.perPage | integer | Images per page. |
data.assets[].id | string | The image id. Send it as assetId in a promotion. |
data.assets[].type | string | banner or billboard. |
data.assets[].url | string | Where the image is stored. |
data.assets[].isDefault | boolean | true if this is a default image for the rooftop. |
data.assets[].priority | integer | Sort order. Left out when the image has none. |
Errors
| Status | Code | When it happens |
|---|---|---|
400 | INVALID_REQUEST | A query parameter is invalid. details.errors lists every problem. |
400 | TEAM_NOT_RESOLVED | The API key isn't linked to a rooftop. |
401 | UNAUTHORIZED | The API key is missing or wrong. |
429 | RATE_LIMITED | More than 120 reads this minute. Wait the seconds in Retry-After. |
502 / 503 | SERVICE_UNAVAILABLE | A 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.
Updated 2 days ago
Did this page help you?
