Organization
The authenticated organization.
| Method | Path | Summary |
|---|---|---|
GET | /v0/organization | Get Organization (alias) |
GET | /v0/organizations | Get Organization |
PATCH | /v0/organizations | Update Organization |
GET | /v0/organizations/invitations | List Invitations |
POST | /v0/organizations/invitations | Invite Member |
DELETE | /v0/organizations/invitations/{invitation_id} | Revoke Invitation |
POST | /v0/organizations/invitations/{invitation_id}/resend | Resend Invitation |
GET | /v0/organizations/members | List Members |
PATCH | /v0/organizations/members/{user_id} | Update Member |
DELETE | /v0/organizations/members/{user_id} | Remove Member |
Get Organization (alias)
Warning
Alias of GET /v0/organizations.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: none beyond a valid key.
Response
200 The organization (application/json)
organization_idstringRequirednamestringRequiredslugstringRequiredplan"free" | "pro" | "enterprise"Requiredinbox_countintegerRequireddomain_countintegerRequiredusageobjectshared_domainstringupdated_atstring (date-time)Requiredcreated_atstring (date-time)RequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Get Organization
The organization of the credential, with inbox and domain counts and usage. inbox_count and usage count what the credential can see (a pod key: its pod).
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: none beyond a valid key.
Response
200 The organization (application/json)
organization_idstringRequirednamestringRequiredslugstringRequiredplan"free" | "pro" | "enterprise"Requiredinbox_countintegerRequireddomain_countintegerRequiredusageobjectshared_domainstringupdated_atstring (date-time)Requiredcreated_atstring (date-time)RequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Update Organization
Rename the organization. Organization-scoped credentials only: pod and inbox credentials get 403.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: none beyond a valid key.
Request body
Content type: application/json.
namestringResponse
200 The organization (application/json)
organization_idstringRequirednamestringRequiredslugstringRequiredplan"free" | "pro" | "enterprise"Requiredinbox_countintegerRequireddomain_countintegerRequiredusageobjectshared_domainstringupdated_atstring (date-time)Requiredcreated_atstring (date-time)RequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
List Invitations
Pending invitations, newest first (ascending=true: oldest first). Dashboard session only (the mm_session cookie): API keys and access tokens get 403. Owners and admins manage members; only owners grant, change or remove the owner role.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: none beyond a valid key.
Query parameters
limitintegerpage_tokenstringascendingbooleanResponse
200 Pending invitations (application/json)
countintegerRequiredlimitintegernext_page_tokenstringEach item of invitations is a Invitation:
invitation_idstringRequiredorganization_idstringRequiredemailstringRequiredrole"owner" | "admin" | "member"Requiredstate"pending" | "accepted" | "expired" | "revoked"Requiredinvited_by_user_idstringexpires_atstring (date-time)Requiredcreated_atstring (date-time)Requireddev_linkstringErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Invite Member
Email an invitation to join the organization, valid for 7 days and only for that address. 409 when the address is already a member or already invited.
The email links to /invite/{token}, where the person signs in (email code, social or SSO) and accepts it. On a server without email-code sign-in (self-hosted or development), which signs people in with magic links, the email is a sign-in link and the invitation is accepted by signing in with that address.
Dashboard session only (the mm_session cookie): API keys and access tokens get 403. Owners and admins manage members; only owners grant, change or remove the owner role.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: none beyond a valid key.
Request body
Content type: application/json.
emailstringRequiredrole"owner" | "admin" | "member"Response
201 Sent (application/json)
invitation_idstringRequiredorganization_idstringRequiredemailstringRequiredrole"owner" | "admin" | "member"Requiredstate"pending" | "accepted" | "expired" | "revoked"Requiredinvited_by_user_idstringexpires_atstring (date-time)Requiredcreated_atstring (date-time)Requireddev_linkstringErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
409 | Conflicts with an existing resource. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Revoke Invitation
Revoke a pending invitation: its link stops working. Dashboard session only (the mm_session cookie): API keys and access tokens get 403. Owners and admins manage members; only owners grant, change or remove the owner role.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: none beyond a valid key.
Path parameters
invitation_idstringRequiredResponse
200 Revoked (application/json)
oktrueRequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Resend Invitation
Send a pending invitation again. Dashboard session only (the mm_session cookie): API keys and access tokens get 403. Owners and admins manage members; only owners grant, change or remove the owner role.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: none beyond a valid key.
Path parameters
invitation_idstringRequiredResponse
200 Sent again (application/json)
invitation_idstringRequiredorganization_idstringRequiredemailstringRequiredrole"owner" | "admin" | "member"Requiredstate"pending" | "accepted" | "expired" | "revoked"Requiredinvited_by_user_idstringexpires_atstring (date-time)Requiredcreated_atstring (date-time)Requireddev_linkstringErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
List Members
The people who sign in to the dashboard for this organization, with their role in it, oldest first. Organization-scoped credentials only: pod and inbox credentials get 403.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: none beyond a valid key.
Query parameters
limitintegerpage_tokenstringascendingbooleanResponse
200 A page of members (application/json)
countintegerRequiredlimitintegernext_page_tokenstringEach item of members is a User:
user_idstringRequiredemailstringRequirednamestring | nullorganization_idstringRequiredrole"owner" | "admin" | "member"Requiredcreated_atstring (date-time)RequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Update Member
Change a member’s role. The last owner cannot be demoted (409). Dashboard session only (the mm_session cookie): API keys and access tokens get 403. Owners and admins manage members; only owners grant, change or remove the owner role.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: none beyond a valid key.
Path parameters
user_idstringRequiredRequest body
Content type: application/json.
role"owner" | "admin" | "member"RequiredResponse
200 The member (application/json)
user_idstringRequiredemailstringRequirednamestring | nullorganization_idstringRequiredrole"owner" | "admin" | "member"Requiredcreated_atstring (date-time)RequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
409 | Conflicts with an existing resource. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Remove Member
Remove a member, or leave the organization with your own user_id (any role). The last owner cannot leave or be removed (409).
Their access ends at once: their dashboard sessions and open event streams for this organization stop working, the API keys they created here are revoked (CLI keys, and keys minted with those keys, included), the apps they connected with OAuth (MCP clients) are disconnected, and invitations they sent that are still pending are revoked. Keys that record no creator (made before organizations had members) are not revoked: review them under API keys. Leaving moves your session to another organization you belong to whose sign-in policy your session meets (its single sign-on and sign-in method rules apply, as for switching); when there is none, the session ends and the mm_session cookie is cleared.
Dashboard session only (the mm_session cookie): API keys and access tokens get 403. Owners and admins manage members; only owners grant, change or remove the owner role.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: none beyond a valid key.
Path parameters
user_idstringRequiredResponse
200 Removed (application/json)
oktrueRequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
409 | Conflicts with an existing resource. |
500 | Unexpected server error. |
Error bodies use the error envelope.