---
title: "Set who can access a folder"
description: "Restrict a folder to its people and teams, replace its own people / teams, and set what new items start as (folder = its people and teams)."
canonical_url: https://docs.markdrop.in/api/folders/set-who-can-access-a-folder
last_updated: 2026-11-20
site: "Markdrop Docs"
index: https://docs.markdrop.in/llms.txt
---

# Set who can access a folder

`PUT https://api.markdrop.in/api/v1/workspaces/{workspace_id}/folders/{folder_id}/access`

Restrict a folder to its people and teams, replace its own people / teams, and set what new items start as (`folder` = its people and teams). Everything inside, including subfolders and items added later, follows at once. Workspace admins, the folder's creator and its editors.

- **Authentication:** API token required: `Authorization: Bearer mdk_…`.
- **Rate limit:** 60 per minute per IP address.
- **Guide:** [Folder access](https://docs.markdrop.in/workspaces/folder-access)

## Path parameters

- `workspace_id` (string, required): The workspace's id, from the address of its settings page (`markdrop.in/settings/workspaces/<workspace-id>`) or from [List workspaces](https://docs.markdrop.in/api/workspaces/list-workspaces).
- `folder_id` (string, required): The folder's id, from [List folders](https://docs.markdrop.in/api/folders/list-folders).

## Request body

`application/json`, required.

- `restricted` (boolean): Only the folder's people and teams (and item owners, people an item is shared with, workspace admins) open what's inside.
- `people` (array of object): Up to 200 items.
  - `email` (string, required): 3–254 characters.
  - `role` ("viewer" | "editor"): Default `"viewer"`.
- `teams` (array of object): Up to 50 items.
  - `team_id` (string, required): The team's id, slug or name. 1–80 characters.
  - `role` ("viewer" | "editor"): Default `"editor"`.
- `default_access` ("private" | "folder" | "workspace" | "link"): What new items here start as; send null to clear (the workspace's default).
- `notify` (boolean): Tell people newly given access (one email / notification each). Default `false`.
- `message` (string): Up to 500 characters.

## Responses

- `200`: OK.
- `401`: No token, or the token is revoked or mistyped.
- `422`: The request didn't validate. `detail` lists each problem, with where it is (`loc`) and why (`msg`).
- `429`: Too many requests from your IP address. Wait the seconds in `Retry-After`.

## Examples

**curl**

```bash
curl -X PUT https://api.markdrop.in/api/v1/workspaces/WORKSPACE_ID/folders/FOLDER_ID/access \
  -H "Authorization: Bearer $MARKDROP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "restricted": true,
       "teams": [
         {
           "team_id": "sales",
           "role": "editor"
         }
       ],
       "people": [
         {
           "email": "sam@example.com",
           "role": "viewer"
         }
       ],
       "default_access": "folder",
       "notify": true
     }'
```

**JavaScript**

```javascript
const res = await fetch("https://api.markdrop.in/api/v1/workspaces/WORKSPACE_ID/folders/FOLDER_ID/access", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.MARKDROP_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "restricted": true,
    "teams": [
      {
        "team_id": "sales",
        "role": "editor"
      }
    ],
    "people": [
      {
        "email": "sam@example.com",
        "role": "viewer"
      }
    ],
    "default_access": "folder",
    "notify": true
  }),
});
const data = await res.json();
```

**Python**

```python
import os

import requests

r = requests.put(
    "https://api.markdrop.in/api/v1/workspaces/WORKSPACE_ID/folders/FOLDER_ID/access",
    headers={"Authorization": f"Bearer {os.environ['MARKDROP_TOKEN']}"},
    json={
        "restricted": True,
        "teams": [{"team_id": "sales", "role": "editor"}],
        "people": [{"email": "sam@example.com", "role": "viewer"}],
        "default_access": "folder",
        "notify": True,
    },
)
r.raise_for_status()
print(r.json())
```
