Leena AI AOP API

Agent Operating Procedure execution and status.

OpenAPI Specification

leena-ai-aop-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Leena AI External Analytics AOP 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: AOP
  description: Agent Operating Procedure execution and status.
paths:
  /api/v1/external/aop/execute:
    post:
      operationId: executeAop
      summary: Execute an AOP
      description: Starts an Agent Operating Procedure run on an AI Colleague. Returns immediately with status `accepted`; poll `getAopStatus` for completion.
      tags:
      - AOP
      security:
      - oauth2: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AopExecuteRequest'
      responses:
        '200':
          description: The run was accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AopExecuteResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid authentication.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: AOP not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /api/v1/external/aop/items/{aop_item_id}/status:
    get:
      operationId: getAopStatus
      summary: Get AOP execution status
      description: Returns the current state of a previously accepted AOP run.
      tags:
      - AOP
      security:
      - oauth2: []
      parameters:
      - name: aop_item_id
        in: path
        required: true
        description: Identifier returned by `executeAop`.
        schema:
          type: string
      responses:
        '200':
          description: The current execution state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AopStatusResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid authentication.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: AOP item not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AopStatusResponse:
      type: object
      properties:
        aop_item_id:
          type: string
        reference_id:
          type: string
        status:
          type: string
          enum:
          - in_progress
          - completed
          - failed
          - paused
          - aborted
        initiated_at:
          type: string
          format: date-time
        completed_at:
          type: string
          format: date-time
          nullable: true
    AopExecuteRequest:
      type: object
      properties:
        aop_id:
          type: string
          description: AOP identifier or ObjectId.
        message_to_start:
          type: string
          description: Initial natural-language instruction.
        context:
          type: object
          additionalProperties: true
          description: Key-value pairs supplying additional context to the run.
      required:
      - aop_id
    AopExecuteResponse:
      type: object
      properties:
        aop_item_id:
          type: string
        request_id:
          type: string
        run_id:
          type: string
        status:
          type: string
          example: accepted
    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