---
title: "Share all hosts in a folder"
method: POST
path: "/rbac/folder/share"
tags: ["RBAC"]
---

# Share all hosts in a folder

`POST /rbac/folder/share`

Shares every host within a folder (and its subfolders) with one or more users and/or roles at a permission level. Only hosts owned by the caller are shared; skips hosts the caller may not share.

## Request body

- object
  - `folder` string, required
  - `targets` object[], required
    - `type` 'user' | 'role'
    - `id` union
      - string
      - integer
  - `permissionLevel` 'connect' | 'view' | 'edit' | 'manage'
  - `durationHours` number

## Response `200`

Folder shared successfully.

## Other responses

- `400` — Invalid request body.
- `500` — Failed to share folder.

---

[API](https://skmtc.dev/termix/apis/termix-api.md) · [All operations](https://skmtc.dev/termix/apis/termix-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/termix/termix-api/revisions/f4ef343eff1b/schema)
