delete https://onesignal.com/api/v1/apps/:/segments/:
Delete segments (not user devices) - Required: OneSignal Paid Plan
You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app.
The segment_id
can be found in the URL of the segment when viewing it in the dashboard.

Example Code - Delete Segments
$ curl -XDELETE \
-H'Authorization: Basic YOUR_REST_API_KEY' \
-H'Content-Type: application/json' \
https://onesignal.com/api/v1/apps/YOUR_APP_ID/segments/YOUR_SEGMENT_ID
Result Format - Delete Segments
{
"success": true
}
{
"success": false
}
{
"errors": [
"app_id not found. You may be missing a Content-Type: application/json header."
]
}