Skip to main content

Delete Segment

Permanently delete a segment or cohort from a website.

Endpoint

DELETE /api/websites/{websiteId}/segments/{segmentId}

Headers

Authorization
string
required
Bearer token for authentication

Path Parameters

websiteId
string
required
Website UUID
segmentId
string
required
Segment UUID

Response

success
boolean
Returns true if deletion was successful

Example Request

curl -X DELETE "https://your-umami-instance.com/api/websites/550e8400-e29b-41d4-a716-446655440000/segments/770e8400-e29b-41d4-a716-446655440001" \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "success": true
}

Error Responses

401
error
Unauthorized - You don’t have permission to delete this segment
404
error
Not Found - Segment does not exist
This action is permanent and cannot be undone. Make sure you want to delete the segment before proceeding.
You must have delete permissions for the website to remove its segments.

Build docs developers (and LLMs) love