# REST API: Permissions

> The 5 operations of the area Permissions, with parameters, bodies and responses.

Source: https://pithyx.org/docs/reference/api/permissions/
Markdown: https://pithyx.org/docs/reference/api/permissions.md

Generated from the daemon's OpenAPI document. Conventions, sign-in, the CSRF header and the WebSocket are on [API](https://pithyx.org/docs/developers/daemon/api/).

## GET /api/groups/{groupId}/grants

Administrators only. Every grant of the group; its members have them all.

**Parameters**

| Name      | In   | Type            | Required | Description |
| --------- | ---- | --------------- | -------- | ----------- |
| `groupId` | path | integer (int64) | yes      |             |

**Responses**

- 200: `application/json`: [GroupGrants](https://pithyx.org/docs/reference/api/schemas/#groupgrants)

Any failure answers with problem details (`application/problem+json`) and a stable code from the [error reference](https://pithyx.org/docs/reference/errors/).

## PUT /api/groups/{groupId}/grants

Administrators only. Replaces every grant of the group. Refused when no active administrator would be left.

**Parameters**

| Name      | In   | Type            | Required | Description |
| --------- | ---- | --------------- | -------- | ----------- |
| `groupId` | path | integer (int64) | yes      |             |

**Request body**: `application/json`: [GrantsRequest](https://pithyx.org/docs/reference/api/schemas/#grantsrequest)

**Responses**

- 200: `application/json`: [GroupGrants](https://pithyx.org/docs/reference/api/schemas/#groupgrants)

Any failure answers with problem details (`application/problem+json`) and a stable code from the [error reference](https://pithyx.org/docs/reference/errors/).

## GET /api/permissions/catalog

Administrators only. The special rights, file protocols and apps a grant can name, in the order the editors show them.

**Responses**

- 200: `application/json`: [PermissionCatalog](https://pithyx.org/docs/reference/api/schemas/#permissioncatalog)

Any failure answers with problem details (`application/problem+json`) and a stable code from the [error reference](https://pithyx.org/docs/reference/errors/).

## GET /api/users/{userId}/grants

Administrators only. The user's own grants, the grants its groups give it (the built-in group users included) and what it may do in the end.

**Parameters**

| Name     | In   | Type            | Required | Description |
| -------- | ---- | --------------- | -------- | ----------- |
| `userId` | path | integer (int64) | yes      |             |

**Responses**

- 200: `application/json`: [UserGrants](https://pithyx.org/docs/reference/api/schemas/#usergrants)

Any failure answers with problem details (`application/problem+json`) and a stable code from the [error reference](https://pithyx.org/docs/reference/errors/).

## PUT /api/users/{userId}/grants

Administrators only. Replaces every grant of the user. Refused when no active administrator would be left; applies to the user's next request and is pushed to its desktop.

**Parameters**

| Name     | In   | Type            | Required | Description |
| -------- | ---- | --------------- | -------- | ----------- |
| `userId` | path | integer (int64) | yes      |             |

**Request body**: `application/json`: [GrantsRequest](https://pithyx.org/docs/reference/api/schemas/#grantsrequest)

**Responses**

- 200: `application/json`: [UserGrants](https://pithyx.org/docs/reference/api/schemas/#usergrants)

Any failure answers with problem details (`application/problem+json`) and a stable code from the [error reference](https://pithyx.org/docs/reference/errors/).
