Skip to main content

Customer organizations

GET /orgs/{orgId}/api/v1/admin/organizations
POST /orgs/{orgId}/api/v1/admin/organizations
GET /orgs/{orgId}/api/v1/admin/organizations/{organizationId}
PUT /orgs/{orgId}/api/v1/admin/organizations/{organizationId}
PATCH /orgs/{orgId}/api/v1/admin/organizations/{organizationId}
DELETE /orgs/{orgId}/api/v1/admin/organizations/{organizationId}
GET /orgs/{orgId}/api/v1/admin/organizations/{organizationId}/members
POST /orgs/{orgId}/api/v1/admin/organizations/{organizationId}/members
PUT /orgs/{orgId}/api/v1/admin/organizations/{organizationId}/members/{userId}
PATCH /orgs/{orgId}/api/v1/admin/organizations/{organizationId}/members/{userId}
DELETE /orgs/{orgId}/api/v1/admin/organizations/{organizationId}/members/{userId}
GET /orgs/{orgId}/api/v1/admin/organizations/{organizationId}/roles
POST /orgs/{orgId}/api/v1/admin/organizations/{organizationId}/roles
PUT /orgs/{orgId}/api/v1/admin/organizations/{organizationId}/roles/{roleId}
PATCH /orgs/{orgId}/api/v1/admin/organizations/{organizationId}/roles/{roleId}
DELETE /orgs/{orgId}/api/v1/admin/organizations/{organizationId}/roles/{roleId}
GET /orgs/{orgId}/api/v1/admin/organizations/{organizationId}/invitations
POST /orgs/{orgId}/api/v1/admin/organizations/{organizationId}/invitations
DELETE /orgs/{orgId}/api/v1/admin/organizations/{organizationId}/invitations/{invId}
POST /orgs/{orgId}/api/v1/admin/organizations/{organizationId}/invitations/{invId}/resend

A customer organization is a company whose people sign in to your application: a named group of users inside your LumoAuth organization, with its own members, roles and invitations. Read Customer organizations for what they are and what they share, and the B2B track for a complete setup.

These routes take two different path parameters:

  • {orgId} is the slug of your LumoAuth organization (acme-corp).
  • {organizationId} names the customer organization: its id (a UUID) or its slug.

Authentication​

The routes need an API key or a Bearer token with an admin:users:* scope, except the role routes, which need admin:roles:*. Each route also needs a permission. A session or Bearer caller must hold the permission; for an API key its creator must still hold it. A missing permission returns 403 forbidden. See Required permissions.

MethodEndpointPermissionAPI-key / token scope
GET/admin/organizationsorganizations.viewadmin:users:read
POST/admin/organizationsorganizations.createadmin:users:write
GET/admin/organizations/{organizationId}organizations.viewadmin:users:read
PUT PATCH/admin/organizations/{organizationId}organizations.editadmin:users:write
DELETE/admin/organizations/{organizationId}organizations.deleteadmin:users:write
GET/admin/organizations/{organizationId}/membersorganizations.viewadmin:users:read
POST/admin/organizations/{organizationId}/membersorganizations.members.manageadmin:users:write
PUT PATCH/admin/organizations/{organizationId}/members/{userId}organizations.members.manageadmin:users:write
DELETE/admin/organizations/{organizationId}/members/{userId}organizations.members.manageadmin:users:write
GET/admin/organizations/{organizationId}/rolesorganizations.viewadmin:roles:read
POST/admin/organizations/{organizationId}/rolesorganizations.editadmin:roles:write
PUT PATCH/admin/organizations/{organizationId}/roles/{roleId}organizations.editadmin:roles:write
DELETE/admin/organizations/{organizationId}/roles/{roleId}organizations.editadmin:roles:write
GET/admin/organizations/{organizationId}/invitationsorganizations.viewadmin:users:read
POST/admin/organizations/{organizationId}/invitationsorganizations.invitations.manageadmin:users:write
DELETE/admin/organizations/{organizationId}/invitations/{invId}organizations.invitations.manageadmin:users:write
POST/admin/organizations/{organizationId}/invitations/{invId}/resendorganizations.invitations.manageadmin:users:write

Giving someone the owner role (as a member or in an invitation) needs more than organizations.members.manage or organizations.invitations.manage: the caller must also hold organizations.edit or be an owner of that customer organization. Otherwise the answer is 403.

The Customer organizations pages of the portal work on every plan. To call these routes from your own code with an API key or an access token, you need a plan that includes the Admin API. Your plan also sets how many customer organizations you can have. See the pricing matrix.

The Organization Object​

Organization Object
{
"data": {
"id": "019d6190-c4f1-7a52-9e0b-3d8f6a2b1c77",
"slug": "globex",
"name": "Globex",
"displayName": "Globex Corporation",
"description": "Enterprise customer since 2026",
"logoUrl": "https://cdn.globex.example/logo.png",
"isActive": true,
"memberCount": 42,
"metadata": { "crmId": "0017Q00000abc" },
"createdAt": "2026-03-02T09:15:00+00:00",
"updatedAt": "2026-06-11T14:02:31+00:00"
}
}
FieldTypeNotes
idstring (UUID)Set by LumoAuth
slugstring2 to 80 characters: lowercase letters, digits and hyphens, not starting with a hyphen. Unique in your organization. It appears in the customer portal address (/b2b/{orgId}/{slug}) and is accepted as {organizationId}
namestring1 to 100 characters
displayNamestring or nullUp to 255 characters. Shown instead of name where set, for example in invitation emails
descriptionstring or nullFree text
logoUrlstring or nullAn absolute https:// address
isActivebooleanfalse deactivates the organization: see Deactivating an organization
memberCountintegerRead only
metadataobject or nullYour own JSON data. LumoAuth stores it and does not read it
createdAt, updatedAtstring (ISO 8601)updatedAt is null until the first change

List Organizations​

curl "https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/organizations?search=glob&isActive=true" \
-H "Authorization: ApiKey lmk_abc123"
Query parameterNotes
page, limitSee Pagination. limit is at most 100 (default 25)
searchOnly organizations whose name or slug contains this text, in upper or lower case
isActivetrue or false

The answer is the shared list envelope (data, meta, pagination, resourceType: "organizations"), newest first.

Create an Organization​

curl -X POST "https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/organizations" \
-H "Authorization: ApiKey lmk_abc123" \
-H "Content-Type: application/json" \
-d '{
"name": "Globex",
"slug": "globex",
"displayName": "Globex Corporation",
"metadata": { "crmId": "0017Q00000abc" }
}'

name is required. slug, displayName, description, logoUrl, metadata and isActive (default true) are optional. Without a slug, one is made from the name. Every new organization gets three built-in roles: Owner, Admin and Member (the default role).

Answers 201 with the organization object.

StatusWhen
400 invalid_requestname missing, empty or longer than 100 characters; a slug that does not fit the rule; a displayName longer than 255 characters; a logoUrl that is not an absolute https:// address
403 plan_limit_reachedYour plan does not allow another customer organization
409 conflictThe slug is taken

Get an Organization​

curl "https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/organizations/globex" \
-H "Authorization: ApiKey lmk_abc123"

Answers 404 not_found when no customer organization of your organization has this id or slug.

Update an Organization​

curl -X PATCH "https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/organizations/globex" \
-H "Authorization: ApiKey lmk_abc123" \
-H "Content-Type: application/json" \
-d '{ "displayName": "Globex Inc.", "isActive": false }'

PUT and PATCH behave the same way: only the fields that you send change. The fields are those of Create. Setting isActive to false signs the members out of the applications that they use through this organization. The errors are those of Create, and 404 for an unknown organization. An empty slug is refused with 400 invalid_request; leave the field out to keep the current slug.

Delete an Organization​

curl -X DELETE "https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/organizations/globex" \
-H "Authorization: ApiKey lmk_abc123"

Deletes the organization with its memberships, roles and invitations. The user accounts stay. The members are signed out of it as on deactivation: the access and refresh tokens that were issued through the organization stop working at once. Answers 200 with {"message": "Organization deleted"}.

Members​

The Member Object​

{
"id": 311,
"user": { "id": "019d6190-9bba-7b5f-a0a5-07a6d10184d2", "email": "jane@globex.example", "name": "Jane Doe" },
"role": { "id": 87, "slug": "admin", "name": "Admin" },
"status": "active",
"joinedAt": "2026-03-02T09:20:00+00:00"
}

status is active or suspended. {userId} in a member address is the user's id (a UUID).

List Members​

GET …/organizations/{organizationId}/members returns the shared list envelope (resourceType: "members"), oldest member first. Query parameters: page, limit, search (email or name contains the text, in upper or lower case) and status (active or suspended).

Add a Member​

curl -X POST "https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/organizations/globex/members" \
-H "Authorization: ApiKey lmk_abc123" \
-H "Content-Type: application/json" \
-d '{ "userId": "019d6190-9bba-7b5f-a0a5-07a6d10184d2", "roleId": 87 }'

Adds an existing user of your organization directly, without an invitation. userId is required. roleId is optional: without it the organization's default role applies. Answers 201 with the member object.

StatusWhen
400 invalid_requestuserId missing
403 forbiddenThe role is the owner role and the caller may not grant it
404 not_foundNo such organization, no user with this id in your organization, or no such role in this customer organization
409 conflictThe user is already a member

Update a Member​

curl -X PATCH "https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/organizations/globex/members/019d6190-9bba-7b5f-a0a5-07a6d10184d2" \
-H "Authorization: ApiKey lmk_abc123" \
-H "Content-Type: application/json" \
-d '{ "roleId": 86, "status": "active" }'

Send roleId, status (active or suspended) or both. Suspending a member signs them out of the applications that they use through this organization. Answers 200 with the member object.

A member who holds the owner role is changed only by a caller who may grant that role: an owner of this customer organization, or a holder of organizations.edit. The same rule applies to removing an owner and to resending or revoking an invitation to become owner.

StatusWhen
400 invalid_requeststatus is not active or suspended
403 forbiddenThe new role is the owner role, or the member holds the owner role now, and the caller may not grant it
404 not_foundNo such organization, member or role
422 validation_errorThe change would leave the organization without an active owner (demoting or suspending the last owner)

Remove a Member​

DELETE …/organizations/{organizationId}/members/{userId} ends the membership and signs the user out of the applications that they used through this organization. The account stays. Answers 200, 404 for an unknown organization or user, and 422 when the user is not a member or is the last owner. Removing an owner answers 403 for a caller who may not grant the owner role.

Roles​

An organization role is a name. LumoAuth attaches no permissions to it: the role's slug reaches your application as the org_role claim, and your application decides what each role allows.

The Role Object​

{
"id": 87,
"slug": "billing_admin",
"name": "Billing admin",
"description": "Manages invoices",
"isDefault": false,
"isOwner": false,
"isSystem": false
}

id is an integer and {roleId} takes that number only. The three built-in roles (owner, admin, member) have isSystem: true and cannot be changed or deleted. Exactly one role is the default role for new members and invitations.

List Roles​

GET …/organizations/{organizationId}/roles returns every role of the organization, built-in roles first, then by name. The answer has data and a pagination object for one page; it takes no page or limit.

Create a Role​

curl -X POST "https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/organizations/globex/roles" \
-H "Authorization: ApiKey lmk_abc123" \
-H "Content-Type: application/json" \
-d '{ "name": "Billing admin", "slug": "billing_admin", "description": "Manages invoices" }'

name (1 to 100 characters) and slug are required. The slug has 2 to 40 characters: lowercase letters, digits, hyphens and underscores. It cannot be changed later. description (up to 1,000 characters) and isDefault are optional; isDefault: true makes this role the default role. Answers 201 with the role object.

StatusWhen
400 invalid_requestA missing field, a slug that does not fit the rule, a name or description that is too long
404 not_foundNo such organization
409 conflictThe organization already has a role with this slug (this includes owner, admin and member)

Update a Role​

PUT or PATCH …/organizations/{organizationId}/roles/{roleId} with any of name, description and isDefault. isDefault: false on the default role gives the default back to the built-in Member role. Answers 200 with the role object, 404 for an unknown organization or role, and 422 for a built-in role or a value that does not fit.

Delete a Role​

DELETE …/organizations/{organizationId}/roles/{roleId} deletes a custom role. Its members get the built-in Member role. Answers 200, 404 for an unknown organization or role, and 422 for a built-in role.

Invitations​

The Invitation Object​

{
"id": 1290,
"email": "new.person@globex.example",
"role": { "id": 88, "slug": "member" },
"status": "pending",
"invitedBy": "019d6190-a2c4-7d10-8f3e-5b9c2e7f4a61",
"createdAt": "2026-06-11T14:05:00+00:00",
"expiresAt": "2026-06-18T14:05:00+00:00"
}

status is pending, accepted or revoked. A pending invitation can be accepted until expiresAt, 7 days after it was sent. After that date it keeps the status pending, so compare expiresAt with the current time. role is null when the invitation was sent without one: the default role then applies when it is accepted. invitedBy is the id of the user who sent it.

List Invitations​

GET …/organizations/{organizationId}/invitations returns every invitation of the organization, newest first, with data and a pagination object for one page. Add ?status=pending (or another status) to filter.

Send an Invitation​

curl -X POST "https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/organizations/globex/invitations" \
-H "Authorization: ApiKey lmk_abc123" \
-H "Content-Type: application/json" \
-d '{ "email": "new.person@globex.example", "roleId": 88, "message": "Welcome to the Globex workspace" }'
FieldNotes
emailRequired. The address is stored in lower case. A pending invitation to the same address in this organization is replaced
roleIdOptional. A role of this customer organization
messageOptional. A personal note for the email, up to 500 characters
skipEmailOptional, default false. true stores the invitation without sending the email. The link is sent only by email, so send it later with Resend

The invited person accepts from the link in the email, with an existing account or by creating one in your organization. Answers 201 with the invitation object.

StatusWhen
400 invalid_requestemail missing or not an email address, a roleId that names no role of this organization, a message longer than 500 characters
403 forbiddenThe role is the owner role and the caller may not grant it
403 plan_limit_reachedlimit: mau: the address has no account in your organization, and on the Developer plan every monthly-active-user place of the month is used
404 not_foundNo such organization
429Your organization sent too many invitations in the last hour, or this address was invited too many times. Wait and try again

Resend or Revoke an Invitation​

  • POST …/organizations/{organizationId}/invitations/{invId}/resend sends a new link (the old one stops working) and starts a new 7-day period. Only a pending invitation can be resent (422 otherwise). For an address without an account, the resend answers 403 plan_limit_reached (limit: mau) while every monthly-active-user place of the Developer plan is used.
  • DELETE …/organizations/{organizationId}/invitations/{invId} revokes the invitation: its link stops working.

{invId} is the invitation's integer id. Both answer 404 when the invitation does not belong to this customer organization, and 403 when the invitation carries the owner role and the caller may not grant it.

Errors​

Errors use the Admin API envelope {"error": "…", "message": "…", "status": …}; see Errors. An {organizationId}, {roleId} or {invId} that cannot be an id of its type answers 404 not_found, like an unknown one.

Events​

Changes reach your webhooks as organization.created, organization.updated, organization.deleted, organization.member.added, organization.member.removed, organization.member.updated and organization.invitation.accepted. The audit log records them too, together with role changes (organization.role_created, organization.role_updated, organization.role_deleted).