Skip to main content
GET
/
v2
/
reporting
/
{table_id}
/
records
Fetch Records Reporting
curl --request GET \
  --url https://api.qobra.co/v2/reporting/{table_id}/records \
  --header 'X-API-Key: <api-key>'
{
  "data": [
    {
      "standard.id": "75b2c3d4e5f6g7h8i9j0k2l3",
      "datatable.opportunity_name": "Acme Corp - Annual License",
      "datatable.account_name": "Acme Corporation",
      "datatable.amount": {
        "value": 50000,
        "currency": "USD"
      },
      "custom.total_paid": {
        "value": 400,
        "currency": "USD"
      },
      "datatable.close_date": "2024-01-15",
      "datatable.stage": "Closed Won",
      "standard.user": {
        "id": "507f191e810c19729de860ea",
        "email": "[email protected]"
      },
      "standard.commission_impact": {
        "value": 2500,
        "currency": "USD"
      },
      "standard.date": "2024-01-01"
    },
    {
      "standard.id": "75b2c3d4e5f6g7h8i9j0k2l4",
      "datatable.opportunity_name": "TechStart - Professional Plan",
      "datatable.account_name": "TechStart Inc",
      "datatable.amount": {
        "value": 25000,
        "currency": "USD"
      },
      "custom.total_paid": {
        "value": 1200,
        "currency": "USD"
      },
      "datatable.close_date": "2024-01-18",
      "datatable.stage": "Closed Won",
      "standard.user": {
        "id": "507f191e810c19729de860eb",
        "email": "[email protected]"
      },
      "standard.commission_impact": {
        "value": 1250,
        "currency": "USD"
      },
      "standard.date": "2024-01-18"
    }
  ],
  "meta": {
    "next_start_id": "75b2c3d4e5f6g7h8i9j999l3",
    "has_more": true,
    "next_url": "https://api.qobra.co/v2/reporting/507f1f77bcf86cd799439012/records?start_id=75b2c3d4e5f6g7h8i9j999l3&limit=1000"
  }
}

Overview

This endpoint extracts records from record reporting structures or custom data tables. Records represent the underlying data used in commission calculations — CRM deals, activities, and custom metrics. Use this endpoint for:
  • Sales analytics and pipeline reports
  • Commission audit trails (what deals contributed to commissions)
  • CRM data extraction
  • Custom data table analysis
Records = Details. This endpoint gives you the source data that flows through Qobra’s calculations, not the final commission amounts.

Pagination

This endpoint uses ID-based pagination for consistent performance with large datasets.

Basic pagination pattern

url = f"https://api.qobra.co/v2/reporting/{table_id}/records"
params = {"limit": 2000}

while True:
    response = requests.get(url, headers=headers, params=params)
    result = response.json()

    # Process records
    for record in result["data"]:
        process(record)

    # Check if more pages exist
    if not result["meta"]["has_more"]:
        break

    # Use next_url for next page
    url = result["meta"]["next_url"]
Use next_url for simplicity: The API returns a pre-constructed next_url in the response meta — just follow it instead of manually building the next request.

Filtering by modification date

Use last_modified_after for incremental sync (only fetch new/updated records).
from datetime import datetime, timezone

def incremental_sync(table_id: str, api_key: str):
    # Load last sync time from your database
    last_sync = get_last_sync_time()  # e.g., 2024-01-14T00:00:00Z

    url = f"https://api.qobra.co/v2/reporting/{table_id}/records"
    headers = {"X-API-Key": api_key}
    params = {
        "limit": 2000,
        "last_modified_after": last_sync.isoformat()
    }

    new_records = []

    while True:
        response = requests.get(url, headers=headers, params=params)
        result = response.json()

        new_records.extend(result["data"])

        if not result["meta"]["has_more"]:
            break

        url = result["meta"]["next_url"]

    # Save current time as last sync
    save_last_sync_time(datetime.now(timezone.utc))

    return new_records

# Usage: Hourly incremental sync
new_records = incremental_sync(table_id, api_key)
print(f"Found {len(new_records)} new/updated records since last sync")

Performance & best practices

Use ID-based pagination

Always use next_url for large datasets.
url = result["meta"]["next_url"]

Incremental sync

Use last_modified_after for efficiency.
params = {"last_modified_after": last_sync}

Use Limit 2000

Optimal balance between network overhead and response time.
params = {"limit": 2000}

Authorizations

X-API-Key
string
header
required

Your Qobra API key. Generate it from Settings > API Keys in Qobra.

Path Parameters

table_id
string<ObjectId>
required

ID of a record reporting or data table structure (from /v2/data-structures)

Query Parameters

start_id
string<ObjectId>

Start after this record ID (for ID-based pagination, recommended)

limit
integer
default:2000

Number of records per page (1-2000)

Required range: 1 <= x <= 2000
last_modified_after
string<date-time>

ISO 8601 datetime - Only return records modified after this timestamp (for incremental sync)

last_modified_before
string<date-time>

ISO 8601 datetime - Only return records modified before this timestamp

Response

Successfully retrieved data records. Returns an array of records from record reporting or data tables with pagination metadata for navigating through large datasets.

data
object[]
required

List of records

meta
object
required