Skip to content

Team

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
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" }
]'
FieldTypeRequiredDescription
emailstringYesThe person’s email — the match key. Case-insensitive. Blank entries are skipped.
namestringDisplay name. Send it on every sync — when omitted it is set to the part of the email before @, also for an existing member.
rolestringTheir role in your directory, mapped to a Whatbot role (table below). Defaults to agent.
source_refstringAccepted for your own bookkeeping; not stored.

These are the default mappings.

You sendWhatbot role
org_admin, super_adminAdmin
supervisor, fls_manager, land_manager, team_leadSupervisor
viewer, auditorViewer
agent, trainer, fls, land_assignee, anything else, or nothingAgent
200
{ "created": 1, "updated": 1, "failed": 0, "skipped": 0, "received": 2 }
FieldDescription
createdNew team members created.
updatedExisting members whose name and role were refreshed.
failedEntries that could not be saved — for example an email already used by a login outside this workspace.
skippedEntries not attempted: after three failures in a row the batch stops, and the rest are counted here. Re-send them later.
receivedEntries 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).

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.

cURL
curl https://api.whatbot.in/public/v1/team -H "X-API-Key: wa_live_xxx"
200
{
"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.

StatusCause
401Missing/invalid API key
422The body wasn’t a JSON array, or an entry had no email field