Skip to content

Update a user

PATCH
/users/{user_id}
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 ] }'
user_id
required

User id

string
/^[1-9]\d*$/

Example

42
Media typeapplication/json
object
email

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.

string format: email
secondary_email

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.

string format: email
nullable
first_name

Given name. Omit for no change; cannot be cleared via null.

string
>= 1 characters

Example

Ada
last_name

Family name. Omit for no change; cannot be cleared via null.

string
>= 1 characters

Example

Lovelace
phone

Contact phone. Omit for no change; cannot be cleared via null.

string
>= 1 characters

Example

+33123456789
phone_country

ISO 3166-1 alpha-2. Omit for no change; cannot be cleared via null.

string

Example

FR
language

Preferred UI language. Omit for no change; null clears when supported.

string
nullable >= 1 characters

Example

fr
position

Job title. Omit for no change; null clears when supported.

string
nullable >= 1 characters

Example

Software engineer
arrival_date

Employment start. Omit for no change; null clears when supported.

string
nullable >= 1 characters

Example

2024-01-15
departure_date

Employment end. Omit for no change; null clears when supported.

string
nullable >= 1 characters

Example

2026-12-31
date_of_birth

Date of birth. Omit for no change; null clears when supported.

string
nullable >= 1 characters

Example

1990-05-21
city_of_birth

City of birth. Omit for no change; null clears when supported.

string
nullable >= 1 characters

Example

Paris
country_of_birth

Country of birth. Omit for no change; null clears when supported.

string
nullable >= 1 characters

Example

FR
role

EMPLOYEE: standard company user. ADMIN: can manage company configuration and users. On create, defaults to EMPLOYEE when omitted.

string
Allowed values: EMPLOYEE ADMIN

Example

EMPLOYEE
is_signatory

Whether 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.

boolean

Example

true
team_ids

Ids of company teams to assign. Teams must already exist. On patch, replaces all current team memberships when provided.

Array<integer>

Example

[
12,
34
]

Updated user

Media typeapplication/json
object
data
required
object
id
required
integer
email
required
string
nullable
secondary_email
required
string
nullable
first_name
required
string
nullable
last_name
required
string
nullable
phone
required
string
nullable
phone_country
required
string
nullable
language
required
string
nullable
position
required
string
nullable
role
required

EMPLOYEE: standard company user. ADMIN: can manage company configuration and users. On create, defaults to EMPLOYEE when omitted.

string
Allowed values: EMPLOYEE ADMIN
is_signatory
required

Whether the user can sign leasing contracts for the company

boolean
arrival_date
required
string
nullable
departure_date
required
string
nullable
date_of_birth
required
string
nullable
city_of_birth
required
string
nullable
country_of_birth
required
string
nullable
teams
required

Teams the user belongs to, sorted by label.

Array<object>
object
id
required
integer
label
required
string
created_at
required
string
nullable
updated_at
required
string
nullable

Example

{
"data": {
"role": "EMPLOYEE"
}
}

Validation or business rule error

Media typeapplication/json
Any of:
object
message
required

Every validation failure, comma-separated

string
type
required
string
Allowed values: validation_error
error
required
string
Allowed values: validation_error

Example

{
"message": "Required, must be an ISO 3166-1 alpha-2 country code",
"type": "validation_error",
"error": "validation_error"
}

Missing, invalid, or revoked API key

Media typetext/plain
string

Example

Unauthorized

The API key has READ scope; this operation needs WRITE

Media typeapplication/json
object
error
required
string
Allowed values: INSUFFICIENT_SCOPE

Example

{
"error": "INSUFFICIENT_SCOPE"
}

User or team not found

Media typeapplication/json
object
error
required
string
Allowed values: USER_NOT_FOUND USER_TEAM_NOT_FOUND

Example

{
"error": "USER_NOT_FOUND"
}

The email, or the personal email, belongs to another user

Media typeapplication/json
object
error
required
string
Allowed values: USER_EMAIL_CONFLICT

Example

{
"error": "USER_EMAIL_CONFLICT"
}

Rate limit exceeded. The RateLimit-* headers give the limit and the reset time.

Media typetext/plain
string

Example

Too many requests, please try again later.

Unexpected server error

Media typeapplication/json
object
error
required
string
Allowed values: INTERNAL_ERROR

Example

{
"error": "INTERNAL_ERROR"
}

Rate limiting is temporarily unavailable; retry with backoff

Media typeapplication/json
object
message
required
string

Example generated

{
"message": "example"
}