Team
Create or update team members
Section titled “Create or update team members”Send a JSON array. Each entry is matched by email within your workspace: a new email creates a team member, an existing one is updated.
curl -X POST https://api.whatbot.in/public/v1/team \ -H "X-API-Key: wa_live_xxx" \ -H "Content-Type: application/json" \ -d '[ { "email": "priya@example.com", "name": "Priya Nair", "role": "agent" }, { "email": "arjun@example.com", "name": "Arjun Rao", "role": "team_lead" } ]'| Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | The person’s email — the match key. Case-insensitive. Blank entries are skipped. | |
| name | string | Display name. Send it on every sync — when omitted it is set to the part of the email before @, also for an existing member. | |
| role | string | Their role in your directory, mapped to a Whatbot role (table below). Defaults to agent. | |
| source_ref | string | Accepted for your own bookkeeping; not stored. |
Role mapping
Section titled “Role mapping”These are the default mappings.
| You send | Whatbot role |
|---|---|
org_admin, super_admin | Admin |
supervisor, fls_manager, land_manager, team_lead | Supervisor |
viewer, auditor | Viewer |
agent, trainer, fls, land_assignee, anything else, or nothing | Agent |
{ "created": 1, "updated": 1, "failed": 0, "skipped": 0, "received": 2 }| Field | Description |
|---|---|
| created | New team members created. |
| updated | Existing members whose name and role were refreshed. |
| failed | Entries that could not be saved — for example an email already used by a login outside this workspace. |
| skipped | Entries not attempted: after three failures in a row the batch stops, and the rest are counted here. Re-send them later. |
| received | Entries in the request. |
When a sync changes an existing member’s role, the change is recorded in the workspace’s Audit log (best effort — a failed audit write does not fail the sync).
How new members sign in
Section titled “How new members sign in”A member created here gets no usable password and receives no invitation email. They can set a password with Forgot password? on the Whatbot sign-in page, using the email you synced. If your product embeds the Whatbot inbox, members are signed in through the embed instead.
List team members
Section titled “List team members”curl https://api.whatbot.in/public/v1/team -H "X-API-Key: wa_live_xxx"{ "agents": [ { "id": "5d1e...", "email": "priya@example.com", "name": "Priya Nair" } ]}Active members only, sorted by email — every active member of the workspace, not just
the ones you synced. id is the member’s user id, the same value that appears as
assigned_agent_id on the ticket in ticket.* webhook payloads.
Errors
Section titled “Errors”| Status | Cause |
|---|---|
401 | Missing/invalid API key |
422 | The body wasn’t a JSON array, or an entry had no email field |