Leena AI Analytics API

AI Colleague run metrics.

OpenAPI Specification

leena-ai-analytics-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Leena AI External AOP Analytics API
  version: 1.0-beta
  description: 'Execute an Agent Operating Procedure (AOP) on a Leena AI AI Colleague from an external

    system and poll its execution status, plus a read-only analytics query endpoint for

    AI Colleague run metrics.


    This specification was generated by the API Evangelist enrichment pipeline from

    Leena AI''s published documentation. Leena AI does not publish a machine-readable

    OpenAPI definition; every path, parameter, response field and error below is

    transcribed from the public guide cited in `x-source`.

    '
  contact:
    name: Leena AI
    url: https://docs.leena.ai/
  x-generated: '2026-07-19'
  x-method: generated
  x-source: https://docs.leena.ai/docs/external-aop-api-authentication-usage-guide
servers:
- url: https://us-east-1-aic.leena.ai
  description: AOP / AI Colleague host, us-east-1
- url: https://us-east-1-analytics-api.leena.ai
  description: Analytics host, us-east-1
tags:
- name: Analytics
  description: AI Colleague run metrics.
paths:
  /api/analytics/query/external:
    get:
      operationId: queryAicAnalytics
      summary: Query AI Colleague analytics
      description: Returns a tabular analytics result. Served from the region analytics host (`https://<region-code>-analytics-api.leena.ai`). Supports incremental polling via the `filters[timestamp][gt]` parameter.
      tags:
      - Analytics
      security:
      - oauth2: []
      parameters:
      - name: metricId
        in: query
        required: true
        description: Metric identifier, e.g. `aic:totalRunsTable`.
        schema:
          type: string
        example: aic:totalRunsTable
      - name: responseType
        in: query
        required: true
        schema:
          type: string
        example: table
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
        example: '2026-07-01'
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
        example: '2026-07-19'
      - name: page
        in: query
        required: false
        schema:
          type: integer
          default: 1
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 10
      - name: filters[timestamp][gt]
        in: query
        required: false
        description: ISO-8601 lower bound for incremental polling.
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: The query result. Note that a query-level failure is also returned as 200 with `isSuccess` false.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsResponse'
        '400':
          description: Malformed request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failure or insufficient scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AnalyticsResponse:
      type: object
      properties:
        isSuccess:
          type: boolean
        result:
          type: object
          properties:
            columns:
              type: array
              items:
                type: object
            rows:
              type: array
              items:
                type: object
            total:
              type: integer
            page:
              type: integer
            limit:
              type: integer
    Error:
      type: object
      properties:
        message:
          type: string
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth 2.0 resource owner password credentials grant. The client authenticates to the token endpoint with HTTP Basic (base64 of `client_id:client_secret`) and posts `username`, `password` and `grant_type=password`. Access tokens are Bearer tokens valid for 3600 seconds and are accompanied by a refresh token.
      flows:
        password:
          tokenUrl: https://us-east-1-acl.leena.ai/api/v1.0/oauth/token
          refreshUrl: https://us-east-1-acl.leena.ai/api/v1.0/oauth/token
          scopes: {}
x-regions:
- us-east-1
- eu-west-1
- eu-central-1
- canadacentral
- ap-southeast-1
- ap-south-1
- qatarcentral
- me-central2