> ## 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 a user file

> Returns the decrypted content of a user file. The file is selected by `fileuuid` (preferred) or by `filename`. When selecting by `filename`, the most recently created file with that name is returned. At least one of `fileuuid` or `filename` is required.

By default the content is returned as a base64-encoded `filedata` field inside a JSON response. Set `raw` to `true` to receive the decrypted bytes directly with the appropriate `Content-Type` and `Content-Disposition` headers (useful for direct downloads).




## OpenAPI

````yaml /pro/api/openapi.yml post /v2/FileGet
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 when DataBunker Pro is configured to work with
    PostgreSQL database. **Note:** DataBunker Pro supports both PostgreSQL and
    MySQL (Percona) as backend databases, but multi-tenancy requires PostgreSQL
    and is not available with MySQL.


    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.
  version: 2.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:
  - 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/FileGet:
    post:
      tags:
        - File Storage
      summary: Get a user file
      description: >
        Returns the decrypted content of a user file. The file is selected by
        `fileuuid` (preferred) or by `filename`. When selecting by `filename`,
        the most recently created file with that name is returned. At least one
        of `fileuuid` or `filename` is required.


        By default the content is returned as a base64-encoded `filedata` field
        inside a JSON response. Set `raw` to `true` to receive the decrypted
        bytes directly with the appropriate `Content-Type` and
        `Content-Disposition` headers (useful for direct downloads).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - mode
                - identity
              properties:
                mode:
                  type: string
                  enum:
                    - login
                    - token
                    - email
                    - phone
                    - custom
                  description: Mode of user identification
                identity:
                  type: string
                  description: User identifier corresponding to the mode
                fileuuid:
                  type: string
                  description: Unique identifier of the file to retrieve (preferred)
                filename:
                  type: string
                  description: >-
                    Name of the file to retrieve (resolves to the most recent
                    file with this name)
                raw:
                  type: boolean
                  description: >-
                    If true, return the raw decrypted bytes instead of a base64
                    JSON response
                request_metadata:
                  type: object
                  description: Additional metadata for the request
      responses:
        '200':
          description: File retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  token:
                    type: string
                    description: User's unique token
                  fileuuid:
                    type: string
                    description: Unique identifier of the file
                  filename:
                    type: string
                    description: Name of the file
                  mimetype:
                    type: string
                    description: MIME type of the file
                  size:
                    type: integer
                    description: Size of the file in bytes
                  filedata:
                    type: string
                    format: byte
                    description: Base64-encoded file content
            application/octet-stream:
              schema:
                type: string
                format: binary
                description: Raw decrypted file content (returned when raw is true)
components:
  securitySchemes:
    XBunkerToken:
      type: apiKey
      in: header
      name: X-Bunker-Token
      description: API token for authentication

````