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

# Delete user by token

> Removes all user records from the database, keeping only the user token for reference.
This fulfills the GDPR "right to be forgotten" requirement.
In the enterprise version, deletion can be delayed according to company policy.




## OpenAPI

````yaml /oss/api/openapi.yml delete /v1/user/token/{token}
openapi: 3.0.3
info:
  title: Databunker API
  description: >
    Databunker is a super-fast, open-source vault built with Go for secure
    storage of sensitive personal records.


    ## Authentication

    All API requests require authentication using the `X-Bunker-Token` header.
    This token is your root access token.


    ## Content Types

    The API supports the following content types for POST and PUT requests:

    - `application/json`

    - `application/x-www-form-urlencoded`


    ## User Tokens

    Keep the user `{token}` generated by Databunker private, as it serves as an
    additional user identifier.

    Under GDPR, this user token is referred to as a pseudonymized identity.


    For more details, visit: https://databunker.org/
  version: 1.0.0
  contact:
    name: Databunker Support
    url: https://databunker.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: http://localhost:3000
    description: Local development server
security:
  - ApiKeyAuth: []
tags:
  - name: User
    description: User personal information management
  - name: User App
    description: Additional user application data
  - name: Session
    description: Secure session storage
  - name: Consent
    description: User consent management
  - name: Agreement
    description: Agreement management
  - name: Request
    description: User privacy requests (GDPR)
  - name: Audit
    description: Audit log access
  - name: Expiration
    description: Data expiration and retention
  - name: System
    description: System administration
paths:
  /v1/user/token/{token}:
    delete:
      tags:
        - User
      summary: Delete user by token
      description: >
        Removes all user records from the database, keeping only the user token
        for reference.

        This fulfills the GDPR "right to be forgotten" requirement.

        In the enterprise version, deletion can be delayed according to company
        policy.
      operationId: deleteUserByToken
      parameters:
        - $ref: '#/components/parameters/UserToken'
      responses:
        '200':
          description: User deleted successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessResponse'
                  - type: object
                    properties:
                      result:
                        type: string
                        example: done
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    UserToken:
      name: token
      in: path
      required: true
      description: User token (UUID)
      schema:
        type: string
        format: uuid
      example: db80789b-0ad7-0690-035a-fd2c42531e87
  schemas:
    SuccessResponse:
      type: object
      required:
        - status
      properties:
        status:
          type: string
          enum:
            - ok
          example: ok
    ErrorResponse:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          enum:
            - error
          example: error
        message:
          type: string
          description: Error description
  responses:
    Unauthorized:
      description: Unauthorized - invalid or missing token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missing:
              summary: Missing token
              value:
                status: error
                message: missing X-Bunker-Token header
    NotFound:
      description: Not found - resource doesn't exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            notFound:
              summary: User not found
              value:
                status: error
                message: user not found
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Bunker-Token
      description: Root access token for Databunker API

````