---
title: "Delete a device"
method: DELETE
path: "/_matrix/client/v3/devices/{deviceId}"
tags: ["Device management"]
---

# Delete a device

`DELETE /_matrix/client/v3/devices/{deviceId}`

## Request

- Base URL: `https://matrix.org`
- URL: `https://matrix.org/_matrix/client/v3/devices/{deviceId}`
- Auth: one of:
  - API key in query parameter `access_token`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/matrix/apis/matrix-client-server-api/docs/_matrix/client/v3/devices/:deviceId/delete.ts> (a function with typed inputs; its response is checked against the schema)

This API endpoint uses the [User-Interactive Authentication API](https://spec.matrix.org/v1.19/client-server-api/#user-interactive-authentication-api),
except when used by an application service.

Deletes the given device, and invalidates any access token associated with it.

**WARNING:** 
When this endpoint requires User-Interactive Authentication, it cannot be used when the access token was obtained
via the [OAuth 2.0 API](https://spec.matrix.org/v1.19/client-server-api/#oauth-20-api).


**WARNING:** 
**[Added in `v1.18`]**  [OAuth 2.0 aware clients](https://spec.matrix.org/v1.19/client-server-api/#oauth-20-aware-clients)
MUST NOT use this endpoint when the server supports the [OAuth 2.0 API](https://spec.matrix.org/v1.19/client-server-api/#oauth-20-api).
Instead they MUST refer the user to the [account management URL](https://spec.matrix.org/v1.19/client-server-api/#oauth-20-account-management),
if available, with the `action=org.matrix.device_delete` and `device_id={deviceId}` parameters.

## Path parameters

- `deviceId` string, required

## Request body

- object
  - `auth` object: Used by clients to submit authentication information to the interactive-authentication API
    - `session` string: The value of the session key given by the homeserver.
    - `type` string: The authentication type that the client is attempting to complete. May be omitted if `session` is given, and the client is reissuing a request which it believes has been completed out-of-band (for example, via the [fallback mechanism](https://spec.matrix.org/v1.19/client-server-api/#fallback)).

## Response `200`

The device was successfully removed, or had been removed
previously.

- object

## Other responses

- `401`: The homeserver requires additional authentication information.

---

[API](https://skmtc.dev/matrix/apis/matrix-client-server-api.md) - [All operations](https://skmtc.dev/matrix/apis/matrix-client-server-api/llms.txt) - [OpenAPI document](https://skmtc.dev/matrix/apis/matrix-client-server-api/revisions/c7fe4072c681?raw)
