---
title: Update a relay
---

[Skip to content](#%5Ftop) 

[API Reference](https://developers.cloudflare.com/api/python)

[MoQ](https://developers.cloudflare.com/api/python/resources/moq)

[Relays](https://developers.cloudflare.com/api/python/resources/moq/subresources/relays)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Update a relay

moq.relays.update(strrelay\_id, RelayUpdateParams\*\*kwargs)  \-> [RelayUpdateResponse](https://developers.cloudflare.com/api/python/resources/moq#%28resource%29%20moq.relays%20%3E%20%28model%29%20relay%5Fupdate%5Fresponse%20%3E%20%28schema%29)

PUT/accounts/{account\_id}/moq/relays/{relay\_id}

Updates a relay’s name and/or configuration. The relay ID goes in the URL path — `PUT /accounts/{account_id}/moq/relays/{relay_id}` — not the request body; there is no collection-level update endpoint. This is also the only way to set a relay’s config (config cannot be set at create time). Partial updates: omitted fields are preserved; config sub-objects replace as whole objects when present.

##### Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. [Create a token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/).

**Example:**`Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY`

##### ParametersExpand Collapse 

account\_id: str

Cloudflare account identifier.

relay\_id: str

config: Optional\[[Config](https://developers.cloudflare.com/api/python/resources/moq/subresources/relays/methods/update#%28resource%29%20moq.relays%20%3E%20%28method%29%20update%20%3E%20%28params%29%20default%20%3E%20%28param%29%20config%20%3E%20%28schema%29)\]

upstreams: Optional\[ConfigUpstreams\]

Upstreams are external MOQT server publishers that a relay falls back to when it has no local publisher for a requested namespace/track.

enabled: Optional\[bool\]

upstreams: Optional\[Iterable\[ConfigUpstreamsUpstream\]\]

Ordered list of upstream MOQT server publishers. Each entry is an object (not a bare string) so per-upstream configuration can be added in the future without another breaking change.

url: str

Upstream MOQT server publisher URL. Must be an absolute URL with a host and a scheme the relay can dial: moqt:// (raw QUIC) or https:// (WebTransport). Validated on update (PUT); rejected with 21013.

formaturi

name: Optional\[str\]

##### ReturnsExpand Collapse 

class RelayUpdateResponse: …

Full relay details (no tokens).

config: Config

upstreams: Optional\[ConfigUpstreams\]

Upstreams are external MOQT server publishers that a relay falls back to when it has no local publisher for a requested namespace/track.

enabled: Optional\[bool\]

upstreams: Optional\[List\[ConfigUpstreamsUpstream\]\]

Ordered list of upstream MOQT server publishers. Each entry is an object (not a bare string) so per-upstream configuration can be added in the future without another breaking change.

url: str

Upstream MOQT server publisher URL. Must be an absolute URL with a host and a scheme the relay can dial: moqt:// (raw QUIC) or https:// (WebTransport). Validated on update (PUT); rejected with 21013.

formaturi

created: datetime

formatdate-time

modified: datetime

formatdate-time

name: str

uid: str

status: Optional\[Literal\["connected"\]\]

“connected” when active, omitted otherwise.

### Update a relay

Python

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
relay = client.moq.relays.update(
    relay_id="a1b2c3d4e5f67890a1b2c3d4e5f67890",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
print(relay.uid)
```

200 example

```
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "success": true,
  "result": {
    "config": {
      "upstreams": {
        "enabled": true,
        "upstreams": [
          {
            "url": "https://example.com"
          }
        ]
      }
    },
    "created": "2019-12-27T18:11:19.117Z",
    "modified": "2019-12-27T18:11:19.117Z",
    "name": "Production Live Stream",
    "uid": "a1b2c3d4e5f67890a1b2c3d4e5f67890",
    "status": "connected"
  }
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "success": true,
  "result": {
    "config": {
      "upstreams": {
        "enabled": true,
        "upstreams": [
          {
            "url": "https://example.com"
          }
        ]
      }
    },
    "created": "2019-12-27T18:11:19.117Z",
    "modified": "2019-12-27T18:11:19.117Z",
    "name": "Production Live Stream",
    "uid": "a1b2c3d4e5f67890a1b2c3d4e5f67890",
    "status": "connected"
  }
}
```