Skip to content
Browse articles
API reference

Users API

Tag the user with segments and add events to their timeline, for your team and for targeting.

Agent44Updated 2 min read

On this page

Two ways to tell your team more about a user than POST /v1/identify does: segments, short tags such as vip or beta that you can filter and target by, and timeline events, what the user did in your app ("Checkout failed", "Upgraded to Pro"). Both show in the inbox next to the user's conversations and on their profile under Users.

Both endpoints act for the user in the identity headers (X-A44-User-Id, else X-A44-Anonymous-Id; see API overview), and create the user if they're new. When the key's workspace enforces identity verification, a user id without a valid X-A44-User-Hash is a 401 and nothing is saved. When an anonymous user signs in (both ids sent, here or in POST /v1/identify), their segments and events move to the signed-in user, as their conversations do.

Bad input is a 422 with a sentence that says what's wrong, for example {"error": "A user can have at most 50 segments"}.

POST /v1/segments#

Adds segments to the user, or replaces them.

{ "segments": ["vip", "beta"], "overwrite": false }

Field

Rules

segments

A list of segments: each 1 to 64 characters of aโ€“z 0โ€“9 _ -, starting with a letter or digit. They're trimmed and lowercased first, and duplicates count once.

overwrite

Optional, default false: the segments are added to the user's. true replaces them, so {"segments": [], "overwrite": true} clears them.

Answers 204. A segment that doesn't follow the rules, a body without a segments list, or a user who would end up with more than 50 segments is a 422, and nothing is saved.

In the dashboard they're called SDK segments (there, "segments" are saved filters of users). Users can be filtered by them (SDK segments include vip, don't include, are set, are empty), and a saved filter that uses them can be a push campaign's audience.

POST /v1/events#

Adds an event to the user's timeline.

{
  "name": "Checkout failed",
  "color": "red",
  "data": { "cart_items": 3, "reason": "card_declined" },
  "occurred_at": "2026-11-21T10:15:00.000Z"
}

Field

Rules

name

1 to 100 characters: letters, digits, spaces and _ . : - (ASCII), starting with a letter or digit. Trimmed first.

color

Optional: one of black, blue, brown, green, grey, orange, pink, purple, red, yellow. Default blue.

data

Optional JSON object, at most 4 KB as JSON. Shown with the event.

occurred_at

Optional: when it happened on the device, as an ISO 8601 time. Default now; a time in the future is saved as now.

Answers 204, a 422 for bad input, and a 429 with Retry-After: 60 once the user has sent 60 events in the last minute ("Too many requests. Try again in a minute."). Treat it as best effort: don't retry, and don't send anything secret or personal in data, which everyone in the workspace can read.

A user keeps their newest 500 events; older ones are removed as new ones arrive. Events are tagged with the key's app.

Limits#

Limit

Answer

POST /v1/segments: 60 requests a minute per IP address

429 with Retry-After

POST /v1/events: 120 requests a minute per IP address

429 with Retry-After

60 events a minute per user, whatever their address

429 with Retry-After: 60

50 segments per user

422

500 events per user

the oldest are removed

Did this answer your question?