Skip to content

Messages API

The messages API lets you fetch in-app messages and render their content. The SDKs call these endpoints automatically to display messages in your app. Free-tier Appspaces are limited to 1 message.

GET /v1/api/messages

Auth: Any valid API key (publishable or secret)

Query parameters:

ParamDescription
triggerFilter by trigger type (manual, milestone, event)
user_idIf provided, enables segment-targeted message filtering

Response 200:

{
"messages": [
{
"id": "msg_id",
"name": "Welcome Modal",
"title": "Welcome to the app!",
"body": "Here's how to get started",
"trigger": "manual",
"trigger_value": null,
"content": { },
"background_color": "#ffffff",
"priority": 10,
"dismiss_days": 7,
"max_impressions": 3,
"min_interval_hours": 24
}
]
}
FieldTypeDescription
idstringUnique message ID
namestringInternal name for the message
titlestringMessage headline
bodystringMessage body text
triggerstringWhen the message should appear (manual, milestone, event)
trigger_valuestring or nullEvent name for event triggers, or milestone name for milestone triggers
contentobject or nullPuck editor content structure (null if no visual content)
background_colorstringHex background color
prioritynumberPriority ranking (higher numbers display first)
dismiss_daysnumberDays the message stays dismissed after the user closes it
max_impressionsnumberMaximum times the message can be shown to a single user
min_interval_hoursnumberMinimum hours between impressions for the same user

Segment targeting and A/B testing work the same as the Banners API.


Generate a short-lived token to render a message’s HTML content. Used by SDKs to load message content in a WebView without exposing the API key.

POST /v1/api/messages/:id/render-token

Auth: Any valid API key (publishable or secret)

URL parameters: :id is the message ID.

Request body: None

Response 200:

{ "token": "eyJhbGciOi..." }

The token is short-lived and should be used immediately.


Return the rendered HTML for a message. This endpoint accepts either an API key or a render token.

GET /v1/api/messages/:id/render

Auth: One of:

  • X-API-Key or Authorization: Bearer header (any valid key)
  • ?token=<render-token> query parameter (from the render-token endpoint)

URL parameters: :id is the message ID.

Response 200:

  • Content-Type: text/html; charset=utf-8
  • Cache-Control: public, max-age=300
  • Body: fully rendered HTML string

Errors:

StatusError
401API key or render token required
401Invalid or expired render token
404Message not found
404Message has no content