Segments
Operações
List segments for an app
Lists every segment belonging to the App, ordered by creation time.
Autorizações
Admin session cookie set by POST /v1/auth/login. Dashboard-only management.
App REST key (rk_...). Server-to-server calls.
Parâmetros
Parâmetros de Caminho
App ID
Parâmetros de Consulta
Comma-separated extras; \
Respostas
OK
Create a segment
Creates a device segment (a named rule set) scoped to the App.
Autorizações
Admin session cookie set by POST /v1/auth/login. Dashboard-only management.
App REST key (rk_...). Server-to-server calls.
Parâmetros
Parâmetros de Caminho
App ID
Corpo da Requisição
Respostas
Created
Count multiple segments' matching devices in one request
Resolves each listed segment's rules and returns how many devices each matches, as an id → count map. Ids that don't exist or belong to another App are silently omitted.
Autorizações
Admin session cookie set by POST /v1/auth/login. Dashboard-only management.
App REST key (rk_...). Server-to-server calls.
Parâmetros
Parâmetros de Caminho
App ID
Parâmetros de Consulta
Comma-separated segment ids (max 100)
Respostas
OK
Preview a rule set's audience
Validates and resolves a rule set that has not been saved as a segment yet, returning the estimated audience as {reach, reachable, by_platform{ios,android,web}, sample[], total_devices, group_reach[]}. The sample is a token-free device projection; group_reach is present only for two or more rule groups. Bounded by a 5s statement timeout (503 preview_timeout) and 60 requests/min per user and app (429 rate_limited).
Autorizações
Admin session cookie set by POST /v1/auth/login. Dashboard-only management.
App REST key (rk_...). Server-to-server calls.
Parâmetros
Parâmetros de Caminho
App ID
Corpo da Requisição
Respostas
OK
Get a segment
Fetches a single segment by ID, scoped to the App, with pending_sends (scheduled notifications) and sends_30d (non-test notifications of the last 30 days).
Autorizações
Admin session cookie set by POST /v1/auth/login. Dashboard-only management.
App REST key (rk_...). Server-to-server calls.
Parâmetros
Parâmetros de Caminho
App ID
Segment ID
Respostas
OK
Delete a segment
Deletes a segment by ID, scoped to the App.
Autorizações
Admin session cookie set by POST /v1/auth/login. Dashboard-only management.
App REST key (rk_...). Server-to-server calls.
Parâmetros
Parâmetros de Caminho
App ID
Segment ID
Respostas
No Content
Update a segment
Partially updates a segment's name and/or rules. Fields omitted from the request keep their existing value.
Autorizações
Admin session cookie set by POST /v1/auth/login. Dashboard-only management.
App REST key (rk_...). Server-to-server calls.
Parâmetros
Parâmetros de Caminho
App ID
Segment ID
Corpo da Requisição
Respostas
OK
List a segment's matching devices
Resolves a segment's rules into the devices it currently matches. The response is capped at 1000 devices; truncated reports whether the segment matches more than that (a preview, not a send).
Autorizações
Admin session cookie set by POST /v1/auth/login. Dashboard-only management.
App REST key (rk_...). Server-to-server calls.
Parâmetros
Parâmetros de Caminho
App ID
Segment ID
Respostas
{"devices": [deviceResponse], "truncated": bool}
Count a segment's matching devices
Resolves a segment's rules and returns how many devices currently match, without listing their tokens.
Autorizações
Admin session cookie set by POST /v1/auth/login. Dashboard-only management.
App REST key (rk_...). Server-to-server calls.
Parâmetros
Parâmetros de Caminho
App ID
Segment ID
Respostas
OK
Duplicate a segment
Creates a copy of the segment with the same rules and description, scoped to the App. The body is optional: with a name the copy takes exactly that name (409 segment_name_taken if used, 422 over 100 characters); without one it is named "{name} (copy)", then "{name} (copy 2)", ...
Autorizações
Admin session cookie set by POST /v1/auth/login. Dashboard-only management.
App REST key (rk_...). Server-to-server calls.
Parâmetros
Parâmetros de Caminho
App ID
Segment ID
Corpo da Requisição
Respostas
Created