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

# Delete Account

> Permanently deletes the authenticated user's account and all associated data. This action cannot be undone. The user must be authenticated to delete their account.

## Overview

This endpoint permanently deletes the authenticated user's account and all associated data from the platform. This action is irreversible and will:

* Delete the user's Firebase Authentication account
* Remove all user data from Firestore (bookings, availability, gallery, etc.)
* Clear the user's session cookie
* Permanently remove all associated records

## Important Notes

<Warning>
  **This action cannot be undone.** Once an account is deleted, all data is
  permanently removed and cannot be recovered.
</Warning>

<Info>
  * The user must be authenticated to delete their account - The operation can
    take up to 5 minutes to complete - All user data including bookings, messages,
    and gallery photos will be deleted - The session cookie will be cleared
    automatically after successful deletion
</Info>

## Use Cases

* User wants to permanently close their account
* Privacy compliance (GDPR right to erasure)
* Account cleanup after testing

## Security

* Requires valid authentication session
* Only the authenticated user can delete their own account
* Session cookie is cleared after successful deletion

## Future Considerations

In future implementations, this endpoint may check for:

* Active subscriptions that need to be cancelled first
* Pending bookings that need to be resolved
* Outstanding payments or refunds


## OpenAPI

````yaml DELETE /auth/delete-account
openapi: 3.1.0
info:
  title: Tatu API
  description: API documentation for Tatu's booking and artist management system
  version: 1.0.0
servers:
  - url: http://localhost:3000/api
    description: Development server
security: []
paths:
  /auth/delete-account:
    delete:
      summary: Delete Account
      description: >-
        Permanently deletes the authenticated user's account and all associated
        data. This action cannot be undone. The user must be authenticated to
        delete their account.
      responses:
        '200':
          description: Account deleted successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - message
                properties:
                  success:
                    type: boolean
                    description: Whether the operation was successful
                  message:
                    type: string
                    description: Confirmation message
                    example: Account successfully deleted
          headers:
            Set-Cookie:
              schema:
                type: string
                description: Session cookie cleared (Max-Age=0)
        '401':
          description: Unauthorized - No active session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '405':
          description: Method not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server error - Failed to delete account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string

````