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

# Ingest a batch of AI call observability events (agent internal)

> Receives batched AICallEvent records from the agent's observability worker and bulk-inserts them into MongoDB. Protected by the shared x-ai-tool-secret header — no JWT required.




## OpenAPI

````yaml /openapi.json post /observability/ai-calls
openapi: 3.0.0
info:
  title: InteraOne API
  version: 1.0.0
  description: >-
    REST API for InteraOne authentication, organizations, support operations,
    channels, knowledge, AI coordination, and administration.
servers:
  - url: http://localhost:3002/api/v1
    description: Local development gateway
security: []
tags:
  - name: Authentication
    description: Signup, login, OTP, password recovery, refresh, logout, and profile.
  - name: Organizations
    description: Tenant lifecycle, switching, billing entitlements, and usage.
  - name: Memberships
    description: Invitations, members, roles, and membership status.
  - name: Agent
    description: Support-agent profile and presence.
  - name: Conversations
    description: Inbox, messages, routing, status, memory, handoff, and agent assist.
  - name: Contacts
    description: Customer profiles, notes, tags, and conflict resolution.
  - name: Tickets
    description: Ticket creation, assignment, updates, notes, replies, and AI operations.
  - name: Templates
    description: Saved support response templates.
  - name: Widget
    description: Widget configuration, public sessions, conversations, and QR scans.
  - name: Channels
    description: >-
      Email, WhatsApp, Telegram, provisioning, verification, and inbound
      webhooks.
  - name: Email
    description: Internal email sending and contact verification.
  - name: Knowledge
    description: >-
      Knowledge sources, uploads, indexing, reindexing, and unanswered
      questions.
  - name: Storage
    description: Presigned object upload/download and metadata operations.
  - name: Notifications
    description: Tenant and user notifications.
  - name: Analytics
    description: Organization, owner, and agent support metrics.
  - name: Observability
    description: AI call ingestion and aggregate performance data.
paths:
  /observability/ai-calls:
    post:
      tags:
        - Observability
      summary: Ingest a batch of AI call observability events (agent internal)
      description: >
        Receives batched AICallEvent records from the agent's observability
        worker and bulk-inserts them into MongoDB. Protected by the shared
        x-ai-tool-secret header — no JWT required.
      parameters:
        - in: header
          name: x-ai-tool-secret
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - events
              properties:
                events:
                  type: array
                  maxItems: 500
                  items:
                    type: object
                    required:
                      - timestamp
                      - provider
                      - modelId
                      - callType
                      - latencyMs
                      - success
                    properties:
                      timestamp:
                        type: string
                        format: date-time
                      provider:
                        type: string
                        example: bedrock
                      modelId:
                        type: string
                      callType:
                        type: string
                        enum:
                          - llm
                          - embedding
                      latencyMs:
                        type: number
                      inputTokens:
                        type: number
                      outputTokens:
                        type: number
                      totalTokens:
                        type: number
                      estimatedCostUsd:
                        type: number
                      success:
                        type: boolean
                      error:
                        type: string
                      organizationId:
                        type: string
                      conversationId:
                        type: string
      responses:
        '201':
          description: Events ingested successfully
        '400':
          description: Invalid request body
        '401':
          description: Unauthorized (missing or invalid AI tool secret)

````