Skip to main content
POST
/
v1
/
network-policies
/
{id}
JavaScript
import Runloop from '@runloop/api-client';

const client = new Runloop({
  bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});

const networkPolicyView = await client.networkPolicies.update('id');

console.log(networkPolicyView.id);
{
  "id": "<string>",
  "name": "<string>",
  "egress": {
    "allow_all": true,
    "allow_devbox_to_devbox": true,
    "allowed_hostnames": [
      "<string>"
    ]
  },
  "create_time_ms": 123,
  "update_time_ms": 123,
  "description": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

The unique identifier of the NetworkPolicy to update.

Body

application/json

Parameters for updating an existing NetworkPolicy. All fields are optional.

name
string | null

Updated human-readable name for the NetworkPolicy.

description
string | null

Updated description for the NetworkPolicy.

allow_all
boolean | null

If true, all egress traffic is allowed (ALLOW_ALL policy).

allow_devbox_to_devbox
boolean | null

If true, allows traffic between the account's own devboxes via tunnels.

allowed_hostnames
string[] | null

Updated DNS-based allow list with wildcard support. Examples: ['github.com', '*.npmjs.org'].

Response

NetworkPolicy updated successfully.

A NetworkPolicy defines egress network access rules for devboxes. Policies can be applied to blueprints, devboxes, and snapshot resumes.

id
string
required

The unique identifier of the NetworkPolicy.

name
string
required

The human-readable name of the NetworkPolicy. Unique per account.

egress
object
required

The egress rules for this policy.

create_time_ms
integer<int64>
required

The creation time of the NetworkPolicy (Unix timestamp in milliseconds).

update_time_ms
integer<int64>
required

Last update time of the NetworkPolicy (Unix timestamp in milliseconds).

description
string | null

Optional description of the NetworkPolicy.