Create a user
const url = 'https://api.fleet.co/platform/v1/users';const options = { method: 'POST', 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 POST \ --url https://api.fleet.co/platform/v1/users \ --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”Request Body
Section titled “Request Body”object
Work email used as the primary identifier. Personal addresses may be rejected; the address must be unique among active users.
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.
Example
Given name (display and HR profile).
Example
AdaFamily name (display and HR profile).
Example
LovelaceContact phone number.
Example
+33123456789ISO 3166-1 alpha-2 country code for phone / dialing context.
Example
FRPreferred UI language code (e.g. en, fr). Defaults to the company’s default when omitted on create.
Example
frJob title or position label.
Example
Software engineerEmployment start date as a date or ISO 8601 datetime string.
Example
2024-01-15Employment end date as a date or ISO 8601 datetime string.
Example
2026-12-31Date of birth as a date or ISO 8601 datetime string (HR profile).
Example
1990-05-21City of birth (HR profile).
Example
ParisCountry of birth (HR profile).
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”Created 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"}Company or team not found
object
Example
{ "error": "COMPANY_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"}
