Grant a user a role in a tenant
const url = 'https://example.com/v1/memberships';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"role":"example","tenant":"example","user_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","workspace_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
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/v1/memberships \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "role": "example", "tenant": "example", "user_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "workspace_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Grants one user a role in a tenant.
Authorizations
Section titled “ Authorizations ”Request Body required
Section titled “ Request Body required ”object
Optional: confine the membership to one workspace of the tenant; empty is tenant-wide
Example generated
{ "role": "example", "tenant": "example", "user_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "workspace_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Responses
Section titled “ Responses ”Created
object
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "role": "example", "tenant": "example", "user_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Consent required: the account exists and is not a member of the tenant; nothing was written
object
Example
{ "status": "consent_required"}Bad request
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}Unauthenticated
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}Forbidden
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}Not found
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}Conflict / setup required
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}Rate limited
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}