Create user
POST
/api/v1/users
const url = 'http://localhost:3000/api/v1/users';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"email":"john.doe@example.com","name":"John Doe","password":"securePassword123!","isSuperAdmin":false,"organizationId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","roleId":"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 http://localhost:3000/api/v1/users \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "email": "john.doe@example.com", "name": "John Doe", "password": "securePassword123!", "isSuperAdmin": false, "organizationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "roleId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Creates a new user. Requires Super Admin privileges.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
email
required
User email address
string format: email
Example
john.doe@example.com name
required
User display name
string
Example
John Doe password
User password (min 8 characters)
string format: password
Example
securePassword123! isSuperAdmin
Whether the user is a super admin with platform-wide privileges
boolean
Example
false organizationId
Organization ID to assign the user to upon creation
string format: uuid
roleId
Role ID to assign to the user in the organization (defaults to viewer)
string format: uuid
Responses
Section titled “ Responses ”User created successfully
Media type application/json
object
id
required
Unique user identifier
string format: uuid
email
required
User email address
string format: email
name
User display name
string
active
required
Whether the user account is active
boolean
emailVerified
required
Whether the user email has been verified
boolean
isSuperAdmin
required
Whether the user is a super admin with platform-wide privileges
boolean
createdAt
required
When the user was created
string format: date-time
updatedAt
required
When the user was last updated
string format: date-time
lastLoginAt
When the user last logged in
string format: date-time
Example
{ "id": "550e8400-e29b-41d4-a716-446655440000", "email": "john.doe@example.com", "name": "John Doe", "active": true, "emailVerified": true, "isSuperAdmin": false, "createdAt": "2024-01-15T10:30:00Z", "updatedAt": "2024-06-20T14:45:00Z", "lastLoginAt": "2024-12-20T09:15:00Z"}Invalid input data
Unauthorized
Forbidden - Super Admin required
User with this email already exists