Skip to main content
POST
/
v1
/
identify
Identify
curl --request POST \
  --url https://api-events.zixflow.com/v1/identify \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "userId": "<string>",
  "anonymousId": "<string>",
  "traits": {},
  "timestamp": "<string>",
  "messageId": "<string>",
  "context": {}
}
'
import requests

url = "https://api-events.zixflow.com/v1/identify"

payload = {
"userId": "<string>",
"anonymousId": "<string>",
"traits": {},
"timestamp": "<string>",
"messageId": "<string>",
"context": {}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
userId: '<string>',
anonymousId: '<string>',
traits: {},
timestamp: '<string>',
messageId: '<string>',
context: {}
})
};

fetch('https://api-events.zixflow.com/v1/identify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api-events.zixflow.com/v1/identify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'userId' => '<string>',
'anonymousId' => '<string>',
'traits' => [

],
'timestamp' => '<string>',
'messageId' => '<string>',
'context' => [

]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api-events.zixflow.com/v1/identify"

payload := strings.NewReader("{\n \"userId\": \"<string>\",\n \"anonymousId\": \"<string>\",\n \"traits\": {},\n \"timestamp\": \"<string>\",\n \"messageId\": \"<string>\",\n \"context\": {}\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api-events.zixflow.com/v1/identify")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"userId\": \"<string>\",\n \"anonymousId\": \"<string>\",\n \"traits\": {},\n \"timestamp\": \"<string>\",\n \"messageId\": \"<string>\",\n \"context\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api-events.zixflow.com/v1/identify")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"userId\": \"<string>\",\n \"anonymousId\": \"<string>\",\n \"traits\": {},\n \"timestamp\": \"<string>\",\n \"messageId\": \"<string>\",\n \"context\": {}\n}"

response = http.request(request)
puts response.read_body
{}
{
  "error": "VALIDATION_FAILED",
  "details": [
    {
      "reason": "REQUIRED",
      "field": "userId",
      "message": "userId is required"
    }
  ]
}
{
  "error": "UNAUTHORIZED",
  "details": []
}

Description

Create or update a user profile. Call this when a user signs up, logs in, or when you want to update their attributes. Short alias: POST /v1/i When to use:
  • User signs up or logs in → call identify with their userId and traits
  • User updates their profile (name, email, plan) → call identify with updated traits
  • Merging anonymous pre-signup activity → call identify with both userId and anonymousId
What happens:
  1. If userId is new → creates a new user profile
  2. If userId exists → merges traits with existing profile (additive, not replace)
  3. If both userId and anonymousId are provided → links all anonymous events to the identified profile

Headers

Authorization
string
required
HTTP Basic Auth. See Events Authentication.
Content-Type
string
default:"application/json"
required
Must be application/json.

Body

userId
string
Your application’s stable identifier for this user. At least one of userId or anonymousId is required.
anonymousId
string
Anonymous ID from the SDK. Required if userId is not provided. Providing both triggers identity merge.
traits
object
Key-value user attributes to set or update (for example email, name, plan).
timestamp
string
When the identify happened, as ISO 8601. Defaults to server time if omitted.
messageId
string
Deduplication ID. SDKs generate this automatically.
context
object
Optional environment metadata (device, OS, app, IP, locale, and more). SDKs populate this automatically. See Context Object.

Response

Successful requests return HTTP 200 with an empty JSON object.
{}
{
  "error": "VALIDATION_FAILED",
  "details": [
    {
      "reason": "REQUIRED",
      "field": "userId",
      "message": "userId is required"
    }
  ]
}
{
  "error": "UNAUTHORIZED",
  "details": []
}