---
title: "Creates a VPC subnet in the project and returns the created subnet."
method: POST
path: "/projects/{project_id}/networking/vpc-subnets"
tags: ["VPC Subnets"]
---

# Creates a VPC subnet in the project and returns the created subnet.

`POST /projects/{project_id}/networking/vpc-subnets`

## Path parameters

- `project_id` string, required

## Request body

- VPCSubnetPostRequest
  - `cidr` string, required — Address range for the VPC subnet, in CIDR notation (for example, 172.27.0.0/16).
  - `location` string, required — Location to create the subnet in.
  - `name` string, required — Name for the new VPC subnet.
  - `nat_gateway_enabled` boolean, required — Whether to create a NAT gateway for the subnet.
  - `vpc_network_id` string, required — ID of the VPC network to create the subnet in.

## Response `200`

- VPCSubnetPostResponse
  - `subnet` VPCSubnet, required
    - `cidr` string, required — Address range of the VPC subnet, in CIDR notation.
    - `id` string, required — ID of the VPC subnet.
    - `location` string, required — Location of the VPC subnet.
    - `name` string, required — Name of the VPC subnet.
    - `nat_gateways` NATGateway[] — NAT gateways attached to the subnet. Empty unless a NAT gateway is enabled for the subnet.
      - `id` string, required — ID of the NAT gateway.
      - `public_ipv4_address` string, required — Public IPv4 address assigned to the NAT gateway.
      - `public_ipv4_id` string, required — ID of the public IPv4 address assigned to the NAT gateway.
    - `vpc_network_id` string, required — ID of the VPC network that the subnet belongs to.

## Other responses

- `400` — Error Bad Request
- `401` — Error Authentication Failed
- `403` — Error Permissions
- `500` — Error Internal Server

---

[API](https://skmtc.net/crusoecloud/apis/crusoe-cloud-api-gateway.md) · [All operations](https://skmtc.net/crusoecloud/apis/crusoe-cloud-api-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/crusoecloud/crusoe-cloud-api-gateway/revisions/a3fd2dedc72b/schema)
