---
title: "Create an egress gateway in a VPC"
method: POST
path: "/vpcs/{vpcName}/egressgateways"
tags: ["vpcs"]
---

# Create an egress gateway in a VPC

`POST /vpcs/{vpcName}/egressgateways`

## Request

- Base URL: `https://api.blaxel.ai/v0`
- URL: `https://api.blaxel.ai/v0/vpcs/{vpcName}/egressgateways`
- Auth: one of:
  - OAuth 2
    - Authorization code: `/oauth/authorize`
    - Client credentials
    - Token URL: `/oauth/token` scopes: `admin`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/blaxel/apis/blaxel-control-plane/docs/vpcs/:vpcName/egressgateways/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `vpcName` string, required

## Request body

- EgressGateway: An egress gateway that manages outbound traffic routing within a VPC. Multiple egress IPs can be allocated from a single gateway.
  - `events` CoreEvent[]: Events happening on a resource deployed on Blaxel
    - `canaryRevision` string: Canary revisionID link to the event
    - `message` string: Event message
    - `revision` string: RevisionID link to the event
    - `status` string: Event status
    - `time` string: Event time
    - `type` string: Event type
  - `metadata` EgressGatewayMetadata, required: Owner fields for Persistence
    - `createdAt` string: The date and time when the resource was created
    - `updatedAt` string: The date and time when the resource was updated
    - `createdBy` string: The user or service account who created the resource
    - `updatedBy` string: The user or service account who updated the resource
    - `displayName` string: Human-readable name for display in the UI. Can contain spaces and special characters, max 63 characters.
    - `name` string, required: Unique identifier for the egress gateway within the VPC. Must be lowercase alphanumeric with hyphens, max 49 characters. Immutable after creation.
    - `vpcName` string: Name of the VPC this egress gateway belongs to
    - `workspace` string: Name of the workspace this resource belongs to (read-only, set automatically)
  - `spec` EgressGatewaySpec, required: Specification for an egress gateway including region and capacity configuration
    - `region` string, required: Region where the egress gateway is provisioned (e.g. us-pdx-1, eu-lon-1)
  - `status` 'DELETING' | 'TERMINATED' | 'FAILED' | 'DEACTIVATED' | 'DEACTIVATING' | 'UPLOADING' | 'BUILDING' | 'DEPLOYING' | 'DEPLOYED' | 'BUILT': Deployment status of a resource deployed on Blaxel

## Response `200`

successful operation

- EgressGateway: An egress gateway that manages outbound traffic routing within a VPC. Multiple egress IPs can be allocated from a single gateway.
  - `events` CoreEvent[]: Events happening on a resource deployed on Blaxel
    - `canaryRevision` string: Canary revisionID link to the event
    - `message` string: Event message
    - `revision` string: RevisionID link to the event
    - `status` string: Event status
    - `time` string: Event time
    - `type` string: Event type
  - `metadata` EgressGatewayMetadata, required: Owner fields for Persistence
    - `createdAt` string: The date and time when the resource was created
    - `updatedAt` string: The date and time when the resource was updated
    - `createdBy` string: The user or service account who created the resource
    - `updatedBy` string: The user or service account who updated the resource
    - `displayName` string: Human-readable name for display in the UI. Can contain spaces and special characters, max 63 characters.
    - `name` string, required: Unique identifier for the egress gateway within the VPC. Must be lowercase alphanumeric with hyphens, max 49 characters. Immutable after creation.
    - `vpcName` string: Name of the VPC this egress gateway belongs to
    - `workspace` string: Name of the workspace this resource belongs to (read-only, set automatically)
  - `spec` EgressGatewaySpec, required: Specification for an egress gateway including region and capacity configuration
    - `region` string, required: Region where the egress gateway is provisioned (e.g. us-pdx-1, eu-lon-1)
  - `status` 'DELETING' | 'TERMINATED' | 'FAILED' | 'DEACTIVATED' | 'DEACTIVATING' | 'UPLOADING' | 'BUILDING' | 'DEPLOYING' | 'DEPLOYED' | 'BUILT': Deployment status of a resource deployed on Blaxel

---

[API](https://skmtc.dev/blaxel/apis/blaxel-control-plane.md) - [All operations](https://skmtc.dev/blaxel/apis/blaxel-control-plane/llms.txt) - [OpenAPI document](https://skmtc.dev/blaxel/apis/blaxel-control-plane/revisions/dfa264bc72ee?raw)
