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

# Fetch record reporting data

> Retrieves record reporting data. A record report holds your compensation's data, consolidated around metrics on a record level.

<Warning>
  This endpoint is deprecated. Use the v2 endpoint instead. See [v2
  documentation](/api_reference/v2/endpoints/data/fetch_records)
</Warning>

## Pagination

This endpoint is paginated using parameters offset and limit
The “next” key in the response allow you to easily follow pagination to get the
next batch of users

## Variable api keys

This endpoint is based on dynamic fields. This mean that all annotations
that look like `<variable-key>`, will have to or will be replaced by their
actual API keys.


## OpenAPI

````yaml get /v1/reporting/{data_table_id}/records
openapi: 3.0.2
info:
  version: 1.0.0
  title: Qobra API
  description: API documentation for Qobra
servers:
  - url: https://api.qobra.co
    description: API
security: []
paths:
  /v1/reporting/{data_table_id}/records:
    get:
      tags:
        - public_api
        - v1
        - reporting
      summary: Fetch record reporting data
      description: >-
        Retrieves record reporting data. A record report holds your
        compensation's data, consolidated around metrics on a record level.
      operationId: GET_/v1/reporting/(data_table_id)/records
      parameters:
        - name: data_table_id
          in: path
          required: true
          schema:
            type: string
          description: >-
            Identifies the data table associated with record reporting. This ID
            can be found in the URL of the table settings page.
        - name: offset
          in: query
          schema:
            title: Offset
            description: Optional (minimum:0 - maximum:9223372036854775807)
            default: 0
            minimum: 0
            maximum: 9223372036854776000
            type: integer
          required: false
        - name: limit
          in: query
          schema:
            title: Limit
            description: >-
              Optional (minimum:0 - maximum:2000): if set to 0 return total
              count only
            default: 2000
            minimum: 0
            maximum: 2000
            type: integer
          required: false
      responses:
        '200':
          description: Success operation
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetManyResponseModel_RecordReportingRecordModel_Success
              examples:
                fetch-reporting-success:
                  $ref: >-
                    #/components/examples/GetManyResponseModel_RecordReportingRecordModel_SuccessExample
      deprecated: true
      security:
        - api_key: []
components:
  schemas:
    GetManyResponseModel_RecordReportingRecordModel_Success:
      type: object
      properties:
        count:
          title: Count
          type: integer
          description: Number of records in the response
        next:
          title: Next
          type: string
          description: Next page of the response
        data:
          title: Data
          type: array
          items:
            $ref: '#/components/schemas/RecordReportingRecordModel'
      required:
        - count
        - data
      title: GetManyResponseModel[RecordReportingRecordModel]
    RecordReportingRecordModel:
      type: object
      properties:
        id:
          title: Id
          type: string
          format: ObjectId
          description: Id of the record
        date:
          title: Date
          type: string
          format: date-time
          description: Date
        plan:
          title: Plan
          type: string
          description: Compensation plan name
        <record-metric-1-api-key>:
          title: Record metric 1 value
          type: string
        <record-metric-2-api-key>:
          title: Record metric 2 value
          type: string
        user:
          $ref: '#/components/schemas/UserModel'
        record:
          $ref: '#/components/schemas/RecordModel'
      required:
        - id
        - user
        - date
        - plan
        - record
        - <record-metric-1-api-key>
        - <record-metric-2-api-key>
      title: RecordReportingRecordModel
    UserModel:
      type: object
      properties:
        id:
          title: Id
          type: string
          format: ObjectId
          description: Id of the user
        email:
          title: Email
          type: string
          description: Email of the user
          format: email
        name:
          title: Name
          type: string
          description: Name of the user
        status:
          $ref: '#/components/schemas/UserStatus'
        role:
          title: Role
          type: string
          description: Role of the user
        currency:
          $ref: '#/components/schemas/CurrencyCode'
        calculation_currency:
          $ref: '#/components/schemas/CurrencyCode'
        <user-attribute-1-api-key>:
          type: string
          description: User attribute 1 value
        <user-attribute-1-api-key>_currency:
          $ref: '#/components/schemas/CurrencyCode'
        <user-attribute-2-api-key>:
          type: string
          description: User attribute 2 value
      required:
        - id
        - email
        - status
        - name
        - role
        - currency
        - calculation_currency
      additionalProperties:
        oneOf:
          - type: string
          - type: integer
      title: UserModel
    RecordModel:
      type: object
      properties:
        id:
          title: Id
          type: string
          format: ObjectId
          description: Id of the user
        name:
          title: Name
          type: string
          description: Name of the record
        <field-1-api-key>:
          type: string
          description: Field 1 value
        <field-1-api-key>_currency:
          $ref: '#/components/schemas/CurrencyCode'
        <field-2-api-key>:
          type: string
          description: Field 2 value
        <field-3-api-key>:
          type: string
          description: Field 3 value
      required:
        - id
        - name
      additionalProperties:
        oneOf:
          - type: string
          - type: integer
      title: RecordModel
    UserStatus:
      description: An enumeration.
      type: string
      title: UserStatus
      enum:
        - active
        - archived
        - inactive
        - pending
    CurrencyCode:
      description: Allowed currency codes.
      type: string
      enum:
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BOV
        - BRL
        - BSD
        - BTN
        - BWP
        - BYR
        - BZD
        - CAD
        - CDF
        - CHF
        - CLF
        - CLP
        - CNY
        - COP
        - COU
        - CRC
        - CUC
        - CUP
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ERN
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HRK
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - IQD
        - IRR
        - ISK
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KPW
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LTL
        - LVL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MRO
        - MUR
        - MVR
        - MWK
        - MXN
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SDG
        - SEK
        - SGD
        - SHP
        - SLL
        - SOS
        - SRD
        - STD
        - SVC
        - SYP
        - SZL
        - THB
        - TJS
        - TMT
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - UYI
        - UYU
        - UZS
        - VEF
        - VND
        - VUV
        - WST
        - XAG
        - XAU
        - XCD
        - XPD
        - XPT
        - XSU
        - YER
        - ZAR
        - ZMK
        - ZWL
      title: CurrencyCode
  examples:
    GetManyResponseModel_RecordReportingRecordModel_SuccessExample:
      value:
        count: 4570
        data:
          - id: 6545110915808dbcc34531ee
            date: '2023-11-30'
            plan: Great plan
            user:
              id: 5537a5b05d6e4824940e9e1bb9a5ebb8
              email: john-doe@company.com
              name: John Doe
              role: Sales Rep
              currency: EUR
              calculation_currency: USD
              country: France
              code: AO32ND56
              ...: ...
            record:
              id: 6545110915808eecc34531ee
              name: Great opportunity
            commission: 3500
            commission_currency: EUR
          - ...
        next: >-
          https://api.qobra.co/v1/reporting/opportunity/records?limit=2000&offset=2000
  securitySchemes:
    api_key:
      type: apiKey
      name: X-API-Key
      in: header

````