---
title: "Attach a policy to an instance"
method: POST
path: "/v1/firewalls/attachments"
tags: ["public", "firewalls"]
---

# Attach a policy to an instance

`POST /v1/firewalls/attachments`

## Request

- Base URL: `https://api.vozora.io`
- URL: `https://api.vozora.io/v1/firewalls/attachments`
- Auth: API key in header `Authorization`

Applies a policy to one of your instances. An instance carries at most one policy; detach the existing one first. Enforcement is asynchronous — poll the attachment until observed_state is attached.

## Request body

- FirewallCreateAttachmentRequest
  - `instance_id` string
  - `policy_id` string

## Response `201`

Created

- FirewallPublicAttachment
  - `created_at` string
  - `desired_state` string
  - `error_message` string
  - `id` string
  - `instance_id` string
  - `observed_state` string
  - `policy_id` string
  - `updated_at` string

## Other responses

- `400`: invalid request body
- `401`: invalid or missing API key
- `403`: the key lacks firewall:write
- `404`: no such resource, or it belongs to another account
- `409`: already_attached — the instance already carries a policy
- `422`: validation_error — the request is well-formed but not acceptable

---

[API](https://skmtc.dev/vozora/apis/vozora-api.md) · [All operations](https://skmtc.dev/vozora/apis/vozora-api/llms.txt) · [OpenAPI document](https://skmtc.dev/vozora/apis/vozora-api/revisions/56f15734fc5a?raw)
