# Create a user

**POST** `/users`

## Request body

**application/json**

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

```json
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "description": "Work email used as the primary identifier. Personal or disposable email domains are rejected; the address must be unique among active users.",
      "example": "ada@example.com"
    },
    "first_name": {
      "type": "string",
      "description": "Given name (display and HR profile).",
      "example": "Ada"
    },
    "last_name": {
      "type": "string",
      "description": "Family name (display and HR profile).",
      "example": "Lovelace"
    },
    "phone": {
      "type": "string",
      "description": "Contact phone number; spaces are removed before storage.",
      "example": "+33123456789"
    },
    "phone_country": {
      "type": "string",
      "description": "Country or dialing context for the phone number (as used by Fleet with phone).",
      "example": "FR"
    },
    "password": {
      "type": "string",
      "description": "Optional initial password. If omitted, set access through your usual onboarding or password-reset flow.",
      "example": "hunter2"
    },
    "language": {
      "type": "string",
      "description": "Preferred UI language code (e.g. en, fr). Defaults to the company's default when omitted on create.",
      "example": "fr"
    },
    "position": {
      "type": "string",
      "description": "Job title or position label.",
      "example": "Software engineer"
    },
    "arrival_date": {
      "type": "string",
      "description": "Employment start date as a date or ISO 8601 datetime string.",
      "example": "2024-01-15"
    },
    "departure_date": {
      "type": "string",
      "description": "Employment end date as a date or ISO 8601 datetime string.",
      "example": "2026-12-31"
    },
    "date_of_birth": {
      "type": "string",
      "description": "Date of birth as a date or ISO 8601 datetime string (HR profile).",
      "example": "1990-05-21"
    },
    "city_of_birth": {
      "type": "string",
      "description": "City of birth (HR profile).",
      "example": "Paris"
    },
    "country_of_birth": {
      "type": "string",
      "description": "Country of birth (HR profile).",
      "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"
    }
  },
  "required": [
    "email"
  ]
}
```

## Responses

### 201

Created 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._
