Add Member
POST
/api/organizations/{organization_id}/members
const url = 'https://example.com/api/organizations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/members';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"email":"example","role":"admin"}'};
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://example.com/api/organizations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/members \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "email": "example", "role": "admin" }'Add an already-registered user to the organization.
BUG-377: the granted role may not rank above the caller’s own role (ORG_ROLE_RANK puts ADMIN above OWNER, so an OWNER can no longer hand out ‘admin’). To bring in someone without an account, use POST …/invite.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ” organization_id
required
Organization Id
string format: uuid
Request Bodyrequired
Section titled “ Request Bodyrequired ” Media type application/json
OrganizationMemberCreate
Add member to organization
object
email
required
Email
string
role
UserRole
User roles
string
Responses
Section titled “ Responses ”Successful Response
Media type application/json
OrganizationMemberResponse
Organization member response
object
created_at
required
Created At
string format: date-time
id
required
Id
string format: uuid
organization_id
required
Organization Id
string format: uuid
role
required
UserRole
User roles
string
user_id
required
User Id
string format: uuid
Example
{ "role": "admin"}Validation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}