> ## 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.

# Get token data

> Retrieves the original data for a given token



## OpenAPI

````yaml /pro/api/openapi.yml post /v2/TokenGet
openapi: 3.0.3
info:
  title: Databunker Pro API
  description: >
    Databunker Pro is a privacy-compliant user data vault and tokenization
    engine that provides secure storage and management of user data with
    built-in privacy controls, consent management, and audit capabilities.


    ## Key Features

    - **User Tokenization**: Create, update, and manage user profiles with
    privacy controls

    - **Consent Management**: Handle legal basis and user agreements for
    GDPR/DPDP compliance

    - **Token Management**: Secure tokenization of sensitive data like credit
    cards

    - **Audit Trail**: Complete audit logging of all data access and
    modifications

    - **Multi-tenant**: Support for multiple tenants with isolated data

    - **Role-based Access**: Fine-grained access control with policies and roles

    - **Bulk Operations**: Efficient bulk data operations with unlock mechanisms


    ## Authentication

    All API calls require authentication via the `X-Bunker-Token` header. For
    multi-tenant setups, use the `X-Bunker-Tenant` header to specify the tenant
    context.


    ### Multi-Tenant Usage

    Multi-tenancy is supported on PostgreSQL, MySQL (Percona), and Oracle
    backend databases. On PostgreSQL it is enforced with the database's native
    row-level security (RLS).


    When using Databunker Pro in a multi-tenant environment:


    - **Single Tenant**: Omit the `X-Bunker-Tenant` header (default behavior)

    - **Multi-Tenant**: Include `X-Bunker-Tenant: your-tenant-name` header


    **Example:**

    ```bash

    # Single tenant

    curl -X POST http://localhost:3000/v2/UserCreate \
      -H "X-Bunker-Token: your-token" \
      -d '{"profile":{"login":"user1"}}'

    # Multi-tenant

    curl -X POST http://localhost:3000/v2/UserCreate \
      -H "X-Bunker-Token: your-token" \
      -H "X-Bunker-Tenant: acme-corp" \
      -d '{"profile":{"login":"user1"}}'
    ```


    ## Base URL

    The API is available at `/v2/` endpoint with all requests using POST method.


    ## Error Handling

    Every error is returned as a JSON body with a fixed shape:


    ```json

    {"status": "error", "message": "The user record was not found"}

    ```


    HTTP status codes follow REST conventions:


    | Code | Meaning |

    |------|---------|

    | 400  | Bad request — malformed body, missing or invalid parameters, schema
    validation failure |

    | 403  | Access denied — missing/invalid API token, insufficient
    permissions, disabled feature, or license limit |

    | 404  | The referenced record was not found |

    | 409  | Conflict — duplicate record, name already in use, or operation
    conflicts with the record's current state |

    | 500  | Internal server error |


    Successful responses always include `"status": "ok"`. As a defensive
    pattern, check the JSON `status` field in addition to the HTTP status code.


    **Note:** Databunker Pro releases prior to the 2026-07 update returned HTTP
    `405` for most error conditions. If you run an older release, treat any
    non-2xx response as an error and rely on the JSON `status`/`message` fields.
  version: 2.0.0
  contact:
    name: Databunker Support
    url: https://databunker.org
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: http://localhost:3000
    description: Local development server
security:
  - XBunkerToken: []
tags:
  - name: User Tokenization
    description: Operations for creating, reading, updating, and deleting users
  - name: App Data Management
    description: Operations for managing application-specific user data
  - name: File Storage
    description: Operations for storing, retrieving, and deleting encrypted user files
  - name: Legal Basis Management
    description: Operations for managing legal basis for data processing
  - name: Agreement Management
    description: Operations for managing user agreements and consent
  - name: Processing Activity Management
    description: Operations for managing data processing activities
  - name: Format Preserving Tokenization
    description: Operations for tokenizing sensitive data
  - name: Group Management
    description: Operations for managing user groups
  - name: Role Management
    description: Operations for managing user roles
  - name: Policy Management
    description: Operations for managing access control policies
  - name: Authentication
    description: Operations for creating access tokens
  - name: Bulk Operations
    description: Operations for bulk data processing
  - name: Audit Management
    description: Operations for accessing audit logs
  - name: Tenant Management
    description: Operations for managing multi-tenant setups
  - name: Shared Records
    description: Operations for creating and accessing shared user records
  - name: Session Management
    description: Operations for managing user sessions
  - name: System Operations
    description: Operations for system administration and monitoring
paths:
  /v2/TokenGet:
    post:
      tags:
        - Format Preserving Tokenization
      summary: Get token data
      description: Retrieves the original data for a given token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - token
              properties:
                token:
                  type: string
                  description: The token to retrieve data for
                request_metadata:
                  type: object
                  description: Additional metadata for the request
      responses:
        '200':
          description: Token data retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  record:
                    type: string
                    description: The original sensitive data
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  responses:
    BadRequest:
      description: >-
        Bad request — malformed body, missing or invalid parameters, schema
        validation failure
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: error
            message: 'Missing API request parameters: profile'
    AccessDenied:
      description: >-
        Access denied — missing or invalid API token, insufficient permissions,
        disabled feature, or license limit
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: error
            message: Access denied
    NotFound:
      description: The referenced record was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: error
            message: The user record was not found
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: error
            message: Internal error
  schemas:
    Error:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          enum:
            - error
          example: error
        message:
          type: string
          description: Human-readable error message
  securitySchemes:
    XBunkerToken:
      type: apiKey
      in: header
      name: X-Bunker-Token
      description: API token for authentication

````