Skip to content

Teams

A team is an account of its own, shared by several people. It has its own inboxes, API keys, custom domains, webhooks, plan, quotas and subscription. Your personal account is unaffected. In the webmail, pick Personal or a team in the account menu (top right), and manage members, roles and invitations in Settings, Team (called Teams in your personal account, where you can also create a team).

Acting in a team over REST

A signed-in session acts in a team when you send the team's id in the X-Botmail-Team header. Everything then applies to the team: its inboxes, keys, webhooks and plan. Without the header you act as yourself.

List a team's inboxes
curl "https://mailforbots.com/api/v1/inboxes" \
  -H "Authorization: Bearer $SESSION_TOKEN" \
  -H "X-Botmail-Team: TEAM_ID"

If you aren't a member of that team the answer is 403 with a machine-readable code:

403 team_access
{ "error": "You are not a member of this team", "code": "team_access" }

API keys never need the header: a key belongs to one account, and a key created while acting in a team belongs to the team (so its agent reads and sends the team's mail). Sending the header with a key for a different account is refused with 403. Teams are managed (create, rename, members, invitations) with the endpoints in the REST API reference; those always act as you, whichever header is set.

Roles

Team roles
RoleCan
memberRead, organize, send and reply to mail, and work with drafts. Can see the team and its members, and leave.
adminEverything a member can, plus create and delete inboxes, manage custom domains, webhooks and API keys, invite people (as member or admin), remove members, and rename the team.
ownerEverything an admin can, plus billing and the subscription, changing roles, inviting owners, removing admins and owners, and deleting the team.

A team always keeps at least one owner: the last owner can't leave or be demoted (409). Owners can be added by promoting a member or by inviting. A person can own at most 10 teams. When the role isn't enough you get a 403 such as This needs the admin role in the team.

Invitations

  • An admin or owner invites an email address with a role (POST /teams/:id/invites). You can't invite a role higher than your own. Mail for Bots emails the address a link to accept.
  • The link is single use and valid for 7 days. A new invitation to the same address replaces the previous one, and pending invitations can be revoked. A team can have 50 pending invitations.
  • Opening the link in the webmail asks the person to sign in or create an account, then shows the team and role before they join (POST /invites/preview, then POST /invites/accept with { "token": "..." }).
  • Any signed-in account holding the link can accept it, even with another email address than the one invited; Mail for Bots logs when the addresses differ. Treat the link like a password.

Plans and billing

Each team has its own plan, daily send quota and inbox limits (see Limits and quotas); personal and team usage are counted separately. Only owners can see billing, start a Pro checkout or open the billing portal. Cancel a team's subscription before deleting the team.

Deleting a team

Deleting a team (owners only) permanently deletes everything it owns: inboxes and their mail, API keys, custom domains and webhooks.

Webhooks and teams

A team's webhooks fire for the team's inboxes. message.sent and draft.created payloads include actor_id, the person who sent or drafted (for an API key, the person who created the key), which differs from the team account.