# Create a Device

Create a new device in your workspace and return the identifiers needed to install it. Device-scoped API keys cannot call this endpoint and receive **403**.

**Required scope:** `device:update`

{% openapi src="/files/qJPD2mHy2OK1cmpxNjKJ" path="/{workspace}/devices/v2" method="post" %}
[deployment-manager.yaml](https://1284666567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe5GEiPeDoFksvZv1vH3A%2Fuploads%2Fgit-blob-d9842382ea00557904abc587230b904ebf240466%2Fdeployment-manager.yaml?alt=media)
{% endopenapi %}

### Example Request

```bash
curl -X POST "https://api.roboflow.com/{workspace}/devices/v2?api_key=$ROBOFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"device_name": "factory-floor-cam-2", "device_type": "edge"}'
```

### Example Response

```json
{
  "deviceId": "abc456",
  "installId": "inst_xyz789"
}
```

Use the returned `installId` to bootstrap the device with the Roboflow Device Manager installer.

### Notes on AI1 devices

* Setting `device_type` to `"ai1"` requires the workspace to have the `deviceAio` feature enabled, otherwise the request returns **403**.
* `offline_mode` is only valid for AI1 devices on workspaces with `roboflowLiteMode`. Other combinations return **400** or **403**.
* For AI1 devices that are not duplicating an existing device and do not specify a `workflow_id`, the slugified `device_name` must contain at least one alphanumeric character, otherwise the request returns **400**.
* When AI1 + offline mode applies, the response also includes an `offlineProvisioningQrPayload` field encoding the QR payload for offline provisioning.

### Notes on duplication

When `sourceDeviceId` is supplied, the new device is created from a copy of the source device's config. The source device must belong to the same workspace as the request, otherwise the request returns **403**. A non-existent `sourceDeviceId` returns **404**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.roboflow.com/developer/rest-api/deployment-manager/create-a-device.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
