---
title: "Attach policy to service user"
url: https://hexelstudio.com/docs/api/ciam-iam/service-users/attach-policy-to-service-user
---

# Attach policy to service user

**POST** `/service-users/{service_user_id}/policies`

## Path parameters

- `service_user_id: string`

  Service User ID

## Headers

- `Authorization: string`

  `Bearer <token>`.

## Body parameters

- `body: object`

  Policy attachment

## Returns

`201` Created (`PolicyAttachment`)

- `attached_at: optional string`

- `attached_by_user_id: optional string`

- `id: optional string`

- `organization_id: optional string`

- `policy_id: optional string`

- `target_id: optional string`

- `target_type: optional string`

## Example

```bash
curl --request POST \
  --url 'https://api.hexelstudio.com/v1/service-users/{service_user_id}/policies' \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{}'
```

### Response (201)

```json
{
  "attached_at": "2026-01-01T00:00:00Z",
  "attached_by_user_id": "string",
  "id": "string",
  "organization_id": "string",
  "policy_id": "string",
  "target_id": "string",
  "target_type": "string"
}
```
