---
title: "Deactivate a user's account."
method: POST
path: "/_matrix/client/v3/account/deactivate"
tags: ["Account management"]
---

# Deactivate a user's account.

`POST /_matrix/client/v3/account/deactivate`

## Request

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

Deactivate the user's account, removing all ability for the user to
login again.

This API endpoint uses the [User-Interactive Authentication API](https://spec.matrix.org/v1.19/client-server-api/#user-interactive-authentication-api).

An access token should be submitted to this endpoint if the client has
an active session.

The homeserver may change the flows available depending on whether a
valid access token is provided.

Unlike other endpoints, this endpoint does not take an `id_access_token`
parameter because the homeserver is expected to sign the request to the
identity server instead.

**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, and MAY use the `action=org.matrix.account_deactivate`
parameter.

## 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)).
  - `erase` boolean: Whether the user would like their content to be erased as much as possible from the server. Erasure means that any users (or servers) which join the room after the erasure request are served redacted copies of the events sent by this account. Users which had visibility on those events prior to the erasure are still able to see unredacted copies. No redactions are sent and the erasure request is not shared over federation, so other servers might still serve unredacted copies. The server should additionally erase any non-event data associated with the user, such as [account data](https://spec.matrix.org/v1.19/client-server-api/#client-config) and [contact 3PIDs](https://spec.matrix.org/v1.19/client-server-api/#adding-account-administrative-contact-information). Defaults to `false` if not present.
  - `id_server` string: The identity server to unbind all of the user's 3PIDs from. If not provided, the homeserver MUST use the `id_server` that was originally use to bind each identifier. If the homeserver does not know which `id_server` that was, it must return an `id_server_unbind_result` of `no-support`.

## Response `200`

The account has been deactivated.

- object
  - `id_server_unbind_result` 'success' | 'no-support', required: An indicator as to whether or not the homeserver was able to unbind the user's 3PIDs from the identity server(s). `success` indicates that all identifiers have been unbound from the identity server while `no-support` indicates that one or more identifiers failed to unbind due to the identity server refusing the request or the homeserver being unable to determine an identity server to unbind from. This must be `success` if the homeserver has no identifiers to unbind for the user.

## Other responses

- `401`: The homeserver requires additional authentication information.
- `429`: This request was rate-limited.

---

[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)
