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

# Get billing summary

> Where your agency stands, in one call: wallet balance and debt, auto-recharge, your platform subscription, any purchase in progress, spend this month, sub-accounts running low, sub-account payments waiting for credit, and a ranked list of what needs attention.

Each section loads on its own. A section that could not be loaded is `null` and is named in `unavailable`, so a `null` you can see in `unavailable` means "unknown", and any other `null` means "none".

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/summary
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/summary:
    get:
      tags:
        - Billing
      summary: Get billing summary
      description: >-
        Where your agency stands, in one call: wallet balance and debt,
        auto-recharge, your platform subscription, any purchase in progress,
        spend this month, sub-accounts running low, sub-account payments waiting
        for credit, and a ranked list of what needs attention.


        Each section loads on its own. A section that could not be loaded is
        `null` and is named in `unavailable`, so a `null` you can see in
        `unavailable` means "unknown", and any other `null` means "none".


        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-summary
      parameters: []
      responses:
        '200':
          description: Billing summary.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingSummaryResponse'
              examples:
                default:
                  value:
                    success: true
                    data:
                      generatedAt: '2026-09-14T12:00:00.000Z'
                      balance:
                        minutes: 412.5
                        valueUSD: 140.25
                        valueIncludingBonusUSD: 150.45
                        debtMinutes: 0
                        debtUSD: 0
                        status: ACTIVE
                        currentRatePerMinute: 0.34
                        planCode: GOLD
                        paymentExempt: false
                      autoRecharge:
                        enabled: true
                        status: ENABLED
                        planCode: GOLD
                        thresholdMinutes: 50
                        blockedReason: null
                        pausedReason: null
                        requiresAction: false
                        recommendedAction: null
                        paymentReviewRequired: false
                        lastSuccessfulRechargeAt: '2026-09-02T08:14:00.000Z'
                        lastFailureAt: null
                        lastFailureCode: null
                        nextRetryAt: null
                      subscription:
                        status: ACTIVE
                        hasAccess: true
                        trialEnd: null
                        currentPeriodEnd: '2026-10-01T00:00:00.000Z'
                        cancelAtPeriodEnd: false
                        pendingPlanCode: null
                        pendingPlanEffectiveAt: null
                        attention: null
                      pendingPurchase: null
                      spendThisMonth:
                        window:
                          from: '2026-09-01'
                          to: '2026-09-14'
                          days: 14
                        calls: 1284
                        minutes: 2310.4
                        callCostUSD: 785.54
                        billedToClientsUSD: 912.3
                        phoneNumbersUSD: 4
                        coAuthorUSD: 3.75
                        totalCostUSD: 793.29
                      subAccounts:
                        total: 12
                        rebilling: 5
                        low: 1
                        empty: 1
                        needsAttention:
                          - locationId: q8LmVt2ZzYQ4pWnKdRb1
                            name: Harbour Roofing
                            balanceMinutes: 0
                            status: DEPLETED
                            creditGuardEnabled: true
                          - locationId: rrHDPw5RIR5ULeUlfSAR
                            name: Bright Dental
                            balanceMinutes: 64.5
                            status: LOW_BALANCE
                            creditGuardEnabled: false
                      pendingCredits:
                        count: 0
                        minutes: 0
                        amountUSD: 0
                      attention:
                        - code: SUB_ACCOUNTS_LOW
                          severity: WARNING
                          message: 2 rebilled sub-accounts are low or empty.
                      unavailable: []
        '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: 'query: Unrecognized key: "agencyTag"'
        '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/summary \
              --header 'Authorization: Bearer YOUR_API_KEY'
components:
  schemas:
    BillingSummaryResponse:
      type: object
      additionalProperties: false
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/BillingSummary'
    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.
    BillingSummary:
      type: object
      additionalProperties: false
      required:
        - generatedAt
        - balance
        - autoRecharge
        - subscription
        - pendingPurchase
        - spendThisMonth
        - subAccounts
        - pendingCredits
        - attention
        - unavailable
      properties:
        generatedAt:
          type: string
          format: date-time
          description: When this answer was computed.
        balance:
          anyOf:
            - $ref: '#/components/schemas/BillingBalance'
            - type: 'null'
        autoRecharge:
          anyOf:
            - $ref: '#/components/schemas/BillingAutoRecharge'
            - type: 'null'
        subscription:
          anyOf:
            - $ref: '#/components/schemas/BillingSubscription'
            - type: 'null'
        pendingPurchase:
          description: The purchase in progress, or `null` when there is none.
          anyOf:
            - $ref: '#/components/schemas/BillingPendingPurchase'
            - type: 'null'
        spendThisMonth:
          description: The current UTC month, to today.
          anyOf:
            - $ref: '#/components/schemas/BillingSpend'
            - type: 'null'
        subAccounts:
          anyOf:
            - $ref: '#/components/schemas/BillingSubAccountRollup'
            - type: 'null'
        pendingCredits:
          description: Sub-account payments waiting for wallet credit.
          anyOf:
            - $ref: '#/components/schemas/BillingPendingCreditRollup'
            - type: 'null'
        attention:
          type: array
          description: What needs attention, most urgent first.
          items:
            $ref: '#/components/schemas/BillingAttentionItem'
        unavailable:
          type: array
          description: Sections that could not be loaded. Each is `null` above.
          items:
            type: string
            enum:
              - balance
              - autoRecharge
              - subscription
              - pendingPurchase
              - spendThisMonth
              - subAccounts
              - pendingCredits
            description: A section name.
    BillingBalance:
      type: object
      additionalProperties: false
      required:
        - minutes
        - valueUSD
        - valueIncludingBonusUSD
        - debtMinutes
        - debtUSD
        - status
        - currentRatePerMinute
        - planCode
        - paymentExempt
      properties:
        minutes:
          type: number
          description: Minutes left in your wallet.
        valueUSD:
          type: number
          description: Value of the paid minutes left.
        valueIncludingBonusUSD:
          type: number
          description: Value of every minute left, bonus minutes included.
        debtMinutes:
          type: number
          description: Minutes owed. A purchase settles these first.
        debtUSD:
          type: number
          description: The debt in dollars, at the rate that applies.
        status:
          type: string
          description: Wallet status, for example `ACTIVE`, `LOW_BALANCE` or `DEPLETED`.
        currentRatePerMinute:
          type:
            - number
            - 'null'
          description: The rate the next minute is drawn at.
        planCode:
          type:
            - string
            - 'null'
          description: The plan your wallet was last bought on.
        paymentExempt:
          type: boolean
          description: Whether your agency is exempt from payment.
    BillingAutoRecharge:
      type: object
      additionalProperties: false
      required:
        - enabled
        - status
        - planCode
        - thresholdMinutes
        - blockedReason
        - pausedReason
        - requiresAction
        - recommendedAction
        - paymentReviewRequired
        - lastSuccessfulRechargeAt
        - lastFailureAt
        - lastFailureCode
        - nextRetryAt
      properties:
        enabled:
          type: boolean
          description: >-
            Whether auto-recharge can fire. `false` while a payment is under
            review or after a failed charge, whatever the stored setting.
        status:
          type:
            - string
            - 'null'
          description: >-
            Operational status, for example `ENABLED`, `DISABLED` or
            `SUSPENDED`.
        planCode:
          type:
            - string
            - 'null'
          description: The plan it buys.
        thresholdMinutes:
          type:
            - number
            - 'null'
          description: It buys when your balance falls to this many minutes.
        blockedReason:
          type:
            - string
            - 'null'
          description: Why it cannot charge, when switched on but blocked.
        pausedReason:
          type:
            - string
            - 'null'
          description: Why it is paused.
        requiresAction:
          type: boolean
          description: Whether someone has to act before it can charge again.
        recommendedAction:
          type:
            - string
            - 'null'
          description: >-
            What to do, for example `UPDATE_PAYMENT_METHOD` or
            `CONTACT_SUPPORT`.
        paymentReviewRequired:
          type: boolean
          description: Whether a payment is waiting for our support team.
        lastSuccessfulRechargeAt:
          type:
            - string
            - 'null'
          format: date-time
          description: The last recharge that charged.
        lastFailureAt:
          type:
            - string
            - 'null'
          format: date-time
          description: The last recharge that failed.
        lastFailureCode:
          type:
            - string
            - 'null'
          description: Why it failed.
        nextRetryAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When it will try again.
    BillingSubscription:
      type: object
      additionalProperties: false
      required:
        - status
        - hasAccess
        - trialEnd
        - currentPeriodEnd
        - cancelAtPeriodEnd
        - pendingPlanCode
        - pendingPlanEffectiveAt
        - attention
      properties:
        status:
          type: string
          description: >-
            Provider status, for example `ACTIVE`, `TRIALING` or `PAST_DUE`.
            `NONE` when your agency has no subscription.
        hasAccess:
          type: boolean
          description: Whether your agency can use the software.
        trialEnd:
          type:
            - string
            - 'null'
          format: date-time
          description: When the trial ends.
        currentPeriodEnd:
          type:
            - string
            - 'null'
          format: date-time
          description: When the current period ends.
        cancelAtPeriodEnd:
          type: boolean
          description: Whether it ends at the period end.
        pendingPlanCode:
          type:
            - string
            - 'null'
          description: A plan change waiting to take effect.
        pendingPlanEffectiveAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When that change takes effect.
        attention:
          description: A subscription problem to act on, or `null`.
          anyOf:
            - $ref: '#/components/schemas/BillingSubscriptionAttention'
            - type: 'null'
    BillingPendingPurchase:
      type: object
      additionalProperties: false
      required:
        - requestNumber
        - planCode
        - amountUSD
        - minutes
        - status
        - requestType
        - requestedAt
        - recoveryStatus
        - requiresSupportReview
      properties:
        requestNumber:
          type:
            - string
            - 'null'
          description: Request reference.
        planCode:
          type:
            - string
            - 'null'
          description: The plan being bought.
        amountUSD:
          type: number
          description: Its price.
        minutes:
          type: number
          description: Minutes it adds.
        status:
          type: string
          description: Request status.
        requestType:
          type: string
          description: '`PAY_NOW` or `AUTO_RECHARGE`.'
        requestedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When it was requested.
        recoveryStatus:
          type:
            - string
            - 'null'
          description: Set while a captured payment is being reconciled.
        requiresSupportReview:
          type: boolean
          description: Whether our support team has to reconcile it. Do not pay again.
    BillingSpend:
      type: object
      additionalProperties: false
      required:
        - window
        - calls
        - minutes
        - callCostUSD
        - billedToClientsUSD
        - phoneNumbersUSD
        - coAuthorUSD
        - totalCostUSD
      properties:
        window:
          $ref: '#/components/schemas/BillingWindow'
        calls:
          type: integer
          minimum: 0
          description: Calls placed in the window.
        minutes:
          type: number
          description: Call minutes in the window.
        callCostUSD:
          type: number
          description: >-
            What the calls cost you at your platform rate, whichever wallet
            funded them.
        billedToClientsUSD:
          type: number
          description: What rebilled sub-accounts were charged for those calls.
        phoneNumbersUSD:
          type: number
          description: Phone number purchases and renewals.
        coAuthorUSD:
          type: number
          description: Co-author usage settled into your wallet.
        totalCostUSD:
          type: number
          description: '`callCostUSD` plus `phoneNumbersUSD` plus `coAuthorUSD`.'
    BillingSubAccountRollup:
      type: object
      additionalProperties: false
      required:
        - total
        - rebilling
        - low
        - empty
        - needsAttention
      properties:
        total:
          type: integer
          minimum: 0
          description: Connected sub-accounts.
        rebilling:
          type: integer
          minimum: 0
          description: Sub-accounts that pay for their own calls.
        low:
          type: integer
          minimum: 0
          description: Rebilled sub-accounts that are low.
        empty:
          type: integer
          minimum: 0
          description: Rebilled sub-accounts that are empty or owing.
        needsAttention:
          type: array
          maxItems: 10
          description: The lowest rebilled sub-accounts, lowest first.
          items:
            $ref: '#/components/schemas/BillingSubAccountAttentionRow'
    BillingPendingCreditRollup:
      type: object
      additionalProperties: false
      required:
        - count
        - minutes
        - amountUSD
      properties:
        count:
          type: integer
          minimum: 0
          description: Payments waiting for credit.
        minutes:
          type: number
          description: Minutes they will add.
        amountUSD:
          type: number
          description: What was paid.
    BillingAttentionItem:
      type: object
      additionalProperties: false
      required:
        - code
        - severity
        - message
      properties:
        code:
          type: string
          enum:
            - BALANCE_EMPTY
            - BALANCE_LOW
            - IN_DEBT
            - AUTO_RECHARGE_ACTION_REQUIRED
            - SUBSCRIPTION_ACTION_REQUIRED
            - PURCHASE_PENDING
            - PURCHASE_NEEDS_SUPPORT
            - SUB_ACCOUNTS_LOW
            - PENDING_CREDITS
          description: What needs attention.
        severity:
          type: string
          enum:
            - ACTION_REQUIRED
            - WARNING
            - INFO
          description: How urgent it is.
        message:
          type: string
          description: For a person.
    BillingSubscriptionAttention:
      type: object
      additionalProperties: false
      required:
        - kind
        - severity
        - actionCode
        - customerMessageCode
        - observedAt
      properties:
        kind:
          type: string
          description: What happened.
        severity:
          type: string
          description: How urgent it is.
        actionCode:
          type:
            - string
            - 'null'
          description: What to do.
        customerMessageCode:
          type:
            - string
            - 'null'
          description: Which message to show.
        observedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When it was seen.
    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.
    BillingSubAccountAttentionRow:
      type: object
      additionalProperties: false
      required:
        - locationId
        - name
        - balanceMinutes
        - status
        - creditGuardEnabled
      properties:
        locationId:
          type: string
          description: GoHighLevel Location ID.
        name:
          type:
            - string
            - 'null'
          description: Display name.
        balanceMinutes:
          type: number
          description: Minutes left.
        status:
          type: string
          enum:
            - ACTIVE
            - LOW_BALANCE
            - IN_DEBT
            - DEPLETED
          description: >-
            `ACTIVE` above the low mark, `LOW_BALANCE` at or under it, `IN_DEBT`
            empty and owing, `DEPLETED` empty.
        creditGuardEnabled:
          type: boolean
          description: Whether it stops its own calls when empty.
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'Send your API key as `Authorization: Bearer YOUR_API_KEY`.'

````