Skip to content
  • There are no suggestions because the search field is empty.

CDP API

The CDP API enables real-time audience membership lookup for individual users.

You can get information about specific users while they're visiting your site and customize their experience on the fly.

You can also track changes over time, learning how membership assignments evolve, and see the current audience members.

Create CDP Activation

To create a new CDP activation, execute the following steps:

  1. In the Control Panel, go to Customer Data Platform -> Activations -> Create new activation.
  2. Select "CDP API"
  3. Fill in the name and description
  4. Add audiences available for this activation
  5. Confirm the creation by choosing "Save"
Only one CDP API activation can be active at the same time.

API Usage

To use the API, reach out to Raptor to get your API key.

Then, visit the CDP API reference to see the available endpoints.

You can start by querying the /api/v3/identifiers endpoint to see the available person identifiers for the activation.

Then, use the identifier chosen in the activation settings to specify the user for whom audiences should be listed.

GET https://cdp-api.raptorsmartadvisor.com/api/v3/memberships/email?identifierValue=name@example.com

If at least one user is found using the specified criterion, the response contains the audiences assigned to the first found user.

{
  "memberships": [
    {
      "id": "5d822e81",
      "name": "Cat owners"
    }
  ]
}

To get more data about audiences attached to the activation, query the /api/v3/audiences endpoint using the Activation ID.

Use the /api/v3/membership/{audienceId} endpoint to get the current profiles assigned to given audience and the current sequence number you can use to track membership changes.

Tracking changes

Use the /api/v3/membership/changes/{identifierType} endpoint to track how audiences change over time.

Pass the following arguments and query parameters:

  • identifierType, argument: the person identifier associated with the user
  • fromSequenceNumber, query parameter: the starting point which should be used to calcucate the changes. When querying for the initial state, use 0
  • targetBatchSize, query parameter: the maximum number of changes returned in the response
  • audienceIds, query parameter: array of audiences to track

The example below will show which users have been added or removed from the specified audiences since the last time the changes were queried. User email address will be used as identifier, as specified using the identifierType.

GET /api/v3/membership/changes/email?audienceIds=5d822e81&audienceIds=ed899486&fromSequenceNumber=70000&targetBatchSize=5

In response, the list of changes will be returned:

{
  "changes": {
  "5d822e81": [
      {
      "id": "user1@example.com",
        "status": "In"
      },
      {
      "id": "user2@example.com",
        "status": "In"
      },
      {
      "id": "user3@example.com",
        "status": "In"
      },
      {
      "id": "user4@example.com",
        "status": "In"
      },
      {
      "id": "user5@example.com",
        "status": "In"
      }
    ]
  },
"nextQuery": "?audienceIds=5d822e81&audienceIds=ed899486&fromSequenceNumber=70005&targetBatchSize=5",
  "nextSequenceNumber": 70005
}

Use the provided nextSequenceNumber and nextQuery properties in the response in the next requests to continue tracking the Audience membership changes over time.