# Create external devices (batch)

**POST** `/devices`

## Request body

**application/json**

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

```json
{
  "type": "object",
  "properties": {
    "devices": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "type": "string",
            "minLength": 1
          },
          "category": {
            "type": "string",
            "minLength": 1
          },
          "user_id": {
            "type": "integer",
            "minimum": 0,
            "exclusiveMinimum": true
          },
          "added_via": {
            "type": "string",
            "enum": [
              "MASS_IMPORT",
              "SINGLE_IMPORT",
              "ONBOARDING"
            ],
            "description": "How the device was added in Fleet",
            "example": "SINGLE_IMPORT"
          },
          "brand": {
            "type": "string"
          },
          "serial_number": {
            "type": "string"
          },
          "is_rented": {
            "type": "boolean",
            "default": false
          },
          "client_purchase_price": {
            "type": "string"
          },
          "client_purchase_date": {
            "type": "string"
          },
          "client_warranty_endDate": {
            "type": "string"
          },
          "client_rental_price": {
            "type": "string"
          },
          "client_rental_startDate": {
            "type": "string"
          },
          "client_rental_endDate": {
            "type": "string"
          },
          "client_contract_number": {
            "type": "string"
          },
          "client_invoice_number": {
            "type": "string"
          },
          "screen_size": {
            "type": "string"
          },
          "graphic": {
            "type": "string"
          },
          "processor": {
            "type": "string"
          },
          "ram": {
            "type": "string"
          },
          "storage": {
            "type": "string"
          },
          "model_year": {
            "type": "string"
          },
          "connectivity": {
            "type": "string"
          },
          "keyboard_layout": {
            "type": "string",
            "enum": [
              "FRENCH_AZERTY",
              "SPANISH_QWERTY",
              "ITALIAN_QWERTY",
              "INTERNATIONAL_ENGLISH_QWERTY",
              "GERMAN_QWERTZ",
              "PORTUGUESE_QWERTY",
              "ENGLISH_QWERTY",
              "SWISS_QWERTZ",
              "AMERICAN_ENGLISH_QWERTY",
              "CANADIAN_ENGLISH_QWERTY",
              "DUTCH_QWERTY"
            ],
            "description": "Keyboard layout key (same enum as cart/order `keyboard_layout`).",
            "example": "FRENCH_AZERTY"
          },
          "resolution": {
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "has_microphone": {
            "type": "boolean",
            "nullable": true
          },
          "has_webcam": {
            "type": "boolean",
            "nullable": true
          },
          "noise_cancellation": {
            "type": "boolean",
            "nullable": true
          },
          "compliance": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "string"
              },
              {
                "nullable": true
              }
            ],
            "description": "Compliance labels"
          },
          "connection_type": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "string"
            },
            "description": "Connection type labels; single string or array (stored as array)."
          },
          "has_stool": {
            "type": "boolean",
            "nullable": true
          },
          "has_video_package": {
            "type": "boolean",
            "nullable": true
          },
          "has_screen": {
            "type": "boolean",
            "nullable": true
          },
          "has_premium_tablet": {
            "type": "boolean",
            "nullable": true
          },
          "color": {
            "type": "string"
          },
          "seats_number": {
            "type": "string"
          },
          "assembly": {
            "type": "string"
          },
          "os_platform": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "type",
          "category"
        ]
      },
      "minItems": 1
    }
  },
  "required": [
    "devices"
  ]
}
```

## Responses

### 201

Devices created

**application/json**

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

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "devices": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string",
                "nullable": true
              },
              "serial_number": {
                "type": "string",
                "nullable": true
              },
              "rent": {
                "type": "string",
                "nullable": true
              },
              "tracking_number": {
                "type": "string",
                "nullable": true
              },
              "client_status": {
                "type": "string",
                "enum": [
                  "ARCHIVED",
                  "PENDING_VALIDATION",
                  "IN_PREPARATION",
                  "DELIVERED",
                  "SHIPPED",
                  "AVAILABLE",
                  "IN_SERVICE",
                  "IN_MAINTENANCE",
                  "OUT_OF_SERVICE"
                ],
                "description": "Device progress key for display and filtering"
              },
              "type": {
                "type": "string",
                "nullable": true
              },
              "category": {
                "type": "string",
                "nullable": true
              },
              "source": {
                "type": "string",
                "nullable": true
              },
              "comment": {
                "type": "string",
                "nullable": true,
                "description": "Free-form device comment"
              },
              "characteristics": {
                "type": "object",
                "properties": {
                  "screen_size": {
                    "type": "string",
                    "nullable": true
                  },
                  "graphic": {
                    "type": "string",
                    "nullable": true
                  },
                  "processor": {
                    "type": "string",
                    "nullable": true
                  },
                  "ram": {
                    "type": "string",
                    "nullable": true
                  },
                  "storage": {
                    "type": "string",
                    "nullable": true
                  },
                  "model_year": {
                    "type": "string",
                    "nullable": true
                  },
                  "connectivity": {
                    "type": "string",
                    "nullable": true
                  },
                  "keyboard_layout": {
                    "type": "string",
                    "nullable": true,
                    "enum": [
                      "FRENCH_AZERTY",
                      "SPANISH_QWERTY",
                      "ITALIAN_QWERTY",
                      "INTERNATIONAL_ENGLISH_QWERTY",
                      "GERMAN_QWERTZ",
                      "PORTUGUESE_QWERTY",
                      "ENGLISH_QWERTY",
                      "SWISS_QWERTZ",
                      "AMERICAN_ENGLISH_QWERTY",
                      "CANADIAN_ENGLISH_QWERTY",
                      "DUTCH_QWERTY"
                    ],
                    "description": "Keyboard layout for delivery pricing (maps to Fleet keyboard_layouts.type)",
                    "example": "FRENCH_AZERTY"
                  },
                  "resolution": {
                    "type": "string",
                    "nullable": true
                  },
                  "has_microphone": {
                    "type": "boolean",
                    "nullable": true
                  },
                  "has_webcam": {
                    "type": "boolean",
                    "nullable": true
                  },
                  "noise_cancellation": {
                    "type": "boolean",
                    "nullable": true
                  },
                  "compliance": {
                    "type": "array",
                    "nullable": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "connection_type": {
                    "type": "array",
                    "nullable": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "has_stool": {
                    "type": "boolean",
                    "nullable": true
                  },
                  "has_video_package": {
                    "type": "boolean",
                    "nullable": true
                  },
                  "has_screen": {
                    "type": "boolean",
                    "nullable": true
                  },
                  "has_premium_tablet": {
                    "type": "boolean",
                    "nullable": true
                  },
                  "color": {
                    "type": "string",
                    "nullable": true
                  },
                  "seats_number": {
                    "type": "string",
                    "nullable": true
                  },
                  "assembly": {
                    "type": "string",
                    "nullable": true
                  },
                  "os_platform": {
                    "type": "string",
                    "nullable": true
                  }
                },
                "required": [
                  "screen_size",
                  "graphic",
                  "processor",
                  "ram",
                  "storage",
                  "model_year",
                  "connectivity",
                  "keyboard_layout",
                  "resolution",
                  "has_microphone",
                  "has_webcam",
                  "noise_cancellation",
                  "compliance",
                  "connection_type",
                  "has_stool",
                  "has_video_package",
                  "has_screen",
                  "has_premium_tablet",
                  "color",
                  "seats_number",
                  "assembly",
                  "os_platform"
                ]
              },
              "mdm": {
                "type": "object",
                "nullable": true,
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "DRAFT",
                      "SUBSCRIBED",
                      "DOWNLOADED",
                      "IDENTIFIED",
                      "ENROLLMENT_IN_PROGRESS",
                      "ENROLLED",
                      "UNENROLLED",
                      "DEVICE_WIPE_PENDING"
                    ],
                    "description": "Raw MDM enrollment status from `devices_mdm`. `DRAFT` rows are omitted by the device relation; other values match DB enum."
                  },
                  "local_name": {
                    "type": "string",
                    "nullable": true
                  },
                  "is_locked": {
                    "type": "boolean",
                    "nullable": true
                  },
                  "lock_date": {
                    "type": "string",
                    "nullable": true
                  },
                  "firewall_enabled": {
                    "type": "boolean",
                    "nullable": true
                  },
                  "os_updates_enabled": {
                    "type": "boolean",
                    "nullable": true
                  },
                  "is_encrypted": {
                    "type": "boolean",
                    "nullable": true
                  },
                  "screenlock_enabled": {
                    "type": "boolean",
                    "nullable": true
                  },
                  "is_compromised": {
                    "type": "boolean",
                    "nullable": true
                  },
                  "os_updates_available": {
                    "type": "boolean",
                    "nullable": true
                  },
                  "disk_encryption_profile_installed": {
                    "type": "boolean",
                    "nullable": true
                  },
                  "enrollment_date": {
                    "type": "string",
                    "nullable": true
                  },
                  "unenrollment_date": {
                    "type": "string",
                    "nullable": true
                  },
                  "download_date": {
                    "type": "string",
                    "nullable": true
                  },
                  "last_seen_date": {
                    "type": "string",
                    "nullable": true
                  },
                  "last_sync_date": {
                    "type": "string",
                    "nullable": true
                  }
                },
                "required": [
                  "id",
                  "status",
                  "local_name",
                  "is_locked",
                  "lock_date",
                  "firewall_enabled",
                  "os_updates_enabled",
                  "is_encrypted",
                  "screenlock_enabled",
                  "is_compromised",
                  "os_updates_available",
                  "disk_encryption_profile_installed",
                  "enrollment_date",
                  "unenrollment_date",
                  "download_date",
                  "last_seen_date",
                  "last_sync_date"
                ],
                "description": "MDM enrollment row when present (non-deleted, non-DRAFT); null otherwise"
              }
            },
            "required": [
              "id",
              "name",
              "serial_number",
              "rent",
              "tracking_number",
              "client_status",
              "type",
              "category",
              "source",
              "comment",
              "characteristics",
              "mdm"
            ]
          }
        }
      },
      "required": [
        "devices"
      ]
    }
  },
  "required": [
    "data"
  ]
}
```

### 400

Validation or business rule error

**application/json**

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

```json
{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        }
      },
      "required": [
        "error"
      ]
    },
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string",
          "enum": [
            "INVALID_SERIAL_NUMBER",
            "INVALID_USER",
            "KEYBOARD_LAYOUT_REQUIRED"
          ]
        }
      },
      "required": [
        "error"
      ]
    }
  ]
}
```

### 403

Forbidden

**application/json**

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

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

### 404

Not found

**application/json**

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

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

### 500

Internal error

**application/json**

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

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

## Security

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

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

---

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