> ## 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 Private Wireless Gateway

> Asynchronously create a Private Wireless Gateway for SIM cards for a previously created network. This operation may take several minutes so you can check the Private Wireless Gateway status at the section Get a Private Wireless Gateway.



## OpenAPI

````yaml /openapi/source/external/wireless/wireless.json post /private_wireless_gateways
openapi: 3.1.0
info:
  version: 2.0.0
  title: Telnyx API
  x-latency-category: responsive
  x-endpoint-cost: light
  description: SIP trunking, SMS, MMS, Call Control and Telephony Data Services.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
    description: Version 2.0.0 of the Telnyx API.
security:
  - bearerAuth: []
tags:
  - name: Wireless
    description: Wireless operations
  - name: SIM Cards
    description: SIM Cards operations
  - name: SIM Card Actions
    description: >-
      View SIM card actions, their progress and timestamps using the SIM Card
      Actions API
  - name: SIM Card Groups
    description: SIM Card Groups operations
  - name: SIM Card Group Actions
    description: SIM Card Group actions operations
  - name: SIM Card Orders
    description: SIM Card Orders operations
  - name: Reporting
    description: Wireless reporting operations
  - name: Wireless Regions
    description: Regions for wireless services
  - name: OTA updates
    description: OTA updates operations
  - name: Mobile Network Operators
    description: Mobile network operators operations
  - name: Private Wireless Gateways
    description: Private Wireless Gateways operations
  - name: Wireless Blocklists
    description: Wireless Blocklists operations
  - name: Traffic Policy Profiles
    description: Traffic Policy Profiles operations
paths:
  /private_wireless_gateways:
    post:
      tags:
        - Private Wireless Gateways
      summary: Create a Private Wireless Gateway
      description: >-
        Asynchronously create a Private Wireless Gateway for SIM cards for a
        previously created network. This operation may take several minutes so
        you can check the Private Wireless Gateway status at the section Get a
        Private Wireless Gateway.
      operationId: CreatePrivateWirelessGateway
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                network_id:
                  type: string
                  format: uuid
                  description: The identification of the related network resource.
                  example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
                name:
                  description: The private wireless gateway name.
                  type: string
                  example: My private wireless gateway
                region_code:
                  description: >-
                    The code of the region where the private wireless gateway
                    will be assigned. A list of available regions can be found
                    at the regions endpoint
                  type: string
                  example: dc2
              required:
                - network_id
                - name
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/PrivateWirelessGateway'
                example:
                  data:
                    id: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
                    network_id: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
                    record_type: private_wireless_gateway
                    created_at: '2018-02-02T22:25:27.521Z'
                    updated_at: '2018-02-02T22:25:27.521Z'
                    name: My private wireless gateway
                    region_code: dc2
                    status:
                      value: provisioning
                      error_description: null
                      error_code: null
                    ip_range: 100.64.1.0/24
                    assigned_resources:
                      - record_type: sim_card_group
                        count: 1
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        default:
          $ref: '#/components/responses/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 privateWirelessGateway = await
            client.privateWirelessGateways.create({
              name: 'My private wireless gateway',
              network_id: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
            });


            console.log(privateWirelessGateway.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
            )
            private_wireless_gateway = client.private_wireless_gateways.create(
                name="My private wireless gateway",
                network_id="6a09cdc3-8948-47f0-aa62-74ac943d6c58",
            )
            print(private_wireless_gateway.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\tprivateWirelessGateway, err := client.PrivateWirelessGateways.New(context.TODO(), telnyx.PrivateWirelessGatewayNewParams{\n\t\tName:      \"My private wireless gateway\",\n\t\tNetworkID: \"6a09cdc3-8948-47f0-aa62-74ac943d6c58\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", privateWirelessGateway.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.privatewirelessgateways.PrivateWirelessGatewayCreateParams;

            import
            com.telnyx.sdk.models.privatewirelessgateways.PrivateWirelessGatewayCreateResponse;


            public final class Main {
                private Main() {}

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

                    PrivateWirelessGatewayCreateParams params = PrivateWirelessGatewayCreateParams.builder()
                        .name("My private wireless gateway")
                        .networkId("6a09cdc3-8948-47f0-aa62-74ac943d6c58")
                        .build();
                    PrivateWirelessGatewayCreateResponse privateWirelessGateway = client.privateWirelessGateways().create(params);
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            private_wireless_gateway = telnyx.private_wireless_gateways.create(
              name: "My private wireless gateway",
              network_id: "6a09cdc3-8948-47f0-aa62-74ac943d6c58"
            )

            puts(private_wireless_gateway)
        - 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 {
              $privateWirelessGateway = $client->privateWirelessGateways->create(
                name: 'My private wireless gateway',
                networkID: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
                regionCode: 'dc2',
              );

              var_dump($privateWirelessGateway);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx private-wireless-gateways create \
              --api-key 'My API Key' \
              --name 'My private wireless gateway' \
              --network-id 6a09cdc3-8948-47f0-aa62-74ac943d6c58
components:
  schemas:
    PrivateWirelessGateway:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Identifies the resource.
          readOnly: true
          example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
        network_id:
          type: string
          format: uuid
          description: The identification of the related network resource.
          example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
        record_type:
          type: string
          readOnly: true
          example: private_wireless_gateway
        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'
        name:
          description: The private wireless gateway name.
          type: string
          example: My private wireless gateway
        region_code:
          description: >-
            The name of the region where the Private Wireless Gateway is
            deployed.
          type: string
          example: dc2
          default: null
        status:
          $ref: '#/components/schemas/PrivateWirelessGatewayStatus'
        ip_range:
          type: string
          description: >-
            IP block used to assign IPs to the SIM cards in the Private Wireless
            Gateway.
          example: 100.64.1.0/24
          readOnly: true
          default: null
        assigned_resources:
          type: array
          description: >-
            A list of the resources that have been assigned to the Private
            Wireless Gateway.
          items:
            $ref: '#/components/schemas/PWGAssignedResourcesSummary'
    PrivateWirelessGatewayStatus:
      type: object
      description: The current status or failure details of the Private Wireless Gateway.
      properties:
        value:
          type: string
          description: >-
            The current status or failure details of the Private Wireless
            Gateway. <ul>
             <li><code>provisioning</code> - the Private Wireless Gateway is being provisioned.</li>
             <li><code>provisioned</code> - the Private Wireless Gateway was provisioned and able to receive connections.</li>
             <li><code>failed</code> - the provisioning had failed for a reason and it requires an intervention.</li>
             <li><code>decommissioning</code> - the Private Wireless Gateway is being removed from the network.</li>
             </ul>
             Transitioning between the provisioning and provisioned states may take some time.
          enum:
            - provisioning
            - provisioned
            - failed
            - decommissioning
          readOnly: true
          default: provisioning
          example: provisioned
        error_description:
          type:
            - string
            - 'null'
          description: >-
            This attribute provides a human-readable explanation of why a
            failure happened.
          readOnly: true
          default: null
          example: null
        error_code:
          type:
            - string
            - 'null'
          description: >-
            This attribute is an [error
            code](https://developers.telnyx.com/docs/development/api-fundamentals/api-errors)
            related to the failure reason.
          readOnly: true
          default: null
          example: null
    PWGAssignedResourcesSummary:
      type: object
      description: >-
        The summary of the resource that have been assigned to the Private
        Wireless Gateway.
      properties:
        record_type:
          type: string
          description: The type of the resource assigned to the Private Wireless Gateway.
          example: sim_card_group
          readOnly: true
        count:
          type: integer
          description: >-
            The current count of a resource type assigned to the Private
            Wireless Gateway.
          example: 1
          readOnly: true
    Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
      type: object
    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:
    UnprocessableEntity:
      description: Unprocessable entity. Check the 'detail' field in response for details.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
          examples:
            unprocessableEntity:
              summary: Request could not be processed
              value:
                errors:
                  - code: '10027'
                    title: Unprocessable Entity
                    detail: >-
                      The server understood the syntax of the request but was
                      unable to process the instructions.
    GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
          examples:
            unexpectedError:
              summary: Unexpected API error
              value:
                errors:
                  - code: '10007'
                    title: Unexpected error
                    detail: An unexpected error occured.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````