Organizations API
Theorganizations module exposes programmatic access to Wacht’s multi-tenancy models. It allows B2B applications to create independent organizations and manage the users (members) within them.
Reading Organizations
listOrganizations()
Retrieves a paginated list of all organizations.
getOrganization(organizationId)
Retrieves a single organization by its ID.
The unique ID of the organization to retrieve.
Mutating Organizations
createOrganization(request)
Programmatically provision a new organization.
updateOrganization(organizationId, request)
Modify an organization’s profile, including metadata.
The unique ID of the organization.
deleteOrganization(organizationId)
Permanently deletes an organization and all of its associated memberships and roles.
The unique ID of the organization.
Memberships
Organizations are collections of Users. You can assign users to an organization by adding them as members and granting them specific roles.listOrganizationMembers(organizationId)
Get all users actively belonging to the organization.
The target organization’s ID.
addOrganizationMember(organizationId, request)
Force-add a user into an organization, bypassing the standard invitation mechanisms.
The ID of the organization.
updateOrganizationMember(organizationId, memberId, request)
Change a member’s role within the organization.
The exact organization ID.
The unique ID of the membership record inside the organization.
removeOrganizationMember(organizationId, memberId)
Evict a user from the organization.
The exact organization ID.
The exact ID of the member to evict.
Custom RBAC Roles
Wacht allows you to provision custom Roles with specific permissions directly via the API.client.organizations.listOrganizationRoles(organizationId)client.organizations.createOrganizationRole(organizationId, request)client.organizations.updateOrganizationRole(organizationId, roleId, request)client.organizations.deleteOrganizationRole(organizationId, roleId)
The exact organization target for the role.
