---
title: "Deactivate user"
method: POST
path: "/users/{user_id}/deactivate"
tags: ["product:chat"]
---

# Deactivate user

`POST /users/{user_id}/deactivate`

Deactivates user with possibility to activate it back

Sends events:
- user.deactivated

## Path parameters

- `user_id` string, required

## Request body

- DeactivateUserRequest, nullable
  - `created_by_id` string — ID of the user who deactivated the user
  - `mark_messages_deleted` boolean — Makes messages appear to be deleted

## Response `201`

Successful response

- DeactivateUserResponse, nullable
  - `duration` string, required — Duration of the request in milliseconds
  - `user` UserResponse — User response object
    - `avg_response_time` integer
    - `ban_expires` string, date-time — Date when ban expires
    - `banned` boolean, required — Whether a user is banned or not
    - `blocked_user_ids` string[], required
    - `bypass_moderation` boolean
    - `created_at` string, date-time, required — Date/time of creation
    - `custom` object, required — Custom data for this object
    - `deactivated_at` string, date-time — Date of deactivation
    - `deleted_at` string, date-time — Date/time of deletion
    - `devices` DeviceResponse[] — List of devices user is using
      - `created_at` string, date-time, required — Date/time of creation
      - `disabled` boolean — Whether device is disabled or not
      - `disabled_reason` string — Reason explaining why device had been disabled
      - `hardware_id` string — Stable physical device identifier used to deduplicate pushes across push providers
      - `id` string, required — Device ID
      - `push_provider` string, required — Push provider
      - `push_provider_name` string — Push provider name
      - `user_id` string, required — User ID
      - `voip` boolean — When true the token is for Apple VoIP push notifications
    - `id` string, required — Unique user identifier
    - `image` string
    - `invisible` boolean, required
    - `language` string, required — Preferred language of a user
    - `last_active` string, date-time — Date of last activity
    - `name` string — Optional name of user
    - `online` boolean, required — Whether a user online or not
    - `privacy_settings` PrivacySettingsResponse
      - `delivery_receipts` DeliveryReceiptsResponse
        - `enabled` boolean
      - `read_receipts` ReadReceiptsResponse
        - `enabled` boolean
      - `typing_indicators` TypingIndicatorsResponse
        - `enabled` boolean
    - `push_notifications` PushNotificationSettingsResponse
      - `disabled` boolean
      - `disabled_until` string, date-time
    - `revoke_tokens_issued_before` string, date-time — Revocation date for tokens
    - `role` string, required — Determines the set of user permissions
    - `shadow_banned` boolean, required — Whether a user is shadow banned
    - `teams` string[], required — List of teams user is a part of
    - `teams_role` object
    - `updated_at` string, date-time, required — Date/time of the last update

## Other responses

- `400` — Bad request
- `429` — Too many requests

---

[API](https://skmtc.net/getstream/apis/stream-api.md) · [All operations](https://skmtc.net/getstream/apis/stream-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getstream/stream-api/versions/509a44ead023/schema)
