---
title: "Set the suspended status of a particular user."
method: PUT
path: "/_matrix/client/v1/admin/suspend/{userId}"
tags: ["Server administration"]
---

# Set the suspended status of a particular user.

`PUT /_matrix/client/v1/admin/suspend/{userId}`

## Request

- Base URL: `https://matrix.org`
- URL: `https://matrix.org/_matrix/client/v1/admin/suspend/{userId}`
- 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/v1/admin/suspend/:userId/put.ts> (a function with typed inputs; its response is checked against the schema)

Sets the suspended status of a particular server-local user.

The user calling this endpoint MUST be a server admin. The client SHOULD check that the user
is allowed to suspend other users at the [`GET /capabilities`](https://spec.matrix.org/v1.19/client-server-api/#get_matrixclientv3capabilities)
endpoint prior to using this endpoint.

In order to prevent user enumeration, servers MUST ensure that authorisation is checked
prior to trying to do account lookups.

## Path parameters

- `userId` string, mx-user-id, required

## Request body

- object
  - `suspended` boolean, required: Whether to suspend the target account.

## Response `200`

The action was successful.

- object
  - `suspended` boolean, required: Whether the target account is suspended.

## Other responses

- `400`: The user ID does not belong to the local server. The errcode is `M_INVALID_PARAM`.
- `403`: The requesting user is not a server administrator, is trying to suspend their own account, or the target user is another administrator. The errcode is `M_FORBIDDEN`.
- `404`: The user ID is not found, or is deactivated. The errcode is `M_NOT_FOUND`.

---

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