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": []
}
Data Pipelines
Identify
Create or update a user profile
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
userIdand traits - User updates their profile (name, email, plan) → call identify with updated traits
- Merging anonymous pre-signup activity → call identify with both
userIdandanonymousId
- If
userIdis new → creates a new user profile - If
userIdexists → mergestraitswith existing profile (additive, not replace) - If both
userIdandanonymousIdare provided → links all anonymous events to the identified profile
Headers
string
required
HTTP Basic Auth. See Events Authentication.
string
default:"application/json"
required
Must be
application/json.Body
string
Your application’s stable identifier for this user. At least one of
userId or anonymousId is required.string
Anonymous ID from the SDK. Required if
userId is not provided. Providing both triggers identity merge.object
Key-value user attributes to set or update (for example
email, name, plan).string
When the identify happened, as ISO 8601. Defaults to server time if omitted.
string
Deduplication ID. SDKs generate this automatically.
object
Optional environment metadata (device, OS, app, IP, locale, and more). SDKs populate this automatically. See Context Object.
Response
Successful requests returnHTTP 200 with an empty JSON object.
{}
{
"error": "VALIDATION_FAILED",
"details": [
{
"reason": "REQUIRED",
"field": "userId",
"message": "userId is required"
}
]
}
{
"error": "UNAUTHORIZED",
"details": []
}