Skip to main content

Screeb API

The Screeb API allows you to send events (identify, track, group, page, screen, copilot) directly from your backend, without relying on a client-side SDK.

This is useful for server-side integrations, data pipelines, or any scenario where you need to push user data to Screeb from your own infrastructure.

Authorizationโ€‹

All requests must be authenticated with a Bearer token. You can find your workspace API key in Screeb workspace settings under Data & Deployment โ†’ Screeb API.

Include it in the Authorization header of every request:

Authorization: Bearer <your_api_token>

Endpointโ€‹

POST https://api.screeb.app/1.0/event

The request body is a JSON array of event items (batch). You can send between 1 and 100 events per request.

Event typesโ€‹

TypeDescription
identifySet or update properties on a user
trackTrack a custom event
group.assignAssign a user to a group
group.unassignUnassign a user from a group
pageTrack a page view
screenTrack a screen view (mobile)
copilotTrack a Screeb Copilot interaction

Request bodyโ€‹

Each item in the array must contain at least type. Additional fields depend on the event type.

Common fieldsโ€‹

FieldTypeRequiredDescription
user_aliasstringnoAn alias to identify the user. If omitted, an anonymous user is created automatically server-side
typestringyesThe event type (see table above)
propertiesobjectnoKey-value pairs attached to the event
contextobjectnoOptional context (see below)

Context objectโ€‹

FieldTypeDescription
localestringUser locale (e.g. en-US)
timezonestringUser timezone (e.g. Europe/Paris)

Type-specific fieldsโ€‹

identifyโ€‹

No additional required fields. Use properties to set user attributes.

trackโ€‹

FieldTypeRequiredDescription
event_namestringyesName of the event

group.assign / group.unassignโ€‹

FieldTypeRequiredDescription
group_typestringnoType/category of the group
group_namestringyesName of the group

pageโ€‹

FieldTypeRequiredDescription
urlstringyesThe page URL

screenโ€‹

FieldTypeRequiredDescription
screen_namestringyesThe screen name

copilotโ€‹

Used to track interactions with a Screeb Copilot agent. The event_name field determines the specific interaction being recorded.

FieldTypeRequiredDescription
event_namestringyesOne of screeb_copilot_user_prompt, screeb_copilot_response, screeb_copilot_conversion, screeb_copilot_satisfaction
conversation_idstringyes (except when event_name is screeb_copilot_conversion)Unique identifier for the conversation (max 100 chars)
copilot_session_idstringyes (except when event_name is screeb_copilot_conversion)Unique identifier for the copilot session (max 100 chars)
promptstringyes (when event_name is screeb_copilot_user_prompt)The user's prompt text (max 10 000 chars)
responsestringyes (when event_name is screeb_copilot_response)The copilot's response text (max 10 000 chars)
ratingstringyes (when event_name is screeb_copilot_satisfaction)The satisfaction rating value
rating_scalestringyes (when event_name is screeb_copilot_satisfaction)The scale used for the rating

Responseโ€‹

On success the API returns a 200 status with:

{
"count": 2,
"lag": null
}
FieldTypeDescription
countnumberNumber of events processed
lagnumber | nullCurrent ingestion lag in milliseconds (if available)

Examplesโ€‹

Identify a userโ€‹

curl -X POST https://api.screeb.app/1.0/event \
-H "Content-Type: application/json" \
-H "Authorization: Bearer my_api_token" \
-d '[
{
"user_alias": "user-123",
"type": "identify",
"properties": {
"email": "support@screeb.app",
"plan": "pro",
"signed_up_at": "2025-01-15T10:30:00Z"
}
}
]'

Track a custom eventโ€‹

curl -X POST https://api.screeb.app/1.0/event \
-H "Content-Type: application/json" \
-H "Authorization: Bearer my_api_token" \
-d '[
{
"user_alias": "user-123",
"type": "track",
"event_name": "subscription_renewed",
"properties": {
"plan": "pro",
"amount": 49.99
}
}
]'

Assign a user to a groupโ€‹

curl -X POST https://api.screeb.app/1.0/event \
-H "Content-Type: application/json" \
-H "Authorization: Bearer my_api_token" \
-d '[
{
"user_alias": "user-123",
"type": "group.assign",
"group_type": "company",
"group_name": "Acme Inc",
"properties": {
"industry": "SaaS",
"employees": 150
}
}
]'

Track a Copilot interactionโ€‹

curl -X POST https://api.screeb.app/1.0/event \
-H "Content-Type: application/json" \
-H "Authorization: Bearer my_api_token" \
-d '[
{
"user_alias": "user-123",
"type": "copilot",
"event_name": "screeb_copilot_user_prompt",
"conversation_id": "conv-abc-123",
"copilot_session_id": "session-xyz-456",
"prompt": "How do I reset my password?"
},
{
"user_alias": "user-123",
"type": "copilot",
"event_name": "screeb_copilot_response",
"conversation_id": "conv-abc-123",
"copilot_session_id": "session-xyz-456",
"response": "You can reset your password from the settings page."
},
{
"user_alias": "user-123",
"type": "copilot",
"event_name": "screeb_copilot_conversion"
},
{
"user_alias": "user-123",
"type": "copilot",
"event_name": "screeb_copilot_satisfaction",
"conversation_id": "conv-abc-123",
"copilot_session_id": "session-xyz-456",
"rating": "5",
"rating_scale": "10"
}
]'

Send a batch of eventsโ€‹

curl -X POST https://api.screeb.app/1.0/event \
-H "Content-Type: application/json" \
-H "Authorization: Bearer my_api_token" \
-d '[
{
"user_alias": "user-123",
"type": "identify",
"properties": { "plan": "enterprise" }
},
{
"user_alias": "user-123",
"type": "track",
"event_name": "plan_upgraded"
},
{
"user_alias": "user-456",
"type": "screen",
"screen_name": "DashboardScreen"
}
]'

Rate limitingโ€‹

The /event endpoint is rate-limited to 50 requests per second per API token. If you exceed this limit, the API will respond with a 429 Too Many Requests status.

When you receive a 429 response, back off and retry after a short delay.

Error handlingโ€‹

StatusDescription
200Events processed successfully
400Validation error (invalid payload, missing required fields)
401Unauthorized โ€” missing or invalid API token
429Too many requests โ€” rate limit exceeded
500Server error

Releases APIโ€‹

You can integrate the creation of your releases into your current workflow using the Releases API.

Authorizationโ€‹

To push a new release to your organization, you will need an API Token generated for you. You can find it on the release create form, next to the Submit button.

Endpointโ€‹

POST https://api.screeb.app/1.0/release

The released_at field is optional and will default to the current date.

Exampleโ€‹

curl -X POST https://api.screeb.app/1.0/release \
-H "Content-Type: application/json" \
-H "Authorization: Bearer my_api_token" \
-d '{
"name": "My release name",
"description": "My release description",
"version": "1.0",
"tags": ["API", "V1"],
"released_at": "2023-03-22T15:22:41+00:00"
}'

Supportโ€‹

If you have any questions or additional requirements, feel free to open an issue or contact support@screeb.app.