Update a user
const url = 'https://api.fleet.co/platform/v1/users/42';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"email":"[email protected]","secondary_email":"[email protected]","first_name":"Ada","last_name":"Lovelace","phone":"+33123456789","phone_country":"FR","language":"fr","position":"Software engineer","arrival_date":"2024-01-15","departure_date":"2026-12-31","date_of_birth":"1990-05-21","city_of_birth":"Paris","country_of_birth":"FR","role":"EMPLOYEE","is_signatory":true,"team_ids":[12,34]}'};
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://api.fleet.co/platform/v1/users/42 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "email": "[email protected]", "secondary_email": "[email protected]", "first_name": "Ada", "last_name": "Lovelace", "phone": "+33123456789", "phone_country": "FR", "language": "fr", "position": "Software engineer", "arrival_date": "2024-01-15", "departure_date": "2026-12-31", "date_of_birth": "1990-05-21", "city_of_birth": "Paris", "country_of_birth": "FR", "role": "EMPLOYEE", "is_signatory": true, "team_ids": [ 12, 34 ] }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”User id
Example
42Request Body
Section titled “Request Body”object
New work email. Omit for no change; cannot be set to null. Same validation as create; must not belong to another active user when changed.
Example
Personal email, kept to reach the user outside work, such as after they leave. Unique among the company’s active users; never used to sign in. Omit for no change; null clears it.
Example
Given name. Omit for no change; cannot be cleared via null.
Example
AdaFamily name. Omit for no change; cannot be cleared via null.
Example
LovelaceContact phone. Omit for no change; cannot be cleared via null.
Example
+33123456789ISO 3166-1 alpha-2. Omit for no change; cannot be cleared via null.
Example
FRPreferred UI language. Omit for no change; null clears when supported.
Example
frJob title. Omit for no change; null clears when supported.
Example
Software engineerEmployment start. Omit for no change; null clears when supported.
Example
2024-01-15Employment end. Omit for no change; null clears when supported.
Example
2026-12-31Date of birth. Omit for no change; null clears when supported.
Example
1990-05-21City of birth. Omit for no change; null clears when supported.
Example
ParisCountry of birth. Omit for no change; null clears when supported.
Example
FREMPLOYEE: standard company user. ADMIN: can manage company configuration and users. On create, defaults to EMPLOYEE when omitted.
Example
EMPLOYEEWhether the user can sign leasing contracts for the company, in addition to their role. Requires a phone number, given in the same request or already on the user.
Example
trueIds of company teams to assign. Teams must already exist. On patch, replaces all current team memberships when provided.
Example
[ 12, 34]Responses
Section titled “Responses”Updated user
object
object
EMPLOYEE: standard company user. ADMIN: can manage company configuration and users. On create, defaults to EMPLOYEE when omitted.
Whether the user can sign leasing contracts for the company
Teams the user belongs to, sorted by label.
object
Example
{ "data": { "role": "EMPLOYEE" }}Validation or business rule error
Missing, invalid, or revoked API key
Example
UnauthorizedThe API key has READ scope; this operation needs WRITE
object
Example
{ "error": "INSUFFICIENT_SCOPE"}User or team not found
object
Example
{ "error": "USER_NOT_FOUND"}The email, or the personal email, belongs to another user
object
Example
{ "error": "USER_EMAIL_CONFLICT"}Rate limit exceeded. The RateLimit-* headers give the limit and the reset time.
Example
Too many requests, please try again later.Unexpected server error
object
Example
{ "error": "INTERNAL_ERROR"}Rate limiting is temporarily unavailable; retry with backoff
object
Example generated
{ "message": "example"}
