Skip to content

Publish Identity

Getting Started

The identity feature allows you to enrich user profiles by adding key-value properties. This feature is optional but valuable for obtaining a more detailed user profile, enabling filtering and searching based on these properties.

For example, you can attach a user's email address, plan information, or last payment date to their profile. Later, you can use these properties to filter and search for specific user segments, such as finding all users on a particular plan.

Making a POST Request

To publish a user's identity in Palzin Track, you will need to make HTTP POST requests to the designated log endpoint. Here's how to get started:

POST https://api.palzin.live/v1/identity

Publish User and their properties

To add identity along with associated properties in Palzin Track, follow these guidelines when crafting your request:

Parameters:

Header

Content-TypeHeaderapplication/json
AuthorizationHeaderYour Authorization Token

Body

project*StringProject name
user_id*StringUser ID
propertiesKey/ValueUser Properties
Responses (200: OK)
js
{
   // Response   
}
{
   // Response   
}

TIP

Important: Fields ending with an (*) are required in your request!

Usage

It's important to note that property keys can override each other. For example, consider users who start with a free trial and then upgrade to a paid plan. To keep track of the user's current plan and other properties like their name and email address, you should call the identity endpoint when the user signs up and again when they upgrade to a paid plan.

json
{
  "project": "my-project",
  "user_id": "12345",
  "properties": {
    "plan": "free",
    "name": "John Doe",
    "email": "[email protected]",
    "username": "johndoe"
  }
}
{
  "project": "my-project",
  "user_id": "12345",
  "properties": {
    "plan": "free",
    "name": "John Doe",
    "email": "[email protected]",
    "username": "johndoe"
  }
}

Later, when the user upgrades to a paid plan, call the identity endpoint again with the updated plan value:

json
{
    "project": "my-project",
    "user_id": "12345",
    "properties": {
      "plan": "business"
    }
}
{
    "project": "my-project",
    "user_id": "12345",
    "properties": {
      "plan": "business"
    }
}

Properties Schema

Note that property keys may only contain lowercase alphabet characters and are optionally separated with hyphens also referred as dashes(-). For example, plan and plan-type are valid property keys, but Plan and plan_type are not. Values may be any string, boolean, or number.