> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wealthyhood.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete test user

> Delete a test user by email address. Useful for cleaning up test data.

<Warning>
  These test endpoints are **only available in development and staging environments**. They are disabled in production for security reasons.
</Warning>

Delete a test user account by email address. This endpoint is useful for cleaning up test data after running test scenarios.

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE 'https://api.sandbox.wealthyhood.com/test/users' \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer YOUR_M2M_TOKEN' \
    -d '{
      "email": "test.user@example.com"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.sandbox.wealthyhood.com/test/users', {
    method: 'DELETE',
    headers: {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    },
    body: JSON.stringify({
      email: 'test.user@example.com'
    })
  });

  if (response.ok) {
    console.log('User deleted successfully');
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Success (200) theme={null}
  (No response body)
  ```
</ResponseExample>

## Request body

<ParamField body="email" type="string" required>
  Email address of the test user to delete. Must match an existing user in the system.
</ParamField>

<Tip>
  Use this endpoint to clean up test users after completing your test scenarios to keep your sandbox environment tidy.
</Tip>


## OpenAPI

````yaml DELETE /test/users
openapi: 3.0.3
info:
  title: Wealthyhood Test API
  version: 1.0.0
  description: >
    Test endpoints for sandbox environments. These endpoints allow you to create
    test users, simulate deposits,

    send test app notifications, and manage test data.


    **Important**: These endpoints are only available in development and staging
    environments. They are disabled in production for security reasons.


    All requests require a bearer token.
servers:
  - url: https://{host}
    variables:
      host:
        default: api.sandbox.wealthyhood.com
        description: Wealthyhood API host name (sandbox environment).
security:
  - bearerAuth: []
tags:
  - name: Test
    description: Test endpoints for sandbox environments.
paths:
  /test/users:
    delete:
      tags:
        - Test
      summary: Delete test user
      description: >-
        Delete a test user account by email address. Useful for cleaning up test
        data.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  format: email
                  description: Email address of the test user to delete
                  example: test.user@example.com
      responses:
        '200':
          description: User deleted successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
components:
  responses:
    BadRequestError:
      description: Bad request – invalid parameters or malformed request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Invalid amount
            code: BAD_REQUEST
    UnauthorizedError:
      description: Unauthorized – missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Authentication required
            code: UNAUTHORIZED
    ForbiddenError:
      description: >-
        Forbidden – valid credentials but insufficient permissions or endpoint
        not available in this environment.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Endpoint not available in production
            code: FORBIDDEN
  schemas:
    Error:
      type: object
      required:
        - message
        - code
      properties:
        message:
          type: string
          example: Invalid amount
        code:
          type: string
          example: BAD_REQUEST
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````