User data

Sending backend data

Unflow supports sending user data over HTTP. This is useful to update attributes and track events that do not occur on device.

Update users

Set user data based on the user_id

Request

curl --location --request POST 'http://api.unflow.com/api/users' \
--header 'Authorization: Bearer <API-KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "user_id": "user_123",
    "events": [
        {
            "key": "account_created",
            "uuid": "2ac4c644-9c24-4387-a50e-3594e94be1c2",
            "metadata": {
                "referrer": "google.com"
            }
        }
    ],
    "attributes": {
        "name": "Jane Doe",
        "plan": "professional"
    }
}'

Parameters

Headers

Your Unflow API key is used to authenticate requests. You can find your API key on the Unflow dashboard. You will need to set it as a Bearer token in the Authorization header.

Body

user_id (Required)

A user_id is required to be set, which should reference the consistent identifier used when tracking users. If the user doesn't exist in our system it will be created.

attributes (Optional)

The attributes key is a key value association, each key corresponds to an attribute in Unflow. If an attribute doesn't exist for a provided key we create it for you. Created keys have a default String data type.

events (Optional)

You can include an array of events, each event must have an associated key, and uuid. The uuid is required for deduplication, with it you can safely retry or backfill events easily.

Once an event is created it cannot be edited, even with subsquent calls with the same key and uuid.

Response

{
    "user_id": "user_123",
    "attributes": [
        "professional"
    ],
    "events": [
        {
            "key": "account_created",
            "uuid": "2ac4c644-9c24-4387-a50e-3594e94be1c2"
        }
    ]
}