# Custom recording for a live stream (/en/api-reference/api-ref/broadcast-streaming/custom-recording/live-stream)

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

## Enable custom recording for a live stream

Enables custom recording for a live stream under the specified entry point.

<CalloutContainer type="info">
  <CalloutDescription>
    Before calling this API, ensure that you have called the Enable/Disable custom recording for an entry point API to disable custom recording for the entry point that includes this live stream.
  </CalloutDescription>
</CalloutContainer>

This API records a stream that is being pushed or is scheduled to be pushed in the next 24 hours. Recording automatically starts and ends when streaming starts and ends.

### HTTP request

```bash
PUT https://api.agora.io/v1/projects/{appid}/fls/entry_points/{entry_point}/admin/record/custom/regions/{region}/tasks?id={stream_name}
```

#### Path parameter

| Parameter     | Type   | Description                                        |
| :------------ | :----- | :------------------------------------------------- |
| `appid`       | String | Required. The App ID retrieved from Agora Console. |
| `entry_point` | String | Required. The entry point name.                    |
| `region`      | String | Required. The area to enable recording.            |
| `stream_name` | String | Required. The stream name.                         |

### 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 codes](#http-code) for possible reasons.

### Example

**Request line**

```bash
PUT https://api.agora.io/v1/projects/{your_appid}/fls/entry_points/live/admin/record/custom/regions/{region}/tasks?id={stream_name} HTTP/1.1
```

**Response line**

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

## Disable custom recording for a live stream

Disables custom recording for a live stream.

### HTTP request

```bash
DELETE https://api.agora.io/v1/projects/{appid}/fls/entry_points/{entry_point}/admin/record/custom/regions/{region}/tasks/{stream_name}
```

#### Path parameter

| Parameter     | Type   | Description                                        |
| :------------ | :----- | :------------------------------------------------- |
| `appid`       | String | Required. The App ID retrieved from Agora Console. |
| `entry_point` | String | Required. The entry point name.                    |
| `region`      | String | Required. The area to disable recording.           |
| `stream_name` | String | Required. The stream name.                         |

### 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 codes](#http-code) for possible reasons.

### Example

**Request line**

```bash
DELETE https://api.agora.io/v1/projects/{appid}/fls/entry_points/{entry_point}/admin/record/custom/regions/{region}/tasks/{stream_name} HTTP/1.1
```

**Response line**

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

<a name="http-code" />

## HTTP status codes

| 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.                         |
