# Folder Permissions

## Advanced Folder Permissions

## Get folder permissions

<mark style="color:blue;">`GET`</mark> `https://api.couchdrop.io/manage/fileprops/permissions`

Get permissions for a specific folder.

#### Query Parameters

| Name | Type   | Description                       |
| ---- | ------ | --------------------------------- |
| path | string | Folder to get permission details. |

#### Headers

| Name  | Type   | Description      |
| ----- | ------ | ---------------- |
| token | string | API Access Token |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{"result": [{"username": "user-38f92ce5", 
    "account": "michael", 
    "lstat": true, 
    "upload": false, 
    "ls": true, 
    "download": true, 
    "path": "/test_folder", 
    "id": "38f92ce5-700f-4f4d-8557-df6f5e8d9b80 "}]}
```

{% endtab %}

{% tab title="403 Authentication Invalid" %}

```
```

{% endtab %}
{% endtabs %}

## Add/Update folder permissions

<mark style="color:green;">`POST`</mark> `https://api.couchdrop.io/manage/fileprops/permissions`

Add new or update existing folder properties.

#### Headers

| Name  | Type   | Description      |
| ----- | ------ | ---------------- |
| token | string | API Access Token |

#### Request Body

| Name     | Type    | Description                          |
| -------- | ------- | ------------------------------------ |
| path     | string  | Folder to grant user permissions on. |
| username | string  | User to grant permissions on.        |
| download | boolean | Grant Download permissions to user.  |
| upload   | boolean | Grant Upload permissions to user.    |
| delete   | boolean | Grant Delete permissions to user.    |
| lstat    | boolean | Grant LSTAT permissions to user.     |
| ls       | boolean | Grant LS permissions to user.        |

{% tabs %}
{% tab title="200 Successfully added permissions for user." %}

```
{}
```

{% endtab %}

{% tab title="403 Authentication Invalid." %}

```
```

{% endtab %}
{% endtabs %}

## Delete folder permissions

<mark style="color:red;">`DELETE`</mark> `https://api.couchdrop.io/manage/fileprops/permissions/<permission_id>`

Delete permissions from a specific folder.

#### Path Parameters

| Name           | Type   | Description                        |
| -------------- | ------ | ---------------------------------- |
| permission\_id | string | ID of the permission to be deleted |

#### Headers

| Name  | Type   | Description      |
| ----- | ------ | ---------------- |
| token | string | API Access Token |

{% tabs %}
{% tab title="200 Successfully deleted permission." %}

```
{}
```

{% endtab %}

{% tab title="403 Authentication Invalid." %}

```
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.couchdrop.io/administration/advanced-folder-permissions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
