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

> ## Agent Instructions
> Use the public API base URL: https://api.teamfollowup.ai/api.
> Authenticate public API requests with Authorization: Bearer YOUR_API_KEY.
> Use product-owned terms: agents, campaigns, projects (GoHighLevel sub-accounts), contacts, calls, outcomes, skills, cadences, phone numbers.
> Scope requests by locationId rather than projectName.
> Read the guide linked from each API reference group before recommending an endpoint.

# List billing transactions

> Everything that moved your agency wallet in a window, newest first, as one paged list: purchases, bonus minutes, sub-account top-ups, returned minutes, calls your wallet paid for (one row per sub-account per day), phone numbers, and co-author usage.

Each row says what it did to your wallet (`walletEffect`) and whether money changed hands (`cashFlow`).

Allowed customer roles: `agency_admin`. The agency is the one the credential belongs to; no parameter selects another.

Required API key scope: `billing:read`.



## OpenAPI

````yaml /openapi.yaml get /api/billing/transactions
openapi: 3.1.0
info:
  title: TFUAI Server API
  version: 1.0.0
  description: >-
    API reference for the TFUAI SaaS server.


    All published endpoints are mounted under `/api`. Responses use a standard
    envelope: `{ "success": true, ... }` on success and `{ "success": false,
    "error": "..." }` on failure.


    Product API modules are being launched module by module. This spec currently
    exposes only contracted public modules.


    Authenticate public API requests with an API key in the `Authorization`
    header: `Authorization: Bearer YOUR_API_KEY`.
servers:
  - url: https://api.teamfollowup.ai
    description: Production API origin. Public API paths are under /api.
security: []
tags:
  - name: Agents
    description: Manage voice agents, campaigns, workflows, and outcomes.
  - name: Analytics
    description: >-
      Minimal, non-billing performance summary: volume, conversion, and pickup
      metrics.
  - name: Billing
    description: >-
      Billing for your own agency: balance, spend, transaction history, invoices
      and sub-account wallets; auto-recharge, rebilling, Credit Guard and Stripe
      customers; and, with the billing:charge scope, purchases and charges.
  - name: Calls
    description: Review calls, test runs, and execution history.
  - name: Campaign Workflows
    description: >-
      What runs after a call lands: for each outcome (booked, opted out, asked
      for a callback…), an ordered chain of actions — tag the contact, move a
      pipeline stage, send an SMS, book an appointment. Stored as a graph:
      `nodes` are the actions, `edges` say what follows what, and
      `dispositionEntries` maps each outcome to the node its chain starts at.


      **Pick the narrowest endpoint that does the job.**


      | To | Call | |

      | --- | --- | --- |

      | See what fires per outcome | `GET .../workflow/digest` | Reads as plain
      text, no graph walking |

      | Add steps to an outcome | `POST .../outcomes/{outcome}/nodes` | Server
      derives node ids, edge ids, handles, layout |

      | Change a message, tag or setting | `PATCH .../workflow` | Merges;
      carries no graph, so it cannot damage one |

      | Remove one step | `DELETE .../nodes/{nodeId}` | Also re-links the chain
      around it |

      | Author or replace the whole graph | `PUT .../workflow` | Replaces
      everything you send |


      `PUT` is the only one that can re-wire, position nodes, build an `if`,
      save an unconfigured draft, or copy a whole workflow — and the only one
      that can overwrite a change someone else made after you read it. Use it
      when you are genuinely authoring the graph, and send `expectedVersion`
      when you do. For everything else the narrower endpoints are both easier
      and safer.
  - name: Contacts
    description: Contact list, filters, contact call history, and do-not-call actions.
  - name: GHL
    description: CRM variables and contact helpers used by agent and campaign setup flows.
  - name: Phone Numbers
    description: >-
      Caller ID pool, number search, assignment, movement, and release
      endpoints.
  - name: Power Dialer
    description: >-
      Power Dialer queue, lead cadence, callback, parked lead, and campaign
      schedule endpoints.
  - name: Projects
    description: >-
      Project management endpoints: list, update, disconnect, configure project
      campaigns, and validate setup.
  - name: Skills and Tools
    description: Manage reusable agent behaviors and in-call tool descriptions.
  - name: Split Testing
    description: >-
      Split live campaign traffic across agent variants and shift the weights
      between them.
  - name: Voices
    description: Voice catalogue endpoints for choosing the voice used by an agent.
paths:
  /api/billing/transactions:
    get:
      tags:
        - Billing
      summary: List billing transactions
      description: >-
        Everything that moved your agency wallet in a window, newest first, as
        one paged list: purchases, bonus minutes, sub-account top-ups, returned
        minutes, calls your wallet paid for (one row per sub-account per day),
        phone numbers, and co-author usage.


        Each row says what it did to your wallet (`walletEffect`) and whether
        money changed hands (`cashFlow`).


        Allowed customer roles: `agency_admin`. The agency is the one the
        credential belongs to; no parameter selects another.


        Required API key scope: `billing:read`.
      operationId: get-billing-transactions
      parameters:
        - name: dateFromUTC
          in: query
          required: false
          schema:
            type: string
          description: >-
            Start of the window. A UTC ISO 8601 timestamp is canonical; a plain
            `YYYY-MM-DD` date is accepted and read as that day at 00:00:00Z. A
            timestamp must carry `Z` or an explicit offset, since one without a
            zone would be read as server-local time and shift the window. An
            empty string clears the bound. Anything else is a 400 rather than a
            silently wrong window. Billing windows are whole UTC days, so a
            timestamp selects the day it falls on. Omit both bounds for the last
            30 days. The window can cover at most 366 days.
          example: '2026-09-01'
        - name: dateToUTC
          in: query
          required: false
          schema:
            type: string
          description: >-
            End of the window, inclusive. Defaults to today. A UTC ISO 8601
            timestamp is canonical; a plain `YYYY-MM-DD` date is accepted and
            covers that whole day, through 23:59:59.999Z. A timestamp must carry
            `Z` or an explicit offset, since one without a zone would be read as
            server-local time and shift the window. An empty string clears the
            bound. Anything else is a 400 rather than a silently wrong window.
            Billing windows are whole UTC days, so a timestamp selects the day
            it falls on.
          example: '2026-09-14'
        - name: type
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - PURCHASE
                - BONUS
                - SUB_ACCOUNT_TOP_UP
                - MINUTES_RETURNED
                - CALL_USAGE
                - PHONE_NUMBER
                - CO_AUTHOR
          description: >-
            Only these transaction types. Repeat the parameter or separate
            values with commas.
          example:
            - PURCHASE
            - SUB_ACCOUNT_TOP_UP
        - name: locationId
          in: query
          required: false
          schema:
            type: string
            minLength: 1
          description: >-
            Only rows that belong to this sub-account. Rows with no sub-account
            (your own purchases, phone numbers, co-author usage) are left out
            when this is set.
          example: rrHDPw5RIR5ULeUlfSAR
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
          description: Page number, from 1.
          example: 1
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
          description: Rows per page, at most 200.
          example: 50
      responses:
        '200':
          description: One page of transactions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingTransactionsResponse'
              examples:
                default:
                  value:
                    success: true
                    data:
                      window:
                        from: '2026-08-16'
                        to: '2026-09-14'
                        days: 30
                      transactions:
                        - id: debit-BKT-7f3a
                          type: PURCHASE
                          occurredAt: '2026-09-12T15:02:11.000Z'
                          description: Purchased GOLD - 1,000 mins @ $0.340/min
                          amountUSD: 340
                          minutes: 1000
                          ratePerMinute: 0.34
                          walletEffect: ADD
                          cashFlow: PAID_BY_YOU
                          subAccount: null
                          planCode: GOLD
                          phoneNumber: null
                          calls: null
                          usageDate: null
                        - id: credit-BKT-51c0
                          type: SUB_ACCOUNT_TOP_UP
                          occurredAt: '2026-09-10T09:30:00.000Z'
                          description: Revenue from Bright Dental - 200 mins @ $0.450/min
                          amountUSD: 90
                          minutes: 200
                          ratePerMinute: 0.45
                          walletEffect: DEDUCT
                          cashFlow: PAID_TO_YOU
                          subAccount:
                            locationId: rrHDPw5RIR5ULeUlfSAR
                            name: Bright Dental
                          planCode: null
                          phoneNumber: null
                          calls: null
                          usageDate: null
                        - id: phone-BKT-7f3a-1757502000000-+14155550100
                          type: PHONE_NUMBER
                          occurredAt: '2026-09-10T11:00:00.000Z'
                          description: Monthly renewal of +14155550100
                          amountUSD: 2
                          minutes: 5.88
                          ratePerMinute: 0.34
                          walletEffect: DEDUCT
                          cashFlow: NONE
                          subAccount: null
                          planCode: null
                          phoneNumber: '+14155550100'
                          calls: null
                          usageDate: null
                        - id: call-usage-2026-09-09-q8LmVt2ZzYQ4pWnKdRb1
                          type: CALL_USAGE
                          occurredAt: '2026-09-09T00:00:00.000Z'
                          description: 42 calls from Harbour Roofing paid from your wallet
                          amountUSD: 26.52
                          minutes: 78
                          ratePerMinute: 0.34
                          walletEffect: DEDUCT
                          cashFlow: NONE
                          subAccount:
                            locationId: q8LmVt2ZzYQ4pWnKdRb1
                            name: Harbour Roofing
                          planCode: null
                          phoneNumber: null
                          calls: 42
                          usageDate: '2026-09-09'
                    pagination:
                      page: 1
                      limit: 50
                      total: 4
                      totalPages: 1
        '400':
          description: >-
            A query parameter is malformed, unknown, or the window cannot be
            formed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
              examples:
                default:
                  value:
                    success: false
                    error: BadRequest
                    message: dateFromUTC must not be after dateToUTC
        '401':
          description: Missing or invalid authentication.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
              examples:
                default:
                  value:
                    success: false
                    error: Unauthorized
        '403':
          description: >-
            The credential lacks `billing:read` (`InsufficientScope`), or it is
            not an agency admin's (`Forbidden`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
              examples:
                default:
                  value:
                    success: false
                    error: InsufficientScope
                    message: This API key does not have the required scope.
                    requiredScope: billing:read
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
              examples:
                default:
                  value:
                    success: false
                    error: TooManyRequests
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingErrorResponse'
              examples:
                default:
                  value:
                    success: false
                    error: InternalError
                    message: Could not load billing usage.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.teamfollowup.ai/api/billing/transactions \
              --header 'Authorization: Bearer YOUR_API_KEY'
components:
  schemas:
    BillingTransactionsResponse:
      type: object
      additionalProperties: false
      required:
        - success
        - data
        - pagination
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          additionalProperties: false
          required:
            - window
            - transactions
          properties:
            window:
              $ref: '#/components/schemas/BillingWindow'
            transactions:
              type: array
              items:
                $ref: '#/components/schemas/BillingTransaction'
        pagination:
          $ref: '#/components/schemas/BillingPagination'
    BillingErrorResponse:
      type: object
      additionalProperties: false
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: Machine-readable code.
        message:
          type: string
          description: For a person.
        requiredScope:
          type: string
          description: On `InsufficientScope`, the scope the credential was missing.
    BillingWindow:
      type: object
      additionalProperties: false
      description: The whole UTC days the answer covers.
      required:
        - from
        - to
        - days
      properties:
        from:
          type: string
          format: date
          description: First day, inclusive.
        to:
          type: string
          format: date
          description: Last day, inclusive.
        days:
          type: integer
          minimum: 0
          description: Days covered.
    BillingTransaction:
      type: object
      additionalProperties: false
      required:
        - id
        - type
        - occurredAt
        - description
        - amountUSD
        - minutes
        - ratePerMinute
        - walletEffect
        - cashFlow
        - subAccount
        - planCode
        - phoneNumber
        - calls
        - usageDate
      properties:
        id:
          type: string
          description: Stable within your agency.
        type:
          type: string
          enum:
            - PURCHASE
            - BONUS
            - SUB_ACCOUNT_TOP_UP
            - MINUTES_RETURNED
            - CALL_USAGE
            - PHONE_NUMBER
            - CO_AUTHOR
          description: What kind of row this is.
        occurredAt:
          type: string
          format: date-time
          description: When it happened. Day rollups carry the start of their day.
        description:
          type: string
          description: For a person.
        amountUSD:
          type: number
          description: >-
            The money on the row. For `SUB_ACCOUNT_TOP_UP`, what the sub-account
            paid you.
        minutes:
          type:
            - number
            - 'null'
          description: >-
            Minutes on the row. `null` for co-author usage, which is billed in
            dollars.
        ratePerMinute:
          type:
            - number
            - 'null'
          description: The per-minute rate the row was priced at.
        walletEffect:
          type: string
          enum:
            - ADD
            - DEDUCT
            - NONE
          description: What the row did to your wallet.
        cashFlow:
          type: string
          enum:
            - PAID_BY_YOU
            - PAID_TO_YOU
            - NONE
          description: Whether money changed hands, and which way.
        subAccount:
          description: The sub-account the row belongs to, or `null` for agency-level rows.
          anyOf:
            - $ref: '#/components/schemas/BillingSubAccountRef'
            - type: 'null'
        planCode:
          type:
            - string
            - 'null'
          description: For purchases, the plan bought.
        phoneNumber:
          type:
            - string
            - 'null'
          description: For phone number rows, the number in E.164.
        calls:
          type:
            - integer
            - 'null'
          minimum: 0
          description: For `CALL_USAGE`, the calls your wallet paid for that day.
        usageDate:
          type:
            - string
            - 'null'
          format: date
          description: For daily rollups, the day they cover.
    BillingPagination:
      type: object
      additionalProperties: false
      required:
        - page
        - limit
        - total
        - totalPages
      properties:
        page:
          type: integer
          minimum: 0
          description: This page, from 1.
        limit:
          type: integer
          minimum: 0
          description: Rows per page.
        total:
          type: integer
          minimum: 0
          description: Rows across every page.
        totalPages:
          type: integer
          minimum: 0
          description: Pages at this limit.
    BillingSubAccountRef:
      type: object
      additionalProperties: false
      required:
        - locationId
        - name
      properties:
        locationId:
          type: string
          description: GoHighLevel Location ID.
        name:
          type:
            - string
            - 'null'
          description: Display name.
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'Send your API key as `Authorization: Bearer YOUR_API_KEY`.'

````