# Authorize recording files

Authorizes a meeting's recording files to an organization/user or makes them public to the public network.

**Notice**：After the meeting is over and the "recording is completed" event is received before authorization can be made; the meeting owner (the meeting booked through the open platform is the reservation person) has permission to operate

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission
HTTP Method | PATCH
Rate Limit | [1000 per minute、50 per second](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
Supported app types | Custom App、Store App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.** | Update meeting recording information(vc:record)
Required field scopes | **Notice**：The response body of the API contains the following sensitive fields, and they will be returned only after corresponding scopes are added. If you do not need the fields, it is not recommended that you request the scopes.<br>Obtain user ID(contact:user.employee_id:readonly)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `user_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer u-7f1bcd13fc57d46bac21793a18e560"<br>[How to choose and get access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)
Content-Type | string | Yes | **Fixed value**: "application/json; charset=utf-8"

### Path parameters

Parameter | Type | Description
---|---|---
meeting_id | string | Meeting ID (unique identifier of the video conference, which will not be generated until the video conference starts)<br>**Example value**: "6911188411932033028"

### Query parameters

Parameter | Type | Required | Description
---|---|---|---
user_id_type | string | No | User ID categories<br>**Example value**: open_id<br>**Optional values are**:<br>- open_id：Identifies a user to an app. The same user has different Open IDs in different apps. [How to get Open ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-openid)<br>- union_id：Identifies a user to a tenant that acts as a developer. A user has the same Union ID in apps developed by the same developer, and has different Union IDs in apps developed by different developers. A developer can use Union ID to link the same user's identities in multiple apps.[How to get Union ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-union-id)<br>- user_id：Identifies a user to a tenant. The same user has different User IDs in different tenants. In one single tenant, a user has the same User ID in all apps （including store apps）. User ID is usually used to communicate user data between different apps. [How to get User ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-user-id)<br>**Default value**: `open_id`<br>**When the value is `user_id`, the following field scopes are required**:<br>Obtain user ID(contact:user.employee_id:readonly)

### Request body

Parameter | Type | Required | Description
---|---|---|---
permission_objects | recording_permission_object\[\] | Yes | List of authorized objects
id | string | No | Authorization object ID<br>**Example value**: "ou_3ec3f6a28a0d08c45d895276e8e5e19b"
type | int | Yes | Authorization object type<br>**Example value**: 1<br>**Optional values are**:<br>- 1：User authorization (fill in the user ID in the id field)<br>- 2：Group authorization (fill in the group open_chat_id in the id field)<br>- 3：In-tenant authorization (id field not filled in)<br>- 4：Public network authorization (id field is not filled in)
permission | int | Yes | permission<br>**Example value**: 1<br>**Optional values are**:<br>- 1：view
action_type | int | No | Authorize or cancel authorization, default authorization<br>**Example value**: 1<br>**Optional values are**:<br>- 0：authorization<br>- 1：Cancel authorization

### Request body example
```json
{
    "permission_objects": [
        {
            "id": "ou_3ec3f6a28a0d08c45d895276e8e5e19b",
            "type": 1,
            "permission": 1
        }
    ],
    "action_type": 1
}
```

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-

### Response body example
```json
{
    "code": 0,
    "msg": "Success",
    "data": {}
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
500 | 121001 | Internal error | Internal server error, if the retry fails, you can contact the administrator.
400 | 121002 | Not supported | This feature is not currently supported
400 | 121003 | Param error | Parameter error, check the value range of the parameter (please follow the instructions in the above fields to check for yourself)
404 | 121004 | Data not exist | The requested data does not exist
403 | 121005 | No permission | No permission to perform this operation, it is recommended to check the token type, operator identity and resource attribution
404 | 122002 | Meeting not exist | The session being run does not exist

