On this page

Delete users

Permanently remove a user from App Context storage with Delete() or DeleteUser().

Both methods produce the same result. Call Delete() on a User object or DeleteUser() on the Chat object with the user ID.

Soft delete deprecated

Soft deletion for users has been deprecated. Delete() now always performs a hard delete. Use Delete() without any parameters to permanently remove a user. The soft parameter and Restore() method are no longer available for users.

Requires App Context

Enable App Context in the Admin Portal to store user data.

Method signature

These methods take the following parameters:

  • Delete() (on the User object)

    1user.Delete()
  • DeleteUser() (on the Chat object)

    1chat.DeleteUser(string userId)

Input

ParameterRequired in Delete()Required in DeleteUser()Description
userId
Type: string
Default:
n/a
No
Yes
Unique user identifier (up to 92 UTF-8 characters).

Output

TypeDescription
Task<ChatOperationResult>
Returned Task that you can await to get the result of the delete operation.

Sample code

Permanently delete user support_agent_15.

  • Delete() (on the User object)

    1
    
  • DeleteUser() (on the Chat object)

    1
    
Last updated on