Skip to main content
GET
/
v1
/
regions
/
{region}
/
projects
/
{project}
/
compute
/
subnets
List subnets
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.k0rdent.ai/v1/regions/{region}/projects/{project}/compute/subnets', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "subnets": [
    {
      "selfLink": "/v1/regions/us-texas-1/projects/project-x9y8z7/compute/subnets/subnet-a1b2c3",
      "uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "id": "subnet-a1b2c3",
      "displayName": "<string>",
      "description": "<string>",
      "network": "/v1/regions/us-texas-1/projects/project-x9y8z7/compute/networks/default",
      "ipv4Cidr": "10.0.1.0/24",
      "ipv6Cidr": "fd00:1::/64",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z"
    }
  ],
  "nextPageToken": "<string>",
  "total": 123
}

Authorizations

Authorization
string
header
required

Bearer token authentication using OAuth2/OIDC tokens

Path Parameters

region
string
required

Region identifier

project
string
required

Project identifier

Query Parameters

pageToken
string

Opaque cursor token returned in the previous response's nextPageToken. Pass to retrieve the next page of results.

Use for: Frequently updated resources (sessions, servers, clusters, API keys, instances, networks, addresses) where cursor pagination prevents items from being skipped or duplicated when the dataset changes between requests.

Mutually exclusive with offset — include one or the other, not both.

pageSize
integer
default:50

Maximum number of items to return per page. Applies to both cursor-based and offset-based pagination.

Range: 1–500. Default: 50.

Required range: 1 <= x <= 500
offset
integer
default:0

Number of items to skip before returning results.

Use for: Stable resources that change infrequently (roles, organizations, providers, policies, groups, projects) where offset pagination enables page-number UIs and total-count displays.

When using offset, the response includes a total field with the full item count. Mutually exclusive with pageToken — include one or the other, not both.

Required range: x >= 0

Response

List of subnets

subnets
object[]
nextPageToken
string

Cursor token for retrieving the next page. Pass as pageToken in the next request. Absent when there are no more results.

Only returned in cursor mode (pageToken-based requests). Not returned when using offset-based pagination.

total
integer

Total number of items matching the query, regardless of pageSize. Use to compute page counts and display 'showing X–Y of Z' UI.

Only populated in offset mode (offset-based requests). Omitted or null in cursor mode. Requires a COUNT(*) query on the backend — avoid relying on this field in performance-critical paths for large datasets.