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

# Events feed

> What happened on the agents this key can access: handovers, tickets created and resolved, knowledge gaps detected and verified, knowledge trained or failed, test runs and experiments finished. Each type also needs the scope and plan feature of its area (help desk: `helpdesk:read`; gaps and knowledge: `knowledge:read`; test runs: `quality:read`; experiments: `experiments:read`); types the key or plan does not cover are listed in `unavailable`. Poll with `since=<nextCursor>`. Built from stored data, so events are never lost between polls; there are no webhooks yet.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/events
openapi: 3.0.0
info:
  title: Totebot Public API
  description: >-
    Manage your agents (settings, instructions, widget, skills, actions, MCP
    connections, integrations), their knowledge, test questions, the help desk,
    customers and your team from code, read conversations and analytics, and
    analyse which knowledge each answer used.


    Authenticate with a Bearer token: a team API key (`tb_live_…`, created by a
    team owner in Team settings → API keys) or a legacy per-agent key.

    New keys can only read. Write access is opt-in per area (`agents:write`,
    `plugins:write`, `knowledge:write`, `conversations:write`, `helpdesk:write`,
    `team:write`, `members:write`, `chat:write`, `customers:delete`,
    `quality:write`, `experiments:write`, `sales:write`). Provider cost in USD
    needs the opt-in `billing:read` scope. A key may also be limited to some
    agents.

    Routes that act on one agent take it from the `agentId` path parameter or,
    on the older `/v1/<resource>` routes, from the `X-Agent-Id` header.

    Write routes accept an `Idempotency-Key` header. Over the rate limit you get
    429 with `Retry-After`. Errors share one shape: `{ status: "error", error: {
    code, message, details } }`.

    Not available through the API, on purpose: billing and plan changes,
    deleting the team, creating or changing API keys, and OAuth connect flows.


    This spec is public at https://api.totebot.ai/v1/openapi.json (and .yaml).
  version: '2.0'
  contact: {}
servers:
  - url: https://api.totebot.ai
security: []
tags: []
paths:
  /v1/events:
    get:
      tags:
        - Events
      summary: Events feed
      description: >-
        What happened on the agents this key can access: handovers, tickets
        created and resolved, knowledge gaps detected and verified, knowledge
        trained or failed, test runs and experiments finished. Each type also
        needs the scope and plan feature of its area (help desk:
        `helpdesk:read`; gaps and knowledge: `knowledge:read`; test runs:
        `quality:read`; experiments: `experiments:read`); types the key or plan
        does not cover are listed in `unavailable`. Poll with
        `since=<nextCursor>`. Built from stored data, so events are never lost
        between polls; there are no webhooks yet.
      operationId: PublicApiEventsController_list
      parameters:
        - name: since
          required: false
          in: query
          description: >-
            `nextCursor` from the previous response, or an ISO 8601 date.
            Default: the last 7 days.
          schema:
            type: string
        - name: types
          required: false
          in: query
          description: >-
            Comma-separated event types. Default: all of handover.requested,
            ticket.created, ticket.resolved, gap.detected, gap.verified,
            knowledge.trained, knowledge.failed, test_run.finished,
            experiment.finished.
          schema:
            type: array
            items:
              type: string
        - name: limit
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 100
            default: 50
            type: number
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventsPageDto'
        '400':
          description: Invalid request, or rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '401':
          description: Missing, invalid, revoked or expired API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '403':
          description: >-
            The plan lacks the feature, or the key lacks a scope
            (`error.details.missingScopes`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
        '404':
          description: Not found, or not an agent this key can access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorDto'
      security:
        - api-key: []
components:
  schemas:
    EventsPageDto:
      type: object
      properties:
        items:
          description: Oldest first.
          type: array
          items:
            $ref: '#/components/schemas/FeedEventDto'
        nextCursor:
          type: string
          description: >-
            Pass as `since` next time to get only newer events. Returned even
            when there are none.
        hasMore:
          type: boolean
          description: More events are waiting; call again now.
        unavailable:
          description: Types left out because of the key scopes or the plan.
          type: array
          items:
            $ref: '#/components/schemas/UnavailableEventTypeDto'
      required:
        - items
        - nextCursor
        - hasMore
        - unavailable
    ApiErrorDto:
      type: object
      properties:
        status:
          type: string
          example: error
        error:
          $ref: '#/components/schemas/ApiErrorBodyDto'
        path:
          type: string
          example: /v1/agents/clx123
        timestamp:
          type: string
          example: '2026-11-24T10:00:00.000Z'
      required:
        - status
        - error
        - path
        - timestamp
    FeedEventDto:
      type: object
      properties:
        id:
          type: string
          example: test_run.finished:clx1run
          description: Stable id; the same event always has the same id.
        type:
          type: string
          enum:
            - handover.requested
            - ticket.created
            - ticket.resolved
            - gap.detected
            - gap.verified
            - knowledge.trained
            - knowledge.failed
            - test_run.finished
            - experiment.finished
        occurredAt:
          type: string
        agentId:
          type: string
          nullable: true
        data:
          type: object
          additionalProperties: true
          example:
            runId: clx1run
            status: COMPLETED
            passed: 9
            total: 10
          description: >-
            Ids and counts for the event. Customer text is masked unless the key
            has `customers:read`.
      required:
        - id
        - type
        - occurredAt
        - agentId
        - data
    UnavailableEventTypeDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - handover.requested
            - ticket.created
            - ticket.resolved
            - gap.detected
            - gap.verified
            - knowledge.trained
            - knowledge.failed
            - test_run.finished
            - experiment.finished
        reason:
          type: string
          example: Needs the helpdesk:read scope.
      required:
        - type
        - reason
    ApiErrorBodyDto:
      type: object
      properties:
        code:
          type: string
          example: NotFoundException
        message:
          type: string
          example: Agent not found
        details:
          type: object
          description: >-
            Extra fields, e.g. `missingScopes` on 403 or `secondsRemaining` on a
            training cooldown.
          additionalProperties: true
      required:
        - code
        - message
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: JWT
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.