Delete Segment
Queue deletion of a manual segment with DELETE /v2/admin/segments/{segmentId}.
Deletes a manual segment asynchronously. Memberships are removed later by the batch job.
Deletion is refused while an active form or another segment still references the segment (same guard as the admin panel). Authenticate with an admin API key. Admin API rate limits apply separately from SDK limits.
Authentication
Admin (secret) API key
Publishable SDK keys receive 403 (publishable API keys cannot call /v2/admin routes).
Server-side only
Keep admin API keys on your server. Never ship them in client code.
Path parameters
Segment UUID to delete.
No request body.
Examples
curl -X DELETE 'https://api.encatch.com/engage-product/encatch/api/v2/admin/segments/550e8400-e29b-41d4-a716-446655440000' \
-H 'X-Api-Key: YOUR_ADMIN_API_KEY'Success response
{ "requestId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8" }Correlation id for the delete operation.
Errors
These are specific to Delete Segment. Shared errors include invalid or missing API key (401), publishable key on admin routes (403), rate limits (429), and sanitized 500 responses.
{
"status": 409,
"error": "Conflict",
"message": "Cannot delete segment: it is currently being used by 2 active consumer(s). Remove the segment from those places first."
}| Status | When |
|---|---|
404 | Segment not found or deleted (Segment not found) |
409 | Not a manual segment, or segment in use by active form(s) or segment(s) |
Related
Was this page helpful?
