> ## 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 new requirement group



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/regulatory.yml post /requirement_groups
openapi: 3.1.0
info:
  title: Telnyx Regulatory Requirements API
  version: 2.0.0
  description: API for Regulatory requirements.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /requirement_groups:
    post:
      tags:
        - Requirement Groups
      summary: Create a new requirement group
      operationId: CreateRequirementGroup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                country_code:
                  type: string
                  description: ISO alpha 2 country code
                  example: US
                phone_number_type:
                  type: string
                  enum:
                    - local
                    - toll_free
                    - mobile
                    - national
                    - shared_cost
                  example: local
                action:
                  type: string
                  enum:
                    - ordering
                    - porting
                  example: ordering
                customer_reference:
                  type: string
                  example: My Requirement Group
                regulatory_requirements:
                  type: array
                  items:
                    type: object
                    properties:
                      requirement_id:
                        type: string
                      field_value:
                        type: string
              required:
                - country_code
                - phone_number_type
                - action
      responses:
        '200':
          description: Requirement group created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequirementGroup'
        '400':
          $ref: '#/components/responses/numbers_BadRequestResponse'
        '401':
          $ref: '#/components/responses/numbers_UnauthorizedResponse'
        '422':
          $ref: '#/components/responses/numbers_UnprocessableEntity'
        '500':
          $ref: '#/components/responses/numbers_GenericErrorResponse'
      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 requirementGroup = await client.requirementGroups.create({
              action: 'ordering',
              country_code: 'US',
              phone_number_type: 'local',
            });

            console.log(requirementGroup.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
            )
            requirement_group = client.requirement_groups.create(
                action="ordering",
                country_code="US",
                phone_number_type="local",
            )
            print(requirement_group.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\trequirementGroup, err := client.RequirementGroups.New(context.TODO(), telnyx.RequirementGroupNewParams{\n\t\tAction:          telnyx.RequirementGroupNewParamsActionOrdering,\n\t\tCountryCode:     \"US\",\n\t\tPhoneNumberType: telnyx.RequirementGroupNewParamsPhoneNumberTypeLocal,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", requirementGroup.ID)\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.requirementgroups.RequirementGroup;

            import
            com.telnyx.sdk.models.requirementgroups.RequirementGroupCreateParams;


            public final class Main {
                private Main() {}

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

                    RequirementGroupCreateParams params = RequirementGroupCreateParams.builder()
                        .action(RequirementGroupCreateParams.Action.ORDERING)
                        .countryCode("US")
                        .phoneNumberType(RequirementGroupCreateParams.PhoneNumberType.LOCAL)
                        .build();
                    RequirementGroup requirementGroup = client.requirementGroups().create(params);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            requirement_group = telnyx.requirement_groups.create(action:
            :ordering, country_code: "US", phone_number_type: :local)


            puts(requirement_group)
        - lang: CLI
          source: |-
            telnyx requirement-groups create \
              --api-key 'My API Key' \
              --action ordering \
              --country-code US \
              --phone-number-type local
components:
  schemas:
    RequirementGroup:
      type: object
      properties:
        id:
          type: string
        country_code:
          type: string
        phone_number_type:
          type: string
        status:
          type: string
          enum:
            - approved
            - unapproved
            - pending-approval
            - declined
            - expired
        action:
          type: string
        customer_reference:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        record_type:
          type: string
          example: requirement_group
        regulatory_requirements:
          type: array
          items:
            $ref: '#/components/schemas/UserRequirement'
    UserRequirement:
      type: object
      properties:
        requirement_id:
          type: string
        field_value:
          type: string
        field_type:
          type: string
        status:
          type: string
          enum:
            - approved
            - unapproved
            - pending-approval
            - declined
            - expired
        expires_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    numbers_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/numbers_Error'
      type: object
    numbers_Error:
      properties:
        code:
          type: string
          example: '10007'
        title:
          type: string
          example: Unexpected error
        detail:
          type: string
          example: An unexpected error occured.
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
              example: /base
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          properties:
            url:
              type: string
              description: URL with additional information on the error.
              example: https://developers.telnyx.com/docs/overview/errors/10015
      type: object
  responses:
    numbers_BadRequestResponse:
      description: >-
        Bad request, the request was unacceptable, often due to missing a
        required parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
    numbers_UnauthorizedResponse:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
          examples:
            Authentication Failed:
              value:
                errors:
                  - code: '10009'
                    title: Authentication failed
                    detail: Could not understand the provided credentials.
                    meta:
                      url: https://developers.telnyx.com/docs/overview/errors/10009
    numbers_UnprocessableEntity:
      description: Unprocessable entity. Check the 'detail' field in response for details.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
    numbers_GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/numbers_Errors'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````