Skip to content
Navigation

Replace a network policy

Mints a NEW policy id from this body. The named policy and every published version using it stay exactly as they were — save the new id on the agent draft and publish it for the change to take effect. Authorization: org admin.

PUT
https://api.cloudraker.com/network-policies/{policyId}
Try it
Path parameters
Request body
Live API request

This request can change data or incur charges for the selected organization.

Authorization

  • bearerAuth
    HTTP
    required

Path parameters

  • policyId
    string
    required
    pattern: ^net_[0-9A-HJKMNP-TV-Z]{26}$

Request body JSON required

  • name
    string
    required
    maxLength: 200 · minLength: 1
  • hosts
    map of
    object
    required

    Host → rule. A key is an exact lowercase public DNS hostname: no port, no wildcard, no path, no IP literal, no internal or private target. At most 50.

Returns

201

The replacement policy, under a new id.

JSON
  • data
    object
    required
    • id
      string
      required
      pattern: ^net_[0-9A-HJKMNP-TV-Z]{26}$
    • name
      string
      required
    • hosts
      map of
      object
      required
    • createdAt
      string
      required
      format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
    • createdBy
      string
      required
    • revokedAt
      required

      Set once the policy is revoked. A revoked policy stays READABLE for history and every egress request under it is denied.

      Any of the following:

      • string
      • null

400

Validation Error
JSON
  • success
    false
    required
  • error
    array of
    unknown
    required
  • data
    unknown
    required

403

forbidden — writing a network policy is an org-admin action.
JSON
  • error
    string
    required

    The sentence a human reads.

  • error_code
    string
    required

    The stable snake_case branch key.

  • issues
    optional
    array of
    object

    Per-field detail, present only on a validation failure.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required

404

network_policy_not_found — no such policy in this organization.
JSON
  • error
    string
    required

    The sentence a human reads.

  • error_code
    string
    required

    The stable snake_case branch key.

  • issues
    optional
    array of
    object

    Per-field detail, present only on a validation failure.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required

422

invalid_network_policy — a host is not an exact public DNS name, or the policy lists more than 50 of them. The sentence names the offending host.
JSON
  • error
    string
    required

    The sentence a human reads.

  • error_code
    string
    required

    The stable snake_case branch key.

  • issues
    optional
    array of
    object

    Per-field detail, present only on a validation failure.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required

Type to search…

↑↓ navigate↵ selectEsc close