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

# Get the minutes ledger

> Returns the shared credit for a window: every grant and move as a row oldest first (plan and trial credit, top-ups, bonus credit, auto top-ups, refunds, adjustments, credit handed to or back from people; with `include_usage=true` also every settled call and chat reply, with its `channel`, `contact`, talk `seconds` and, for a reply, `price_milli`), usage by channel in `by_channel`, minutes used by each agent in `usage`, and the balances: `closing_balance` = `opening_balance` + the rows' minutes - `used_minutes`. Defaults to the current billing period so far, or the last 30 days with no plan; pass `from` and `to` (ISO 8601, at most 400 days) for another. Pages the rows with `limit` and `cursor`; the balances and `usage` cover the whole window on every page.

**Scopes:** `billing:read`



## OpenAPI

````yaml /api-reference/openapi.json get /v1/billing/ledger
openapi: 3.1.0
info:
  title: Kallabot API
  version: '2026-11-07'
  description: >
    The Kallabot API lets you build and run AI agents that answer and make phone
    calls and reply on

    WhatsApp, Messenger, Instagram and website chat.


    - **Base URL:** `https://api.kallabot.com`

    - **Auth:** `Authorization: Bearer kb_live_…` (create a key in the dashboard
    under Settings → API keys).
      Each operation lists the scopes its key needs. A workspace key (`kb_live_…`) belongs to the workspace;
      a personal key (`kbp_live_…`) acts as the person who made it, within their role, and is logged under
      their name. Operations marked **Needs a personal key** need someone behind them, so only a personal
      key works there. The browser side of a web call is the exception: its
      `/client` operations take only the session's `X-Webcall-Grant`, so your key never reaches the page.
    - **Errors:** every error is `application/problem+json` with a stable `code`
    ([error reference](https://docs.kallabot.com/developers/errors)).

    - **Retries:** send an `Idempotency-Key` on creates and control actions; a
    retry with the same key never runs twice.

    - **Rate limits:** every response carries `RateLimit-Limit`,
    `RateLimit-Remaining` and `RateLimit-Reset`;
      a `429` carries `Retry-After`.
    - **Versions:** the API is versioned by date. Send `Kallabot-Version:
    2026-11-07` to pin the version
      you built against; without it you get the current version (`2026-11-07`). Every response names the
      version that answered in `Kallabot-Version`, and an unknown version is refused with 400
      `unsupported_api_version`.
    - **Lists:** every list takes `limit` and `cursor` and answers `{data,
    next_cursor, has_more}`. Pass
      `next_cursor` back as `cursor` for the next page; cursors are opaque.
    - **Concurrency:** reads of versioned objects carry an `ETag` (the revision
    in quotes, e.g. `"7"`); send it back as
      `If-Match` and a stale write is refused with 412. Where `If-Match` is marked required, a write without it gets 428.
    - **SDKs:** the official SDKs send `X-Kallabot-SDK`. A deprecated release
    gets a `Kallabot-SDK-Warning` header;
      a release that has been switched off is refused with 426 `sdk_version_unsupported` and must upgrade.
    - **Webhooks:** every event Kallabot sends is listed under Webhooks with its
    payload, signed with
      [Standard Webhooks](https://docs.kallabot.com/developers/webhooks) headers.
  contact:
    name: Kallabot support
    email: contact@kallabot.com
    url: https://docs.kallabot.com
  termsOfService: https://kallabot.com/terms
servers:
  - url: https://api.kallabot.com
    description: Production
security:
  - apiKey: []
tags:
  - name: Agents
    description: >-
      Create, version, publish and archive the AI agents that answer and make
      calls and chats.
  - name: Calls
    description: >-
      Place phone calls, read them back with transcripts, recordings and
      timings, and control live calls.
  - name: Scheduled calls
    description: >-
      Book an outbound call for later; Kallabot dials at the right time in the
      callee's time zone.
  - name: Web calls
    description: Start a voice call from a browser (WebRTC) with a short-lived grant.
  - name: Tools
    description: >-
      Give agents actions: HTTP API tools, MCP servers, and the secrets they
      use.
  - name: Workflows
    description: >-
      Read the workspace's automations, their runs, app connections and
      templates; start a workflow; browse the apps agents' tools are built from.
  - name: Knowledge
    description: Index websites, files and catalogs so agents answer from your own facts.
  - name: Numbers
    description: >-
      Search, buy and configure phone numbers, port numbers in, and choose
      caller IDs.
  - name: Spam and blocking
    description: >-
      Block people on any channel and set the limits that catch spammers by
      themselves.
  - name: Calling zones and countries
    description: >-
      What a call costs a minute by where it goes and the number it comes in on,
      and the countries a workspace's calls may go to or come from.
  - name: SIP trunks
    description: Bring your own carrier over SIP and attach its numbers to agents.
  - name: Inbox
    description: >-
      Read chat threads from WhatsApp, Messenger, Instagram and web chat, and
      manage their state.
  - name: Web chat
    description: Create and publish website chat widgets.
  - name: Webhooks
    description: >-
      Receive signed events when calls end, messages arrive and more; inspect
      and replay deliveries.
  - name: Minutes
    description: Read the workspace's minutes and move them between the pool and people.
  - name: Billing
    description: >-
      See the plan, prices and invoices; open Checkout or the billing portal,
      sync seats and set auto top-up. Money is integer minor units plus
      `currency`.
paths:
  /v1/billing/ledger:
    get:
      tags:
        - Billing
      summary: Get the minutes ledger
      description: >-
        Returns the shared credit for a window: every grant and move as a row
        oldest first (plan and trial credit, top-ups, bonus credit, auto
        top-ups, refunds, adjustments, credit handed to or back from people;
        with `include_usage=true` also every settled call and chat reply, with
        its `channel`, `contact`, talk `seconds` and, for a reply,
        `price_milli`), usage by channel in `by_channel`, minutes used by each
        agent in `usage`, and the balances: `closing_balance` =
        `opening_balance` + the rows' minutes - `used_minutes`. Defaults to the
        current billing period so far, or the last 30 days with no plan; pass
        `from` and `to` (ISO 8601, at most 400 days) for another. Pages the rows
        with `limit` and `cursor`; the balances and `usage` cover the whole
        window on every page.


        **Scopes:** `billing:read`
      operationId: getMinutesLedger
      parameters:
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: 'ISO 8601. Default: the period''s start.'
            title: From
          description: 'ISO 8601. Default: the period''s start.'
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: 'ISO 8601. Default: now.'
            title: To
          description: 'ISO 8601. Default: now.'
        - name: limit
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 100
                minimum: 1
              - type: 'null'
            title: Limit
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 512
              - type: 'null'
            title: Cursor
        - name: include_usage
          in: query
          required: false
          schema:
            type: boolean
            description: Also list each settled call and chat reply.
            default: false
            title: Include Usage
          description: Also list each settled call and chat reply.
        - name: order
          in: query
          required: false
          schema:
            enum:
              - asc
              - desc
            type: string
            description: '`desc`: newest rows first.'
            default: asc
            title: Order
          description: '`desc`: newest rows first.'
        - name: Kallabot-Version
          in: header
          required: false
          description: >-
            The API version to answer as, a date (`YYYY-MM-DD`). Leave it out
            for the current version (`2026-11-07`). An unknown version is
            refused with 400 `unsupported_api_version`.
          schema:
            type: string
            enum:
              - '2026-11-07'
            example: '2026-11-07'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LedgerPage'
          headers:
            RateLimit-Limit:
              description: Requests allowed per minute for this credential.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window is full again.
              schema:
                type: integer
            X-Request-Id:
              description: Quote this when contacting support.
              schema:
                type: string
            Kallabot-Version:
              description: The API version that answered this request.
              schema:
                type: string
                example: '2026-11-07'
            Kallabot-SDK-Warning:
              description: >-
                Sent when the SDK release that made the request is deprecated:
                what to upgrade to. The SDKs log it once.
              schema:
                type: string
        '400':
          $ref: '#/components/responses/UnsupportedApiVersion'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/InvalidRequest'
        '426':
          $ref: '#/components/responses/SdkVersionUnsupported'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - apiKey: []
components:
  schemas:
    LedgerPage:
      properties:
        data:
          items:
            $ref: '#/components/schemas/LedgerRowOut'
          type: array
          title: Data
          description: >-
            Grants and moves in the window, oldest first (newest first with
            `order=desc`).
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
        has_more:
          type: boolean
          title: Has More
        from:
          type: string
          title: From
        to:
          type: string
          title: To
        window:
          type: string
          enum:
            - period
            - last_30_days
            - custom
          title: Window
          description: >-
            `period`: the current billing period so far; `last_30_days`: no
            plan; `custom`: from/to given.
        opening_balance:
          type: number
          title: Opening Balance
          description: The shared pool at `from`, live calls' holds left out.
        closing_balance:
          type: number
          title: Closing Balance
          description: >-
            At `to`: opening + Σ rows − used_minutes − chat replies (as
            minutes). In money: closing_amount = opening_amount + Σ credit −
            calls_amount − chats_amount.
        held_minutes:
          type: number
          title: Held Minutes
          description: Held by calls still live at `to`.
        available_at_close:
          type: number
          title: Available At Close
          description: 'closing_balance − held_minutes: what could be spent at `to`.'
        granted_minutes:
          type: number
          title: Granted Minutes
        taken_minutes:
          type: number
          title: Taken Minutes
          description: >-
            Refunds, adjustments and moves out of the pool, as a positive
            number.
        used_minutes:
          type: number
          title: Used Minutes
          description: Settled call minutes in the window, all agents.
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
          description: The currency of the `*_amount` fields.
        opening_amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Opening Amount
          description: The balance at `from`, holds left out, minor units.
        closing_amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Closing Amount
        held_amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Held Amount
        available_amount_at_close:
          anyOf:
            - type: integer
            - type: 'null'
          title: Available Amount At Close
        granted_amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Granted Amount
        taken_amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Taken Amount
        calls_amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Calls Amount
          description: Settled calls in the window.
        chats_amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Chats Amount
          description: Chat replies in the window.
        chat_replies:
          anyOf:
            - type: integer
            - type: 'null'
          title: Chat Replies
        usage:
          items:
            $ref: '#/components/schemas/AgentUsageOut'
          type: array
          title: Usage
          description: Minutes used in the window by agent, most first.
        by_channel:
          items:
            $ref: '#/components/schemas/ChannelUsageOut'
          type: array
          title: By Channel
          description: Usage in the window by channel.
      type: object
      required:
        - data
        - next_cursor
        - has_more
        - from
        - to
        - window
        - opening_balance
        - closing_balance
        - held_minutes
        - available_at_close
        - granted_minutes
        - taken_minutes
        - used_minutes
        - usage
      title: LedgerPage
    LedgerRowOut:
      properties:
        id:
          type: string
          title: Id
        at:
          type: string
          title: At
        kind:
          type: string
          enum:
            - plan
            - trial
            - starter
            - pack
            - auto_topup
            - refund
            - adjustment
            - to_member
            - from_member
            - expiry
            - reversal
            - bonus
            - addon
            - call
            - chat
            - message
            - promo
            - staff
            - number
            - other
          title: Kind
          description: >-
            `plan`: the plan's minutes for a period; `trial`: the free trial's;
            `starter`: the minutes a new workspace opened with; `pack` /
            `auto_topup`: bought; `addon`: came with an add-on (the Launch
            package); `promo`: free credit to try (spent first on calls and
            chats, never on numbers); `staff`: staff credit; `number`: a phone
            number paid from credit; `to_member` / `from_member`: handed to or
            back from a person's own allowance; `call` / `chat` / `message`:
            usage, only with `include_usage=true`.
        ledger_kind:
          type: string
          title: Ledger Kind
          description: 'The ledger''s own kind: plan_grant, purchase, transfer_out …'
        minutes:
          type: number
          title: Minutes
          description: >-
            Signed: positive into the shared pool, negative out of it. Since the
            money balance: the money as minutes of calls at the plan rate.
        credit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Credit
          description: Signed money this row moved, minor units of `credit_currency`.
        credit_currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Credit Currency
        amount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Amount
          description: What it cost (packs, auto top-ups) or was refunded, minor units.
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
        note:
          type: string
          title: Note
        payment_intent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Payment Intent Id
        member_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Member User Id
          description: The person on the other side of a move.
        channel:
          anyOf:
            - type: string
            - type: 'null'
          title: Channel
          description: >-
            Usage rows: `call`, `web_call`, `whatsapp`, `instagram`,
            `messenger`, `web`.
        direction:
          anyOf:
            - type: string
            - type: 'null'
          title: Direction
          description: 'Usage rows: `inbound` or `outbound`.'
        contact:
          anyOf:
            - type: string
            - type: 'null'
          title: Contact
          description: 'Usage rows: the masked number, or the chat contact''s name.'
        seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Seconds
          description: 'Calls: talk time in seconds.'
        agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Id
          description: 'Usage rows: the agent.'
        price_milli:
          anyOf:
            - type: integer
            - type: 'null'
          title: Price Milli
          description: >-
            Chat replies: the price of one reply in thousandths of a minor unit
            (each row takes the running total's step).
      type: object
      required:
        - id
        - at
        - kind
        - ledger_kind
        - minutes
        - note
      title: LedgerRowOut
    AgentUsageOut:
      properties:
        agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Id
          description: Null for calls with no agent.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        avatar_image:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Image
        avatar_emoji:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Emoji
        archived:
          type: boolean
          title: Archived
          default: false
        minutes:
          type: number
          title: Minutes
        calls:
          type: integer
          title: Calls
          description: Calls that used minutes.
        calls_amount:
          type: integer
          title: Calls Amount
          description: What its calls cost, minor units.
          default: 0
        chats_amount:
          type: integer
          title: Chats Amount
          description: What its chat replies cost, minor units.
          default: 0
        chat_replies:
          type: integer
          title: Chat Replies
          description: AI replies it sent on chat channels.
          default: 0
      type: object
      required:
        - agent_id
        - name
        - minutes
        - calls
      title: AgentUsageOut
    ChannelUsageOut:
      properties:
        channel:
          type: string
          title: Channel
          description: '`call`, `whatsapp`, `instagram`, `messenger`, `web` …'
        amount:
          type: integer
          title: Amount
          description: What it cost in the window, minor units.
        calls:
          type: integer
          title: Calls
          default: 0
        minutes:
          type: number
          title: Minutes
          default: 0
        replies:
          type: integer
          title: Replies
          default: 0
      type: object
      required:
        - channel
        - amount
      title: ChannelUsageOut
    Problem:
      type: object
      description: >-
        An RFC 9457 problem. `code` is the stable contract; `title` and `detail`
        are for people.
      required:
        - type
        - title
        - status
        - code
        - retryable
      properties:
        type:
          type: string
          format: uri
          example: https://docs.kallabot.com/errors/not_found
        title:
          type: string
          example: Agent not found
        status:
          type: integer
          example: 404
        code:
          type: string
          example: not_found
        detail:
          type: string
          example: Agent does not exist, or you do not have access to it.
        retryable:
          type: boolean
          example: false
        field_problems:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                description: JSON Pointer to the field.
                example: /to
              code:
                type: string
                example: missing
              message:
                type: string
                example: Field required
        request_id:
          type: string
          example: req_01HZX3K9Q2
  responses:
    UnsupportedApiVersion:
      description: Kallabot-Version names a version this API doesn't have
      headers:
        X-Request-Id:
          description: Quote this when contacting support.
          schema:
            type: string
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://docs.kallabot.com/errors/unsupported_api_version
            title: Kallabot-Version names a version this API doesn't have
            status: 400
            code: unsupported_api_version
            retryable: false
    Unauthenticated:
      description: Missing or invalid API key
      headers:
        X-Request-Id:
          description: Quote this when contacting support.
          schema:
            type: string
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://docs.kallabot.com/errors/unauthenticated
            title: Missing or invalid API key
            status: 401
            code: unauthenticated
            retryable: false
    Forbidden:
      description: The key lacks a required scope
      headers:
        X-Request-Id:
          description: Quote this when contacting support.
          schema:
            type: string
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://docs.kallabot.com/errors/insufficient_scope
            title: The key lacks a required scope
            status: 403
            code: insufficient_scope
            retryable: false
    InvalidRequest:
      description: One or more fields are not valid
      headers:
        X-Request-Id:
          description: Quote this when contacting support.
          schema:
            type: string
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://docs.kallabot.com/errors/invalid_request
            title: One or more fields are not valid
            status: 422
            code: invalid_request
            retryable: false
    SdkVersionUnsupported:
      description: 'This SDK release is switched off: upgrade the SDK'
      headers:
        X-Request-Id:
          description: Quote this when contacting support.
          schema:
            type: string
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://docs.kallabot.com/errors/sdk_version_unsupported
            title: 'This SDK release is switched off: upgrade the SDK'
            status: 426
            code: sdk_version_unsupported
            retryable: false
    RateLimited:
      description: Too many requests
      headers:
        X-Request-Id:
          description: Quote this when contacting support.
          schema:
            type: string
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
        RateLimit-Limit:
          description: Requests allowed per minute for this credential.
          schema:
            type: integer
        RateLimit-Remaining:
          description: Requests left in the current window.
          schema:
            type: integer
        RateLimit-Reset:
          description: Seconds until the window is full again.
          schema:
            type: integer
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://docs.kallabot.com/errors/rate_limited
            title: Too many requests
            status: 429
            code: rate_limited
            retryable: true
    InternalError:
      description: Something went wrong on our side
      headers:
        X-Request-Id:
          description: Quote this when contacting support.
          schema:
            type: string
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://docs.kallabot.com/errors/internal_error
            title: Something went wrong on our side
            status: 500
            code: internal_error
            retryable: true
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: kb_live_<lookup>_<secret> | kbp_live_<lookup>_<secret>
      description: >-
        An API key from Settings → API keys, sent as `Authorization: Bearer
        kb_live_…`. A workspace key starts `kb_`; a personal key starts `kbp_`
        and acts as its owner.

````

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