# Update a user

**PATCH** `/users/{user_id}`

## Parameters

### `user_id` (_path_, required)

User id

- **Type:** `string`
- **Example:** `"42"`
- **Constraints:** pattern `^[1-9]\d*$`

## Request body

**application/json**

_Schema ref:_ `#/components/schemas/PatchUserBody` (PatchUserBody)

```json
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "description": "New work email. Same validation as create; must not belong to another active user when changed.",
      "example": "ada@example.com"
    },
    "first_name": {
      "type": "string",
      "nullable": true,
      "description": "Given name. Omit for no change; null clears when supported.",
      "example": "Ada"
    },
    "last_name": {
      "type": "string",
      "nullable": true,
      "description": "Family name. Omit for no change; null clears when supported.",
      "example": "Lovelace"
    },
    "phone": {
      "type": "string",
      "nullable": true,
      "description": "Contact phone; spaces are removed. Omit for no change; null clears when supported.",
      "example": "+33123456789"
    },
    "phone_country": {
      "type": "string",
      "nullable": true,
      "description": "Omit for no change; null clears when supported.",
      "example": "FR"
    },
    "password": {
      "type": "string",
      "nullable": true,
      "description": "New password: only a non-empty string updates the login password (hashed server-side). Omit for no change; null does not clear an existing password.",
      "example": "hunter2"
    },
    "language": {
      "type": "string",
      "nullable": true,
      "description": "Preferred UI language. Omit for no change; null clears when supported.",
      "example": "fr"
    },
    "position": {
      "type": "string",
      "nullable": true,
      "description": "Job title. Omit for no change; null clears when supported.",
      "example": "Software engineer"
    },
    "arrival_date": {
      "type": "string",
      "nullable": true,
      "description": "Employment start. Omit for no change; null clears when supported.",
      "example": "2024-01-15"
    },
    "departure_date": {
      "type": "string",
      "nullable": true,
      "description": "Employment end. Omit for no change; null clears when supported.",
      "example": "2026-12-31"
    },
    "date_of_birth": {
      "type": "string",
      "nullable": true,
      "description": "Date of birth. Omit for no change; null clears when supported.",
      "example": "1990-05-21"
    },
    "city_of_birth": {
      "type": "string",
      "nullable": true,
      "description": "City of birth. Omit for no change; null clears when supported.",
      "example": "Paris"
    },
    "country_of_birth": {
      "type": "string",
      "nullable": true,
      "description": "Country of birth. Omit for no change; null clears when supported.",
      "example": "FR"
    },
    "role": {
      "type": "string",
      "enum": [
        "EMPLOYEE",
        "ADMIN"
      ],
      "description": "EMPLOYEE: standard company user. ADMIN: can manage company configuration and users in Fleet. On create, defaults to EMPLOYEE when omitted.",
      "example": "EMPLOYEE"
    }
  }
}
```

## Responses

### 200

Updated user

**application/json**

_Schema ref:_ `#/components/schemas/GetUserResponse` (GetUserResponse)

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "company_id": {
          "type": "integer"
        },
        "email": {
          "type": "string",
          "nullable": true
        },
        "first_name": {
          "type": "string",
          "nullable": true
        },
        "last_name": {
          "type": "string",
          "nullable": true
        },
        "phone": {
          "type": "string",
          "nullable": true
        },
        "phone_country": {
          "type": "string",
          "nullable": true
        },
        "language": {
          "type": "string",
          "nullable": true
        },
        "position": {
          "type": "string",
          "nullable": true
        },
        "role": {
          "type": "string",
          "enum": [
            "EMPLOYEE",
            "ADMIN"
          ],
          "description": "EMPLOYEE: standard company user. ADMIN: can manage company configuration and users in Fleet. On create, defaults to EMPLOYEE when omitted.",
          "example": "EMPLOYEE"
        },
        "arrival_date": {
          "type": "string",
          "nullable": true
        },
        "departure_date": {
          "type": "string",
          "nullable": true
        },
        "date_of_birth": {
          "type": "string",
          "nullable": true
        },
        "city_of_birth": {
          "type": "string",
          "nullable": true
        },
        "country_of_birth": {
          "type": "string",
          "nullable": true
        }
      },
      "required": [
        "id",
        "company_id",
        "email",
        "first_name",
        "last_name",
        "phone",
        "phone_country",
        "language",
        "position",
        "role",
        "arrival_date",
        "departure_date",
        "date_of_birth",
        "city_of_birth",
        "country_of_birth"
      ]
    }
  },
  "required": [
    "data"
  ]
}
```

## Security

```json
[
  {
    "bearerAuth": []
  }
]
```

**bearerAuth:** Bearer token using a Fleet platform API key (flt_sk_…).

---

_Generated from the OpenAPI specification for raw Markdown / tooling use._
