Skip to main content
The Placements API returns personalized content and offers based on user context and behavior. Use this API to display targeted promotions, product recommendations, and custom offers at key moments in your user journey.

Endpoint

Authentication

Authenticate your requests by including your API key in the x-publishable-api-key header.

Create a placement

Creates a personalized placement for display to your users.

Parameters

string
required
Unique identifier for the placement (e.g., “home-page”, “checkout_success”)
object
required
User and transaction data for personalization

Returns

The response format depends on the Accept header:

JSON Response (default)

When Accept: application/json or no specific HTML accept header is provided, returns a placement object.

HTML Response

When Accept: text/html is provided, returns an HTML document directly in the response body with Content-Type: text/html.
string
Unique identifier for this placement
string
Name of the template used for rendering
object
Structured data for native rendering
string
ISO timestamp of when the placement was rendered

Usage

The Placements API can return either structured JSON data or HTML content directly, depending on your Accept header.

Getting HTML Content Directly

To receive HTML content directly (for iframe or server-side rendering), set the Accept header:

Getting Structured JSON Data

For native mobile apps or custom rendering, request JSON (default):

Native mobile integration

Use the structured data for native rendering: