Invite people and manage members
Everything here follows the rules of the Team screen of the dashboard, capped by the current role of the person who issued the key (see API keys):
| Issuer | May invite as | May change or remove |
|---|---|---|
| Owner | admin, member, viewer | Admins, members and viewers |
| Admin | member, viewer | Members and viewers |
Nobody is invited or named owner by API, and the owner is never changed or removed by API.
The examples use this client:
Code
Invite a person
POST /v2/invitations sends an email with a link that lasts 7 days. The link is never returned by the API.
The answer is the invitation (inv_...) with status: "pending" and emailSent. When the email could not be sent, the invitation exists anyway and emailSent is false: check the address and resend it. An email that already joined or has a pending invitation answers 409.
Follow, resend and cancel
GET /v2/invitationslists every invitation, newest first, withstatuspending,accepted,expiredorcancelled. Filter withstatus.POST /v2/invitations/{id}/resendrenews the 7 days and sends a new link. The previous link stops working. It works on pending and expired invitations.POST /v2/invitations/{id}/cancelstops the link. The invitation stays listed ascancelled, and the same email can be invited again.
Resending or cancelling an accepted or cancelled invitation answers 409. Both need a role that can give the role of the invitation.
Code
Change a member
GET /v2/members lists the people who already joined, with their mbr_... id, role and the cases they see. Then:
| Request | What it does |
|---|---|
PATCH /v2/members/{id}/role | Sets role to admin, member or viewer |
PATCH /v2/members/{id}/case-scope | Sets caseScope: all, unassigned_and_own, assigned, or null for the default of the organization |
DELETE /v2/members/{id} | Removes the person. They lose access and leave their teams |
Owners and admins always see every case, so their caseScope cannot be set. effectiveCaseScope on each member tells you what applies right now. The MCP connector needs all. Setting a value the member already has writes nothing, so repeating a request is safe.
The keys a removed person issued keep only what a member may do, from the next call.
Read who did what
GET /v2/members/audit-log lists every invitation created, resent and cancelled, every role and case scope change and every removal, newest first. Each entry has action, actor (the member, and the key when it came from one), target, and the role or scope before and after. Filter with member to see what was done to one person, their invitation included.
Code
The audit log needs members:audit-read, which only an admin or the owner can give.
Errors you will meet
| Error | Cause |
|---|---|
403 scope_missing | The key lacks the scope, or the role of its issuer does not allow it |
403 forbidden | The role of the issuer cannot give that role, or cannot touch that person |
409 conflict | The email already joined or has a pending invitation, or the invitation was already accepted or cancelled |
What's next
- API keys for what a key can do depending on who issued it.
- Command line for every command of the API.