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

# List Data Structures

> Retrieves all available data structures (statement reporting and record reporting) accessible through the API. Use this endpoint to discover what data you can extract.

## Overview

This endpoint returns all data structures (tables) available in your Qobra account. It's the **entry point** for the V2 API — use it to discover what data you can extract.

<Info>
  **This is always your first call.** It tells you what data structures exist and where to find their schemas and records.
</Info>

***

## Understanding Data Structure Types

The `type` field indicates what kind of data the structure contains:

<AccordionGroup>
  <Accordion title="statement_reporting">
    **What it is:** A statement report summarizes commission data at statement level.

    **Typical use:** payroll integration, high-level payout analysis per user, sales performance tracking

    **Record endpoint:** `/v2/reporting/{id}/statements`

    **Contains fields like:**

    * Statement user
    * Statement date
    * Payment
    * Statement status (paid, pending, validated)
  </Accordion>

  <Accordion title="record_reporting">
    **What it is:** A record report summarizes commission data at transaction level (e.g. CRM opportunity level)

    **Typical use:** Commission analysis per opportunity, cost of sales and deal margin monitoring 

    **Record endpoint:** `/v2/reporting/{id}/records`

    **Contains fields like:**

    * Deal/opportunity information
    * Account details
    * Close dates and amounts
    * Commission amounts
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml get /v2/data-structures
openapi: 3.0.2
info:
  version: 2.0.0
  title: Qobra API v2
  description: >-
    Modern data extraction API for Qobra - Optimized for high-volume data
    extraction with ID-based pagination and flexible schema discovery.
  license:
    name: Proprietary
    url: https://www.qobra.co/terms
servers:
  - url: https://api.qobra.co
    description: Production API
security: []
paths:
  /v2/data-structures:
    get:
      tags:
        - public_api
        - v2
        - discovery
      summary: List Data Structures
      description: >-
        Retrieves all available data structures (statement reporting and record
        reporting) accessible through the API. Use this endpoint to discover
        what data you can extract.
      operationId: GET_/v2/data-structures
      responses:
        '200':
          description: >-
            Returns a list of all available data structures (statement reporting
            and record reporting) accessible through the API.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataStructuresResponse'
              examples:
                data-structures-success:
                  $ref: '#/components/examples/DataStructuresResponseExample'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponse'
              examples:
                unauthorized-error:
                  $ref: '#/components/examples/UnauthorizedErrorResponseExample'
      security:
        - api_key: []
components:
  schemas:
    DataStructuresResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DataStructureModel'
          description: List of available data structures
      required:
        - data
    UnauthorizedErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message
        type:
          type: string
          enum:
            - UnauthorizedError
          description: Type of the error
      required:
        - message
        - type
    DataStructureModel:
      type: object
      properties:
        id:
          type: string
          format: ObjectId
          description: Unique identifier of the data structure
        name:
          type: string
          description: Human-readable name of the data structure
        type:
          $ref: '#/components/schemas/DataStructureType'
        total_records:
          type: integer
          nullable: true
          description: Total number of records in this structure (null if not available)
        links:
          $ref: '#/components/schemas/LinksModel'
      required:
        - id
        - name
        - type
        - total_records
        - links
    DataStructureType:
      type: string
      enum:
        - statement_reporting
        - record_reporting
      description: >-
        Type of data structure: statement_reporting (commission statements), or
        record_reporting (CRM records with commission impact)
    LinksModel:
      type: object
      properties:
        fields:
          type: string
          description: URL to fetch the fields schema for this data structure
        records:
          type: string
          description: URL to fetch data for this data structure
      required:
        - fields
        - records
  examples:
    DataStructuresResponseExample:
      value:
        data:
          - id: 507f1f77bcf86cd799439011
            name: Commission Statements
            type: statement_reporting
            total_records: 12450
            links:
              fields: >-
                https://api.qobra.co/v2/data-structures/507f1f77bcf86cd799439011/fields
              records: >-
                https://api.qobra.co/v2/reporting/507f1f77bcf86cd799439011/statements
          - id: 507f1f77bcf86cd799439012
            name: Opportunities (Record Reporting)
            type: record_reporting
            total_records: 45230
            links:
              fields: >-
                https://api.qobra.co/v2/data-structures/507f1f77bcf86cd799439012/fields
              records: >-
                https://api.qobra.co/v2/reporting/507f1f77bcf86cd799439012/records
    UnauthorizedErrorResponseExample:
      value:
        message: You're trying to access resource you're not authorized to.
        type: UnauthorizedError
  securitySchemes:
    api_key:
      type: apiKey
      name: X-API-Key
      in: header
      description: Your Qobra API key. Generate it from Settings > API Keys in Qobra.

````