Add user to organization
const url = 'https://localhost:8080/api/v1/organizations/example/members';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"roles":["organization_owner","project_owner"],"userId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://localhost:8080/api/v1/organizations/example/members \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "roles": [ "organization_owner", "project_owner" ], "userId": "example" }'Add a user to an organization with the specified roles and best-effort sync the membership to the bound IDP organization
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Organization ID or UUID (bare or urn:uuid)
Request Body
Section titled “Request Body ”Roles to assign
object
At least one known role
Example
[ "organization_owner", "project_owner"]Responses
Section titled “ Responses ”User added successfully
A user’s membership in a single organization, and the roles it grants
object
Example generated
{ "joinedAt": "2026-04-15T12:00:00Z", "organizationId": 1, "roles": [ "example" ], "status": "example"}Invalid request
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Unauthorized
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Forbidden - requires Organization Owner role
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Organization not found
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}User is already a member of this organization
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Internal server error
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}