Skip to main content

Your Team

Two calls show who is on your team. GET /v1/agents/{agentId}/members lists everyone and whether each can open the agent, and GET /v1/organization/members lists everyone with their role and the agents each can open. Use them to route leads to the right person, to show a name for a lead's assigned_to or a note's author, and to match teammates to the owners in your CRM by email.

A key also invites people, changes their role or agents, and removes them, as the dashboard's Team page does, when it works on every agent and its creator manages the team. Use it to keep your team in step with your HR system or your CRM.

How do I find who can be assigned an agent's leads?​

Call GET /v1/agents/{agentId}/members.

curl https://api.mojeeb.app/v1/agents/YOUR_AGENT_ID/members \
-H "Authorization: Bearer mk_live_YOUR_KEY_HERE"

Assign a lead only to someone with can_open_agent: true: only they can be given the agent's leads and conversations, and Mojeeb refuses anyone else with 422 assignee_not_allowed. See Lead Assignment, Filters and Fields for assigning, and the List teammates for an agent reference for every field.

How do I list everyone in my organization?​

Call GET /v1/organization/members.

curl https://api.mojeeb.app/v1/organization/members \
-H "Authorization: Bearer mk_live_YOUR_KEY_HERE"

Each member comes with their role, their email and the agents they can open: all_agents: true means every agent, including agents added later; otherwise agent_ids lists the agents they were given. See the List your organization's members reference.

roleIn the dashboardCan do
ownerOwnerEverything, including the team and billing. Always every agent.
adminAdminSets up the agents they can open. With every agent, also invites teammates and changes their role or agents (only the owner removes someone), and runs billing and API keys.
memberMemberHandles the conversations and leads of their agents.
repAgentHandles only the leads and conversations assigned to them.

How do I show a name for assigned_to or a note's author?​

A lead's assigned_to and a note's author_id are a teammate's user_id. Read the members list once, keep it, and look names up there. When an id isn't in your copy, read the list again: someone may have joined since. An id that still isn't listed belongs to someone who is no longer in your organization.

Which keys can manage the team?​

Every key holds team:write; there is nothing to tick when you create one. A key manages the team only while two things hold:

  • It works on every agent.
  • The person who created it could still do the same on the dashboard's Team page: the owner, or an admin with every agent. Removing someone takes a key created by the owner, as only the owner can remove someone in the dashboard.

A key never makes, changes or removes an owner, and never changes the access of the person who created it. Owners are managed in the dashboard.

How do I invite someone?​

POST their email, a role and their agents.

curl -X POST https://api.mojeeb.app/v1/organization/invitations \
-H "Authorization: Bearer mk_live_YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"email": "nour@example.com",
"role": "rep",
"all_agents": false,
"agent_ids": ["YOUR_AGENT_ID"]
}'

The role is admin, member or rep. Leave out all_agents to give every agent, or set it to false and list the agents in agent_ids; agent_ids go only with all_agents: false. Mojeeb emails the person the invitation link, as from the person who created the key; the link is valid for 7 days, and they join when they accept it. The answer is 201 with the invitation. A new invitation to the same email replaces the open one, and someone already on the team is 409 already_member. See the Invite someone reference.

How do I see, resend or cancel invitations?​

GET /v1/organization/invitations lists the open ones, newest first. POST /v1/organization/invitations/{invitationId}/resend emails one again with a new link, valid for 7 more days, and DELETE /v1/organization/invitations/{invitationId} cancels it, so its link stops working. The invitation link itself is never returned: the person gets it by email. See the List open invitations reference.

How do I change someone's role or agents?​

PATCH their user_id with what changes.

curl -X PATCH https://api.mojeeb.app/v1/organization/members/THEIR_USER_ID \
-H "Authorization: Bearer mk_live_YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{ "role": "member" }'

A field you leave out keeps its value. To choose their agents, send all_agents: false with agent_ids, which replace the agents they had. The answer is the teammate as they are now, and the change takes effect within a minute. See the Change a member reference.

How do I remove someone?​

DELETE /v1/organization/members/{userId} takes them off the team, and they lose every agent within a minute. It can't be undone: to bring them back, invite them again. Only a key created by the owner can remove someone. See the Remove a member reference.

How do I turn Mojeeb Support access on or off?​

GET /v1/organization/support-access says whether Mojeeb's support team may open your organization's conversations, contacts, leads, knowledge, tickets and comments, and who changed it last. PUT with enabled changes it.

curl -X PUT https://api.mojeeb.app/v1/organization/support-access \
-H "Authorization: Bearer mk_live_YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{ "enabled": false }'

It's on until someone turns it off, and nothing turns it back on by itself. The change takes effect on Mojeeb's next request and is stamped with the person who created the key. Any key reads it; changing it takes an admin or the owner, and a key counts as an admin. See Mojeeb Support Access for what it covers, and the Get and Turn on or off references.

What can go wrong?​

  • 403 insufficient_scope: the key holds specific scopes and team:write isn't among them. A key created in the dashboard holds * and never sees this.
  • 403 insufficient_role: the key is limited to some agents, or the person who created it can't do this in the dashboard any more.
  • 403 owner_only: the teammate is an owner.
  • 403 self_edit or self_remove: the teammate is the person who created the key.
  • 409 already_member: the person you invited is already on the team.
  • 404 not_found: the person isn't on the team, or the invitation isn't one of your organization's.
  • 422 invalid_request_body: a role other than admin, member or rep, all_agents: false without agent_ids, agent_ids without all_agents: false, or an empty change; param names the field.
  • 422 unknown_agent or too_many_agents: one of agent_ids isn't an agent of your organization, or there are more than 100.
  • 422 invalid_request_body on PUT /v1/organization/support-access: enabled is missing or isn't true or false.
  • 422 invitation_not_pending: the invitation is no longer open (accepted, or expired and its link then used).
  • 429 rate_limit_exceeded: inviting and resending share the lower limit of the WhatsApp template endpoints, broadcast sends and retries, and AI attachment media uploads and imports; see Rate Limits.

Errors lists every code.

Common questions​

Why isn't someone in the list?​

Only members are listed: someone you invited appears once they accept. Until then, GET /v1/organization/invitations lists them, with a key that can manage the team. A lead or note can still carry the id of someone who has left your organization; reassign those leads to someone with can_open_agent: true.

Why is agent_ids empty?​

Either all_agents is true, which covers every agent, or the teammate was given no agent this key can act on. A key limited to some agents shows only those agents in agent_ids, so the teammate may have others.

Why is a name or email null?​

Not every account has one on record.

Can I get my teammates' phone numbers?​

No. The API returns each teammate's name, role and email, never a phone number.

What happens to a removed teammate's leads and conversations?​

They stay assigned to them until you reassign them. Reassign them to someone with can_open_agent: true.

Can an AI assistant manage my team?​

Yes, when the person who signed the assistant in manages the team, or with a key that works on every agent and whose creator manages the team. An assistant using the MCP server can list, send, resend and cancel invitations, change someone's role or agents, and remove someone (signed in as the owner, or with a key the owner created). An invitation lets someone into your company and a removal can't be undone, so use a client that asks before running these.

Which scopes do these calls need?​

team:read to list your teammates and read Mojeeb Support access, which every key holds today, and team:write to list invitations, manage the team and change Mojeeb Support access, which every key holds too; see Authentication. A key can read your teammates' emails, so keep it on your servers.