Skip to content

List segments for an app​

GET
/v1/apps/{app_id}/segments

Lists every segment belonging to the App, ordered by creation time.

Authorizations​

SessionAuth

Admin session cookie set by POST /v1/auth/login. Dashboard-only management.

Type
API Key (cookie: notti_session)
or
RESTKeyAuth

App REST key (rk_...). Server-to-server calls.

Type
HTTP (bearer)

Parameters​

Path Parameters

app_id*

App ID

Type
string
Required

Query Parameters

include

Comma-separated extras; \

Type
string

Responses​

OK

application/json
JSON
[
  
{
  
  
"app_id": "string",
  
  
"created_at": "string",
  
  
"description": "string",
  
  
"id": "string",
  
  
"name": "string",
  
  
"pending_sends": 0,
  
  
"reach": 0,
  
  
"rules": {
  
  
  
"conditions": [
  
  
  
  
{
  
  
  
  
  
"eq": "string",
  
  
  
  
  
"exists": true,
  
  
  
  
  
"field": "string",
  
  
  
  
  
"gt": {
  
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
  
"str": "string"
  
  
  
  
  
},
  
  
  
  
  
"gte": {
  
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
  
"str": "string"
  
  
  
  
  
},
  
  
  
  
  
"in": [
  
  
  
  
  
  
"string"
  
  
  
  
  
],
  
  
  
  
  
"lt": {
  
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
  
"str": "string"
  
  
  
  
  
},
  
  
  
  
  
"neq": "string",
  
  
  
  
  
"nexists": true,
  
  
  
  
  
"nin": [
  
  
  
  
  
  
"string"
  
  
  
  
  
]
  
  
  
  
}
  
  
  
],
  
  
  
"groups": [
  
  
  
  
{
  
  
  
  
}
  
  
  
],
  
  
  
"op": "string"
  
  
},
  
  
"sends_30d": 0,
  
  
"updated_at": "string"
  
}
]

Playground​

Authorization
Variables
Key
Value

Samples​


Create a segment​

POST
/v1/apps/{app_id}/segments

Creates a device segment (a named rule set) scoped to the App.

Authorizations​

SessionAuth

Admin session cookie set by POST /v1/auth/login. Dashboard-only management.

Type
API Key (cookie: notti_session)
or
RESTKeyAuth

App REST key (rk_...). Server-to-server calls.

Type
HTTP (bearer)

Parameters​

Path Parameters

app_id*

App ID

Type
string
Required

Request Body​

application/json
JSON
{
  
"description": "string",
  
"name": "string",
  
"rules": {
  
  
"conditions": [
  
  
  
{
  
  
  
  
"eq": "string",
  
  
  
  
"exists": true,
  
  
  
  
"field": "string",
  
  
  
  
"gt": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"gte": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"in": [
  
  
  
  
  
"string"
  
  
  
  
],
  
  
  
  
"lt": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"neq": "string",
  
  
  
  
"nexists": true,
  
  
  
  
"nin": [
  
  
  
  
  
"string"
  
  
  
  
]
  
  
  
}
  
  
],
  
  
"groups": [
  
  
  
{
  
  
  
}
  
  
],
  
  
"op": "string"
  
}
}

Responses​

Created

application/json
JSON
{
  
"app_id": "string",
  
"created_at": "string",
  
"description": "string",
  
"id": "string",
  
"name": "string",
  
"pending_sends": 0,
  
"reach": 0,
  
"rules": {
  
  
"conditions": [
  
  
  
{
  
  
  
  
"eq": "string",
  
  
  
  
"exists": true,
  
  
  
  
"field": "string",
  
  
  
  
"gt": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"gte": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"in": [
  
  
  
  
  
"string"
  
  
  
  
],
  
  
  
  
"lt": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"neq": "string",
  
  
  
  
"nexists": true,
  
  
  
  
"nin": [
  
  
  
  
  
"string"
  
  
  
  
]
  
  
  
}
  
  
],
  
  
"groups": [
  
  
  
{
  
  
  
}
  
  
],
  
  
"op": "string"
  
},
  
"sends_30d": 0,
  
"updated_at": "string"
}

Playground​

Authorization
Variables
Key
Value
Body

Samples​


Count multiple segments' matching devices in one request​

GET
/v1/apps/{app_id}/segments/devices/count

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.

Authorizations​

SessionAuth

Admin session cookie set by POST /v1/auth/login. Dashboard-only management.

Type
API Key (cookie: notti_session)
or
RESTKeyAuth

App REST key (rk_...). Server-to-server calls.

Type
HTTP (bearer)

Parameters​

Path Parameters

app_id*

App ID

Type
string
Required

Query Parameters

ids*

Comma-separated segment ids (max 100)

Type
string
Required

Responses​

OK

application/json
JSON
{
  
"counts": {
  
  
"additionalProperties": 0
  
}
}

Playground​

Authorization
Variables
Key
Value

Samples​


Preview a rule set's audience​

POST
/v1/apps/{app_id}/segments/preview

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).

Authorizations​

SessionAuth

Admin session cookie set by POST /v1/auth/login. Dashboard-only management.

Type
API Key (cookie: notti_session)
or
RESTKeyAuth

App REST key (rk_...). Server-to-server calls.

Type
HTTP (bearer)

Parameters​

Path Parameters

app_id*

App ID

Type
string
Required

Request Body​

application/json
JSON
{
  
"description": "string",
  
"name": "string",
  
"rules": {
  
  
"conditions": [
  
  
  
{
  
  
  
  
"eq": "string",
  
  
  
  
"exists": true,
  
  
  
  
"field": "string",
  
  
  
  
"gt": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"gte": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"in": [
  
  
  
  
  
"string"
  
  
  
  
],
  
  
  
  
"lt": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"neq": "string",
  
  
  
  
"nexists": true,
  
  
  
  
"nin": [
  
  
  
  
  
"string"
  
  
  
  
]
  
  
  
}
  
  
],
  
  
"groups": [
  
  
  
{
  
  
  
}
  
  
],
  
  
"op": "string"
  
}
}

Responses​

OK

application/json
JSON
{
  
"by_platform": {
  
  
"additionalProperties": 0
  
},
  
"group_reach": [
  
  
0
  
],
  
"reach": 0,
  
"reachable": 0,
  
"sample": [
  
  
{
  
  
  
"app_version": "string",
  
  
  
"country": "string",
  
  
  
"external_user_id": "string",
  
  
  
"id": "string",
  
  
  
"last_seen_at": "string",
  
  
  
"platform": "string"
  
  
}
  
],
  
"total_devices": 0
}

Playground​

Authorization
Variables
Key
Value
Body

Samples​


Get a segment​

GET
/v1/apps/{app_id}/segments/{id}

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).

Authorizations​

SessionAuth

Admin session cookie set by POST /v1/auth/login. Dashboard-only management.

Type
API Key (cookie: notti_session)
or
RESTKeyAuth

App REST key (rk_...). Server-to-server calls.

Type
HTTP (bearer)

Parameters​

Path Parameters

app_id*

App ID

Type
string
Required
id*

Segment ID

Type
string
Required

Responses​

OK

application/json
JSON
{
  
"app_id": "string",
  
"created_at": "string",
  
"description": "string",
  
"id": "string",
  
"name": "string",
  
"pending_sends": 0,
  
"reach": 0,
  
"rules": {
  
  
"conditions": [
  
  
  
{
  
  
  
  
"eq": "string",
  
  
  
  
"exists": true,
  
  
  
  
"field": "string",
  
  
  
  
"gt": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"gte": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"in": [
  
  
  
  
  
"string"
  
  
  
  
],
  
  
  
  
"lt": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"neq": "string",
  
  
  
  
"nexists": true,
  
  
  
  
"nin": [
  
  
  
  
  
"string"
  
  
  
  
]
  
  
  
}
  
  
],
  
  
"groups": [
  
  
  
{
  
  
  
}
  
  
],
  
  
"op": "string"
  
},
  
"sends_30d": 0,
  
"updated_at": "string"
}

Playground​

Authorization
Variables
Key
Value

Samples​


Delete a segment​

DELETE
/v1/apps/{app_id}/segments/{id}

Deletes a segment by ID, scoped to the App.

Authorizations​

SessionAuth

Admin session cookie set by POST /v1/auth/login. Dashboard-only management.

Type
API Key (cookie: notti_session)
or
RESTKeyAuth

App REST key (rk_...). Server-to-server calls.

Type
HTTP (bearer)

Parameters​

Path Parameters

app_id*

App ID

Type
string
Required
id*

Segment ID

Type
string
Required

Responses​

No Content

Playground​

Authorization
Variables
Key
Value

Samples​


Update a segment​

PATCH
/v1/apps/{app_id}/segments/{id}

Partially updates a segment's name and/or rules. Fields omitted from the request keep their existing value.

Authorizations​

SessionAuth

Admin session cookie set by POST /v1/auth/login. Dashboard-only management.

Type
API Key (cookie: notti_session)
or
RESTKeyAuth

App REST key (rk_...). Server-to-server calls.

Type
HTTP (bearer)

Parameters​

Path Parameters

app_id*

App ID

Type
string
Required
id*

Segment ID

Type
string
Required

Request Body​

application/json
JSON
{
  
"description": "string",
  
"name": "string",
  
"rules": {
  
  
"conditions": [
  
  
  
{
  
  
  
  
"eq": "string",
  
  
  
  
"exists": true,
  
  
  
  
"field": "string",
  
  
  
  
"gt": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"gte": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"in": [
  
  
  
  
  
"string"
  
  
  
  
],
  
  
  
  
"lt": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"neq": "string",
  
  
  
  
"nexists": true,
  
  
  
  
"nin": [
  
  
  
  
  
"string"
  
  
  
  
]
  
  
  
}
  
  
],
  
  
"groups": [
  
  
  
{
  
  
  
}
  
  
],
  
  
"op": "string"
  
}
}

Responses​

OK

application/json
JSON
{
  
"app_id": "string",
  
"created_at": "string",
  
"description": "string",
  
"id": "string",
  
"name": "string",
  
"pending_sends": 0,
  
"reach": 0,
  
"rules": {
  
  
"conditions": [
  
  
  
{
  
  
  
  
"eq": "string",
  
  
  
  
"exists": true,
  
  
  
  
"field": "string",
  
  
  
  
"gt": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"gte": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"in": [
  
  
  
  
  
"string"
  
  
  
  
],
  
  
  
  
"lt": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"neq": "string",
  
  
  
  
"nexists": true,
  
  
  
  
"nin": [
  
  
  
  
  
"string"
  
  
  
  
]
  
  
  
}
  
  
],
  
  
"groups": [
  
  
  
{
  
  
  
}
  
  
],
  
  
"op": "string"
  
},
  
"sends_30d": 0,
  
"updated_at": "string"
}

Playground​

Authorization
Variables
Key
Value
Body

Samples​


List a segment's matching devices​

GET
/v1/apps/{app_id}/segments/{id}/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).

Authorizations​

SessionAuth

Admin session cookie set by POST /v1/auth/login. Dashboard-only management.

Type
API Key (cookie: notti_session)
or
RESTKeyAuth

App REST key (rk_...). Server-to-server calls.

Type
HTTP (bearer)

Parameters​

Path Parameters

app_id*

App ID

Type
string
Required
id*

Segment ID

Type
string
Required

Responses​

{"devices": [deviceResponse], "truncated": bool}

application/json
JSON
{
}

Playground​

Authorization
Variables
Key
Value

Samples​


Count a segment's matching devices​

GET
/v1/apps/{app_id}/segments/{id}/devices/count

Resolves a segment's rules and returns how many devices currently match, without listing their tokens.

Authorizations​

SessionAuth

Admin session cookie set by POST /v1/auth/login. Dashboard-only management.

Type
API Key (cookie: notti_session)
or
RESTKeyAuth

App REST key (rk_...). Server-to-server calls.

Type
HTTP (bearer)

Parameters​

Path Parameters

app_id*

App ID

Type
string
Required
id*

Segment ID

Type
string
Required

Responses​

OK

application/json
JSON
{
  
"count": 0
}

Playground​

Authorization
Variables
Key
Value

Samples​


Duplicate a segment​

POST
/v1/apps/{app_id}/segments/{id}/duplicate

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)", ...

Authorizations​

SessionAuth

Admin session cookie set by POST /v1/auth/login. Dashboard-only management.

Type
API Key (cookie: notti_session)
or
RESTKeyAuth

App REST key (rk_...). Server-to-server calls.

Type
HTTP (bearer)

Parameters​

Path Parameters

app_id*

App ID

Type
string
Required
id*

Segment ID

Type
string
Required

Request Body​

application/json
JSON
{
  
"name": "string"
}

Responses​

Created

application/json
JSON
{
  
"app_id": "string",
  
"created_at": "string",
  
"description": "string",
  
"id": "string",
  
"name": "string",
  
"pending_sends": 0,
  
"reach": 0,
  
"rules": {
  
  
"conditions": [
  
  
  
{
  
  
  
  
"eq": "string",
  
  
  
  
"exists": true,
  
  
  
  
"field": "string",
  
  
  
  
"gt": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"gte": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"in": [
  
  
  
  
  
"string"
  
  
  
  
],
  
  
  
  
"lt": {
  
  
  
  
  
"hoursAgo": 0,
  
  
  
  
  
"str": "string"
  
  
  
  
},
  
  
  
  
"neq": "string",
  
  
  
  
"nexists": true,
  
  
  
  
"nin": [
  
  
  
  
  
"string"
  
  
  
  
]
  
  
  
}
  
  
],
  
  
"groups": [
  
  
  
{
  
  
  
}
  
  
],
  
  
"op": "string"
  
},
  
"sends_30d": 0,
  
"updated_at": "string"
}

Playground​

Authorization
Variables
Key
Value
Body

Samples​


Powered by VitePress OpenAPI