Leena AI Knowledge Articles API

Stage attachments and sync articles into the Leena Knowledge Base.

OpenAPI Specification

leena-ai-knowledge-articles-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Leena AI External AOP Analytics Knowledge Articles 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: Knowledge Articles
  description: Stage attachments and sync articles into the Leena Knowledge Base.
paths:
  /api/integration/articles/upload/:
    post:
      operationId: uploadKnowledgeAttachment
      summary: Upload an attachment
      description: Stages a file and returns an `attachment_id` to reference from a subsequent article sync. Supported file types are PDF, DOC, DOCX, TXT, HTML, XLS, XLSX, PPT, PPTX, PNG and JPEG.
      tags:
      - Knowledge Articles
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                mime_type:
                  type: string
              required:
              - file
      responses:
        '200':
          description: The attachment was staged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentResponse'
        '401':
          description: Missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /api/integration/articles/sync/:
    post:
      operationId: syncKnowledgeArticle
      summary: Push a knowledge article
      description: Creates or updates an article in the Leena Knowledge Base, keyed by the source system's `reference_id`, with optional attachments and permission scoping.
      tags:
      - Knowledge Articles
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ArticleSyncRequest'
      responses:
        '200':
          description: The article was accepted.
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid article payload, e.g. `html_content` that is not valid HTML.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /sync/complete/:
    post:
      operationId: completeKnowledgeSync
      summary: Complete the initial migration
      description: Signals the end of a bulk load and triggers indexing of the synced articles.
      tags:
      - Knowledge Articles
      security:
      - bearerAuth: []
      responses:
        '200':
          description: Indexing was triggered.
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ArticleSyncRequest:
      type: object
      properties:
        reference_id:
          type: string
          description: Stable identifier of the article in the source system.
        html_content:
          type: string
          description: Article body. Must be valid HTML.
        attachments:
          type: array
          description: Attachment identifiers returned by `uploadKnowledgeAttachment`.
          items:
            type: string
        permissions:
          $ref: '#/components/schemas/ArticlePermissions'
      required:
      - reference_id
      - html_content
    ArticlePermissions:
      type: object
      description: Visibility rules for the article.
      properties:
        department:
          type: array
          items:
            type: string
        location:
          type: array
          items:
            type: string
        user_groups:
          type: array
          items:
            type: string
    Error:
      type: object
      properties:
        message:
          type: string
    AttachmentResponse:
      type: object
      properties:
        attachment_id:
          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