> ## 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 Tailscale Subnet Router

> Creates a Tailscale Subnet Router on a Network and enrolls it in the user's tailnet with the auth key. The response returns the router with `status` `provisioning`. Poll `GET /tailscale_subnet_routers/{id}` until it is `provisioned`. Then approve its routes in the tailnet, unless an auto-approver covers them.



## OpenAPI

````yaml /openapi/source/external/netapps/netapps.json post /tailscale_subnet_routers
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.
  license:
    name: MIT
    identifier: MIT
  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: Networks
    description: Network operations
  - name: Public Internet Gateways
    description: Public Internet Gateway operations
  - name: WireGuard Interfaces
    description: WireGuard Interface operations
  - name: Tunnels
    description: >-
      Tunnels connect a Network to hosts behind a tunnel process within the
      user's network.
  - name: Network Routes
    description: Routes on a Network that send a CIDR to a next hop, such as a tunnel.
  - name: Tailscale Subnet Routers
    description: Tailscale Subnet Router operations
  - name: Virtual Cross Connects
    description: Virtual Cross Connect operations
  - name: Regions
    description: Regions
  - name: Global IPs
    description: Global IPs
paths:
  /tailscale_subnet_routers:
    post:
      tags:
        - Tailscale Subnet Routers
      summary: Create a Tailscale Subnet Router
      description: >-
        Creates a Tailscale Subnet Router on a Network and enrolls it in the
        user's tailnet with the auth key. The response returns the router with
        `status` `provisioning`. Poll `GET /tailscale_subnet_routers/{id}` until
        it is `provisioned`. Then approve its routes in the tailnet, unless an
        auto-approver covers them.
      operationId: CreateTailscaleSubnetRouter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TailscaleSubnetRouterCreate'
            example:
              name: tailnet-ashburn
              network_id: 0de011ae-ee53-4df4-ba96-754728eb5aad
              region_code: ashburn-va
              advertised_routes:
                - 172.27.0.0/24
              auth_key: tskey-auth-k1AbCdEfGh2IjKlMnOpQrStUv
      responses:
        '200':
          description: >-
            Successful response. The router is created and provisioning has
            started.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/TailscaleSubnetRouter'
              example:
                data:
                  id: 5c6f0a7e-6c7b-4d7f-9f2e-3b1e4e9a8c21
                  record_type: tailscale_subnet_router
                  name: tailnet-ashburn
                  network_id: 0de011ae-ee53-4df4-ba96-754728eb5aad
                  region_code: ashburn-va
                  advertised_routes:
                    - 172.27.0.0/24
                  status: provisioning
                  customer_address: 172.27.254.1
                  device_id: null
                  tailnet_name: null
                  tailscale_ips: []
                  created_at: '2026-10-13T15:04:05.123456Z'
                  updated_at: '2026-10-13T15:04:05.123456Z'
        '400':
          description: >-
            Bad request: the body failed validation. `detail` says what failed,
            for example `Routes must exclude default, local, and Tailscale
            ranges.` or `The request contains unknown or read-only fields.`; a
            missing parameter or an unknown `network_id` or `region_code` names
            the field in `source.pointer`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                errors:
                  - code: '10015'
                    title: Bad Request
                    detail: Routes must exclude default, local, and Tailscale ranges.
                    meta:
                      url: https://developers.telnyx.com/docs/overview/errors/10015
        '422':
          description: >-
            Unprocessable entity: an advertised route overlaps the addresses
            reserved for routers, `172.27.254.0/24` and `198.18.0.0/20`. The
            body is the generic error; it does not name the route.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                errors:
                  - code: '10027'
                    title: Unprocessable Entity
                    detail: >-
                      The server understood the syntax of the request but was
                      unable to process the instructions.
        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 response = await client.tailscaleSubnetRouters.create({
              advertised_routes: ["172.27.0.0/24"],
              auth_key: 'tskey-auth-k1AbCdEfGh2IjKlMnOpQrStUv',
              name: 'tailnet-ashburn',
              network_id: '0de011ae-ee53-4df4-ba96-754728eb5aad',
              region_code: 'ashburn-va',
            });

            console.log(response.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
            )
            response = client.tailscale_subnet_routers.create(
                advertised_routes=["172.27.0.0/24"],
                auth_key="tskey-auth-k1AbCdEfGh2IjKlMnOpQrStUv",
                name="tailnet-ashburn",
                network_id="0de011ae-ee53-4df4-ba96-754728eb5aad",
                region_code="ashburn-va",
            )
            print(response.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\ttailscaleSubnetRouter, err := client.TailscaleSubnetRouters.New(\n\t\tcontext.TODO(),\n\t\ttelnyx.TailscaleSubnetRouterNewParams{\n\t\t\tAdvertisedRoutes: \"['172.27.0.0/24']\",\n\t\t\tAuthKey:          \"tskey-auth-k1AbCdEfGh2IjKlMnOpQrStUv\",\n\t\t\tName:             \"tailnet-ashburn\",\n\t\t\tNetworkID:        \"0de011ae-ee53-4df4-ba96-754728eb5aad\",\n\t\t\tRegionCode:       \"ashburn-va\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", tailscaleSubnetRouter.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.tailscaleSubnetRouters.TailscaleSubnetRouterCreateParams;


            public final class Main {
                private Main() {}

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

                    TailscaleSubnetRouterCreateParams params = TailscaleSubnetRouterCreateParams.builder()
                        .advertisedRoutes(["172.27.0.0/24"])
                        .authKey("tskey-auth-k1AbCdEfGh2IjKlMnOpQrStUv")
                        .name("tailnet-ashburn")
                        .networkId("0de011ae-ee53-4df4-ba96-754728eb5aad")
                        .regionCode("ashburn-va")
                        .build();
                    var response = client.tailscaleSubnetRouters().create(params);
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            response = telnyx.tailscale_subnet_routers.create(
              advertised_routes: ["172.27.0.0/24"],
              auth_key: "tskey-auth-k1AbCdEfGh2IjKlMnOpQrStUv",
              name: "tailnet-ashburn",
              network_id: "0de011ae-ee53-4df4-ba96-754728eb5aad",
              region_code: "ashburn-va"
            )

            puts(response)
        - 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 {
              $response = $client->tailscaleSubnetRouters->create(
                advertised_routes: ["172.27.0.0/24"],
                auth_key: 'tskey-auth-k1AbCdEfGh2IjKlMnOpQrStUv',
                name: 'tailnet-ashburn',
                network_id: '0de011ae-ee53-4df4-ba96-754728eb5aad',
                region_code: 'ashburn-va',
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx tailscale-subnet-routers create \
              --api-key 'My API Key' \
              --name tailnet-ashburn \
              --network-id 0de011ae-ee53-4df4-ba96-754728eb5aad \
              --region-code ashburn-va \
              --advertised-routes 172.27.0.0/24 \
              --auth-key tskey-auth-k1AbCdEfGh2IjKlMnOpQrStUv
components:
  schemas:
    TailscaleSubnetRouterCreate:
      type: object
      title: TailscaleSubnetRouterCreate
      additionalProperties: false
      required:
        - name
        - network_id
        - region_code
        - advertised_routes
        - auth_key
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 128
          description: A user specified name for the router.
          example: tailnet-ashburn
        network_id:
          type: string
          format: uuid
          description: The id of the Network to attach the router to.
          example: 0de011ae-ee53-4df4-ba96-754728eb5aad
        region_code:
          type: string
          description: >-
            The code of the region to create the router in. `GET
            /network_coverage` lists the regions whose `available_services`
            include `tailscale_subnet_router`.
          example: ashburn-va
        advertised_routes:
          type: array
          minItems: 1
          maxItems: 64
          uniqueItems: true
          items:
            type: string
            example: 172.27.0.0/24
          example:
            - 172.27.0.0/24
          description: >-
            IPv4 subnets of the Network that the router advertises to the
            tailnet. Each entry is a canonical CIDR that the Network routes.
            Default, loopback, link-local, multicast, and Tailscale
            (`100.64.0.0/10`) ranges are rejected. So are ranges that overlap
            the router's own, `172.27.254.0/24` and `198.18.0.0/20`.
        auth_key:
          type: string
          writeOnly: true
          format: password
          pattern: ^tskey-auth-[A-Za-z0-9_-]{10,250}$
          description: >-
            A Tailscale auth key that enrolls the router in the user's tailnet:
            reusable, pre-approved, tagged, and not ephemeral. Telnyx stores it
            encrypted until enrollment succeeds, then discards it. It is never
            returned.
          example: tskey-auth-k1AbCdEfGh2IjKlMnOpQrStUv
    TailscaleSubnetRouter:
      type: object
      title: TailscaleSubnetRouter
      properties:
        id:
          type: string
          format: uuid
          description: Identifies the resource.
          readOnly: true
          example: 5c6f0a7e-6c7b-4d7f-9f2e-3b1e4e9a8c21
        record_type:
          type: string
          description: Identifies the type of the resource.
          readOnly: true
          example: tailscale_subnet_router
        name:
          type: string
          minLength: 1
          maxLength: 128
          description: A user specified name for the router.
          example: tailnet-ashburn
        network_id:
          type: string
          format: uuid
          description: The id of the Network the router is attached to.
          example: 0de011ae-ee53-4df4-ba96-754728eb5aad
        region_code:
          type: string
          description: >-
            The code of the region the router is created in. `GET
            /network_coverage` lists the regions whose `available_services`
            include `tailscale_subnet_router`.
          example: ashburn-va
        advertised_routes:
          type: array
          minItems: 1
          maxItems: 64
          uniqueItems: true
          items:
            type: string
            example: 172.27.0.0/24
          example:
            - 172.27.0.0/24
          description: >-
            IPv4 subnets of the Network that the router advertises to the
            tailnet. Each entry is a canonical CIDR that the Network routes.
            Default, loopback, link-local, multicast, and Tailscale
            (`100.64.0.0/10`) ranges are rejected. So are ranges that overlap
            the router's own, `172.27.254.0/24` and `198.18.0.0/20`.
        status:
          type: string
          enum:
            - provisioning
            - provisioned
            - failed
            - deleting
          readOnly: true
          example: provisioned
          description: >-
            `provisioning`: Telnyx is creating the router or applying a change.
            `provisioned`: the router is on the tailnet and advertises its
            routes; the tailnet still approves them. `failed`: enrollment did
            not complete, and `PATCH` retries it. `deleting`: the router is
            being removed.
        customer_address:
          type: string
          readOnly: true
          example: 172.27.254.1
          description: >-
            The router's address on the Network, from `172.27.254.0/24`. Tailnet
            traffic enters the Network from this address.
        device_id:
          type:
            - string
            - 'null'
          readOnly: true
          example: n5c6f0a7e1CNTRL
          description: >-
            The router's node id on the tailnet. Set once the router has
            enrolled.
        tailnet_name:
          type:
            - string
            - 'null'
          readOnly: true
          example: acme.example
          description: >-
            The name of the tailnet the router is enrolled in. Set once the
            router has enrolled.
        tailscale_ips:
          type: array
          readOnly: true
          items:
            type: string
          example:
            - 100.101.2.30
            - fd7a:115c:a1e0::2a
          description: >-
            The router's addresses on the tailnet. Empty until the router has
            enrolled.
        created_at:
          type: string
          format: date-time
          description: >-
            ISO 8601 formatted date-time indicating when the resource was
            created.
          readOnly: true
          example: '2026-10-13T15:04:05.123456Z'
        updated_at:
          type: string
          format: date-time
          description: >-
            ISO 8601 formatted date-time indicating when the resource was
            updated.
          readOnly: true
          example: '2026-10-13T15:09:41.654321Z'
    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:
    GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````