Delete a promotion
Remove a promotion you no longer need, such as a test or an old completed one.
An active promotion must be paused or completed first.
DELETE
AuthBearer tokenRate limit30 changes / min per rooftopAllowedNot while active
Before you call it
You can delete a draft, scheduled, paused or completed promotion. Deleting an active one returns 409 INVALID_STATUS_CHANGE. Images used by the promotion stay saved and can be reused.
Counts toward the 30 changes a minute per rooftop.
Path parameters
Requiredalways send
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Required | The promotion id. |
Sample request
curl --request DELETE \
--url 'https://api.spyne.ai/api/pv1/promotions/351' \
--header 'Authorization: Bearer YOUR_API_KEY'import requests
url = "https://api.spyne.ai/api/pv1/promotions/351"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.delete(url, headers=headers)
print(response.status_code, response.json())const response = await fetch("https://api.spyne.ai/api/pv1/promotions/351", {
method: "DELETE",
headers: {
Authorization: "Bearer YOUR_API_KEY",
},
});
console.log(response.status, await response.json());Sample response
{
"success": true,
"statusCode": 200,
"message": "Promotion deleted",
"data": {
"id": "351",
"deleted": true
}
}Response parameters (200)
| Parameter | Type | Description |
|---|---|---|
data.id | string | The promotion id, as sent in the path. |
data.deleted | boolean | Always true. |
Errors
| Status | Code | When it happens |
|---|---|---|
404 | PROMOTION_NOT_FOUND | No such promotion for this rooftop, or it was already deleted. |
409 | INVALID_STATUS_CHANGE | The promotion is active, or can't be deleted in its current state; message says why. |
400 | VALIDATION_FAILED | Spyne refused the request. |
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 30 changes this minute. Wait the seconds in Retry-After. |
502 / 503 | SERVICE_UNAVAILABLE | A Spyne service is briefly unavailable. Retry shortly. |
What happens next
A deleted promotion no longer appears in List promotions. Its vehicles are free to join another hand-picked promotion.
Updated 2 days ago
Did this page help you?
