---
title: "Unlink a device – Superbot API"
canonical_url: "https://superbot.gg/developers/devices/deleteDevice"
summary: "Sign the device out: its tokens and the caller keys it minted are revoked. The caller's own device answers 409 `own_device` (sign out from that device instead)."
---

> Markdown of https://superbot.gg/developers/devices/deleteDevice. Site index: /llms.txt.

# Unlink a device

`DELETE /v1/devices/{device_id}`

Sign the device out: its tokens and the caller keys it minted are revoked. The caller's own device answers 409 `own_device` (sign out from that device instead).

- Operation id: `deleteDevice`
- Group: [Devices](https://superbot.gg/developers/devices.md)
- Auth: A caller key holding `devices:write` (`Authorization: Bearer sbc_…` or `x-api-key: sbc_…`), or a signed-in session.
- Scopes: `devices:write`

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `device_id` | string | required | The device id (a Device `id`). |

## Response 200

The device was unlinked.

`application/json`: DeletedDevice.

- `id` (string, required)
- `object` (string, required): One of `device`.
- `deleted` (boolean, required): One of `true`.
- `agent_unlink` (AgentUnlink): What unlinking an agent computer did, and the credentials to rotate at the source.
  - `device_id` (string, required)
  - `reason` (string, required): One of `user`, `revoked`, `link_idle`.
  - `cancelled` (object, required)
    - `jobs` (integer, required)
    - `terminals` (integer, required)
    - `loci` (integer, required)
    - `prompts` (integer, required)
    - `pair_requests` (integer, required)
    - `live_sessions` (integer, required)
    - `automations` (integer, required)
  - `key` (object, required)
    - `holder_removed` (boolean, required)
    - `factor_wraps_removed` (integer, required)
    - `rotation` (string, required): One of `enqueued`, `no_holder_device`, `not_needed`.
  - `rotate_at_source` (array of object, required)
    - `kind` (string, required)
    - `adapter` (string, required)
    - `label` (string | null, required)
    - `class` (string, required)

## Errors

Every refusal carries `error`, `message`, `doc_url` and `request_id`; the gateway routes answer in the dialect you dialed.

| Status | Codes | When |
| --- | --- | --- |
| 400 | [`invalid_request`](https://superbot.gg/developers#errors-invalid_request) | The request is malformed or a parameter is invalid; `param` names the field. |
| 401 | [`unauthorized`](https://superbot.gg/developers#errors-unauthorized) | The bearer is missing, malformed or unknown. |
| 403 | [`insufficient_scope`](https://superbot.gg/developers#errors-insufficient_scope) | The key lacks a scope (insufficient_scope), is revoked, or may not call this route. |
| 404 | [`not_found`](https://superbot.gg/developers#errors-not_found) | No such resource on this account. |
| 409 | [`conflict`](https://superbot.gg/developers#errors-conflict) | The resource is not in a state that allows this change. |
| 429 | [`rate_limited`](https://superbot.gg/developers#errors-rate_limited) | Over the per-key request bucket; retry after x-ratelimit-reset. |

## Examples

```sh
curl -sS -X DELETE "https://superbot.gg/v1/devices/$DEVICE_ID" \
  -H "Authorization: Bearer $SUPERBOT_API_KEY"
```

```js
const deviceId = 'DEVICE_ID';
const res = await fetch(`https://superbot.gg/v1/devices/${deviceId}`, {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.SUPERBOT_API_KEY}`,
  },
});
console.log(res.status, await res.json());
```

```python
import os
import requests

device_id = "DEVICE_ID"
res = requests.request(
    "DELETE",
    f"https://superbot.gg/v1/devices/{device_id}",
    headers={
        "Authorization": f"Bearer {os.environ['SUPERBOT_API_KEY']}",
    },
)
print(res.status_code, res.json())
```
