---
title: "Create Policy Attachment"
method: POST
path: "/policies/attachments"
tags: ["Policies"]
---

# Create Policy Attachment

`POST /policies/attachments`

Create a new policy attachment.

Example Request:
```bash
curl -X POST "http://localhost:4000/policies/attachments" \
    -H "Authorization: Bearer <your_api_key>" \
    -H "Content-Type: application/json" \
    -d '{
        "policy_name": "global-baseline",
        "scope": "*"
    }'
```

Example with team-specific attachment:
```bash
curl -X POST "http://localhost:4000/policies/attachments" \
    -H "Authorization: Bearer <your_api_key>" \
    -H "Content-Type: application/json" \
    -d '{
        "policy_name": "healthcare-compliance",
        "teams": ["healthcare-team", "medical-research"]
    }'
```

Example Response:
```json
{
    "attachment_id": "123e4567-e89b-12d3-a456-426614174000",
    "policy_name": "global-baseline",
    "scope": "*",
    "teams": [],
    "keys": [],
    "models": [],
    "created_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-01T00:00:00Z"
}
```

## Request body

- PolicyAttachmentCreateRequest — Request body for creating a policy attachment.
  - `policy_name` string, required — Name of the policy to attach.
  - `scope` string, nullable — Use '*' for global scope (applies to all requests).
  - `teams` string[], nullable — Team aliases or patterns this attachment applies to.
  - `keys` string[], nullable — Key aliases or patterns this attachment applies to.
  - `models` string[], nullable — Model names or patterns this attachment applies to.
  - `tags` string[], nullable — Tag patterns this attachment applies to. Supports wildcards (e.g., health-*).

## Response `200`

Successful Response

- PolicyAttachmentDBResponse — Response for a policy attachment from the database.
  - `attachment_id` string, required — Unique ID of the attachment.
  - `policy_name` string, required — Name of the attached policy.
  - `scope` string, nullable — Scope of the attachment.
  - `teams` string[] — Team patterns.
  - `keys` string[] — Key patterns.
  - `models` string[] — Model patterns.
  - `tags` string[] — Tag patterns.
  - `created_at` string, date-time, nullable — When the attachment was created.
  - `updated_at` string, date-time, nullable — When the attachment was last updated.
  - `created_by` string, nullable — Who created the attachment.
  - `updated_by` string, nullable — Who last updated the attachment.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/sea-lion/apis/litellm-api.md) · [All operations](https://skmtc.net/sea-lion/apis/litellm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sea-lion/litellm-api/revisions/79928a3d37d3/schema)
