Organizations
Organizations, members, roles and invitations.
Create an organization
application/json- body
name*stringThe name of the organization
1 <= lengthslug*stringThe slug of the organization
1 <= lengthuserId?stringThe user id of the organization creator. If not provided, the current user will be used. Should only be used by admins or when called by the server. server-only. Eg: "user-id"
logo?|The logo of the organization
metadata?The metadata of the organization
keepCurrentActiveOrganization?booleanWhether to keep the current active organization active after creating a new one. Eg: true
Success
application/json- response
The organization that was created
id*stringname*stringslug*stringlogo?stringcreatedAt*stringdate-timemetadata?stringcurl -X POST 'https://auth.example.com/api/auth/organization/create' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "slug": "string"}'{ "id": "string", "name": "string", "slug": "string", "logo": "string", "createdAt": "2019-08-24T14:15:22Z", "metadata": "string"}Update an organization
application/json- body
data*organizationId?stringThe organization ID. Eg: "org-id"
Success
application/json- response
The updated organization
id*stringname*stringslug*stringlogo?stringcreatedAt*stringdate-timemetadata?stringcurl -X POST 'https://auth.example.com/api/auth/organization/update' \ -H 'Content-Type: application/json' \ -d '{ "data": {}}'{ "id": "string", "name": "string", "slug": "string", "logo": "string", "createdAt": "2019-08-24T14:15:22Z", "metadata": "string"}Delete an organization
application/json- body
organizationId*stringThe organization id to delete
Success
response?stringapplication/jsonThe organization id that was deleted
curl -X POST 'https://auth.example.com/api/auth/organization/delete' \ -H 'Content-Type: application/json' \ -d '{ "organizationId": "string"}'"string"Set the active organization
application/json- body
organizationId?|The organization id to set as active. It can be null to unset the active organization. Eg: "org-id"
organizationSlug?stringThe organization slug to set as active. It can be null to unset the active organization if organizationId is not provided. Eg: "org-slug"
Success
application/json- response
The organization
id*stringname*stringslug*stringlogo?stringcreatedAt*stringdate-timemetadata?stringcurl -X POST 'https://auth.example.com/api/auth/organization/set-active' \ -H 'Content-Type: application/json' \ -d '{}'{ "id": "string", "name": "string", "slug": "string", "logo": "string", "createdAt": "2019-08-24T14:15:22Z", "metadata": "string"}Get the organization metadata
organizationId?stringThe organization id to get
organizationSlug?stringThe organization slug to get
Success
application/json- response
The organization
id*stringname*stringslug*stringlogo?stringcreatedAt*stringdate-timemetadata?stringcurl -X GET 'https://auth.example.com/api/auth/organization/get-organization'{ "id": "string", "name": "string", "slug": "string", "logo": "string", "createdAt": "2019-08-24T14:15:22Z", "metadata": "string"}Get the full organization
organizationId?stringThe organization id to get
organizationSlug?stringThe organization slug to get
membersLimit?|The limit of members to get. By default, it uses the membershipLimit option.
Success
application/json- response
The organization
id*stringname*stringslug*stringlogo?stringcreatedAt*stringdate-timemetadata?stringcurl -X GET 'https://auth.example.com/api/auth/organization/get-full-organization'{ "id": "string", "name": "string", "slug": "string", "logo": "string", "createdAt": "2019-08-24T14:15:22Z", "metadata": "string"}List all organizations
Success
application/json- response
[index: integer]?curl -X GET 'https://auth.example.com/api/auth/organization/list'[ { "id": "string", "name": "string", "slug": "string", "logo": "string", "createdAt": "2019-08-24T14:15:22Z", "metadata": "string" }]Create an invitation to an organization
application/json- body
email*stringThe email address of the user to invite
role*|array<>The role(s) to assign to the user. It can be admin, member, owner. Eg: "member"
organizationId?stringThe organization ID to invite the user to
resend?booleanResend the invitation email, if the user is already invited. Eg: true
teamId?|array<string>Success
application/json- response
id*stringemail*stringrole*stringorganizationId*stringinviterId*stringstatus*stringexpiresAt*stringcreatedAt*stringcurl -X POST 'https://auth.example.com/api/auth/organization/invite-member' \ -H 'Content-Type: application/json' \ -d '{ "email": "string", "role": "string"}'{ "id": "string", "email": "string", "role": "string", "organizationId": "string", "inviterId": "string", "status": "string", "expiresAt": "string", "createdAt": "string"}application/json- body
invitationId*stringThe ID of the invitation to cancel
Bad Request. Usually due to missing parameters, or invalid parameters.
application/json- response
message*stringcurl -X POST 'https://auth.example.com/api/auth/organization/cancel-invitation' \ -H 'Content-Type: application/json' \ -d '{ "invitationId": "string"}'{ "message": "string"}Accept an invitation to an organization
application/json- body
invitationId*stringThe ID of the invitation to accept
Success
application/json- response
invitation?member?curl -X POST 'https://auth.example.com/api/auth/organization/accept-invitation' \ -H 'Content-Type: application/json' \ -d '{ "invitationId": "string"}'{ "invitation": {}, "member": {}}Get an invitation by ID
id?stringThe ID of the invitation to get
Success
application/json- response
id*stringemail*stringrole*stringorganizationId*stringinviterId*stringstatus*stringexpiresAt*stringorganizationName*stringorganizationSlug*stringinviterEmail*stringcurl -X GET 'https://auth.example.com/api/auth/organization/get-invitation'{ "id": "string", "email": "string", "role": "string", "organizationId": "string", "inviterId": "string", "status": "string", "expiresAt": "string", "organizationName": "string", "organizationSlug": "string", "inviterEmail": "string"}Reject an invitation to an organization
application/json- body
invitationId*stringThe ID of the invitation to reject
Success
application/json- response
invitation?member?curl -X POST 'https://auth.example.com/api/auth/organization/reject-invitation' \ -H 'Content-Type: application/json' \ -d '{ "invitationId": "string"}'{ "invitation": {}, "member": {}}organizationId?stringThe ID of the organization to list invitations for
Bad Request. Usually due to missing parameters, or invalid parameters.
application/json- response
message*stringcurl -X GET 'https://auth.example.com/api/auth/organization/list-invitations'{ "message": "string"}Get the member details of the active organization
Success
application/json- response
id*stringuserId*stringorganizationId*stringrole*stringcurl -X GET 'https://auth.example.com/api/auth/organization/get-active-member'{ "id": "string", "userId": "string", "organizationId": "string", "role": "string"}application/json- body
slug*stringThe organization slug to check. Eg: "my-org"
Bad Request. Usually due to missing parameters, or invalid parameters.
application/json- response
message*stringcurl -X POST 'https://auth.example.com/api/auth/organization/check-slug' \ -H 'Content-Type: application/json' \ -d '{ "slug": "string"}'{ "message": "string"}Remove a member from an organization
application/json- body
memberIdOrEmail*stringThe ID or email of the member to remove
organizationId?stringThe ID of the organization to remove the member from. If not provided, the active organization will be used. Eg: "org-id"
Success
application/json- response
member*curl -X POST 'https://auth.example.com/api/auth/organization/remove-member' \ -H 'Content-Type: application/json' \ -d '{ "memberIdOrEmail": "string"}'{ "member": { "id": "string", "userId": "string", "organizationId": "string", "role": "string" }}Update the role of a member in an organization
application/json- body
role*|array<string>The new role to be applied. This can be a string or array of strings representing the roles. Eg: ["admin", "sale"]
memberId*stringThe member id to apply the role update to. Eg: "member-id"
organizationId?stringAn optional organization ID which the member is a part of to apply the role update. If not provided, you must provide session headers to get the active organization. Eg: "organization-id"
Success
application/json- response
member*curl -X POST 'https://auth.example.com/api/auth/organization/update-member-role' \ -H 'Content-Type: application/json' \ -d '{ "role": "string", "memberId": "string"}'{ "member": { "id": "string", "userId": "string", "organizationId": "string", "role": "string" }}application/json- body
organizationId*stringThe organization Id for the member to leave. Eg: "organization-id"
Bad Request. Usually due to missing parameters, or invalid parameters.
application/json- response
message*stringcurl -X POST 'https://auth.example.com/api/auth/organization/leave' \ -H 'Content-Type: application/json' \ -d '{ "organizationId": "string"}'{ "message": "string"}List all invitations a user has received
email?stringThe email of the user to list invitations for. This only works for server side API calls.
Success
application/json- response
[index: integer]?curl -X GET 'https://auth.example.com/api/auth/organization/list-user-invitations'[ { "id": "string", "email": "string", "role": "string", "organizationId": "string", "organizationName": "string", "inviterId": "string", "teamId": "string", "status": "string", "expiresAt": "string", "createdAt": "string" }]limit?|numberoffset?|numbersortBy?stringThe field to sort by
sortDirection?stringThe direction to sort by
"asc""desc"filterField?stringThe field to filter by
filterValue?|number|boolean|array<string>|array<number>filterOperator?stringThe operator to use for the filter
"eq""ne""lt""lte""gt""gte""in""not_in""contains""starts_with""ends_with"organizationId?stringThe organization ID to list members for. If not provided, will default to the user's active organization. Eg: "organization-id"
organizationSlug?stringThe organization slug to list members for. If not provided, will default to the user's active organization. Eg: "organization-slug"
Bad Request. Usually due to missing parameters, or invalid parameters.
application/json- response
message*stringcurl -X GET 'https://auth.example.com/api/auth/organization/list-members'{ "message": "string"}userId?stringThe user ID to get the role for. If not provided, will default to the current user's
organizationId?stringThe organization ID to list members for. If not provided, will default to the user's active organization. Eg: "organization-id"
organizationSlug?stringThe organization slug to list members for. If not provided, will default to the user's active organization. Eg: "organization-slug"
Bad Request. Usually due to missing parameters, or invalid parameters.
application/json- response
message*stringcurl -X GET 'https://auth.example.com/api/auth/organization/get-active-member-role'{ "message": "string"}Check if the user has permission
application/json- body
permission?DeprecatedThe permission to check
permissions*The permission to check
Success
application/json- response
error?stringsuccess*booleancurl -X POST 'https://auth.example.com/api/auth/organization/has-permission' \ -H 'Content-Type: application/json' \ -d '{ "permissions": {}}'{ "error": "string", "success": true}