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

# Create a billing group



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/account-billing/billing-groups.yml post /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:
    post:
      tags:
        - Billing Groups
      summary: Create a billing group
      operationId: CreateBillingGroup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewBillingGroup'
            example:
              name: string
      responses:
        '200':
          description: Expected billing group response to a valid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/BillingGroup'
          headers: {}
        '409':
          $ref: '#/components/responses/ConflictErrorResponse'
        '422':
          $ref: '#/components/responses/UnprocessableEntityErrorResponse'
        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
            });


            const billingGroup = await client.billingGroups.create({ name:
            'string' });


            console.log(billingGroup.data);
        - 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
            )
            billing_group = client.billing_groups.create(
                name="string",
            )
            print(billing_group.data)
        - 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\tbillingGroup, err := client.BillingGroups.New(context.TODO(), telnyx.BillingGroupNewParams{\n\t\tName: telnyx.String(\"string\"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", billingGroup.Data)\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.BillingGroupCreateParams;

            import
            com.telnyx.sdk.models.billinggroups.BillingGroupCreateResponse;


            public final class Main {
                private Main() {}

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

                    BillingGroupCreateResponse billingGroup = client.billingGroups().create();
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            billing_group = telnyx.billing_groups.create

            puts(billing_group)
        - lang: CLI
          source: |-
            telnyx billing-groups create \
              --api-key 'My API Key'
components:
  schemas:
    NewBillingGroup:
      type: object
      properties:
        name:
          type: string
          description: A name for the billing group
      example:
        name: string
    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
    Errors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/billing-group_Error'
    billing_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/billing_Error'
      type: object
    billing-group_Error:
      type: object
      required:
        - code
        - title
      properties:
        code:
          type: integer
          format: int32
        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
          properties: {}
          additionalProperties: true
    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:
    ConflictErrorResponse:
      description: Resource conflict or in use
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
    UnprocessableEntityErrorResponse:
      description: Invalid request data
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
    GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/billing_Errors'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````