# Delete a user

**DELETE** `/users/{user_id}`

## Parameters

### `user_id` (_path_, required)

User id

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

## Responses

### 200

Deleted user

**application/json**

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

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "email": {
          "type": "string",
          "nullable": true
        },
        "secondary_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. On create, defaults to EMPLOYEE when omitted.",
          "example": "EMPLOYEE"
        },
        "is_signatory": {
          "type": "boolean",
          "description": "Whether the user can sign leasing contracts for the company"
        },
        "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
        },
        "teams": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "label": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "label"
            ]
          },
          "description": "Teams the user belongs to, sorted by label."
        },
        "created_at": {
          "type": "string",
          "nullable": true
        },
        "updated_at": {
          "type": "string",
          "nullable": true
        }
      },
      "required": [
        "id",
        "email",
        "secondary_email",
        "first_name",
        "last_name",
        "phone",
        "phone_country",
        "language",
        "position",
        "role",
        "is_signatory",
        "arrival_date",
        "departure_date",
        "date_of_birth",
        "city_of_birth",
        "country_of_birth",
        "teams",
        "created_at",
        "updated_at"
      ]
    }
  },
  "required": [
    "data"
  ]
}
```

### 400

Validation error

**application/json**

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

```json
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "Every validation failure, comma-separated",
      "example": "Required, must be an ISO 3166-1 alpha-2 country code"
    },
    "type": {
      "type": "string",
      "enum": [
        "validation_error"
      ]
    },
    "error": {
      "type": "string",
      "enum": [
        "validation_error"
      ]
    }
  },
  "required": [
    "message",
    "type",
    "error"
  ]
}
```

### 401

Missing, invalid, or revoked API key

**text/plain**

```json
{
  "type": "string",
  "example": "Unauthorized"
}
```

### 403

The API key has READ scope; this operation needs WRITE

**application/json**

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

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "INSUFFICIENT_SCOPE"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 404

User not found

**application/json**

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

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "USER_NOT_FOUND"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 409

Deletion blocked because this user is a purchaser on at least one order and no other eligible purchaser exists in the company.

**application/json**

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

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "USER_DELETE_BLOCKED"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 429

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

**text/plain**

```json
{
  "type": "string",
  "example": "Too many requests, please try again later."
}
```

### 500

Unexpected server error

**application/json**

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

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "enum": [
        "INTERNAL_ERROR"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 503

Rate limiting is temporarily unavailable; retry with backoff

**application/json**

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

```json
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  },
  "required": [
    "message"
  ]
}
```

## Security

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

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

---

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