# Update a live relay

## /v1/live-entities/:id/relays/:relay\_id

<mark style="color:orange;">`PUT`</mark> `https://api.uiza.io/api-live/owner/v1/live-entities/:id/relays/:relay_id`

#### Path Parameters

| Name      | Type   | Description                                               |
| --------- | ------ | --------------------------------------------------------- |
| id        | string | The identifier of the live entity you want to be updated. |
| relay\_id | string | The identifier of the relay object.                       |

#### Request Body

| Name | Type   | Description                                                                             |
| ---- | ------ | --------------------------------------------------------------------------------------- |
| name | string | The new name of relay to be updated.                                                    |
| url  | string | The new RTMP server endpoint to be updated, make sure it included the `rtmp://` prefix. |
| key  | string | The key of your new RTMP server that you want the live entity relay to.                 |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "id": "8cf47749-1fa4-40e9-8303-580b34f14683",
    "name": "Replay name3333",
    "url": "rtmp://a.rtmp.youtube.com/live2",
    "key": "0df3-76bz-6t4r-1by5xxxxxx",
    "status": "enable",
    "created_at": "2020-06-24T16:25:58Z",
    "updated_at": "2020-06-24T16:25:58Z"
  }
}
```

{% endtab %}

{% tab title="401 " %}

```
{
  "message": "You are unauthorized to access the requested resource. Please verify and resubmit.",
  "error_type": "invalid_request_error"
}
```

{% endtab %}

{% tab title="404 " %}

```
{
  "message": "The live entity you requested does not exist.",
  "error_type": "invalid_request_error"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
  "message": "An unexpected error occurred on Uiza's end.",
  "error_type": "api_error"
}
```

{% endtab %}
{% endtabs %}

{% code title="Sample Request" %}

```
curl -X PUT https://api.uiza.io/api-live/owner/v1/live-entities/22013d8a-d5fa-48f0-9a63-1f471ca9e81d/relays/8cf47749-1fa4-40e9-8303-580b34f14683 
    -H 'Accept: */*' 
    -H 'Authorization: <token>' 
    -H 'uiza-app-id: <your_app_id>' 
    -H 'Cache-Control: no-cache' 
    -H 'Connection: keep-alive' 
    -d '{"name": "A Relay Updated", "url": "rtmp://youtu.be/live", "key": "test-key"}'
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.uiza.io/2022-06-06/api-reference/live-entities/disable-live-entity-dvr.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
