Skip to content

Members & Teams

Member, invitation, and team management is handled by Better Auth’s organization plugin. All endpoints below are served at /api/auth/organization/*.

GET /api/auth/organization/list-members

Query parameters:

ParameterTypeDescription
organizationIdstringOrganization to list members for. Defaults to the session’s active organization.
limitnumberMax results to return (default: 100).
offsetnumberOffset for pagination (default: 0).
sortBystringField to sort by (default: "createdAt").
sortDirection"asc" | "desc"Sort direction (default: "desc").

POST /api/auth/organization/update-member-role
Content-Type: application/json

Required role: Admin or owner.

Request body:

FieldTypeRequiredDescription
memberIdstringYesThe member ID to update.
role"owner" | "admin" | "member"YesThe new role.
organizationIdstringNoDefaults to the session’s active organization.

POST /api/auth/organization/remove-member
Content-Type: application/json

Required role: Admin or owner.

Request body:

FieldTypeRequiredDescription
memberIdstringYesThe member ID to remove.
organizationIdstringNoDefaults to the session’s active organization.

POST /api/auth/organization/invite-member
Content-Type: application/json

Required role: Admin or owner.

Request body:

FieldTypeRequiredDescription
emailstringYesEmail address of the person to invite.
role"owner" | "admin" | "member"YesRole to assign on acceptance.
organizationIdstringNoDefaults to the session’s active organization.
teamIdstringNoTeam to add the member to on acceptance.
resendbooleanNoRe-send the invitation email if one is already pending for this address.

GET /api/auth/organization/get-invitations

Required role: Admin or owner.

Query parameters:

ParameterTypeDescription
organizationIdstringDefaults to the session’s active organization.

Returns pending invitations including id, email, role, teamId, status, and expiresAt.


POST /api/auth/organization/cancel-invitation
Content-Type: application/json

Required role: Admin or owner (or the user who sent the invitation).

Request body:

FieldTypeRequiredDescription
invitationIdstringYesID of the invitation to cancel.

POST /api/auth/organization/accept-invitation
Content-Type: application/json

Called by the invitee after clicking the invitation link.

Request body:

FieldTypeRequiredDescription
invitationIdstringYesID of the invitation to accept.

GET /api/auth/organization/list-teams

Query parameters:

ParameterTypeDescription
organizationIdstringDefaults to the session’s active organization.

POST /api/auth/organization/create-team
Content-Type: application/json

Required role: Admin or owner.

Request body:

FieldTypeRequiredDescription
namestringYesTeam name.
organizationIdstringNoDefaults to the session’s active organization.

POST /api/auth/organization/update-team
Content-Type: application/json

Required role: Admin or owner.

Request body:

FieldTypeRequiredDescription
teamIdstringYesID of the team to update.
data.namestringYesNew team name.

POST /api/auth/organization/remove-team
Content-Type: application/json

Required role: Admin or owner.

Deleting a team does not remove its members from the organization — members’ teamId is set to null.

Request body:

FieldTypeRequiredDescription
teamIdstringYesID of the team to delete.

GET /api/auth/organization/list-team-members

Query parameters:

ParameterTypeDescription
teamIdstringID of the team.

POST /api/auth/organization/remove-team-member
Content-Type: application/json

Required role: Admin or owner.

Request body:

FieldTypeRequiredDescription
teamIdstringYes
userIdstringYes