# Update Network

> Infra API · Networks

```http
PATCH https://app.mk.io/api/v1/projects/{project_name}/infra/networks/{name}
```

Update a network. To learn more about networks, read [Network Concept](ref:infrastructure-api#network-concept)..

RBAC Capability Required: `infra.network.update`

## Authentication

- `Authorization` header — Bearer authentication of the form `Bearer <token>`.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_name` | string | Yes | — |
| `name` | string | Yes | — |

## Request body

Content type: `application/json`

- `metadata` · object · Optional — Resource metadata.
  - `displayName` · string · Optional · _1-255 characters_ — A human-readable name for the resource.
  - `labels` · map from strings to string · Optional — A dictionary of labels associated with the resource. Maximum number of labels: 32. Maximum length of a label or value: 256 characters. Label: alphanumeric, hyphens and underscores. Value: alphanumeric, hyphens, underscores and spaces.
    - `[any key]` · string — map of additional properties
- `spec` · object · Optional — Network specification.

## Example request

```bash
curl -X PATCH "https://app.mk.io/api/v1/projects/{project_name}/infra/networks/{name}" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
  "metadata": {
    "displayName": "string",
    "labels": {
      "key": "string"
    }
  },
  "spec": {}
}'
```

## Responses

### 200 — The updated network

- `kind` · string · **Required** — The kind of record.
- `metadata` · object · **Required** — Network metadata.
  - `created` · string · Optional · _format: date-time_ — The time when the resource was created
  - `createdBy` · string · Optional · _format: uuid_ — ID of the user who created the resource
  - `createdByEmail` · string · Optional — Email of the user who created the resource
  - `displayName` · string · Optional — The display name of the resource
  - `id` · string · **Required** · _format: uuid_ — The ID of the resource
  - `labels` · map from strings to string · Optional — A dictionary of labels associated with the resource
    - `[any key]` · string — map of additional properties
  - `name` · string · Optional — The name of the resource
  - `updated` · string · Optional · _format: date-time_ — The time when the resource was last updated
  - `updatedBy` · string · Optional · _format: uuid_ — ID of the user who last updated the resource
  - `updatedByEmail` · string · Optional — Email of the user who last updated the resource
- `spec` · object · **Required** — Network specification.
- `status` · object · **Required** — Network status.
  - `owner` · enum · **Required** — Indicates whether the network was automatically created by the system. System owned networks cannot be deleted, but they can be modified. To learn more, read [System owned networks](ref:infrastructure-api#system-owned-networks).
    - Allowed values: `User`, `System`
  - `scope` · enum · **Required** — Indicates whether the network is a local network within a site. Local networks are always system owned and therefore cannot be deleted, however they can be modified.
    - Allowed values: `Connecting`, `Local`

Example:

```json
{
  "kind": "string",
  "metadata": {
    "created": "2024-01-01T00:00:00Z",
    "createdBy": "00000000-0000-0000-0000-000000000000",
    "createdByEmail": "string",
    "displayName": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "labels": {
      "label1": "value1",
      "label2": "value2"
    },
    "name": "string",
    "updated": "2024-01-01T00:00:00Z",
    "updatedBy": "00000000-0000-0000-0000-000000000000",
    "updatedByEmail": "string"
  },
  "spec": {},
  "status": {
    "owner": "User",
    "scope": "Connecting"
  }
}
```

### 400 — Bad Request

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 401 — Unauthorized

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 403 — Forbidden

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 404 — Not Found

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 429 — Too Many Requests

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 500 — Internal Server Error

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

---

Source spec: `infrastructure-api` · operationId: `[patch]_/api/v1/projects/{project_name}/infra/networks/{name}`
