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

# List all billing groups



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/account-billing/billing-groups.yml get /billing_groups
openapi: 3.1.0
info:
  title: Telnyx Billing Groups API
  version: 2.0.0
  description: API for Billing groups.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /billing_groups:
    get:
      tags:
        - Billing Groups
      summary: List all billing groups
      operationId: ListBillingGroups
      parameters:
        - name: page
          in: query
          style: deepObject
          explode: true
          description: >-
            Consolidated page parameter (deepObject style). Originally:
            page[number], page[size]
          schema:
            type: object
            properties:
              number:
                type: integer
                minimum: 1
                default: 1
                description: The page number to load
              size:
                type: integer
                minimum: 1
                maximum: 250
                default: 20
                description: The size of the page
      responses:
        '200':
          description: A paginated array of billing groups
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/BillingGroup'
                  meta:
                    $ref: '#/components/schemas/PaginationMeta'
          headers: {}
        '400':
          $ref: '#/components/responses/BadRequestErrorResponse'
        default:
          $ref: '#/components/responses/GenericErrorResponse'
      deprecated: false
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            // Automatically fetches more pages as needed.
            for await (const billingGroup of client.billingGroups.list()) {
              console.log(billingGroup.id);
            }
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            page = client.billing_groups.list()
            page = page.data[0]
            print(page.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.BillingGroups.List(context.TODO(), telnyx.BillingGroupListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
            import com.telnyx.sdk.models.billinggroups.BillingGroupListPage;
            import com.telnyx.sdk.models.billinggroups.BillingGroupListParams;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    BillingGroupListPage page = client.billingGroups().list();
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            page = telnyx.billing_groups.list

            puts(page)
        - lang: CLI
          source: |-
            telnyx billing-groups list \
              --api-key 'My API Key'
components:
  schemas:
    BillingGroup:
      type: object
      properties:
        record_type:
          type: string
          enum:
            - billing_group
          description: Identifies the type of the resource.
          example: billing_group
        id:
          type: string
          format: uuid
          description: Identifies the type of resource.
          example: f5586561-8ff0-4291-a0ac-84fe544797bd
        organization_id:
          type: string
          format: uuid
          description: Identifies the organization that owns the resource.
          example: f1486bae-f067-460c-ad43-73a92848f902
        name:
          type: string
          description: A user-specified name for the billing group
          example: My billing group name
        created_at:
          type: string
          format: date-time
          description: ISO 8601 formatted date indicating when the resource was created.
          example: '2019-10-15T10:07:15.527Z'
        updated_at:
          type: string
          format: date-time
          description: ISO 8601 formatted date indicating when the resource was updated.
          example: '2019-10-15T10:07:15.527Z'
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 formatted date indicating when the resource was removed.
          example: null
      example:
        record_type: billing_group
        id: f5586561-8ff0-4291-a0ac-84fe544797bd
        organization_id: f1486bae-f067-460c-ad43-73a92848f902
        name: My billing group name
        created_at: '2019-10-15T10:07:15.527Z'
        updated_at: '2019-10-15T10:07:15.527Z'
        deleted_at: null
    PaginationMeta:
      type: object
      properties:
        total_pages:
          type: integer
          example: 3
        total_results:
          type: integer
          example: 55
        page_number:
          type: integer
          example: 2
        page_size:
          type: integer
          example: 25
    invoice_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/invoice_Error'
      type: object
    billing_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/billing_Error'
      type: object
    invoice_Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          additionalProperties: true
      type: object
    billing_Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          additionalProperties: true
      type: object
  responses:
    BadRequestErrorResponse:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/invoice_Errors'
    GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/billing_Errors'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````