Skip to main content
DELETE
cURL

Overview

The Delete segment method is used when you want to programmatically delete a segment from within the OneSignal Dashboard UI.
Once a segment is deleted, it cannot be recovered. You will need to create a new segment with the same filters.

How to use this API

You can pass in the segment_id dictating which segment from our dashboard will be deleted. To get a segment_id, go to Audience > Segments in the dashboard, open the segment’s options menu, and select Copy segment ID. You can also get it from the View segments API or from the segment’s URL in the dashboard, as shown below:

Example shows segment ID


Headers

Authorization
string
default:Key YOUR_APP_API_KEY
required

Your App API key with prefix Key . See Keys & IDs.

Path Parameters

app_id
string
default:YOUR_APP_ID
required

Your OneSignal App ID in UUID v4 format. See Keys & IDs.

segment_id
string
default:YOUR_SEGMENT_ID
required

The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View segments API or the segment's URL in the dashboard.

Response

200

success
boolean
default:true
Example:

true