Real-time API

Use the Real-time API to stream customer events into Amperity and to look up unified customer profiles on demand. Send events, such as page views, purchases, and loyalty actions, to an event stream, then look up profiles by identity key, retrieve profiles by ID, query segment membership, and retrieve profile collection statistics. The Real-time API supports low-latency use cases such as personalization, decisioning, and in-session activation.

Note

The Real-time API is an unstable API. Its endpoints do not require an api-version header, may change, and are offered without a guarantee of support or advance notice of breaking changes.

Note

Before creating a profile collection, an event stream, or a real-time segment, you must contact your Amperity representative to enable real-time product features.

Events

POST /events/{stream-id}

Use the POST /events/{stream-id} endpoint to send a real-time event to an event stream. Events are the primary way to update profiles in a profile collection in real time.

POST /events/{stream-id}

Lookup

GET /lookup/{collection-id}/keychain

Use the GET /lookup/{collection-id}/keychain endpoint to find a single profile in a profile collection by one or more keychain keys, such as an email address or loyalty ID. Keychain keys are passed as query string parameters.

GET /lookup/{collection-id}/keychain
POST /lookup/{collection-id}/keychain

Use the POST /lookup/{collection-id}/keychain endpoint to find a single profile in a profile collection by one or more keychain keys, such as an email address or loyalty ID. This endpoint behaves like GET /lookup/{collection-id}/keychain, but the keychain keys are sent in the request body. Use this endpoint when a key value should not appear in a query string.

POST /lookup/{collection-id}/keychain

Profiles

GET /profiles/{collection-id}/{profile-id}

Use the GET /profiles/{collection-id}/{profile-id} endpoint to return a single profile from a profile collection by its profile ID.

GET /profiles/{collection-id}/{profile-id}

Segments

GET /segments/{segment-id}/profiles

Use the GET /segments/{segment-id}/profiles endpoint to return a paginated list of the profiles that are members of a real-time segment.

GET /segments/{segment-id}/profiles
GET /profiles/{collection-id}/{profile-id}/segments

Use the GET /profiles/{collection-id}/{profile-id}/segments endpoint to return a paginated list of the real-time segments that a profile is a member of.

GET /profiles/{collection-id}/{profile-id}/segments

Profile collections

GET /collections/{collection-id}/stats

Use the GET /collections/{collection-id}/stats endpoint to return statistics for a profile collection, including the total number of profiles it contains.

GET /collections/{collection-id}/stats
GET /collections/{collection-id}/history

Use the GET /collections/{collection-id}/history endpoint to return a bucketed time series of profile counts for a profile collection.

GET /collections/{collection-id}/history