v1

latestOpenAPI 3.1.02026-07-26497885.9 KB

Create segment

Programmatically create segments in your OneSignal app using flexible filters and targeting rules.

post/apps/{app_id}/segments

Path parameters

app_idstring required

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

Headers

Authorizationstring required

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

Content-Typestring required

Request body

idstring

UUID of the segment. If left empty, it will be assigned automatically.

namestring required

An internal name you set to help organize and track Segments. Maximum 128 characters.

descriptionstring

Optional human-readable description for the segment. Maximum 255 characters.

Response

201

successboolean

true if the segment was created successfully, false otherwise.

idstring

The UUID of the created segment.