Vpcs
Virtual Private Cloud networks
Virtual Private Cloud networks
| Base URL | https://api.hanzo.ai |
| Operations | 4 |
| Auth | Authorization: Bearer $HANZO_API_KEY |
vpcs
GetVpc returns one of the caller org's VPCs by id.
GET /v1/vpcs/{id}
GetVpc returns one of the caller org's VPCs by id. A VPC that exists but sits in another org's namespace is reported 404, never 403 — the answer must not tell one tenant that another tenant's resource exists.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | DO VPC id |
DeleteVpc removes one of the caller org's VPCs and answers 204.
DELETE /v1/vpcs/{id}
DeleteVpc removes one of the caller org's VPCs and answers 204. Ownership is confirmed by re-fetching the resource and checking its physical name carries the caller's org prefix BEFORE anything is deleted, so a cross-tenant id is a 404 rather than a delete of another org's VPC.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | DO VPC id |
ListVpcs returns every VPC the caller's org owns, under the friendly names the org created them with.
GET /v1/vpcs
ListVpcs returns every VPC the caller's org owns, under the friendly names the org created them with. DigitalOcean is one account for the whole deployment, so the account-wide inventory is filtered to the caller's own "o"<orgHash>- name prefix and the prefix is stripped — another org's VPC is not merely hidden, it is never in the answer.
CreateVpc creates a VPC in the caller's org namespace and answers 201 with it.
POST /v1/vpcs
CreateVpc creates a VPC in the caller's org namespace and answers 201 with it. The physical DigitalOcean name is derived server-side from the validated org, so a tenant can only ever create inside its own namespace; a name that already exists there is a 409.
Request body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
ip_range | string | — | IPRange is the VPC's private CIDR. |
name | string | — | Name is the FRIENDLY name, a DNS-safe slug of at most 40 characters. |
region | string | — | Region is the DigitalOcean region slug (nyc3, sfo3, …). |
How is this guide?