Create user
POST
/api/v1/users
const url = 'https://example.com/%7B%7Bapp_url%7D/api/v1/users';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"first_name":"example","last_name":"example","email":"example","role_id":1,"workspace_ids":[1],"team_ids":[1]}'};
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/%7B%7Bapp_url%7D/api/v1/users \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "first_name": "example", "last_name": "example", "email": "example", "role_id": 1, "workspace_ids": [ 1 ], "team_ids": [ 1 ] }'Creates a new user.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
first_name
required
string
last_name
required
string
email
required
string
role_id
required
integer
workspace_ids
Array of workspace IDs the user should be added to
Array<integer>
team_ids
Array of team IDs the user should be added to (must belong to selected workspaces)
Array<integer>
Examplegenerated
{ "first_name": "example", "last_name": "example", "email": "example", "role_id": 1, "workspace_ids": [ 1 ], "team_ids": [ 1 ]}Responses
Section titled “Responses”Successful
Media typeapplication/json
object
id
required
integer
first_name
required
string
last_name
required
string
email
required
string format: email
created_at
required
string format: date-time
updated_at
required
string format: date-time
profile_image_url
required
string format: url
wants_marketing_emails
required
boolean
two_factor_enabled
required
boolean
disabled_email_notifications
required
Array<string>
organization_membership
required
object
role_id
required
integer
invitation_sent_at
required
string format: date-time
invitation_accepted_at
required
string format: date-time
Example
{ "id": 12345, "first_name": "Joe", "last_name": "Cottam", "email": "joe@example.com", "created_at": "2023-08-23T10:30:00.000Z", "updated_at": "2023-08-23T10:30:00.000Z", "profile_image_url": "https://example.com/profile.jpg", "wants_marketing_emails": false, "two_factor_enabled": false, "disabled_email_notifications": [ "mentioned_in_comment" ], "organization_membership": { "role_id": 12345, "invitation_sent_at": "2023-08-23T10:30:00.000Z", "invitation_accepted_at": "2023-08-23T10:30:00.000Z" }}Unauthorized
Media typeapplication/json
object
message
required
string
Example
{ "message": "Record not found"}Forbidden
Media typeapplication/json
object
message
required
string
Example
{ "message": "Record not found"}Unprocessable Entity
Media typeapplication/json
object
message
required
string
errors
required
object
key
additional properties
Array<string>
Example
{ "errors": { "username": [ "Username is required.", "Username must be unique." ], "email": [ "Invalid email format." ] }}