Team API
Your team is everyone who works inside your account besides you: admins, agents and read-only viewers, plus the invitations you have sent and the departments you organise them into. The Team API is the programmatic version of Settings → Team: add and remove people, set what each of them can see and do, send and chase invitations, and manage departments.
All endpoints are relative to https://api.dmchamp.com/v1. Every field, body and response is in the API Reference; errors use the standard envelope described in Errors & Pagination. For the dashboard version of this page, see Team Management.
Authentication: these endpoints need a signed-in person
This is the one part of the API that an API key cannot use. Every /team endpoint, except the departments endpoints and GET /team/assignees, has to be called with a Firebase ID token from a signed-in session:
Authorization: Bearer <Firebase ID token>
Send an API key instead and the request is refused with 401 and the message This endpoint requires a Firebase ID token (Authorization: Bearer <token>).
The reason: these endpoints decide what to do based on who is signed in: your role, the ceiling on what you may grant someone else, and whether you are currently working inside another account. An API key is an integration, not a person, so there is nobody for those rules to apply to.
In practice the Team API is for a first-party app with a logged-in DM Champ user (see Authentication → Firebase ID token). A server-to-server integration cannot manage team members: there is no way to mint one of these tokens from outside the app.
The exceptions: the four department endpoints and
GET /team/assigneesare ordinary API endpoints. They accept your API key like the rest of the API, as well as a signed-in session.
Roles and permissions
Every team member has one role, which sets their default access across 14 areas of the app. You can then override individual areas.
| Role | Value | Summary |
|---|---|---|
| Admin | admin |
Everything except the owner’s billing-level actions. |
| Editor | editor |
Can create and change things. Shown as Agent in the app. |
| Viewer | viewer |
Read-only. |
Each area is set to one of four levels: none (hidden), view (read-only), edit (create and change), full (including deleting).
| Area | Admin | Editor | Viewer |
|---|---|---|---|
campaigns |
full | edit | view |
contacts |
full | edit | view |
automations |
follows contacts |
follows contacts |
follows contacts |
messages |
full | edit | view |
appointments |
full | edit | view |
settings |
edit | view | none |
white_labeling |
follows settings |
follows settings |
follows settings |
billing |
edit | none | none |
team_management |
edit | none | none |
analytics |
full | view | view |
phone_numbers |
edit | none | none |
integrations |
edit | none | none |
faqs |
full | edit | view |
daily_summaries |
full | view | view |
To depart from the role’s defaults, send permission_overrides, an array of { "area": ..., "level": ... } objects. Each entry replaces the role default for that one area; everything you do not list keeps the role default. On update, the list you send replaces the whole override list; [] puts the member back on pure role defaults.
white_labeling(agency branding) has no default of its own: it takes the member’s effectivesettingslevel. Send{ "area": "white_labeling", "level": "none" }to keep settings editable and hide branding.automationsworks the same way withcontacts. Send{ "area": "automations", "level": "view" }(ornone) to keep contacts editable while the member cannot change live automations.
Who can call these endpoints
- The account owner can always do everything.
- A team member needs
team_managementatviewto read the roster and the invite list, and ateditto add, change, suspend, remove, invite, cancel or resend. Admins haveeditby default; editors and viewers havenone, so by default only admins manage the team. - Nobody can grant access above their own. Asking for more than you hold is not an error: those areas are lowered to your own level and listed in
capped_areason the response. Editing, suspending or removing someone whose access is already broader than yours is refused with403and a message naming the area.
Limiting what a member can see
These optional fields, accepted on add, update and invite, decide how much of the account a person sees. They stack: a member limited on more than one is limited by all of them. None of them can be set on the account owner (400).
contact_scope:all(the default) orassigned(only the contacts assigned to them). Withassigned,contact_scope_unassigned: truealso shows contacts nobody owns yet.contact_scope_axes: limits them to namedagents,channelsordepartments(up to 200 each).include_unrouted(withagents) also shows chats no agent handles;include_undepartmented(withdepartments) also shows chats in no department. Both are off by default and ignored when their list is empty.- Agent and department IDs are not checked when you save them: an ID that does not exist matches nothing, which shows up as an empty inbox rather than an error. Channel names are checked; an unknown one is refused with
400. The channel vocabulary iswhatsapp,whatsapp_web,sms,instagram,instagram_private,messenger,facebook,chat_widget,telegram,line,viber,tiktok,imessage,email,linkedin,skool,custom,custom_channel. - These limits are write-only.
GET /team/membersdoes not returncontact_scope,contact_scope_axes,task_scopeorsub_account_access.GET /team/permissionsreturns the contact scope fields for the signed-in member only. - Only
PATCHtreatsnullas “clear”. Sending"contact_scope": null,"contact_scope_axes": nullor"sub_account_access": nullon update removes that limit and puts the member back to seeing everything. On create and invite,nulljust means “not supplied”.
sub_account_access (agencies only) sets which client sub-accounts this member may open: mode is all, selected or none; with selected, sub_account_uids lists up to 500 clients, each of which must be a sub-account of yours (400 otherwise); role is the role they act as inside a client account and defaults to editor. See Managing Client Sub-Accounts for the dashboard view.
Limiting which tasks a member sees
task_scope (add and update only): all (the default) shows every task on the contacts they can see. assigned_only shows a task only once it is assigned to them: on the task board, in search, on a direct task link, in a contact’s task list and in notifications. task_scope_include_created and task_scope_include_unassigned widen it again to tasks they created or tasks nobody is assigned to.
It works on top of contact_scope: a task on a contact they cannot see stays hidden either way. Setting task_scope to all (or null on update) switches both widening fields off.
Endpoints
| Task | Method + path | Explorer |
|---|---|---|
| List team members and seat counts | GET /team/members |
Open in API Reference |
| List assignable teammates (API key works) | GET /team/assignees |
Open in API Reference |
| Add a team member directly | POST /team/members |
Open in API Reference |
| Update a team member | PATCH /team/members/{memberUid} |
Open in API Reference |
| Suspend a team member | POST /team/members/{memberUid}/suspend |
Open in API Reference |
| Remove a team member | DELETE /team/members/{memberUid} |
Open in API Reference |
| List invitations | GET /team/invites |
Open in API Reference |
| Send an invitation | POST /team/invites |
Open in API Reference |
| Cancel an invitation | DELETE /team/invites/{inviteId} |
Open in API Reference |
| Resend an invitation | POST /team/invites/{inviteId}/resend |
Open in API Reference |
| Accept an invitation | POST /team/invites/accept |
Open in API Reference |
| Decline an invitation | POST /team/invites/decline |
Open in API Reference |
| List departments | GET /team/departments |
Open in API Reference |
| Create a department | POST /team/departments |
Open in API Reference |
| Update a department | PATCH /team/departments/{departmentId} |
Open in API Reference |
| Delete a department | DELETE /team/departments/{departmentId} |
Open in API Reference |
| Check your own permissions | GET /team/permissions |
Open in API Reference |
| Switch into a team account | POST /team/tokens/team-member |
Open in API Reference |
| Return from a team account | POST /team/tokens/return-from-team |
Open in API Reference |
| Staff assist session | POST /team/tokens/assist |
Open in API Reference |
| End a staff assist session | POST /team/tokens/return-to-admin |
Open in API Reference |
| Open a client sub-account (agencies) | POST /team/tokens/agency-assist |
Open in API Reference |
| Assign a platform role (staff only) | POST /team/users/{targetUid}/role |
Open in API Reference |
Members
List the roster with seat counts:
curl "https://api.dmchamp.com/v1/team/members" \
-H "Authorization: Bearer FIREBASE_ID_TOKEN"
{ "success": true, "members": [ { "member_uid": "uid_alice", "role": "admin", "status": "active", "…": "…" } ], "seat_limit": 5, "seats_used": 3 }
Update a member (send only what changes):
curl -X PATCH "https://api.dmchamp.com/v1/team/members/uid_sam" \
-H "Authorization: Bearer FIREBASE_ID_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "role": "admin", "permission_overrides": [{ "area": "billing", "level": "none" }] }'
Good to know
- Seats.
seat_limitisnullwhen your plan has no seat cap.seats_usedcounts active members only; suspending or removing someone frees their seat at once. A full plan refuses a new member with429. - The roster returns active and suspended members only; removed members are not listed.
auto_assign_enabled: nullmeans never changed, which behaves astrue. - Adding directly sends no email. Nobody is told they were added, and if they had no DM Champ login, the account created for them has no password, so they cannot sign in until they reset it. Use an invitation unless you have your own way of telling the person and getting them signed in.
- Adding someone who was previously suspended or removed reinstates them rather than failing. Adding someone already active returns
409; adding yourself returns400. - Suspend keeps their place on the team but ends access. Their access ends when their current session token next refreshes, which can take up to an hour: remove them instead if it must be immediate. Bring them back with
PATCHand{"status": "active"}; that is the only statusPATCHaccepts. The account owner cannot be suspended, nor can a member who is already suspended or removed (400). - Remove frees the seat and signs them out of your account; their own login is untouched and their email is taken off your account’s notification list. Removal is permanent from your side: a removed member cannot be reactivated with
PATCH(400); invite them again instead. The account owner cannot be removed.
Invitations
Inviting is the usual way to add a teammate: they click the link, sign in as themselves and accept. If they have no DM Champ account yet, one is created and the email walks them through setting a password. Permissions and visibility limits sent with the invite are copied onto their membership when they accept.
curl -X POST "https://api.dmchamp.com/v1/team/invites" \
-H "Authorization: Bearer FIREBASE_ID_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "email": "[email protected]", "role": "editor" }'
{ "success": true, "invite_id": "inv_abc123", "message": "Team invite sent successfully." }
Good to know
- Invitations expire after 7 days. Resending a
pendingorexpiredinvitation starts a fresh 7 days. - Pending invitations hold a seat. Unlike adding a member directly, the seat check counts active members plus pending invitations, so an account with all seats spoken for is refused before the email goes out. Reviving an expired invitation re-checks seats too.
- 20 invitations per day per account, counting both sends and resends. A
429means either full seats or this limit; theerrormessage says which. 409means a pending invitation for that email already exists, or that person is already on your team.- The invitation token is never returned by the API; it only exists in the email. A resend carries a new link and the old link keeps working too, so someone who finds the first email later is not stuck.
- Cancel works on
pendingandexpiredinvitations and stops the link working. An invitation already accepted, declined or cancelled returns400; one that is not yours returns403. - Accept and decline take the
invite_tokenfrom the email and are acts of your own identity: they are refused with403while you are working inside somebody else’s account, and when the invitation was sent to a different email than the one you are signed in with. Accepting your own account’s invitation returns400, a used or unknown token404, seats that filled up in the meantime429, and an expired invitation504(ask the sender to resend).
Departments
A department is a named group of your team: Sales, Customer support, HR. It gives a lead an owner team, can claim new conversations on its own, and can be used to limit what a member sees (contact_scope_axes.departments).
These endpoints take an API key. They authenticate like every other endpoint in the API (see Authentication). A signed-in team member needs
contactsatviewto read them, andteam_managementateditto create, change or delete one.
curl -X POST "https://api.dmchamp.com/v1/team/departments?apiKey=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Sales",
"color": "#2f6fed",
"member_uids": ["uid_alice", "uid_bob"],
"routing_channels": ["whatsapp"]
}'
How routing works
- New conversations handled by an agent in
routing_agents, or arriving on a channel inrouting_channels, are filed under the department automatically. When both lists are set, a conversation must match both: that is how you give one team “the support agent, but only on WhatsApp”. - With
auto_assign_enabled(defaulttrue) a lead filed under the department is also handed to someone on it.falsemeans the department works from a shared queue.
Good to know
- Names are up to 60 characters and unique on the account (
409on a clash). An account can have up to 50 departments. - Every
member_uidsentry must be the account owner or an active team member (400otherwise).routing_channelsuses the same channel vocabulary ascontact_scope_axes.channels. PATCHchanges only the fields you send; a body with no recognised fields returns400.- Deleting a department that someone is limited to is refused. The
400response names the members whose visibility is narrowed to it, so you can re-scope them first. That is deliberate: silently un-limiting them would hand them your whole customer base with nothing to show it happened. - Contacts filed under a deleted department are not rewritten: they simply stop showing a department, and the next time you file them it sticks.
Check your own permissions
GET /team/permissions returns what the signed-in person may do in the account they are currently working in. Use it to hide buttons a member cannot use, instead of letting them discover the limit through an error. role is owner for the account owner (every area full), otherwise their team role. The member block is present only in team mode, and carries contact_scope, contact_scope_unassigned and contact_scope_axes when their membership has them.
Session tokens
The five /team/tokens/* endpoints mint a one-time sign-in token (customToken) for switching between accounts: into a team account and back, a staff assist session and back, and an agency opening one of its client sub-accounts (called without subAccountUid, it returns to the agency account). The token is exchanged for a session with the Firebase client SDK. It is not an API key and cannot be sent as one, so these endpoints are only useful inside a first-party app. Each refuses with 403 when the session is not entitled to it: not a member of that account, not staff, a sub-account that is not yours or not granted to you, or a session not currently in the mode the endpoint ends.
POST /team/users/{targetUid}/role sets a user’s platform role (User, Dev, Support or Agency), which is what kind of DM Champ account somebody has, not team membership. It is restricted to DM Champ staff, refused while working inside another account, and the last remaining Dev cannot be demoted. It is not part of managing your own team.
Related
- Team Management: the same features in the dashboard, with screenshots.
- Authentication: how to send a Firebase ID token instead of an API key.
- Contacts API: the contacts a member’s visibility limits apply to.
- Errors & Pagination: the shared
429and500codes with retry guidance.
- API for Agencies: client sub-accounts and
sub_account_access.