Skip to content
AzimeaDocs
Dashboard
GET
/segments
curl --request GET \
--url https://api.azimea.com/v1/segments \
--header 'Authorization: Bearer <token>'

The company’s saved segments with their live counts: count is everyone the segment’s rule picks now, sendableCount those Azimea may email. Pass a segment’s id to GET /contacts?segment= to read its people. Needs contacts:read.

Every segment, with its rule and counts

Media typeapplication/json
object
isSuccess

true when the call worked, false when errors say why it did not.

boolean
value

The answer itself; null when the call failed.

Array<object>
nullable
object
id

The segment’s id. Use it as segment in GET /contacts.

string format: guid
name

The segment’s name.

string
description

A note about the segment; null when none was written.

string
nullable
definition

The rules that decide who is in the segment.

object
join

All: a contact must match every rule. Any: matching one is enough.

string
Allowed values: All Any
rules

The rules.

Array<object>
object
fieldKey

The field the rule looks at: a built-in field, or the key of one of your custom fields.

string
operator

How the field is compared with the value.

string
Allowed values: Equals NotEquals Contains GreaterThan LessThan Before After NotContains WithinLastDays NotWithinLastDays
value

What it is compared with. Its type follows the field: text, a number, a date, or a number of days.

builtInKey

A stable key for Azimea’s own segments; null for segments your team made.

string
nullable
count

How many contacts are in the segment now.

integer format: int32
sendableCount

How many of them can receive marketing email, because they have a consent basis.

integer format: int32
status

An internal result number. Rely on the HTTP status code instead.

integer format: int32
errors

What went wrong, one entry per problem; empty when the call worked.

Array<object>
object
code

A stable code such as audience.contact_not_found. Branch on this, never on message. Every code is listed in the error codes catalog.

string
message

An English sentence for your logs. Do not show it to end users: it can change.

string
params

The numbers the message mentions (a minimum, a maximum), when there are any.

object
key
additional properties
fieldErrors

The same problems grouped by the request field they belong to; null when none is tied to a field.

object
key
additional properties
Array<object>
object
code

A stable code such as audience.contact_not_found. Branch on this, never on message. Every code is listed in the error codes catalog.

string
message

An English sentence for your logs. Do not show it to end users: it can change.

string
params

The numbers the message mentions (a minimum, a maximum), when there are any.

object
key
additional properties
Example
{
"isSuccess": true,
"value": [
{
"id": "01a10a3c-6b7d-7c52-8e1f-2a3b4c5d6e7f",
"name": "Pro plan",
"description": "Everyone on the pro plan.",
"definition": {
"join": "All",
"rules": [
{
"fieldKey": "plan",
"operator": "Equals",
"value": "pro"
}
]
},
"builtInKey": null,
"count": 412,
"sendableCount": 377
}
],
"status": 0,
"errors": [],
"fieldErrors": null
}

Validation failed: see errors[].code and fieldErrors

Media typeapplication/json
object
isSuccess

true when the call worked, false when errors say why it did not.

boolean
value

The answer itself; null when the call failed.

nullable
status

An internal result number. Rely on the HTTP status code instead.

integer format: int32
errors

What went wrong, one entry per problem; empty when the call worked.

Array<object>
object
code

A stable code such as audience.contact_not_found. Branch on this, never on message. Every code is listed in the error codes catalog.

string
message

An English sentence for your logs. Do not show it to end users: it can change.

string
params

The numbers the message mentions (a minimum, a maximum), when there are any.

object
key
additional properties
fieldErrors

The same problems grouped by the request field they belong to; null when none is tied to a field.

object
key
additional properties
Array<object>
object
code

A stable code such as audience.contact_not_found. Branch on this, never on message. Every code is listed in the error codes catalog.

string
message

An English sentence for your logs. Do not show it to end users: it can change.

string
params

The numbers the message mentions (a minimum, a maximum), when there are any.

object
key
additional properties
Example
{
"isSuccess": false,
"value": null,
"status": 5,
"errors": [
{
"code": "validation.required",
"message": "Fill in this field.",
"params": null
}
],
"fieldErrors": {
"email": [
{
"code": "validation.required",
"message": "Fill in this field.",
"params": null
}
]
}
}

Missing or invalid API key

The key lacks the contacts:read permission

Too many requests for this key