Add user to organization
POST
/api/v1/users/{id}/organizations
const url = 'http://localhost:3000/api/v1/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/organizations';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"organizationId":"550e8400-e29b-41d4-a716-446655440001","roleId":"550e8400-e29b-41d4-a716-446655440002"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/v1/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/organizations \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "organizationId": "550e8400-e29b-41d4-a716-446655440001", "roleId": "550e8400-e29b-41d4-a716-446655440002" }'Adds a user to an organization with a specific role. Requires Super Admin privileges.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
string format: uuid
User UUID
Request Body required
Section titled “Request Body required ” Media type application/json
object
organizationId
required
Organization UUID to add the user to
string format: uuid
Example
550e8400-e29b-41d4-a716-446655440001 roleId
required
Role UUID to assign to the user in the organization
string format: uuid
Example
550e8400-e29b-41d4-a716-446655440002Responses
Section titled “ Responses ”User added to organization successfully
Invalid input data
Unauthorized
Forbidden - Super Admin required
User or organization not found
User already belongs to this organization