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.

DELETEhttps://api.spyne.ai/api/pv1/promotions/{id}
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
ParameterTypeRequiredDescription
idintegerRequiredThe 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)

ParameterTypeDescription
data.idstringThe promotion id, as sent in the path.
data.deletedbooleanAlways true.

Errors

StatusCodeWhen it happens
404PROMOTION_NOT_FOUNDNo such promotion for this rooftop, or it was already deleted.
409INVALID_STATUS_CHANGEThe promotion is active, or can't be deleted in its current state; message says why.
400VALIDATION_FAILEDSpyne refused the request.
400TEAM_NOT_RESOLVEDThe API key isn't linked to a rooftop.
401UNAUTHORIZEDThe API key is missing or wrong.
429RATE_LIMITEDMore than 30 changes this minute. Wait the seconds in Retry-After.
502 / 503SERVICE_UNAVAILABLEA 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.


Did this page help you?