# Custom recording configuration (/en/api-reference/api-ref/broadcast-streaming/custom-recording/configuration)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

<CalloutContainer type="info">
  <CalloutDescription>
    Custom recording enables you to use third-party cloud storage services, while standard recording does not.
  </CalloutDescription>
</CalloutContainer>

## Set custom recording configuration

Sets the custom recording configuration for all live streams under the specified entry point.

### HTTP request

```bash
PATCH https://api.agora.io/v1/projects/{appid}/fls/entry_points/{entry_point}/settings/record/custom/regions/{region}
```

#### Path parameter

| Parameter     | Type   | Description                                             |
| :------------ | :----- | :------------------------------------------------------ |
| `appid`       | String | Required. The App ID corresponding to the entry point.  |
| `entry_point` | String | Required. The entry point name.                         |
| `region`      | String | Required. The configured region when adding the domain. |

#### Request body

The request body is in the JSON Object type, and contains the following fields:

| Field           | Type        | Description                                                                                                                                                       |
| :-------------- | :---------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mp4Config`     | JSON Object | Optional. For the configuration of the MP4 recording files, see [mp4Config](#mp4config).                                                                          |
| `hlsConfig`     | JSON Object | Optional. For the configuration of the HLS recording files, see [HlsConfig](#hlsconfig).                                                                          |
| `storageConfig` | JSON Object | Optional (required when setting recording options for the first time). For the storage configuration of the recording files, see [StorageConfig](#storageconfig). |

### HTTP response

If the returned HTTP status code is 200, the request is successful.

If the returned HTTP status code is not 200, the request fails. You can refer to the [HTTP status code](#http-code) for possible reasons.

### Example

**Request line**

```bash
PATCH https://api.agora.io/v1/projects/{your_appid}/fls/entry_points/live/settings/record/custom/regions/cn HTTP/1.1
```

**Request body**

```json
{
    "hlsConfig": {
        "enabled": true
    },
    "mp4Config": {
        "enabled": true
    },
    "storageConfig": {
        "accessKey": "{your access key}",
        "bucket": "{your bucket}",
        "region": 3,
        "secretKey": "{your secret key}",
        "vendor": 2
    }
}
```

**Response line**

```bash
HTTP/1.1 200 OK
```

## Get custom recording configuration

Gets the custom recording configuration for the specified entry point.

### HTTP request

```bash
GET https://api.agora.io/v1/projects/{appid}/fls/entry_points/{entry_point}/settings/record/custom/regions/{region}
```

#### Path parameter

| Parameter     | Type   | Description                                             |
| :------------ | :----- | :------------------------------------------------------ |
| `appid`       | String | Required. The App ID corresponding to the entry point.  |
| `entry_point` | String | Required. The entry point name.                         |
| `region`      | String | Required. The configured region when adding the domain. |

### HTTP response

If the returned HTTP status code is 200, the request is successful, and the response body contains the following fields:

| Field           | Type        | Description                                                                                |
| :-------------- | :---------- | :----------------------------------------------------------------------------------------- |
| `mp4Config`     | JSON Object | For the configuration of the MP4 recording files, see [mp4Config](#mp4config).             |
| `hlsConfig`     | JSON Object | For the configuration of the HLS recording files, see [HlsConfig](#hlsconfig).             |
| `storageConfig` | JSON Object | For the storage configuration of the recording files, see [StorageConfig](#storageconfig). |

If the returned HTTP status code is not 200, the request fails. You can refer to the [HTTP status code](#http-code) for possible reasons.

### Example

**Request line**

```bash
GET https://api.agora.io/v1/projects/{your_appid}/fls/entry_points/live/settings/record/custom/regions/cn HTTP/1.1
```

**Response line**

```bash
HTTP/1.1 200 OK
```

**Request body**

```json
{
    "hlsConfig": {
        "enabled": true
    },
    "mp4Config": {
        "enabled": true
    },
    "storageConfig": {
        "accessKey": "{your accesskey}",
        "region": 3,
        "secretKey": "{your secretkey}",
        "vendor": 2
    }
}
```

## Parameter type

### mp4Config

The configuration of the MP4 recording files, including the following fields:

`enabled`: Bool type, optional. Whether to enable recording in the MP4 format.

### HlsConfig

The configuration of the HLS recording files, including the following fields:

`enabled`: Bool type, optional. Whether to enable recording in the HLS format.

### StorageConfig

The storage configuration of the recording files, including the following fields:

* `vendor`: Number. The third-party cloud storage vendor.

  * `0`: [Qiniu Cloud](https://www.qiniu.com/en/products/kodo)
  * `1`: [Amazon S3](https://aws.amazon.com/s3/?nc1=h_ls)
  * `2`: [Alibaba Cloud](https://www.alibabacloud.com/product/oss)
  * `3`: [Tencent Cloud](https://intl.cloud.tencent.com/product/cos)
  * `4`: [Kingsoft Cloud](https://en.ksyun.com/nv/product/KS3.html)
  * `5`: [Microsoft Azure](https://azure.microsoft.com/en-us/services/storage/blobs/)
  * `6`: [Google Cloud](https://cloud.google.com/storage)
  * `7`: [Huawei Cloud](https://www.huaweicloud.com/intl/en-us/product/obs.html)
  * `8`: [Baidu AI Cloud](https://intl.cloud.baidu.com/product/bos.html)

* `region`: Number. The region information specified for the third-party cloud storage. The recording service only supports regions in the following lists:
  <CalloutContainer type="info" />

In order to improve the success rate and real-time performance when uploading recording files, if you set the `region` of the cloud recording service in the `acquire` method, make sure that the region of the third-party cloud storage corresponds to the same geographical region. For example, if the region of the cloud recording service is set to `NA` (North America), the third-party cloud storage needs to be set to a location within North America.
\:::

<details>
  <summary>
    When the third-party cloud storage is Qiniu Cloud (

    <code>vendor</code>

     \= 0):
  </summary>

  <ul>
    <li>
      <code>0</code>

      : East China
    </li>

    <li>
      <code>1</code>

      : North China 
    </li>

    <li>
      <code>2</code>

      : South China
    </li>

    <li>
      <code>3</code>

      : North America 
    </li>

    <li>
      <code>4</code>

      : Southeast Asia
    </li>
  </ul>
</details>

<details>
  <summary>
    When the third-party cloud storage is Amazon S3 (

    <code>vendor</code>

     \= 1):
  </summary>

  <ul>
    <li>
      <code>0</code>

      ：US_EAST_1
    </li>

    <li>
      <code>1</code>

      ：US_EAST_2
    </li>

    <li>
      <code>2</code>

      ：US_WEST_1
    </li>

    <li>
      <code>3</code>

      ：US_WEST_2
    </li>

    <li>
      <code>4</code>

      ：EU_WEST_1
    </li>

    <li>
      <code>5</code>

      ：EU_WEST_2
    </li>

    <li>
      <code>6</code>

      ：EU_WEST_3
    </li>

    <li>
      <code>7</code>

      ：EU_CENTRAL_1
    </li>

    <li>
      <code>8</code>

      ：AP_SOUTHEAST_1
    </li>

    <li>
      <code>9</code>

      ：AP_SOUTHEAST_2
    </li>

    <li>
      <code>10</code>

      ：AP_NORTHEAST_1
    </li>

    <li>
      <code>11</code>

      ：AP_NORTHEAST_2
    </li>

    <li>
      <code>12</code>

      ：SA_EAST_1
    </li>

    <li>
      <code>13</code>

      ：CA_CENTRAL_1
    </li>

    <li>
      <code>14</code>

      ：AP_SOUTH_1
    </li>

    <li>
      <code>15</code>

      ：CN_NORTH_1
    </li>

    <li>
      <code>16</code>

      ：CN_NORTHWEST_1
    </li>

    <li>
      <code>18</code>

      ：AF_SOUTH_1
    </li>

    <li>
      <code>19</code>

      ：AP_EAST_1
    </li>

    <li>
      <code>20</code>

      ：AP_NORTHEAST_3
    </li>

    <li>
      <code>21</code>

      ：EU_NORTH_1
    </li>

    <li>
      <code>22</code>

      ：ME_SOUTH_1
    </li>

    <li>
      <code>24</code>

      ：AP_SOUTHEAST_3
    </li>

    <li>
      <code>25</code>

      ：EU_SOUTH_1
    </li>

    <li>
      <code>26</code>

      ：AWS_REGION_NUM
    </li>
  </ul>
</details>

<details>
  <summary>
    When the third-party cloud storage is Alibaba Cloud (

    <code>vendor</code>

     \= 2):
  </summary>

  <ul>
    <li>
      <code>0</code>

      : CN_Hangzhou 
    </li>

    <li>
      <code>1</code>

      : CN_Shanghai 
    </li>

    <li>
      <code>2</code>

      : CN_Qingdao 
    </li>

    <li>
      <code>3</code>

      : CN_Beijing
    </li>

    <li>
      <code>4</code>

      : CN_Zhangjiakou 
    </li>

    <li>
      <code>5</code>

      : CN_Huhehaote 
    </li>

    <li>
      <code>6</code>

      : CN_Shenzhen 
    </li>

    <li>
      <code>7</code>

      : CN_Hongkong 
    </li>

    <li>
      <code>8</code>

      : US_West_1 
    </li>

    <li>
      <code>9</code>

      : US_East_1 
    </li>

    <li>
      <code>10</code>

      : AP_Southeast_1 
    </li>

    <li>
      <code>11</code>

      : AP_Southeast_2 
    </li>

    <li>
      <code>12</code>

      : AP_Southeast_3 
    </li>

    <li>
      <code>13</code>

      : AP_Southeast_5 
    </li>

    <li>
      <code>14</code>

      : AP_Northeast_1 
    </li>

    <li>
      <code>15</code>

      : AP_South_1 
    </li>

    <li>
      <code>16</code>

      : EU_Central_1 
    </li>

    <li>
      <code>17</code>

      : EU_West_1 
    </li>

    <li>
      <code>18</code>

      : EU_East_1
    </li>

    <li>
      <code>19</code>

      ：AP_Southeast_6
    </li>

    <li>
      <code>20</code>

      ：CN_Heyuan
    </li>

    <li>
      <code>21</code>

      ：CN_Guangzhou
    </li>

    <li>
      <code>22</code>

      ：CN_Chengdu
    </li>
  </ul>

  For details, see <a href="https://www.alibabacloud.com/help/doc-detail/31837.html">Alibaba Cloud Documentation</a>.
</details>

<details>
  <summary>
    When the third-party cloud storage is Tencent Cloud (

    <code>vendor</code>

     \= 3):
  </summary>

  <ul>
    <li>
      <code>0</code>

      ：AP_Beijing_1
    </li>

    <li>
      <code>1</code>

      ：AP_Beijing
    </li>

    <li>
      <code>2</code>

      ：AP_Shanghai
    </li>

    <li>
      <code>3</code>

      ：AP_Guangzhou
    </li>

    <li>
      <code>4</code>

      ：AP_Chengdu 
    </li>

    <li>
      <code>5</code>

      ：AP_Chongqing 
    </li>

    <li>
      <code>6</code>

      ：AP_Shenzhen_FSI 
    </li>

    <li>
      <code>7</code>

      ：AP_Shanghai_FSI 
    </li>

    <li>
      <code>8</code>

      ：AP_Beijing_FSI 
    </li>

    <li>
      <code>9</code>

      ：AP_Hongkong 
    </li>

    <li>
      <code>10</code>

      ：AP_Singapore 
    </li>

    <li>
      <code>11</code>

      ：AP_Mumbai 
    </li>

    <li>
      <code>12</code>

      ：AP_Seoul 
    </li>

    <li>
      <code>13</code>

      ：AP_Bangkok 
    </li>

    <li>
      <code>14</code>

      ：AP_Tokyo 
    </li>

    <li>
      <code>15</code>

      ：NA_Siliconvalley 
    </li>

    <li>
      <code>16</code>

      ：NA_Ashburn 
    </li>

    <li>
      <code>17</code>

      ：NA_Toronto 
    </li>

    <li>
      <code>18</code>

      ：EU_Frankfurt 
    </li>

    <li>
      <code>19</code>

      ：EU_Moscow
    </li>
  </ul>
</details>

<details>
  <summary>
    When the third-party cloud storage is Kingsoft Cloud (

    <code>vendor</code>

     \= 4):
  </summary>

  <ul>
    <li>
      <code>0</code>

      ：CN_Hangzhou
    </li>

    <li>
      <code>1</code>

      ：CN_Shanghai
    </li>

    <li>
      <code>2</code>

      ：CN_Qingdao
    </li>

    <li>
      <code>3</code>

      ：CN_Beijing
    </li>

    <li>
      <code>4</code>

      ：CN_Guangzhou
    </li>

    <li>
      <code>5</code>

      ：CN_Hongkong
    </li>

    <li>
      <code>6</code>

      ：JR_Beijing
    </li>

    <li>
      <code>7</code>

      ：JR_Shanghai
    </li>

    <li>
      <code>8</code>

      ：NA_Russia_1
    </li>

    <li>
      <code>9</code>

      ：NA_Singapore_1
    </li>
  </ul>
</details>

<details>
  <summary>
    When the third-party cloud storage is Microsoft Azure (

    <code>vendor</code>

     \= 5): 
  </summary>

  <summary>
    The 

    <code>region</code>

     parameter has no effect, whether or not it is set.
  </summary>
</details>

<details>
  <summary>
    When the third-party cloud storage is Google Cloud (

    <code>vendor</code>

     \= 6): 
  </summary>

  <summary>
    The 

    <code>region</code>

     parameter has no effect, whether or not it is set.
  </summary>
</details>

<details>
  <summary>
    When the third-party cloud storage is Huawei Cloud (

    <code>vendor</code>

     \= 7):
  </summary>

  <ul>
    <li>
      <code>0</code>

      ：CN_North_1
    </li>

    <li>
      <code>1</code>

      ：CN_North_4
    </li>

    <li>
      <code>2</code>

      ：CN_East_2
    </li>

    <li>
      <code>3</code>

      ：CN_East_3
    </li>

    <li>
      <code>4</code>

      ：CN_South_1
    </li>

    <li>
      <code>5</code>

      ：CN_Southwest_2
    </li>

    <li>
      <code>6</code>

      ：AP_Southeast_1
    </li>

    <li>
      <code>7</code>

      ：AP_Southeast_2
    </li>

    <li>
      <code>8</code>

      ：AP_Southeast_3
    </li>

    <li>
      <code>9</code>

      ：AF_South_1
    </li>

    <li>
      <code>10</code>

      ：SA_Argentina_1
    </li>

    <li>
      <code>11</code>

      ：SA_Peru_1
    </li>

    <li>
      <code>12</code>

      ：NA_Mexico_1
    </li>

    <li>
      <code>13</code>

      ：SA_Brazil_1
    </li>

    <li>
      <code>14</code>

      ：LA_South_2
    </li>

    <li>
      <code>15</code>

      ：SA_Chile_1
    </li>
  </ul>
</details>

<details>
  <summary>
    When the third-party cloud storage is Baidu AI Cloud (

    <code>vendor</code>

     \= 8):
  </summary>

  <ul>
    <li>
      <code>0</code>

      ：Beijing
    </li>

    <li>
      <code>1</code>

      ：Baoding
    </li>

    <li>
      <code>2</code>

      ：Suzhou
    </li>

    <li>
      <code>3</code>

      ：Guangzhou
    </li>

    <li>
      <code>4</code>

      ：Hongkong
    </li>

    <li>
      <code>5</code>

      ：Singapore
    </li>

    <li>
      <code>6</code>

      ：Wuhan
    </li>

    <li>
      <code>7</code>

      ：Shanghai
    </li>
  </ul>
</details>

* `bucket`: String. The bucket name of the third-party cloud storage.

* `accessKey`: String. The access key of the third-party cloud storage. Agora suggests that you use a write-only access key.

* `secretKey`: String. The secret key of the third-party cloud storage.

<a name="http-code" />

## HTTP status code

| Status code | Description                                                                                                                                              |
| :---------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 200         | The request succeeds.                                                                                                                                    |
| 400         | The parameter is invalid, for example the `appid` or the `entry_point` is empty, or the `region` parameter value is invalid.                             |
| 401         | Unauthorized (the customer ID and the customer secret do not match).                                                                                     |
| 404         | The server cannot find the resource according to the request, which means the requested entry point does not exist or the requested URI path is invalid. |
| 500         | An internal error occurs in the server, so the server is not able to complete the request.                                                               |
| 504         | An internal error occurs in the server. The gateway or the proxy server did not receive a timely request from the remote server.                         |
