> For AI agents: the complete documentation index is available at [llms.txt](https://docs.snaptrade.com/llms.txt). Markdown versions of documentation pages are available by appending .md to the URL path.

# Delete user

DELETE https://api.snaptrade.com/snapTrade/deleteUser

Deletes a registered user and all associated data. This action is irreversible. This API is asynchronous and will return a 200 status code if the request is accepted. The user and all associated data will be queued for deletion. Once deleted, a `USER_DELETED` webhook will be sent.

Reference: https://docs.snaptrade.com/reference/Authentication/Authentication_deleteSnapTradeUser

## Code Examples

### TypeScript

```typescript

import { Snaptrade } from "snaptrade-typescript-sdk";

const snaptrade = new Snaptrade({
  clientId: "PARTNER_CLIENT_ID",
  consumerKey: "CONSUMER_KEY",
});

const response =
  await snaptrade.authentication.deleteSnapTradeUser(
    { userId: "snaptrade-user-123" },
  );
console.log(response.data);

```

### Python

```python

from pprint import pprint
from snaptrade_client import SnapTrade

snaptrade = SnapTrade(
    client_id="PARTNER_CLIENT_ID",
    consumer_key="CONSUMER_KEY"
)

response = snaptrade.authentication.delete_snap_trade_user(
    user_id="snaptrade-user-123"
)
pprint(response.body)

```

## OpenAPI Specification

```yaml

openapi: 3.0.0
info:
  description: Connect brokerage accounts to your app for live positions and trading
  version: 1.0.0
  title: SnapTrade
  termsOfService: N/A
  contact:
    email: api@snaptrade.com
  x-konfig-ignore:
    potential-incorrect-type: true
  x-readme:
    explorer-enabled: false
paths:
  /snapTrade/deleteUser:
    delete:
      tags:
        - Authentication
      summary: Delete user
      operationId: Authentication_deleteSnapTradeUser
      description: >-
        Deletes a registered user and all associated data. This action is
        irreversible. This API is asynchronous and will return a 200 status code
        if the request is accepted. The user and all associated data will be
        queued for deletion. Once deleted, a `USER_DELETED` webhook will be
        sent.
      parameters:
        - in: query
          required: true
          name: userId
          schema:
            description: >-
              SnapTrade User ID. This is chosen by the API partner and can be
              any string that is a) unique to the user, and b) immutable for the
              user. It is recommended to NOT use email addresses for this
              property because they are usually not immutable.
            type: string
            example: snaptrade-user-123
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    description: >-
                      This is always `deleted` when a user is queued for
                      deletion.
                    type: string
                    example: deleted
                  detail:
                    description: Human friendly message about the deletion status.
                    type: string
                    example: >-
                      User queued for deletion; please wait for webhook for
                      confirmation.
                  userId:
                    description: >-
                      SnapTrade User ID. This is chosen by the API partner and
                      can be any string that is a) unique to the user, and b)
                      immutable for the user. It is recommended to NOT use email
                      addresses for this property because they are usually not
                      immutable.
                    type: string
                    example: snaptrade-user-123
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                description: Example for failed request response
                type: object
                properties:
                  default_detail:
                    example: Unable to verify data sent
                  default_code:
                    example: 1076
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                description: Example for failed request response
                type: object
                properties:
                  default_detail:
                    example: User does not have permission to access this resource
                  default_code:
                    example: 1066
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                description: Example for failed request response
                type: object
                properties:
                  default_detail:
                    example: The requested resource does not exist.
                  default_code:
                    example: 1011
        '500':
          description: Unexpected Error

```