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

# List sessions by user token

> Returns an array of all session records for a user



## OpenAPI

````yaml /oss/api/openapi.yml get /v1/session/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/session/token/{token}:
    get:
      tags:
        - Session
      summary: List sessions by user token
      description: Returns an array of all session records for a user
      operationId: listSessionsByToken
      parameters:
        - $ref: '#/components/parameters/UserToken'
      responses:
        '200':
          description: Sessions retrieved successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessResponse'
                  - type: object
                    properties:
                      sessions:
                        type: array
                        items:
                          $ref: '#/components/schemas/Session'
        '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
    Session:
      type: object
      properties:
        session:
          type: string
          format: uuid
        when:
          type: integer
          format: int64
          description: Unix timestamp
        data:
          type: object
          additionalProperties: true
    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

````