# Asynchronous playback (/en/api-reference/api-ref/broadcast-streaming/asynchronous-playback)

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

Asynchronous playback refers to purposely setting a time lag between the playback screen seen by the user and the live stream.

<CalloutContainer type="info">
  <CalloutDescription>
    Currently, the asynchronous playback function only supports [Push CDN mode](/en/realtime-media/broadcast-streaming/quickstart).
  </CalloutDescription>
</CalloutContainer>

## Set a time lag [#set-a-time-lag]

Sets a time lag for the specified live stream.

### HTTP request [#http-request]

```bash
PATCH https://api.agora.io/v1/projects/{appid}/fls/entry_points/{entry_point}/admin/delayed_streams/{stream_name}
```

#### Path parameter [#path-parameter]

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

#### Request body [#request-body]

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

| Field   | Type    | Description                                                     |
| :------ | :------ | :-------------------------------------------------------------- |
| `delay` | Integer | Required. The time lag in seconds, with a maximum value of 600. |

### HTTP response [#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 [#example]

**Request line**

```bash
PATCH https://api.agora.io/v1/projects/{your_appid}/fls/entry_points/live/admin/delayed_streams/{stream_name} HTTP/1.1
```

**Response line**

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

## Cancel the time lag [#cancel-the-time-lag]

Cancels the time lag for the specified live stream.

### HTTP request [#http-request-1]

```bash
DELETE https://api.agora.io/v1/projects/{appid}/fls/entry_points/{entry_point}/admin/delayed_streams/{stream_name}
```

#### Path parameter [#path-parameter-1]

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

### HTTP response [#http-response-1]

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 [#example-1]

**Request line**

```bash
DELETE https://api.agora.io/v1/projects/{your_appid}/fls/entry_points/live/admin/delayed_streams/{stream_name} HTTP/1.1
```

**Response line**

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

<a name="http-code" />

## HTTP status 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.                         |
