Members
People in the workspace and their roles. Roles and scopes:
Authentication. Project tokens are refused on
every endpoint here (403 permission_denied “a project token cannot
manage the whole workspace”).
GET /v1/members
Section titled “GET /v1/members”List members and pending invitees.
Auth: scope read; not a project token.
Response 200, ordered by name then email:
{"items": [ {"user_id": "2b8e7c41-5d0a-4f3e-8c6b-9e1f2a3d4c5b", "email": "sara@acme.example", "name": "Sara Al-Harbi", "role": "owner", "pending": false, "created_at": "2026-10-02T07:58:11Z"}, {"user_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d", "email": "omar@acme.example", "name": "Omar Haddad", "role": "operator", "pending": true, "created_at": "2026-11-29T14:03:00Z"}]}pending: true: invited, not yet accepted. A pending member has no access.
curl -s "$MAYADYN/v1/members" -H "Authorization: Bearer $TOKEN"POST /v1/members
Section titled “POST /v1/members”Invite someone by email.
Auth: scope admin; not a project token. Only an owner can invite
with role: "owner".
Request body
| Field | Type | Required | Description |
|---|---|---|---|
email |
string | yes | trimmed, lowercased; must contain @, max 254, no line breaks |
role |
string | yes | owner, admin, operator or viewer |
{"email": "omar@acme.example", "role": "operator"}Response 204, whether or not the address has a Mayadyn account
(so the endpoint cannot be used to find out who has one).
What happens
| Address | Effect |
|---|---|
| has an account, not a member | pending membership with role; invitation email |
| has an account, pending | reminder email (role unchanged) |
| has an account, already a member | nothing |
| no account | email asking them to sign up; no membership is created (invite again after they sign up) |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_input |
bad email or role |
| 403 | email_unverified |
the inviter has not verified their own email |
| 403 | permission_denied |
no admin; project token; non-owner inviting an owner |
| 429 | rate_limited |
30 invitations per workspace per hour: “too many invitations from this workspace”, hint “Try again in an hour.” |
Notes: invitation emails are limited to one per address per day per
workspace and five per address per day across all workspaces; a suppressed
email does not stop the invitation (the invitee still sees it in
GET /v1/invitations). Only callers who could send the invitation spend
the workspace budget. Audit: member.invite (target: the email, detail:
role), the same entry whether or not the address has an account.
curl -s -X POST "$MAYADYN/v1/members" -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" -d '{"email":"omar@acme.example","role":"operator"}'PATCH /v1/members/{user_id}
Section titled “PATCH /v1/members/{user_id}”Change a member’s role.
Auth: scope admin; not a project token. Granting owner, or changing
an owner’s role, needs the caller to be an owner.
| Param | In | Description |
|---|---|---|
user_id |
path | UUID from GET /v1/members |
Request body: {"role": "admin"} (owner, admin, operator,
viewer).
Response 204.
Errors: 400 invalid_input role; 404 “member not found”; 403 permission_denied “only an owner can grant or remove the owner role”;
409 conflict “a tenant needs at least one owner” (demoting the last
accepted owner).
Notes: applies to pending invitations too. The member’s tokens are
narrowed or widened at once (token scopes ∩ role). Audit: member.update
with from and to.
DELETE /v1/members/{user_id}
Section titled “DELETE /v1/members/{user_id}”Remove a member, cancel an invitation, or leave.
Auth:
- removing yourself (leaving): scope
read, session only (a token cannot remove its own user:403“leaving a workspace is done in the console”); - removing someone else: scope
admin; anownercan be removed only by an owner.
Not a project token in either case.
Response 204.
Errors: 404 “member not found”; 403 permission_denied; 409 conflict “a tenant needs at least one owner” (removing the last accepted
owner, including yourself).
Notes: the removed person’s API tokens for this workspace are deleted
with the membership. Audit: member.remove.