Create a user (superadmin)
const url = 'https://example.com/v1/users';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"display_name":"example","email":"hello@example.com","password":"example","role":"example","superadmin":false,"tenant":"example","workspace_id":"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://example.com/v1/users \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "display_name": "example", "email": "hello@example.com", "password": "example", "role": "example", "superadmin": false, "tenant": "example", "workspace_id": "example" }'Creates one user account. Superadmin only.
Authorizations
Section titled “ Authorizations ”Request Body required
Section titled “ Request Body required ”object
The role granted in tenant
Optional tenant granted role in the create transaction
Optional workspace the membership is confined to
Responses
Section titled “ Responses ”Created
object
The first membership, granted in the create transaction when tenant was given
object
Example
{ "status": "active"}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" }}