TEASEDocs
API ReferenceLandings

Delete a geo-segment

Delete a draft segment. The default segment cannot be deleted until another is promoted. Pass `force=true` to also delete buttons still in the segment. Requires a write-scoped key.

Authorization

bearerAuth
AuthorizationBearer <token>

Your al_live_<prefix>_<secret> API key. Mint and manage keys in the dashboard.

In: header

Path Parameters

domain*string

The domain hostname.

segment_id*string

The segment id.

Query Parameters

force?boolean

Cascade-delete buttons that still reference this segment.

Defaultfalse

Response Body

application/json

application/json

application/json

application/json

DELETE
/api/admin/segments/{domain}/{segment_id}
curl -X DELETE "https://example.com/api/admin/segments/string/string"
Empty
{  "detail": {    "code": "segment_default_required",    "message": "Нельзя удалить сегмент по умолчанию: сначала назначьте другой сегмент по умолчанию"  }}
{  "detail": "auth required"}
{  "detail": {    "code": "domain_not_found",    "message": "Domain not found"  }}
{  "detail": {    "code": "segment_has_buttons",    "message": "В сегменте есть кнопки (3). Удалите их или повторите запрос с force=true"  }}