/v1/firewall-policies/{uid}Changes a policy's name, description or default flag. Send only the fields you want to
change. Renaming the policy also changes its slug. This does not change any rules, so no
firewall operation is queued.
A name that another policy in the workspace already uses (exact, case-sensitive match) is
rejected with 409.
Authentication
Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.
Path parameters
uidstringRequiredThe firewall policy's uid.
Headers
X-Workspace-SlugstringRequiredSlug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.
Request body
namestringNew name. Leading and trailing spaces are trimmed. Cannot be blank.
descriptionstringNew description. Send an empty string to clear it.
is_defaultbooleanMarks or unmarks the policy as a workspace default. This is a label only.
Response
The updated policy.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataobjectShow attributesHide attributes
uidstringRequiredUnique identifier of the policy.
namestringRequiredName of the policy, unique in the workspace.
slugstringRequiredURL-friendly form of the name.
descriptionstringFree-text description. Omitted when empty.
is_defaultbooleanRequiredWhether the policy is labelled as a workspace default. It is not applied automatically.
rulesarray of objectsThe policy's rules, oldest first. Omitted when the policy has no rules.
Show item attributesHide item attributes
operation_idstringRequiredOn Add a firewall rule and
Update a firewall rule, the UID of the
first firewall.apply operation queued for the change. An empty string when no
operation was queued, and always empty when rules are returned inside a policy.
uidstringRequiredUnique identifier of the rule.
directionstringRequiredTraffic direction the rule applies to.
One ofinboundoutbound
actionstringRequiredWhat happens to matching traffic. Always allow.
One ofallow
protocolstringRequiredIP protocol the rule matches.
One oftcpudpall
port_startintegerRequiredFirst port of the range. 0 with port_end 0 means all ports.
port_endintegerRequiredLast port of the range.
cidrstringRequiredSource address range in CIDR notation.
descriptionstringNote about the rule. Omitted when empty.
is_defaultbooleanRequiredtrue for the SSH and app-port rules added automatically when the policy was created.
attached_resourcesarray of objectsResources the policy is attached to, newest first. Omitted when there are none.
Show item attributesHide item attributes
operation_idstringRequiredOn Attach a firewall policy, the UID
of the firewall.apply operation queued for the resource. An empty string when the
policy was already attached or no operation could be queued, and always empty when
attachments are returned inside a policy.
uidstringRequiredUnique identifier of the attachment. Use it to detach the policy.
resource_typestringRequiredKind of resource the policy is attached to.
One ofvmdatabasedeployment
resourceobjectRequiredShort description of the attached resource. All fields are empty strings if the resource no longer exists.
Show attributesHide attributes
uidstringRequiredUID of the VM, database or deployment.
namestringRequiredName of the resource.
slugstringRequiredSlug of the resource.
statusstringRequiredCurrent status of the resource. For VMs and databases this is the display status.
created_atstring (date-time)RequiredWhen the policy was created (RFC 3339).
updated_atstring (date-time)RequiredWhen the policy itself was last changed. Rule changes do not update it.
Errors
| Status | Meaning |
|---|---|
400 | The body is not valid JSON (invalid request) or name is blank (policy name cannot be empty). |
401 | The API key is missing, invalid, expired or revoked. |
403 | You cannot access the workspace, your role does not allow this action, or the account is suspended. |
404 | No firewall policy with this uid exists in the workspace. |
409 | Another policy in the workspace already has this name. |
Errors use the standard error format.