> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aviatrix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect transit gateway to external device

> POST /v2/api/connect_transit_gw_to_external_device



## OpenAPI

````yaml /openapi/10.0/aviatrix-api.json post /v2/api/connect_transit_gw_to_external_device
openapi: 3.1.0
info:
  title: Aviatrix Controller API
  version: '10.0'
  description: >-
    Aviatrix Controller API — version 10.0. Selected operations with Mintlify
    metadata.
servers: []
security: []
tags:
  - name: policies
    x-group: Policies
  - name: authentication
    x-group: Authentication
  - name: account-management
    x-group: Account Management
  - name: rbac
    x-group: RBAC & Permissions
  - name: gateways
    x-group: Gateways
  - name: transit
    x-group: Transit
  - name: nat
    x-group: NAT
  - name: app-domains
    x-group: SmartGroups
  - name: certificates
    x-group: Certificates
  - name: mitm
    x-group: MITM
  - name: monitoring
    x-group: Monitoring & Diagnostics
  - name: fqdn
    x-group: FQDN
  - name: logging
    x-group: Logging
  - name: vpn
    x-group: UserVPN
  - name: site-to-cloud
    x-group: Site-to-Cloud
  - name: controller
    x-group: Controller
  - name: bgp
    x-group: BGP
  - name: general
    x-group: General
  - name: firenet
    x-group: FireNet
  - name: networking
    x-group: Networking
  - name: tgw
    x-group: AWS TGW
  - name: ips
    x-group: IPS
  - name: saml
    x-group: SAML
paths:
  /v2/api/connect_transit_gw_to_external_device:
    post:
      tags:
        - site-to-cloud
      operationId: connect_transit_gw_to_external_device
      requestBody:
        content:
          application/json:
            schema:
              properties:
                CID:
                  $ref: '#/components/schemas/CID'
                action:
                  $ref: '#/components/schemas/action'
                auth_type:
                  description: 'Auth type: pubkey or psk.'
                  type: string
                backup_bgp_md5_key:
                  description: Backup BGP MD5 key.
                  type: string
                backup_external_device_as_number:
                  description: External device backup ASN.
                  type: string
                backup_local_lan_ip:
                  description: Local HA interface ip address.
                  type: string
                backup_local_lan_ipv6_ip:
                  description: Local HA interface ipv6 ip address for BGP over LAN.
                  type: string
                backup_local_tunnel_ip:
                  description: Address of tunnel interface on primary gateweay.
                  type: string
                backup_pre_shared_key:
                  description: Backup Pre-shared key.
                  type: string
                backup_remote_lan_ip:
                  description: External backup on-prem ip address.
                  type: string
                backup_remote_lan_ipv6_ip:
                  description: External backup on-prem ipv6 address.
                  type: string
                backup_remote_tunnel_ip:
                  description: Address of tunnel interface on backup gateway.
                  type: string
                bfd_detect_multiplier:
                  description: BFD detect multiplier (only honored if --enable_bfd is set).
                  type: integer
                bfd_receive_interval:
                  description: >-
                    BFD receive interval in ms (only honored if --enable_bfd is
                    set).
                  type: integer
                bfd_transmit_interval:
                  description: >-
                    BFD transmit interval in ms (only honored if --enable_bfd is
                    set).
                  type: integer
                bgp_lan_activemesh:
                  description: Enable activemesh BGP over LAN.
                  type: boolean
                bgp_local_as_number:
                  description: Local ASN.
                  type: string
                bgp_md5_key:
                  description: BGP MD5 key.
                  type: string
                bgp_md5_key_changed:
                  description: BGP connection MD5 key updated.
                  type: boolean
                cert_name:
                  description: Remote CA cert name for cert based S2C.
                  type: string
                conn_learned_cidrs_approval:
                  $ref: '#/components/schemas/StringToggle'
                  description: Connection learned cidrs approval.
                connection_name:
                  description: Connection Name.
                  type: string
                connection_policy:
                  description: Enable connection policy for site2cloud connection.
                  type: boolean
                direct_connect_backup:
                  description: Backup over aws direct-connect.
                  type: boolean
                direct_connect_primary:
                  description: Primary over aws direct-connect.
                  type: boolean
                disable_activemesh:
                  description: Disable activemesh.
                  type: boolean
                edge_underlay:
                  description: Create edge underlay BGP connection.
                  type: boolean
                enable_bfd:
                  description: Enable BGP BFD on the connection at create time.
                  type: boolean
                enable_bgp_multihop:
                  description: Enable Multihop for BGP.
                  type: boolean
                enable_global_accelerator:
                  description: .
                  type: boolean
                enable_ha:
                  description: Enable HA.
                  type: boolean
                enable_ikev2:
                  description: Enable IKEv2.
                  type: boolean
                external_device_as_number:
                  description: External device ASN.
                  type: string
                external_device_backup_ipv6:
                  description: IPv6 Address of external backup device ip address(es).
                  type: string
                external_device_ip_address:
                  description: External device ip address(es).
                  type: string
                external_device_ipv6:
                  description: IPv6 Address of external device ip address(es).
                  type: string
                ipv6_enabled:
                  description: Enable IPv6 BGP peering.
                  type: boolean
                jumbo_frame:
                  description: Enabled jumbo frame for the connection.
                  type: boolean
                local_device_ip:
                  description: Local device tunnel ip address.
                  type: string
                local_lan_ip:
                  description: Local interface ip address.
                  type: string
                local_lan_ipv6_ip:
                  description: Local interface ipv6 ip address for BGP over LAN.
                  type: string
                local_subnet:
                  description: Local cidrs to remote peer.
                  type: string
                local_tunnel_ip:
                  description: Address of tunnel interface on primary gateweay.
                  type: string
                log_file:
                  description: Path to progress file.
                  type: string
                peer_vnet_id:
                  description: Peer VNET ID.
                  type: string
                phase1_authentication:
                  description: Phase 1 authentication algorithm.
                  type: string
                phase1_dh_groups:
                  description: Phase 1 DH group.
                  type: string
                phase1_encryption:
                  description: Phase 1 encryption algorithm.
                  type: string
                phase2_authentication:
                  description: Phase 2 authentication algorithm.
                  type: string
                phase2_dh_groups:
                  description: Phase 2 DH group.
                  type: string
                phase2_encryption:
                  description: Phase 2 encryption algorithm.
                  type: string
                pre_shared_key:
                  description: Pre-shared key.
                  type: string
                proxy_id:
                  description: >-
                    Enable/disable proxy ID for static route-based IPSec
                    connection.
                  enum:
                    - disable
                    - enable
                  type: string
                remote_ha_identifier:
                  description: Remote identifier for IKE config in HA gateway.
                  type: string
                remote_identifier:
                  description: Remote identifier for IKE config in primary gateway.
                  type: string
                remote_lan_ip:
                  description: External on-prem ip address.
                  type: string
                remote_lan_ipv6_ip:
                  description: External on-prem ipv6 address.
                  type: string
                remote_subnet:
                  description: Remote site CIDRs.
                  type: string
                remote_tunnel_ip:
                  description: Address of tunnel interface on backup gateway.
                  type: string
                routing_protocol:
                  description: Static or BGP routing.
                  enum:
                    - bgp
                    - static
                  type: string
                transit_gw:
                  description: Transit gateway name.
                  type: string
                tunnel_protocol:
                  description: Bgp link type.
                  enum:
                    - GRE
                    - IPsec
                    - LAN
                  type: string
                vpc_id:
                  description: Transit VPC ID.
                  type: string
                vti_policy:
                  description: Remote peer is running policy.
                  type: boolean
              required:
                - connection_name
                - vpc_id
              type: object
        required: true
      responses:
        '200':
          $ref: '#/components/responses/general_response_v2'
        default:
          $ref: '#/components/responses/general_response_v2'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -sk -X POST
            "https://<controller>/v2/api/connect_transit_gw_to_external_device"
            \
              -H "Authorization: cid <CID>"
        - lang: python
          label: Python
          source: >-
            import requests


            url =
            "https://<controller>/v2/api/connect_transit_gw_to_external_device"

            headers = {"Authorization": "cid <CID>"}


            response = requests.post(url, headers=headers, verify=False)

            print(response.status_code)

            print(response.text)
        - lang: javascript
          label: JavaScript
          source: >-
            fetch("https://<controller>/v2/api/connect_transit_gw_to_external_device",
            {
              method: "POST",
              headers: {"Authorization": "cid <CID>"}
            })
              .then(res => res.text())
              .then(console.log)
              .catch(console.error);
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
            )

            func main() {
              req, _ := http.NewRequest("POST", "https://<controller>/v2/api/connect_transit_gw_to_external_device", nil)
              req.Header.Set("Authorization", "cid <CID>")

              client := &http.Client{}
              resp, err := client.Do(req)
              if err != nil {
                panic(err)
              }
              defer resp.Body.Close()

              fmt.Println(resp.Status)
            }
components:
  schemas:
    CID:
      description: The opaque session ID token. Required for 7.2 controllers only.
      type: string
    action:
      description: The API action to perform. Required for 7.2 controllers only.
      type: string
    StringToggle:
      description: A boolean choice expressed as a string
      enum:
        - 'yes'
        - 'no'
      type: string
    general_response_v2:
      additionalProperties: true
      description: A generic API response container for v2 style APIs.
      properties:
        errortype:
          description: Error type if the API failed.
          type: string
        reason:
          description: Failure reason if the API failed.
          type: string
        results:
          oneOf:
            - description: API response data
              type: boolean
            - description: API response data
              type: integer
            - description: API response data
              type: string
            - description: API response data
              type: object
            - description: API response data
              items: {}
              type: array
        return:
          description: Whether the API returned successfully
          type: boolean
      title: General Response v2
      type: object
  responses:
    general_response_v2:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/general_response_v2'
      description: General v2 API response schema.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.