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

> Invoices and receipts. `platform` (the default) is what your agency paid the platform: subscription invoices and your own wallet top-up receipts. `sub_accounts` is what your sub-accounts paid you, which is always a top-up receipt.

The platform list is assembled from two sources and capped. When the cap is reached, `truncated` is `true` and the list is not complete history.

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/documents
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/documents:
    get:
      tags:
        - Billing
      summary: List billing documents
      description: >-
        Invoices and receipts. `platform` (the default) is what your agency paid
        the platform: subscription invoices and your own wallet top-up receipts.
        `sub_accounts` is what your sub-accounts paid you, which is always a
        top-up receipt.


        The platform list is assembled from two sources and capped. When the cap
        is reached, `truncated` is `true` and the list is not complete history.


        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-documents
      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 to read
            every document.
          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: scope
          in: query
          required: false
          schema:
            type: string
            enum:
              - platform
              - sub_accounts
            default: platform
          description: Whose payments to list.
          example: platform
        - name: type
          in: query
          required: false
          schema:
            type: string
            enum:
              - ALL
              - INVOICE
              - RECEIPT
            default: ALL
          description: Only invoices or only receipts.
          example: ALL
        - name: locationId
          in: query
          required: false
          schema:
            type: string
            minLength: 1
          description: >-
            With `scope=sub_accounts`, only this sub-account's receipts. Refused
            with any other scope.
          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: 100
            default: 10
          description: Rows per page, at most 100.
          example: 10
      responses:
        '200':
          description: One page of documents.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingDocumentsResponse'
              examples:
                default:
                  value:
                    success: true
                    data:
                      scope: platform
                      window: null
                      documents:
                        - id: i_4f0c2d9a1b7e6c3d5a8f0e1b2c3d4e5f6a7b8c9d
                          kind: INVOICE
                          date: '2026-09-01T00:04:12.000Z'
                          description: Pro subscription
                          detail: Sep 1 to Oct 1, 2026
                          amountUSD: 297
                          currency: USD
                          subAccount: null
                          hasPdf: true
                        - id: r_stripe-credit:9b1d0e7c
                          kind: RECEIPT
                          date: '2026-08-28T14:22:40.000Z'
                          description: Wallet top-up
                          detail: Paid by card
                          amountUSD: 340
                          currency: USD
                          subAccount: null
                          hasPdf: false
                      truncated: false
                    pagination:
                      page: 1
                      limit: 10
                      total: 2
                      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: 'locationId: locationId applies only to scope=sub_accounts'
        '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/documents \
              --header 'Authorization: Bearer YOUR_API_KEY'
components:
  schemas:
    BillingDocumentsResponse:
      type: object
      additionalProperties: false
      required:
        - success
        - data
        - pagination
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          additionalProperties: false
          required:
            - scope
            - window
            - documents
            - truncated
          properties:
            scope:
              type: string
              enum:
                - platform
                - sub_accounts
              description: Whose payments are listed.
            window:
              description: '`null` when no window was asked for.'
              anyOf:
                - $ref: '#/components/schemas/BillingWindow'
                - type: 'null'
            documents:
              type: array
              items:
                $ref: '#/components/schemas/BillingDocument'
            truncated:
              type: boolean
              description: >-
                `true` when the platform list hit its cap and is not complete
                history.
        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.
    BillingDocument:
      type: object
      additionalProperties: false
      required:
        - id
        - kind
        - date
        - description
        - detail
        - amountUSD
        - currency
        - subAccount
        - hasPdf
      properties:
        id:
          type: string
          description: Opaque document handle.
        kind:
          type: string
          enum:
            - INVOICE
            - RECEIPT
          description: '`INVOICE` for a subscription invoice, `RECEIPT` for a wallet top-up.'
        date:
          type:
            - string
            - 'null'
          format: date-time
          description: When it was paid or issued.
        description:
          type: string
          description: What it is for.
        detail:
          type:
            - string
            - 'null'
          description: A second line, such as the period or how it was paid.
        amountUSD:
          type: number
          description: Amount paid.
        currency:
          type: string
          description: ISO 4217 code.
        subAccount:
          description: For sub-account receipts, who paid.
          anyOf:
            - $ref: '#/components/schemas/BillingSubAccountRef'
            - type: 'null'
        hasPdf:
          type: boolean
          description: Whether a PDF exists. Only invoices have one.
    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`.'

````