AccoilAccoil Developer Docs
Quick Start

Quick Start: REST API

Send your first event to Accoil in under 5 minutes using curl.

This guide walks you through the three core API calls -- identify, group, and track -- using curl against the v2 REST API.

Prerequisites

You need an active Accoil account and an API key. Find your key under Account > General in the Accoil dashboard. Each product has its own key.

All requests go to https://in.accoil.com and return 202 Accepted. Processing happens asynchronously.

Replace YOUR_API_KEY in every command below with your actual key.


Step 1: Identify a user

The identify call creates or updates a user profile in Accoil. Send it whenever a user signs up or logs in.

curl -X POST https://in.accoil.com/v2/identify \
  -H "Authorization: Basic YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "user_12345",
    "traits": {
      "email": "jane@example.com",
      "name": "Jane Doe",
      "created_at": "2025-03-15T10:00:00Z"
    }
  }'

A 202 Accepted response means the request was received. The user will appear in Accoil within a few moments.


Step 2: Group the user to an account

The group call creates or updates an account and links users to it. This is how Accoil builds account-level engagement scores.

curl -X POST https://in.accoil.com/v2/group \
  -H "Authorization: Basic YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "groupId": "account_456",
    "userId": "user_12345",
    "traits": {
      "name": "Acme Corp",
      "plan": "pro",
      "mrr": 50000
    }
  }'

The userId field links this user to the account. The traits object can include any account-level attributes you want to track (plan, MRR, industry, etc.).


Step 3: Track an event

The track call records a user action. Accoil uses event names for engagement scoring -- no event properties are stored.

curl -X POST https://in.accoil.com/v2/track \
  -H "Authorization: Basic YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "user_12345",
    "event": "Report_Created"
  }'

Use a consistent naming convention for events. We recommend Noun_Verb format (e.g., Report_Created, Dashboard_Viewed, Integration_Enabled).


What's next?

On this page