Segments
Define and resolve dynamic device segments for targeted notifications.
Lists every segment belonging to the App, ordered by creation time.
Path Parameters
app_id*string
App ID
Response Body
application/json
curl -X GET "https://example.com/v1/apps/string/segments"[ { "app_id": "string", "created_at": "string", "id": "string", "name": "string", "rules": { "conditions": [ { "eq": "string", "exists": true, "field": "string", "neq": "string" } ], "op": "string" } }]Creates a device segment (a named rule set) scoped to the App.
Path Parameters
app_id*string
App ID
Request Body
application/json
Segment name and rules
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/v1/apps/string/segments" \ -H "Content-Type: application/json" \ -d '{}'{ "app_id": "string", "created_at": "string", "id": "string", "name": "string", "rules": { "conditions": [ { "eq": "string", "exists": true, "field": "string", "neq": "string" } ], "op": "string" }}Fetches a single segment by ID, scoped to the App.
Path Parameters
app_id*string
App ID
id*string
Segment ID
Response Body
application/json
curl -X GET "https://example.com/v1/apps/string/segments/string"{ "app_id": "string", "created_at": "string", "id": "string", "name": "string", "rules": { "conditions": [ { "eq": "string", "exists": true, "field": "string", "neq": "string" } ], "op": "string" }}Partially updates a segment's name and/or rules. Fields omitted from the request keep their existing value.
Path Parameters
app_id*string
App ID
id*string
Segment ID
Request Body
application/json
Fields to update
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X PATCH "https://example.com/v1/apps/string/segments/string" \ -H "Content-Type: application/json" \ -d '{}'{ "app_id": "string", "created_at": "string", "id": "string", "name": "string", "rules": { "conditions": [ { "eq": "string", "exists": true, "field": "string", "neq": "string" } ], "op": "string" }}Deletes a segment by ID, scoped to the App.
Path Parameters
app_id*string
App ID
id*string
Segment ID
Response Body
curl -X DELETE "https://example.com/v1/apps/string/segments/string"Empty