---
title: "Batch-apply folder policies for a connection"
method: PUT
path: "/connections/{connection_id}/folder-policies"
tags: ["Folder Policies"]
---

# Batch-apply folder policies for a connection

`PUT /connections/{connection_id}/folder-policies`

## Request

- Base URL: `https://api.hyperspell.com`
- URL: `https://api.hyperspell.com/connections/{connection_id}/folder-policies`
- Auth: HTTP bearer

Apply multiple folder-policy changes as one operation.

The request is validated as a whole before any changes are applied. It triggers
at most one resync and returns the connection's complete policy set.

## Path parameters

- `connection_id` string, uuid, required

## Headers

- `X-As-User` string, nullable: Optionally set this header to act as a specific user when using an API Key, equivalent to first exchanging the API Key for a User Token

## Request body

- BatchFolderPolicyRequest
  - `changes` BatchFolderPolicyItem[], required: Folder-policy changes to apply in a single transaction
    - `provider_folder_id` string, required: Folder ID from the source provider
    - `folder_name` string, nullable: Display name of the folder
    - `folder_path` string, nullable: Display path of the folder
    - `parent_folder_id` string, nullable: Parent folder's provider ID for inheritance resolution
    - `sync_mode` 'sync' | 'skip' | 'manual'
    - `action` 'set' | 'delete': 'set' creates or updates the policy; 'delete' removes it

## Response `200`

Successful Response

- FolderPolicyListResponse
  - `policies` FolderPolicyResponse[], required: List of folder policies
    - `id` string, uuid, required: Unique policy ID
    - `provider_folder_id` string, required: Folder ID from the source provider
    - `folder_name` string, nullable: Display name of the folder
    - `folder_path` string, nullable: Display path of the folder
    - `parent_folder_id` string, nullable: Parent folder's provider ID
    - `sync_mode` 'sync' | 'skip' | 'manual', required
    - `connection_id` string, uuid, nullable: Connection ID (null for integration defaults)

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/hyperspell/apis/hyperspell-api.md) - [All operations](https://skmtc.dev/hyperspell/apis/hyperspell-api/llms.txt) - [OpenAPI document](https://skmtc.dev/hyperspell/apis/hyperspell-api/revisions/9bafd1215a0f?raw)
