Notix
API reference

Segments.

Save a live filter on a contact book and read who matches it. Every request needs an API key in the Authorization header; the reference overview covers keys, errors and rate limits.

List segments

GET/v1/contactBooks/{contactBookId}/segmentsFull access key

List a contact book's segments, oldest first. Each carries its live count and any problems that make it match nothing.

Path parameters
FieldTypeAbout
contactBookIdrequiredstring
terminal
curl -X GET "https://app.usenotix.dev/api/v1/contactBooks/<contactBookId>/segments" \
  -H "Authorization: Bearer $NOTIX_API_KEY"

Responses

200The contact book's segments, oldest first, each with its live count.
200 response fields
FieldTypeAbout
datarequiredobject[]
data[].idrequiredstring
data[].contactBookIdrequiredstring
data[].namerequiredstring
data[].descriptionrequiredstring

Can be null.

data[].definitionrequiredobject
data[].definition.versionrequirednumber

One of 1.

data[].definition.matchrequiredstring

One of all, any.

data[].definition.conditionsrequiredobject[]
data[].countrequiredinteger

Contacts that match right now. 0 while the segment has problems.

data[].problemsrequiredstring[]

Why the segment matches nothing, such as a property removed from the contact book.

data[].createdAtrequiredstring
data[].updatedAtrequiredstring
404No contact book with this id for the calling team.

Create a segment

POST/v1/contactBooks/{contactBookId}/segmentsFull access key

Create a live filter on a contact book. A segment is evaluated whenever it is used, so contacts join and leave it as their details and behaviour change.

Definition

match is all or any, and conditions holds up to 20 conditions, counting those inside groups. A condition can be a group with its own match; groups do not nest.

typeOperatorsFields
emailequals, not_equals, contains, ends_withvalue
first_name, last_nameequals, not_equals, contains, is_set, is_emptyvalue, except for is_set and is_empty
subscribedisvalue: true or false
addedbefore, after, in_last_daysvalue: a date, or a number of days
propertyequals, not_equals, contains, is_set, is_empty, gt, gte, lt, ltekey (a variable on the book) and value
email_activityin_last_days, ever, neverevent: received, opened or clicked; optional campaignId; days for in_last_days
email_problemever, neverevent: bounced or complained
journeyis_in, completed, exited, not_injourneyId

Text comparisons ignore case. A contact book holds at most 100 segments.

json
{
  "name": "Engaged Pro users",
  "definition": {
    "version": 1,
    "match": "all",
    "conditions": [
      { "type": "property", "key": "plan", "op": "equals", "value": "Pro" },
      {
        "type": "group",
        "match": "any",
        "conditions": [
          { "type": "email_activity", "event": "opened", "op": "in_last_days", "days": 30 },
          { "type": "email_activity", "event": "clicked", "op": "in_last_days", "days": 30 }
        ]
      }
    ]
  }
}
Path parameters
FieldTypeAbout
contactBookIdrequiredstring
Request body (JSON)
FieldTypeAbout
namerequiredstring

At most 80 characters.

descriptionstring

At most 280 characters. Can be null.

definitionrequiredobject
definition.versionrequirednumber

One of 1.

definition.matchrequiredstring

One of all, any.

definition.conditionsrequiredobject[]
terminal
curl -X POST "https://app.usenotix.dev/api/v1/contactBooks/<contactBookId>/segments" \
  -H "Authorization: Bearer $NOTIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Engaged Pro users",
  "definition": {
    "version": 1,
    "match": "all",
    "conditions": [
      {
        "type": "property",
        "key": "plan",
        "op": "equals",
        "value": "Pro"
      },
      {
        "type": "email_activity",
        "event": "opened",
        "op": "in_last_days",
        "days": 30
      }
    ]
  }
}'

Responses

201The segment was created.
201 response fields
FieldTypeAbout
idrequiredstring
contactBookIdrequiredstring
namerequiredstring
descriptionrequiredstring

Can be null.

definitionrequiredobject
definition.versionrequirednumber

One of 1.

definition.matchrequiredstring

One of all, any.

definition.conditionsrequiredobject[]
countrequiredinteger

Contacts that match right now. 0 while the segment has problems.

problemsrequiredstring[]

Why the segment matches nothing, such as a property removed from the contact book.

createdAtrequiredstring
updatedAtrequiredstring
400The definition is not valid, names something the book or team does not have, or the book already has 100 segments.
404No contact book with this id for the calling team.
409A segment with this name already exists in the contact book.

Get a segment

GET/v1/contactBooks/{contactBookId}/segments/{segmentId}Full access key

Retrieve one segment with its definition, live count and problems.

Path parameters
FieldTypeAbout
contactBookIdrequiredstring
segmentIdrequiredstring
terminal
curl -X GET "https://app.usenotix.dev/api/v1/contactBooks/<contactBookId>/segments/<segmentId>" \
  -H "Authorization: Bearer $NOTIX_API_KEY"

Responses

200The segment with its live count.
200 response fields
FieldTypeAbout
idrequiredstring
contactBookIdrequiredstring
namerequiredstring
descriptionrequiredstring

Can be null.

definitionrequiredobject
definition.versionrequirednumber

One of 1.

definition.matchrequiredstring

One of all, any.

definition.conditionsrequiredobject[]
countrequiredinteger

Contacts that match right now. 0 while the segment has problems.

problemsrequiredstring[]

Why the segment matches nothing, such as a property removed from the contact book.

createdAtrequiredstring
updatedAtrequiredstring
404No segment with this id in the contact book for the calling team.

Update a segment

PATCH/v1/contactBooks/{contactBookId}/segments/{segmentId}Full access key

Change a segment's name, description or definition. A segment that a scheduled or running campaign, or an active journey, uses can be renamed but not redefined.

Path parameters
FieldTypeAbout
contactBookIdrequiredstring
segmentIdrequiredstring
Request body (JSON)
FieldTypeAbout
namestring

At most 80 characters.

descriptionstring

At most 280 characters. Can be null.

definitionobject
definition.versionrequirednumber

One of 1.

definition.matchrequiredstring

One of all, any.

definition.conditionsrequiredobject[]
terminal
curl -X PATCH "https://app.usenotix.dev/api/v1/contactBooks/<contactBookId>/segments/<segmentId>" \
  -H "Authorization: Bearer $NOTIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Engaged Pro users (30 days)"
}'

Responses

200The segment after the change.
200 response fields
FieldTypeAbout
idrequiredstring
contactBookIdrequiredstring
namerequiredstring
descriptionrequiredstring

Can be null.

definitionrequiredobject
definition.versionrequirednumber

One of 1.

definition.matchrequiredstring

One of all, any.

definition.conditionsrequiredobject[]
countrequiredinteger

Contacts that match right now. 0 while the segment has problems.

problemsrequiredstring[]

Why the segment matches nothing, such as a property removed from the contact book.

createdAtrequiredstring
updatedAtrequiredstring
400The definition is not valid, or a live campaign or journey uses the segment and the definition changed.
404No segment with this id in the contact book for the calling team.
409Another segment in the contact book already has this name.

Delete a segment

DELETE/v1/contactBooks/{contactBookId}/segments/{segmentId}Full access key

Delete a segment. Refused with 400 while a scheduled or running campaign, or an active journey, uses it.

Path parameters
FieldTypeAbout
contactBookIdrequiredstring
segmentIdrequiredstring
terminal
curl -X DELETE "https://app.usenotix.dev/api/v1/contactBooks/<contactBookId>/segments/<segmentId>" \
  -H "Authorization: Bearer $NOTIX_API_KEY"

Responses

200The segment was deleted.
200 response fields
FieldTypeAbout
idrequiredstring
deletedrequiredboolean

One of true.

400A scheduled or running campaign, or an active journey, uses the segment.
404No segment with this id in the contact book for the calling team.

List a segment's contacts

GET/v1/contactBooks/{contactBookId}/segments/{segmentId}/contactsFull access key

Page through the contacts that match a segment right now, ordered by id. Pass nextCursor back as cursor for the next page; limit is 1 to 100 (50 by default).

Path parameters
FieldTypeAbout
contactBookIdrequiredstring
segmentIdrequiredstring
Query parameters
FieldTypeAbout
cursorstring
limitinteger

Contacts per page, 1 to 100. Defaults to 50.

Default 50.

terminal
curl -X GET "https://app.usenotix.dev/api/v1/contactBooks/<contactBookId>/segments/<segmentId>/contacts" \
  -H "Authorization: Bearer $NOTIX_API_KEY"

Responses

200A page of matching contacts ordered by id, with the cursor for the next page and the total.
200 response fields
FieldTypeAbout
datarequiredobject[]
data[].idrequiredstring
data[].emailrequiredstring
data[].firstNamerequiredstring

Can be null.

data[].lastNamerequiredstring

Can be null.

data[].subscribedrequiredboolean
data[].propertiesrequiredmap of any
data[].createdAtrequiredstring
data[].updatedAtrequiredstring
nextCursorrequiredstring

Can be null.

totalrequiredinteger
400Invalid cursor or limit.
404No segment with this id in the contact book for the calling team.
422The segment took longer than 10 seconds to evaluate.