The users endpoints let you identify users, set traits, retrieve profiles, and delete user data via the API — without going through the Saytics dashboard.
POST /v1/users/identify
Associate a user ID with a set of traits. Call this endpoint when a user signs up, logs in, or when you need to update their profile attributes.
Your system’s unique identifier for the user.
Key-value attributes to set or update on the user’s profile, such as name, email, or subscription plan.
curl -X POST https://api.saytics.com/v1/users/identify \
-H "Authorization: Bearer sk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"userId": "user_789",
"traits": {
"name": "Alice Smith",
"email": "alice@example.com",
"plan": "pro",
"created_at": "2024-01-01T00:00:00Z"
}
}'
GET /v1/users/:id
Retrieve a user’s profile, including all traits set via identify() and their event history.
curl "https://api.saytics.com/v1/users/user_789" \
-H "Authorization: Bearer sk_live_YOUR_KEY"
The response includes the following fields:
The user ID you provided when identifying the user.
All user traits set via identify(), such as name, email, and plan.
ISO 8601 timestamp for when the user was first seen in Saytics.
ISO 8601 timestamp of the most recent event associated with this user.
DELETE /v1/users/:id
Permanently delete a user and all of their associated data, including events and traits. This is useful for fulfilling GDPR or CCPA data erasure requests.
curl -X DELETE "https://api.saytics.com/v1/users/user_789" \
-H "Authorization: Bearer sk_live_YOUR_KEY"
Deleting a user removes all associated events and traits permanently. This action cannot be undone and cannot be reversed.