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

> Create a new Network.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/networking/networking.yml post /networks
openapi: 3.1.0
info:
  title: Telnyx Networking API
  version: 2.0.0
  description: API for Networking.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /networks:
    post:
      tags:
        - Networks
      summary: Create a Network
      description: Create a new Network.
      operationId: CreateNetwork
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NetworkCreate'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/NetworkResponse'
        '422':
          $ref: '#/components/responses/netapps_UnprocessableEntity'
        default:
          $ref: '#/components/responses/netapps_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 network = await client.networks.create({ name: 'test network'
            });


            console.log(network.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
            )
            network = client.networks.create(
                name="test network",
            )
            print(network.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\tnetwork, err := client.Networks.New(context.TODO(), telnyx.NetworkNewParams{\n\t\tNetworkCreate: telnyx.NetworkCreateParam{\n\t\t\tRecordParam: telnyx.RecordParam{},\n\t\t\tName:        \"test network\",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", network.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.networks.NetworkCreate;
            import com.telnyx.sdk.models.networks.NetworkCreateResponse;

            public final class Main {
                private Main() {}

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

                    NetworkCreate params = NetworkCreate.builder()
                        .name("test network")
                        .build();
                    NetworkCreateResponse network = client.networks().create(params);
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            network = telnyx.networks.create(name: "test network")

            puts(network)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $network = $client->networks->create(name: 'test network');

              var_dump($network);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx networks create \
              --api-key 'My API Key' \
              --name 'test network'
components:
  schemas:
    NetworkCreate:
      allOf:
        - $ref: '#/components/schemas/Network'
        - type: object
          title: NetworkCreate
          required:
            - name
    Network:
      allOf:
        - $ref: '#/components/schemas/Record'
        - type: object
          title: Network
          properties:
            record_type:
              type: string
              description: Identifies the type of the resource.
              readOnly: true
              example: network
            name:
              type: string
              description: A user specified name for the network.
              example: test network
    netapps_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/netapps_Error'
      type: object
    Record:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Identifies the resource.
          readOnly: true
          example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
        record_type:
          type: string
          description: Identifies the type of the resource.
          readOnly: true
          example: sample_record_type
        created_at:
          type: string
          description: >-
            ISO 8601 formatted date-time indicating when the resource was
            created.
          readOnly: true
          example: '2018-02-02T22:25:27.521Z'
        updated_at:
          type: string
          description: >-
            ISO 8601 formatted date-time indicating when the resource was
            updated.
          readOnly: true
          example: '2018-02-02T22:25:27.521Z'
    netapps_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:
    NetworkResponse:
      description: Successful response
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/Network'
    netapps_UnprocessableEntity:
      description: Unprocessable entity. Check the 'detail' field in response for details.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/netapps_Errors'
    netapps_GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/netapps_Errors'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````