> ## 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.

# Get outcomes over time

> How the agent is doing over time, bucketed by day, week or month in `timezone`. Per bucket: conversations, handover rate, human take-overs, thumbs up/down rate, no-search and empty-search rate, tickets and mean resolution hours, conversion rate and attributed revenue per currency. Conversation metrics count in the bucket the conversation started in, tickets in the bucket they were opened in, orders in the bucket they were attributed in. Rates are null when there is nothing to divide by. Default range: the last 30 days by day in UTC; at most 400 buckets.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/agents/{agentId}/outcomes
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/agents/{agentId}/outcomes:
    get:
      tags:
        - Analytics
      summary: Get outcomes over time
      description: >-
        How the agent is doing over time, bucketed by day, week or month in
        `timezone`. Per bucket: conversations, handover rate, human take-overs,
        thumbs up/down rate, no-search and empty-search rate, tickets and mean
        resolution hours, conversion rate and attributed revenue per currency.
        Conversation metrics count in the bucket the conversation started in,
        tickets in the bucket they were opened in, orders in the bucket they
        were attributed in. Rates are null when there is nothing to divide by.
        Default range: the last 30 days by day in UTC; at most 400 buckets.
      operationId: PublicApiAgentOutcomesController_get
      parameters:
        - name: from
          required: false
          in: query
          description: Start date (ISO 8601)
          schema:
            format: date-time
            example: '2024-01-01T00:00:00.000Z'
            type: string
        - name: to
          required: false
          in: query
          description: End date (ISO 8601)
          schema:
            format: date-time
            example: '2024-12-31T23:59:59.999Z'
            type: string
        - name: timezone
          required: false
          in: query
          description: >-
            IANA time zone the daily buckets follow, so a day runs from local
            midnight to midnight.
          schema:
            default: UTC
            example: Europe/Zagreb
            type: string
        - name: interval
          required: false
          in: query
          description: Bucket size. Weeks start on Monday.
          schema:
            default: day
            type: string
            enum:
              - day
              - week
              - month
        - name: agentId
          required: true
          in: path
          schema: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentOutcomesDto'
        '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:
    AgentOutcomesDto:
      type: object
      properties:
        from:
          type: string
          format: date-time
        to:
          type: string
          format: date-time
        interval:
          type: string
          enum:
            - day
            - week
            - month
        timezone:
          type: string
          example: Europe/Zagreb
        agentId:
          type: string
        total:
          $ref: '#/components/schemas/OutcomeMetricsDto'
        buckets:
          description: Every bucket in the range, oldest first; empty ones are zero.
          type: array
          items:
            $ref: '#/components/schemas/OutcomeBucketDto'
      required:
        - from
        - to
        - interval
        - timezone
        - agentId
        - total
        - buckets
    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
    OutcomeMetricsDto:
      type: object
      properties:
        conversations:
          type: number
          description: Conversations started (playground left out).
        handovers:
          type: number
          description: >-
            Conversations that asked for or reached a person, or got a help-desk
            ticket.
        handoverRate:
          type: number
          nullable: true
          minimum: 0
          maximum: 1
          description: handovers / conversations.
        humanTakeovers:
          type: number
          description: >-
            Conversations a team member took over (live chat, or "take over" on
            a ticket).
        replies:
          type: number
          description: Bot replies.
        thumbsUp:
          type: number
        thumbsDown:
          type: number
        thumbsUpRate:
          type: number
          nullable: true
          minimum: 0
          maximum: 1
          description: Thumbs-up share of rated replies.
        thumbsDownRate:
          type: number
          nullable: true
          minimum: 0
          maximum: 1
          description: Thumbs-down share of rated replies.
        userTurns:
          type: number
          description: Customer messages.
        searches:
          type: number
          description: Knowledge searches.
        emptySearches:
          type: number
          description: Searches that returned nothing.
        noSearchRate:
          type: number
          nullable: true
          minimum: 0
          maximum: 1
          description: >-
            Share of customer messages the bot answered without a knowledge
            search.
        emptySearchRate:
          type: number
          nullable: true
          minimum: 0
          maximum: 1
          description: emptySearches / searches.
        tickets:
          type: number
          description: Help-desk tickets opened.
        resolvedTickets:
          type: number
          description: Of those, tickets resolved.
        avgResolutionHours:
          type: number
          nullable: true
          description: Mean hours from a ticket being opened to being resolved.
        convertedConversations:
          type: number
          description: Conversations with an attributed order.
        conversionRate:
          type: number
          nullable: true
          minimum: 0
          maximum: 1
          description: convertedConversations / conversations.
        orders:
          type: number
          description: Attributed orders.
        revenue:
          description: Attributed revenue per currency, largest first.
          type: array
          items:
            $ref: '#/components/schemas/RevenueByCurrencyDto'
      required:
        - conversations
        - handovers
        - handoverRate
        - humanTakeovers
        - replies
        - thumbsUp
        - thumbsDown
        - thumbsUpRate
        - thumbsDownRate
        - userTurns
        - searches
        - emptySearches
        - noSearchRate
        - emptySearchRate
        - tickets
        - resolvedTickets
        - avgResolutionHours
        - convertedConversations
        - conversionRate
        - orders
        - revenue
    OutcomeBucketDto:
      type: object
      properties:
        conversations:
          type: number
          description: Conversations started (playground left out).
        handovers:
          type: number
          description: >-
            Conversations that asked for or reached a person, or got a help-desk
            ticket.
        handoverRate:
          type: number
          nullable: true
          minimum: 0
          maximum: 1
          description: handovers / conversations.
        humanTakeovers:
          type: number
          description: >-
            Conversations a team member took over (live chat, or "take over" on
            a ticket).
        replies:
          type: number
          description: Bot replies.
        thumbsUp:
          type: number
        thumbsDown:
          type: number
        thumbsUpRate:
          type: number
          nullable: true
          minimum: 0
          maximum: 1
          description: Thumbs-up share of rated replies.
        thumbsDownRate:
          type: number
          nullable: true
          minimum: 0
          maximum: 1
          description: Thumbs-down share of rated replies.
        userTurns:
          type: number
          description: Customer messages.
        searches:
          type: number
          description: Knowledge searches.
        emptySearches:
          type: number
          description: Searches that returned nothing.
        noSearchRate:
          type: number
          nullable: true
          minimum: 0
          maximum: 1
          description: >-
            Share of customer messages the bot answered without a knowledge
            search.
        emptySearchRate:
          type: number
          nullable: true
          minimum: 0
          maximum: 1
          description: emptySearches / searches.
        tickets:
          type: number
          description: Help-desk tickets opened.
        resolvedTickets:
          type: number
          description: Of those, tickets resolved.
        avgResolutionHours:
          type: number
          nullable: true
          description: Mean hours from a ticket being opened to being resolved.
        convertedConversations:
          type: number
          description: Conversations with an attributed order.
        conversionRate:
          type: number
          nullable: true
          minimum: 0
          maximum: 1
          description: convertedConversations / conversations.
        orders:
          type: number
          description: Attributed orders.
        revenue:
          description: Attributed revenue per currency, largest first.
          type: array
          items:
            $ref: '#/components/schemas/RevenueByCurrencyDto'
        start:
          type: string
          example: '2026-11-02'
          description: First local day of the bucket (YYYY-MM-DD) in `timezone`.
      required:
        - conversations
        - handovers
        - handoverRate
        - humanTakeovers
        - replies
        - thumbsUp
        - thumbsDown
        - thumbsUpRate
        - thumbsDownRate
        - userTurns
        - searches
        - emptySearches
        - noSearchRate
        - emptySearchRate
        - tickets
        - resolvedTickets
        - avgResolutionHours
        - convertedConversations
        - conversionRate
        - orders
        - revenue
        - start
    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
    RevenueByCurrencyDto:
      type: object
      properties:
        currency:
          type: string
          example: EUR
        amount:
          type: number
          example: 1249.5
        orders:
          type: number
          example: 14
      required:
        - currency
        - amount
        - orders
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: JWT
      type: http

````

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