API Reference
Technical reference for the Accoil APIs.
Accoil exposes two APIs that serve different purposes:
- Ingress API -- send user, account, and event data into Accoil for processing.
- Accoil API -- read engagement scores, metrics, and insights back out of Accoil.
Ingress API
The Ingress API accepts identify, group, and track calls. All requests are sent to:
https://in.accoil.comAll ingress requests are processed asynchronously and return 202 Accepted.
Authentication
v2 endpoints (recommended): Include your API key in the Authorization header using Basic authentication:
Authorization: Basic YOUR_API_KEYv1 endpoints (legacy): Include your API key in the request body as the api_key field.
Your Ingress API key is found in the Accoil dashboard under Account > General settings. Each product has its own key.
Endpoints
| Endpoint | Description |
|---|---|
| POST /v2/identify | Identify a user and set their traits |
| POST /v2/group | Associate a user with an account and set account traits |
| POST /v2/track | Record a user event |
Legacy v1 endpoints are also available under Legacy (v1).
Accoil API
The Accoil API lets you read engagement data back out of Accoil. All requests are sent to:
https://api.accoil.comAuthentication
Include your API token in the Authorization header using Bearer authentication:
Authorization: Bearer accoil_YOUR_API_TOKENYour Accoil API token is found in the Accoil dashboard under Settings > Product Settings > API Token. It is not the same as the ingress API key above.
Endpoints
Most endpoints are scoped to a workspace, so start at Workspaces to find the workspace_id to query with.
| Endpoint | Description |
|---|---|
| GET /v2/workspaces | List the workspaces your token can access |
| GET /v2/workspaces/{id} | Retrieve a single workspace |
| GET /v2/accounts | List accounts in a workspace, ranked by engagement score |
| GET /v2/accounts/{id} | Retrieve a single account with its full metric set |
| GET /v2/users | List users in a workspace, or look one up by email or tracking ID |
| GET /v2/users/{id} | Retrieve a single user with its full metric set |
| GET /v2/segments | List segments in a workspace |
| GET /v2/segments/{id} | Retrieve a single segment |
| GET /v2/segments/{id}/members | List the members of a segment |
The legacy GET /v1/accounts lookup, which finds an account by domain, name, or tracking ID, is documented under Legacy (v1).