Update user
PATCH
/api/v1/users/{id}
const url = 'https://example.com/%7B%7Bapp_url%7D/api/v1/users/1';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"role_id":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/%7B%7Bapp_url%7D/api/v1/users/1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "role_id": 1 }'Updates a user.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
integer
User ID
Request Body
Section titled “Request Body”Media typeapplication/json
object
role_id
required
integer
Examplegenerated
{ "role_id": 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"}Not Found
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." ] }}