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¶
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.
Lookup¶
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.
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.
Profiles¶
Use the GET /profiles/{collection-id}/{profile-id} endpoint to return a single profile from a profile collection by its profile ID.
Segments¶
Use the GET /segments/{segment-id}/profiles endpoint to return a paginated list of the profiles that are members of a real-time segment.
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.
Profile collections¶
Use the GET /collections/{collection-id}/stats endpoint to return statistics for a profile collection, including the total number of profiles it contains.
Use the GET /collections/{collection-id}/history endpoint to return a bucketed time series of profile counts for a profile collection.