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

# Get Table Data

> Re-runs the table's **current** saved recipe for the date range you pass and returns its rows. Edits made to the table in Labby AI show up on the next call. Read-only: it never changes the saved table.

Rate limit: 20 calls per minute per account, shared by all your tables.



## OpenAPI

````yaml GET /client/aiTables/{tableID}
openapi: 3.0.3
info:
  title: Flabs Labby AI Tables API
  version: 1.0.0
  description: Read the tables you saved in Labby AI, re-run for any date range.
servers:
  - url: https://v2.flabs.in
    description: Production
security:
  - bearerAuth: []
paths:
  /client/aiTables/{tableID}:
    get:
      summary: Get table data
      description: >-
        Re-runs the table's **current** saved recipe for the date range you pass
        and returns its rows. Edits made to the table in Labby AI show up on the
        next call. Read-only: it never changes the saved table.


        Rate limit: 20 calls per minute per account, shared by all your tables.
      parameters:
        - name: tableID
          in: path
          required: true
          schema:
            type: string
          description: >-
            Table identifier from `GET /client/aiTables`, or from **Get API** on
            the table in Labby AI.
        - name: gte
          in: query
          required: true
          schema:
            type: string
            example: '2026-11-01'
          description: >-
            Start of the range. `YYYY-MM-DD` is the whole day in IST (from 00:00
            IST); a full ISO 8601 timestamp is used as-is.
        - name: lte
          in: query
          required: true
          schema:
            type: string
            example: '2026-11-30'
          description: >-
            End of the range. `YYYY-MM-DD` is the whole day in IST (to
            23:59:59.999 IST). One call covers at most 30 days, both ends
            included: `gte=2026-11-01&lte=2026-11-30` is allowed,
            `lte=2026-12-01` is not.
        - name: labIDs
          in: query
          required: false
          schema:
            type: string
            example: 6530a4a6f1d2c8b7e9a12345,6530a4a6f1d2c8b7e9a67890
          description: >-
            Comma-separated lab IDs. Omit to use the labs the table was saved
            with. For a multi-lab table it narrows to these labs (it never adds
            labs the table doesn't cover). For a single-lab table, the first ID
            switches the table to that lab.
      responses:
        '200':
          description: Table data returned
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      tableID:
                        type: string
                      title:
                        type: string
                      columns:
                        type: array
                        description: >-
                          Columns in display order, including formula columns
                          added in Labby AI. Each table has its own columns.
                        items:
                          type: object
                          properties:
                            key:
                              type: string
                              description: Property name of this column in each row.
                            title:
                              type: string
                              description: Column header as shown in Labby AI.
                            type:
                              type: string
                              description: >-
                                `string`, `number` or `currency` (a plain number
                                in the lab's currency). Treat any other value as
                                a string.
                      rows:
                        type: array
                        description: >-
                          One object per row, keyed by `columns[].key`. A
                          formula that cannot be computed for a row is `null`.
                        items:
                          type: object
                          additionalProperties: true
                      truncated:
                        type: object
                        nullable: true
                        description: >-
                          Set when the range held more rows than one call
                          returns (`{ "limit": 5000 }`): only the first `limit`
                          rows came back. Split the range to get the rest.
                          `null` otherwise.
                        properties:
                          limit:
                            type: integer
                      dateRange:
                        type: object
                        description: The range that was run, as UTC instants.
                        properties:
                          gte:
                            type: string
                            format: date-time
                          lte:
                            type: string
                            format: date-time
                      labScope:
                        type: array
                        description: Labs (branches) the table reads.
                        items:
                          type: object
                          properties:
                            labID:
                              type: string
                              description: Lab (branch) identifier.
                            name:
                              type: string
                              description: Lab name.
              example:
                success: true
                data:
                  tableID: 6afef8e0f1a419d24b9938ae
                  title: Doctor-wise revenue
                  columns:
                    - key: doctor
                      title: Doctor
                      type: string
                    - key: bills
                      title: Bills
                      type: number
                    - key: revenue
                      title: Revenue
                      type: currency
                  rows:
                    - doctor: Dr. A. Mehta
                      bills: 412
                      revenue: 386250
                    - doctor: Dr. S. Rao
                      bills: 268
                      revenue: 241900
                  truncated: null
                  dateRange:
                    gte: '2026-10-31T18:30:00.000Z'
                    lte: '2026-11-30T18:29:59.999Z'
                  labScope:
                    - labID: 6530a4a6f1d2c8b7e9a12345
                      name: Flabs Diagnostics - Andheri
        '400':
          description: >-
            `gte` / `lte` missing, not a date, in the wrong order or more than
            30 days apart; or `labIDs` is not a list of lab IDs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
              example:
                success: false
                status: 400
                message: >-
                  Bad Request - The request could not be understood or was
                  missing required parameters.
                error:
                  details: Date range cannot exceed 30 days
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            Labby AI is not enabled on the table's labs, or `labIDs` names labs
            this table or account cannot read
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
              example:
                success: false
                status: 403
                message: Forbidden - Access to the requested resource is forbidden.
                error:
                  details: Labby AI is not enabled for any lab on this account
        '404':
          description: >-
            No saved table with this ID on your account (deleted, or saved on
            another account)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
              example:
                success: false
                status: 404
                message: Not Found - The requested resource could not be found.
                error:
                  details: Table not found
        '409':
          description: 'The table was built from an uploaded document (`refreshable: false`)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
              example:
                success: false
                status: 409
                message: >-
                  Conflict - The request could not be completed due to a
                  conflict.
                error:
                  details: >-
                    This table was built from an uploaded document and cannot be
                    re-run for a date range
        '422':
          description: >-
            The table could not be built for this range or these labs. Use a
            shorter range; retrying the same request gives the same result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
              example:
                success: false
                status: 422
                message: >-
                  Unprocessable Entity - The request was well-formed but unable
                  to be followed due to semantic errors.
                error:
                  details: >-
                    There is too much data in the selected range to load in
                    time. Try a shorter range.
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
        '503':
          description: A temporary failure. Retry after a short wait
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
              example:
                success: false
                status: 503
                message: Service Unavailable - The server is currently unavailable.
                error:
                  details: The table could not be built right now. Retry shortly.
components:
  schemas:
    ErrorBody:
      type: object
      properties:
        success:
          type: boolean
          example: false
        status:
          type: integer
        message:
          type: string
        error:
          type: object
          properties:
            details:
              type: string
  responses:
    Unauthorized:
      description: Missing, invalid or expired token. Get a new `authToken` and retry
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          example:
            success: false
            status: 401
            message: >-
              Unauthorized - Authentication failed or user does not have
              permissions.
            error:
              details: Token expired, please login again
    RateLimited:
      description: >-
        Rate limit hit. Wait the number of seconds in `error.details`, then
        retry
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          example:
            success: false
            status: 429
            message: An error occurred
            error:
              details: Too many requests. Try again in 42 seconds
    ServerError:
      description: Unexpected server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          example:
            success: false
            status: 500
            message: Internal Server Error - Something went wrong on the server.
            error:
              details: Failed to build table
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: '`authToken` from `POST /client/auth/token`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.