AccoilAccoil Developer Docs
Concepts

Identify Call

The identify call creates or updates a user in Accoil, setting traits like email, name, and role. Requires a user ID -- anonymous users are not supported.

The identify call tells Accoil who a user is. It creates a user profile if one does not exist, or updates it if it does. Every user in Accoil is tied to a unique identifier -- there is no anonymous tracking.

When to fire an identify call

  • User signs up -- immediately after account creation, before any track calls
  • User logs in -- ensures traits are current for the session
  • User profile changes -- role change, email update, subscription conversion

The goal is to ensure Accoil always has up-to-date user information before events are recorded against that user.

Required fields

FieldTypeDescription
userIdstringA unique, stable identifier for the user. This is the primary key in Accoil.
timestampstring (ISO 8601)When this identification occurred. Defaults to current UTC time if omitted.

Anonymous users are not supported

Every identify call must include a userId. Accoil does not create user profiles from calls without a user identifier. If your application has anonymous visitors, only begin sending data after the user authenticates.

Traits are optional key-value pairs that describe the user. While you can send any custom traits, these are the ones Accoil uses most effectively:

TraitRecommendationTypeDescription
emailHighly recommendedstringThe user's email address. Used for display and cross-platform matching.
nameHighly recommendedstringThe user's full name. Makes user profiles human-readable in the Accoil UI.
created_atHighly recommendedstring (ISO 8601)When the user first signed up. Required for accurate tenure calculations.
roleRecommendedstringThe user's role in their account (e.g., "admin", "member", "owner"). Enables role-based segmentation.

Example payload

{
  "userId": "user_12345",
  "traits": {
    "email": "alice@acme.com",
    "name": "Alice Chen",
    "created_at": "2024-08-01T12:00:00Z",
    "role": "admin"
  },
  "timestamp": "2025-01-28T12:00:00Z"
}

cURL example (v2)

curl -X POST https://in.accoil.com/v2/identify \
  -H "Content-Type: application/json" \
  -H "Authorization: Basic YOUR_API_KEY" \
  -d '{
    "userId": "user_12345",
    "traits": {
      "email": "alice@acme.com",
      "name": "Alice Chen",
      "created_at": "2024-08-01T12:00:00Z",
      "role": "admin"
    },
    "timestamp": "2025-01-28T12:00:00Z"
  }'

The API returns 202 Accepted. Processing happens asynchronously.

Optional: associating a user with an account

You can include a groupId in the identify call to associate the user with an account at the same time:

{
  "userId": "user_12345",
  "groupId": "account_67890",
  "traits": {
    "email": "alice@acme.com",
    "name": "Alice Chen"
  },
  "timestamp": "2025-01-28T12:00:00Z"
}

This is a convenience -- you can also establish the relationship with a separate group call.

Best practices

  1. Send identify before track. Ensure the user profile exists in Accoil before recording events against it.
  2. Use stable, immutable IDs. Use your database primary key or an internal user ID -- not an email address, which can change.
  3. Keep traits current. Re-send identify calls when traits change. Accoil merges new traits with existing ones.
  4. Include created_at from the start. If you omit the signup date, Accoil cannot calculate user tenure accurately.
  5. Match IDs across platforms. If you also use HubSpot, Intercom, or Segment, use the same userId for seamless data reconciliation.

On this page