# Device Config

## Get Workspace Default Config

Returns the workspace-level default device configuration. This is the base default config with the workspace's config patch (if any) merged in. Use it as a template when provisioning a new device before calling `POST /:workspace/devices/v2`.

**Required scope:** `device:read`

{% hint style="info" %}
This is a workspace-wide endpoint. Device-scoped API keys will receive **403** since there is no `:deviceId` in the path.
{% endhint %}

### Example Request

```bash
curl "https://api.roboflow.com/{workspace}/devices/v2/default-config?api_key=$ROBOFLOW_API_KEY"
```

### Example Response

```json
{
  "config": {
    "version": "1.0.0",
    "config": {
      "inference": { "confidence": 0.7, "threshold": 0.3 },
      "device_type": "edge"
    },
    "services": {}
  },
  "patch": {
    "config": {
      "inference": { "confidence": 0.7 }
    }
  }
}
```

* `config` -- the merged result (base default + workspace patch).
* `patch` -- the workspace's stored patch. Empty object `{}` if the workspace has no custom patch.

## Get Config

Returns the device's current runtime configuration. The response shape mirrors the Roboflow Device Manager (RFDM) config spec.

**Required scope:** `device:read`

{% openapi src="/files/qJPD2mHy2OK1cmpxNjKJ" path="/{workspace}/devices/v2/{deviceId}/config" method="get" %}
[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 "https://api.roboflow.com/{workspace}/devices/v2/{deviceId}/config?api_key=$ROBOFLOW_API_KEY"
```

The response is the full configuration document and includes (but is not limited to) the following top-level fields:

* `device_id`, `device_name`
* `workspace_id`
* `version`, `last_updated`, `last_updated_at`, `created_at`
* `config` (the device's runtime config tree, including `device_type`, `stream`, and `offline_mode`)
* `services` (per-service container definitions including `image`, `volumes`, and `environment_variables`)
* `environment_variables` (top-level environment variables, in addition to the per-service ones inside `services`)
* `production_mode`, `last_automatic_update`, `updated`, `updated_by`, `$schema`, `id`

Additional fields written by RFDM may also appear. Treat the response shape as open-ended and only depend on the fields you need.

Returns **404** if the device does not exist or does not belong to your workspace, or if no configuration is stored for it.

{% hint style="warning" %}
The response includes the full configuration as authored. Per-service `environment_variables` and any integration credentials embedded in the config are returned unredacted. Treat the response body as sensitive and do not log it in plaintext.
{% endhint %}

## Config History

List prior configuration revisions for a device, newest first.

**Required scope:** `device:read`

{% openapi src="/files/qJPD2mHy2OK1cmpxNjKJ" path="/{workspace}/devices/v2/{deviceId}/config/history" method="get" %}
[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 "https://api.roboflow.com/{workspace}/devices/v2/{deviceId}/config/history?api_key=$ROBOFLOW_API_KEY&limit=10"
```

### Example Response

```json
{
  "data": [
    {
      "revision_id": "rev_abc",
      "created_at": "2026-04-20T14:30:00.000Z",
      "created_by": "user_123"
    }
  ],
  "pagination": {
    "next_cursor": "...",
    "has_more": true,
    "limit": 10
  }
}
```

A malformed `cursor` returns **400** with `{"error": "Invalid cursor format"}`.


---

# 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/device-config.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.
