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

# Enable gateway insertion for specified VPC and routing tables

> Configures gateway insertion functionality for the provided VPC and their associated routing tables



## OpenAPI

````yaml /openapi/9.0/aviatrix-api.json put /v2.5/api/gateway-insertion/vpc
openapi: 3.1.0
info:
  title: Aviatrix Controller API
  version: '9.0'
  description: >-
    Aviatrix Controller API — version 9.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.5/api/gateway-insertion/vpc:
    put:
      tags:
        - gateways
      summary: Enable gateway insertion for specified VPC and routing tables
      description: >-
        Configures gateway insertion functionality for the provided VPC and
        their associated routing tables
      operationId: createOrUpdateGatewayInsertion
      parameters:
        - name: Authorization
          in: header
          required: true
          description: 'Controller ID in the format: cid <CID>.'
          schema:
            type: string
            example: cid <CID>
            default: cid <CID>
          example: cid <CID>
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GatewayInsertionRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayInsertionResponse'
          description: Successfully enabled gateway insertion for the specified VPC
        '400':
          description: Bad request - invalid input parameters
        '500':
          description: Server error during processing
        default:
          $ref: '#/components/responses/general_response_v25'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -sk -X PUT
            "https://<controller>/v2.5/api/gateway-insertion/vpc" \
              -H "Authorization: cid <CID>"
        - lang: python
          label: Python
          source: |-
            import requests

            url = "https://<controller>/v2.5/api/gateway-insertion/vpc"
            headers = {"Authorization": "cid <CID>"}

            response = requests.put(url, headers=headers)
            print(response.text)
        - lang: go
          label: Go
          source: |-
            package main

            import (
              "fmt"
              "net/http"
            )

            func main() {
              req, _ := http.NewRequest("PUT", "https://<controller>/v2.5/api/gateway-insertion/vpc", 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:
    GatewayInsertionRequest:
      properties:
        vpc_config:
          properties:
            additional_params:
              additionalProperties: true
              description: Optional additional parameters for the VPC configuration
              type: object
            egress_mode:
              default: non-egress
              description: >-
                Controls egress NAT behavior for gateway insertion. Defaults to
                "non-egress" if not specified.
              enum:
                - non-egress
                - egress-subset
                - egress-exact
              example: non-egress
              type: string
            route_tables:
              description: List of routing table IDs for this VPC
              items:
                description: Routing table ID
                example:
                  - rtb-0a1b2c3d4e5f67890
                type: string
              type: array
            vpc_id:
              description: The ID of the VPC to enable
              example: vpc-0a1b2c3d4e5f67890
              type: string
          required:
            - vpc_id
            - route_tables
          type: object
      required:
        - vpc_config
      type: object
    GatewayInsertionResponse:
      properties:
        status:
          description: Status of the enablement operation
          example: success
          type: string
        vpc_result:
          description: Result for the VPC enablement
          properties:
            err_message:
              description: Error message if the enablement operation fails
              example: Invalid VPC ID provided
              type: string
            status:
              description: Status of the enablement for this VPC
              example: enabled
              type: string
            vpc_id:
              description: The ID of the enabled VPC
              example: vpc-0a1b2c3d4e5f67890
              type: string
          type: object
      type: object
    general_response_v25:
      description: A generic API response container for v2.5 style APIs.
      properties:
        message:
          description: A human-readable message.
          type: string
      title: General Response v2.5
      type: object
  responses:
    general_response_v25:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/general_response_v25'
      description: General v2.5 API response schema.

````