---
source_url: https://www.pubnub.com/docs/chat/chat-sdk/build/features/users/delete
title: Delete users
updated_at: 2026-05-25T11:25:04.884Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Delete users

Remove users permanently with `delete()` or `deleteUser()`.

* `delete()` - call on a `User` object (no ID needed)
* `deleteUser()` - call on a `Chat` object (requires user ID)

:::note Requires App Context
Enable [App Context](https://youtu.be/9UEoSlngpYI) in the [Admin Portal](https://admin.pubnub.com/) to store user data.
:::

### Method signature

##### Under the hood

`delete()` and `deleteUser()` call PubNub App Context API and the JavaScript SDK [removeUUIDMetadata()](https://www.pubnub.com/docs/sdks/javascript/api-reference/objects#remove-user-metadata) method.

These methods take the following parameters:

* delete() 1user.delete(): Promise<true>
* deleteUser() 1chat.deleteUser(id: string): Promise<true>

#### Input

| Parameter | Required in delete() | Required in deleteUser() | Description |
| --- | --- | --- | --- |
| id | string | Optional |  | No | Yes | [Unique user identifier](https://www.pubnub.com/docs/general/setup/users-and-devices#user-id-usage) (up to 92 UTF-8 characters). |

#### Output

| Type | Description |
| --- | --- |
| `Promise<true>` | For `delete()`, a confirmation that the user metadata was permanently deleted. |
| `Promise<true>` | For `deleteUser()`, a confirmation that the user metadata was permanently deleted. |

#### Errors

Whenever the user ID is obligatory, and you try to delete a user without providing their ID, you will receive the `ID is required` error.

### Sample code

Permanently delete user `support_agent_15`.

* delete() 1// reference the "user" object2const user = await chat.getUser("support_agent_15")3// permanently delete the user4await user.delete()
* deleteUser() 1// reference the "chat" object and invoke the "deleteUser()" method2const user = await chat.deleteUser("support_agent_15")