Version:

Activation API (Early Access)

Expose user profiles stored in your Redis instance over an API.

warning

The Activation API is part of our Early Access Program, where we work with users and customers to test new features and get feedback before making them generally available. These features are fully functional but can change as we improve them. We recommend connecting with our team before running them in production.

Contact us if you would like access to this feature.

With RudderStack’s Activation API, you can fetch enriched user traits stored in your Redis instance and use them for near real-time personalization for your target audience.

warning
You must have a working Redis instance in place before setting up the connection.
Activation API

Overview

A brief summary of how the Activation API works:

  1. Sync all your customer 360 data from your Profiles project to your Redis store.
  2. The Activation API sits on top of this Redis instance and provides endpoints for retrieving and using the enriched user data for personalization.

How to use the Activation API

  1. For the warehouse used for your Profiles project, create the RudderStack schema and grant permissions to it. Refer to the detailed steps for each warehouse:

  2. In your Profiles project settings, scroll down to Activation API and turn on the Enable sync to Redis toggle.

warning

Before you enable the Activation API toggle, make sure that:

  • You have at least one successful Profiles run.
  • Your pb_project.yaml > entities defines a feature_views property.
Enable Redis sync for using Activation API
  1. Enter the account credentials for your Redis instance and click Create. This will also create a Redis destination in your dashboard.
Enable Redis sync for using Activation API
  1. Generate a service access token in the RudderStack dashboard. You will need this token for authenticating the Activation API.
warning

Profiles users in the US region will not be able to use SATs to authenticate the Activation API. You will have to temporarily use the personal access token instead.

The RudderStack team is working on resolving this issue at the earliest.

Note your Redis destination ID from the Settings tab. Further, use the Activation API endpoint to access your Redis instance and get user data.

Authorization

This API uses Bearer Authentication for authenticating all requests. Set the access token you generated above as the bearer token for authentication.

Base URL

https://profiles.rudderstack.com/v1/

Get user profiles

POST
/activation

Request body

entity
Required
String
Entity type
destinationId
Required
String
Redis destination ID.
id
Required
Object
ID containing type and value
{
  "entity": <entity_type>,  // User, project, account, etc.
  "destinationId": <redis_destination_id> , // Redis destination ID
  "id": {
    "type": <id_type>,
    "value": <id_value>
  }
}

Example request

Responses

  • If the service access token is absent or trying to access a destination to which it does not have access:
statusCode: 401
Response: {
  "error": "Unauthorized request. Please check your access token"
}
  • If the destination is not Redis or the destination ID is absent/blank:
statusCode: 404
Response: {
  "error": "Invalid Destination. Please verify you are passing the right destination ID"
}
  • If ID is present:
statusCode: 200
Response:
{
  "entity": <entity_type>,
  "id": {
    "type": <id_type>,
    "value": <id_value>
  },
  "data": {
    <traits_from_Redis>
  }
}
  • If ID is not present in Redis:
statusCode: 200
Response:
{
  "entity": <entity_type>,
  "id": {
    "type": <id_type>,
    "value": <id_value>
  },
  "data": {}
}

Use case

You can use the Activation API for real-time personalization. Once you fetch the user traits from your Redis instance via the API, you can pull them into your client application to alter the application behavior in real-time based on user interactions.

You can respond immediately with triggered, user-focused messaging based on actions like page views or app clicks and provide a better customer experience.

Real time personalization use case

Redis configuration

warning
You must have a working Redis instance in place before setting up the connection.
  • Address: Enter the public endpoint of your Redis database. If you are using Redis Cloud, you can find this endpoint by going to your Redis database and navigating to Configuration tab > General.
success
You can also use Amazon ElastiCache for Redis to set up your Redis database. See the ElastiCache documentation to get started.
Redis database public endpoint
  • Password: Enter the database password. You can find it in the Security section of the Configuration tab:
Redis database password
  • Cluster Mode: Turn on this setting if you’re connecting to a Redis cluster.
  • Secure: Enable this setting to secure the TLS communication between RudderStack Redis client and your Redis server.

Data mapping

RudderStack creates multiple Reverse ETL sources automatically based on your Profiles project. You will see separate sources for different id_served connected to the same Redis destination.

The following pb_project.yaml snippet shows the sources to be created:

entities:
  - name: user
    id_types:
      - main_id
      - user_id
    feature_views:
      using_ids:
        - id: email
          name: features_by_email # Optional. Takes default view name, if not specified.
        - id: salesforce_id
          name: salesforce_id_stitched_features
      features: # Optional
        - from: models/cart_feature_table
          include:
            - "*"

FAQ

How can I make Profiles work with the Activation API?

To use the Activation API with your Profiles project, you need a successful run of your Profiles project that is not past the retention period.

To enable the Activation API for your Profiles project, turn on the Enable sync to Redis setting. A Profile run will then sync automatically.

Toggle API in Settings

Why am I getting an error trying to enable API in my instance for a custom project hosted on GitHub?

For GitHub projects, you need to explicitly add the IDs of the custom project that need to be served.

In your pb_project.yaml file, you can specify them as shown:

entities:
  - name: user
    id_types:
      - main_id
      - user_id
    feature_views:
      name: user_feature_view
      using_ids:
        - id: email
          name: features_by_email
        - id: salesforce_id
          name: salesforce_id_stitched_features
      features:
        - from: models/cart_feature_table
          include:
            - "*"

If I force a full resync, stop it, and then start a new sync, does RudderStack always perform a full sync the next time?

It depends on the state of the task when it was canceled.

  • If the sync is cancelled while RudderStack is preparing a snapshot, then next run depends on the state of the previous successful run and any mapping changes.
  • If it is cancelled after the sync data is prepared, the next run is incremental.

Generally if a sync is cancelled manually, it is recommended to trigger a full sync if the previous cancelled task was a full sync. If the previously cancelled sync was incremental, triggering an incremental sync is recommended.

Does RudderStack perform a full sync if I add a new column?

RudderStack does not change the sync mode if you make any column additions. It triggers a full sync only if you change/update the data mappings, for example, if the newly added column is sent to the destination via the Visual Data Mapper.

For Profiles activation syncs, RudderStack updates the mappings and automatically sends all columns from the customer 360 view by triggering a full sync.

Suppose I’m running a full sync and the Profiles job is running in parallel and finishes eventually. What happens to the scheduled sync? Does it get queued?

RudderStack first creates a temporary snapshot copy of any sync when it starts. So its syncing the created copy. Even if a Profiles job is running in parallel, the sync - if started - is not impacted by it.



Questions? Contact us by email or on Slack