Pular para o conteúdo

List segments for an app​

GET
/v1/apps/{app_id}/segments

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

Autorizações​

SessionAuth

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

Tipo
API Key (cookie: notti_session)
ou
RESTKeyAuth

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

Tipo
HTTP (bearer)

Parâmetros​

Parâmetros de Caminho

app_id*

App ID

Tipo
string
Obrigatório

Parâmetros de Consulta

include

Comma-separated extras; \

Tipo
string

Respostas​

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​

Autorização
Variáveis
Chave
Valor

Exemplos​


Create a segment​

POST
/v1/apps/{app_id}/segments

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

Autorizações​

SessionAuth

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

Tipo
API Key (cookie: notti_session)
ou
RESTKeyAuth

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

Tipo
HTTP (bearer)

Parâmetros​

Parâmetros de Caminho

app_id*

App ID

Tipo
string
Obrigatório

Corpo da Requisição​

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"
  
}
}

Respostas​

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​

Autorização
Variáveis
Chave
Valor
Corpo

Exemplos​


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.

Autorizações​

SessionAuth

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

Tipo
API Key (cookie: notti_session)
ou
RESTKeyAuth

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

Tipo
HTTP (bearer)

Parâmetros​

Parâmetros de Caminho

app_id*

App ID

Tipo
string
Obrigatório

Parâmetros de Consulta

ids*

Comma-separated segment ids (max 100)

Tipo
string
Obrigatório

Respostas​

OK

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

Playground​

Autorização
Variáveis
Chave
Valor

Exemplos​


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

Autorizações​

SessionAuth

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

Tipo
API Key (cookie: notti_session)
ou
RESTKeyAuth

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

Tipo
HTTP (bearer)

Parâmetros​

Parâmetros de Caminho

app_id*

App ID

Tipo
string
Obrigatório

Corpo da Requisição​

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"
  
}
}

Respostas​

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​

Autorização
Variáveis
Chave
Valor
Corpo

Exemplos​


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

Autorizações​

SessionAuth

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

Tipo
API Key (cookie: notti_session)
ou
RESTKeyAuth

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

Tipo
HTTP (bearer)

Parâmetros​

Parâmetros de Caminho

app_id*

App ID

Tipo
string
Obrigatório
id*

Segment ID

Tipo
string
Obrigatório

Respostas​

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​

Autorização
Variáveis
Chave
Valor

Exemplos​


Delete a segment​

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

Deletes a segment by ID, scoped to the App.

Autorizações​

SessionAuth

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

Tipo
API Key (cookie: notti_session)
ou
RESTKeyAuth

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

Tipo
HTTP (bearer)

Parâmetros​

Parâmetros de Caminho

app_id*

App ID

Tipo
string
Obrigatório
id*

Segment ID

Tipo
string
Obrigatório

Respostas​

No Content

Playground​

Autorização
Variáveis
Chave
Valor

Exemplos​


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.

Autorizações​

SessionAuth

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

Tipo
API Key (cookie: notti_session)
ou
RESTKeyAuth

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

Tipo
HTTP (bearer)

Parâmetros​

Parâmetros de Caminho

app_id*

App ID

Tipo
string
Obrigatório
id*

Segment ID

Tipo
string
Obrigatório

Corpo da Requisição​

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"
  
}
}

Respostas​

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​

Autorização
Variáveis
Chave
Valor
Corpo

Exemplos​


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

Autorizações​

SessionAuth

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

Tipo
API Key (cookie: notti_session)
ou
RESTKeyAuth

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

Tipo
HTTP (bearer)

Parâmetros​

Parâmetros de Caminho

app_id*

App ID

Tipo
string
Obrigatório
id*

Segment ID

Tipo
string
Obrigatório

Respostas​

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

application/json
JSON
{
}

Playground​

Autorização
Variáveis
Chave
Valor

Exemplos​


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.

Autorizações​

SessionAuth

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

Tipo
API Key (cookie: notti_session)
ou
RESTKeyAuth

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

Tipo
HTTP (bearer)

Parâmetros​

Parâmetros de Caminho

app_id*

App ID

Tipo
string
Obrigatório
id*

Segment ID

Tipo
string
Obrigatório

Respostas​

OK

application/json
JSON
{
  
"count": 0
}

Playground​

Autorização
Variáveis
Chave
Valor

Exemplos​


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

Autorizações​

SessionAuth

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

Tipo
API Key (cookie: notti_session)
ou
RESTKeyAuth

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

Tipo
HTTP (bearer)

Parâmetros​

Parâmetros de Caminho

app_id*

App ID

Tipo
string
Obrigatório
id*

Segment ID

Tipo
string
Obrigatório

Corpo da Requisição​

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

Respostas​

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​

Autorização
Variáveis
Chave
Valor
Corpo

Exemplos​


Desenvolvido por VitePress OpenAPI