Frontline Object aggregations API

Per-view aggregations on objects

OpenAPI Specification

frontline-object-aggregations-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Public Account Object aggregations API
  version: 1.0.0
  description: 'Public API for accessing agents, flows, and analytics.


    ## Authentication


    The Public API supports two API key types. Pass the key as a Bearer token:


    ```

    Authorization: Bearer <YOUR_API_KEY>

    ```


    ### Account API key (GENERAL)


    Account-level key that acts on behalf of the entire account. Required for account-level endpoints unless noted otherwise.


    ### User API key (USER)


    User-level key tied to a specific user. Required for write operations and user-owned resources. **Also accepted on all account-level endpoints.**


    Each operation documents which key type(s) it accepts in its **Security** section.'
  license:
    name: Proprietary
    url: https://www.getfrontline.ai/terms-and-conditions
servers:
- url: https://prod-api.getfrontline.ai
tags:
- name: Object aggregations
  description: Per-view aggregations on objects
paths:
  /public/v1/objects/{name}/views/{viewId}/aggregations:
    get:
      summary: List aggregations
      operationId: listObjectAggregations
      description: Returns aggregations configured for a view.
      security:
      - bearerAuth: []
      tags:
      - Object aggregations
      parameters:
      - schema:
          type: string
          minLength: 1
          example: deals
        required: true
        name: name
        in: path
      - schema:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          example: 11
        required: true
        name: viewId
        in: path
      responses:
        '200':
          description: Aggregations
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                    - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        view_id:
                          type: number
                          example: 1
                        column_id:
                          type: number
                          example: 1
                        operation:
                          type: string
                          example: example
                        tag_id:
                          type: number
                          nullable: true
                          example: 1
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                      required:
                      - id
                      - view_id
                      - column_id
                      - operation
                      - created_at
                      - updated_at
                required:
                - ok
                - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create aggregation
      operationId: createObjectAggregation
      description: Creates an aggregation on a column for the given view. Requires a USER API key.
      security:
      - bearerAuth: []
      tags:
      - Object aggregations
      parameters:
      - schema:
          type: string
          minLength: 1
          example: deals
        required: true
        name: name
        in: path
      - schema:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          example: 11
        required: true
        name: viewId
        in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                columnId:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
                operation:
                  type: string
                  enum:
                  - COUNT_EMPTY
                  - COUNT_FILLED
                  - PERCENT_EMPTY
                  - PERCENT_FILLED
                  - SUM
                  - AVERAGE
                  - MIN
                  - MAX
                  - COUNT_TRUE
                  - COUNT_FALSE
                  - PERCENT_TRUE
                  - PERCENT_FALSE
                  example: COUNT_EMPTY
                tagId:
                  type: integer
                  nullable: true
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
              required:
              - columnId
              - operation
      responses:
        '201':
          description: Created aggregation
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                    - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      view_id:
                        type: number
                        example: 1
                      column_id:
                        type: number
                        example: 1
                      operation:
                        type: string
                        example: example
                      tag_id:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                    - id
                    - view_id
                    - column_id
                    - operation
                    - created_at
                    - updated_at
                required:
                - ok
                - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/views/{viewId}/aggregations/{aggId}:
    patch:
      summary: Update aggregation
      operationId: updateObjectAggregation
      description: Changes the operation of an aggregation. Requires a USER API key.
      security:
      - bearerAuth: []
      tags:
      - Object aggregations
      parameters:
      - schema:
          type: string
          minLength: 1
          example: deals
        required: true
        name: name
        in: path
      - schema:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          example: 11
        required: true
        name: viewId
        in: path
      - schema:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          example: 5
        required: true
        name: aggId
        in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                operation:
                  type: string
                  enum:
                  - COUNT_EMPTY
                  - COUNT_FILLED
                  - PERCENT_EMPTY
                  - PERCENT_FILLED
                  - SUM
                  - AVERAGE
                  - MIN
                  - MAX
                  - COUNT_TRUE
                  - COUNT_FALSE
                  - PERCENT_TRUE
                  - PERCENT_FALSE
                  example: COUNT_EMPTY
              required:
              - operation
      responses:
        '200':
          description: Updated aggregation
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                    - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      view_id:
                        type: number
                        example: 1
                      column_id:
                        type: number
                        example: 1
                      operation:
                        type: string
                        example: example
                      tag_id:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                    - id
                    - view_id
                    - column_id
                    - operation
                    - created_at
                    - updated_at
                required:
                - ok
                - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete aggregation
      operationId: deleteObjectAggregation
      description: Removes an aggregation from a view. Requires a USER API key.
      security:
      - bearerAuth: []
      tags:
      - Object aggregations
      parameters:
      - schema:
          type: string
          minLength: 1
          example: deals
        required: true
        name: name
        in: path
      - schema:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          example: 11
        required: true
        name: viewId
        in: path
      - schema:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          example: 5
        required: true
        name: aggId
        in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                    - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                        - true
                        example: true
                      id:
                        anyOf:
                        - type: string
                          example: example
                        - type: number
                          example: 1
                    required:
                    - deleted
                required:
                - ok
                - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/views/{viewId}/aggregations/compute:
    post:
      summary: Compute aggregations
      operationId: computeObjectAggregations
      description: Computes the configured aggregations for the rows matching the query.
      security:
      - bearerAuth: []
      tags:
      - Object aggregations
      parameters:
      - schema:
          type: string
          minLength: 1
          example: deals
        required: true
        name: name
        in: path
      - schema:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          example: 11
        required: true
        name: viewId
        in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: object
                  description: Query + search + sort + filters for the aggregation compute call.
                search:
                  type: string
                  nullable: true
                  example: example
                recordType:
                  anyOf:
                  - type: string
                    example: example
                  - type: number
                    example: 1
                  - nullable: true
                    type: object
                columnId:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
      responses:
        '200':
          description: Aggregation results
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                    - true
                    example: true
                  data:
                    type: object
                    additionalProperties:
                      nullable: true
                      type: object
                required:
                - ok
                - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        ok:
          type: boolean
          enum:
          - false
          example: false
        error:
          $ref: '#/components/schemas/ErrorBody'
      required:
      - ok
      - error
    ErrorBody:
      type: object
      properties:
        code:
          type: string
          enum:
          - bad_request
          - unauthorized
          - forbidden
          - not_found
          - conflict
          - internal_error
          - cli_outdated
          example: unauthorized
        message:
          type: string
          example: Detailed error message
        details:
          type: object
          description: 'Optional structured details. Validation errors include `{ issues: [...] }`.'
          example:
            issues:
            - path:
              - name
              message: String must contain at least 1 character(s)
              code: too_small
      required:
      - code
      - message
  securitySchemes:
    accountApiKey:
      type: http
      scheme: bearer
      bearerFormat: Account API Key
      description: Account-level API key (GENERAL). Authenticates on behalf of the entire account. Use for read-only and analytics endpoints marked as account-level in this documentation.
    userApiKey:
      type: http
      scheme: bearer
      bearerFormat: User API Key
      description: User-level API key (USER). Authenticates on behalf of a specific user. Required for write operations and user-owned resources. Also accepted on all account-level endpoints.
x-tagGroups:
- name: Agent Builder
  tags:
  - Agent Builder
  - Flows
  - Flow Variables
  - Intents
  - Agents
- name: Workflows
  tags:
  - Workflows
  - Workflow Variables
- name: Objects
  tags:
  - Objects
  - Object fields
  - Object options
  - Object record types
  - Object views
  - Object relations
  - Object rows
  - Object aggregations
  - Object activities
  - Object tasks
  - Object files
  - Object export
- name: Tables
  tags:
  - Tables
  - Table fields
  - Table options
  - Table rows
  - Table aggregations
  - Table activities
  - Table tasks
  - Table files
  - Table export
- name: Integrations
  tags:
  - Tools
  - Incoming Webhooks
- name: Core
  tags:
  - Account
  - AI Models
  - Billing