Skip to main content
GET
Fetch Records Reporting

Overview

This endpoint extracts records from record reporting structures. 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
Records = Details. This endpoint gives you the source data that flows through Qobra’s calculations, not the final commission amounts.
To extract a data table as it was imported, before any calculation, use fetch data table records.
Only reporting tables from your company’s live environment are reachable. A table_id that belongs to a sandbox environment returns 404 Not Found, even if the id was copied from the Qobra app while viewing a sandbox.

Pagination

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

Basic pagination pattern

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

Selecting fields

The endpoint returns every field of the table by default. Pass fields to receive only the ones you need:
  • The values are api_keys, as listed by GET /v2/data-structures/{table_id}/fields, separated by commas. The keys above are examples: read yours from that endpoint.
  • standard.id and standard.source_id are always returned, whether you list them or not.
  • A record keeps the table’s order of fields, not the order of your list. Spaces around a key and duplicate keys are ignored.
  • next_url keeps your selection. If you build the next URL yourself from next_start_id, pass fields again.
  • Without fields, nothing changes: every field is returned.

Why select fields

A page holds one value per field and per record, so fewer fields make faster and lighter pages. On a table of 186 fields, keeping 50 divides the server time of a page by about three and its compressed size by about four. For a full extraction of a wide table, list only the fields your warehouse uses.

Unknown keys

A key the fields endpoint does not list returns 400, naming every unknown key:
A key can change, for instance when a metric is renamed. If a sync that used to work starts failing on fields, read the fields endpoint again and update your list. A list left empty (fields=) returns 400 too.

How many fields fit in the URL

The server accepts request lines of up to 4,094 bytes. The rest of the URL (the path, start_id, limit and the date filters) takes about 300 bytes. That leaves about 3,790 bytes for the value of fields. Count start_id from your first call: next_url adds it to every next page. Each key costs its length plus 3 bytes, the size of a comma once encoded (%2C). Plan on about 70 fields with typical keys, and work it out for yours when they are long.
A URL over the limit is refused before it reaches the API. You receive a 400 Bad Request in text/html, not in the JSON error format above, and its body contains Request Line is too large. Remove fields from your list, or drop fields to receive every field.

Performance & best practices

Use ID-based pagination

Always use next_url for large datasets.

Incremental sync

Use last_modified_after for efficiency.

Use Limit 2000

Optimal balance between network overhead and response time.

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

fields
string

Comma-separated api_keys of the fields to return, as listed by /v2/data-structures/{table_id}/fields (e.g. datatable.amount,datatable.close_date). standard.id and standard.source_id are always returned. When omitted, every field is returned. A key the fields endpoint does not list returns 400.

Response

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

data
object[]
required

List of records

meta
object
required