---
title: Update a relay
---

[Skip to content](#_top)

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

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

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

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Update a relay

client.MoQ.Relays.Update(ctx, relayID, params) (\*[RelayUpdateResponse](<https://developers.cloudflare.com/api/go/resources/moq#(resource)%20moq.relays%20%3E%20(model)%20RelayUpdateResponse%20%3E%20(schema)>), error)

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

relayID string

[Link to this property](<#(resource)%20moq.relays%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20relay_id%20%3E%20(schema)>)

<details>

<summary>

params RelayUpdateParams

</summary>

AccountID param.Field\[string]

Path param: Cloudflare account identifier.

<a href="#(resource)%20moq.relays%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

<details>

<summary>

Config param.Field\[<a href="https://developers.cloudflare.com/api/go/resources/moq/subresources/relays/methods/update#(resource)%20moq.relays%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20config%20%3E%20(schema)">RelayUpdateParamsConfig</a>]Optional

Body param

</summary>

<details>

<summary>

Upstreams RelayUpdateParamsConfigUpstreamsOptional

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

</summary>

Enabled boolOptional

<a href="#(resource)%20moq.relays%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20config%20%3E%20(schema)%20%3E%20(property)%20upstreams%20%3E%20(property)%20enabled">Link to this property</a>

<details>

<summary>

Upstreams \[]RelayUpdateParamsConfigUpstreamsUpstreamOptional

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.

</summary>

URL string

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

<a href="#(resource)%20moq.relays%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20config%20%3E%20(schema)%20%3E%20(property)%20upstreams%20%3E%20(property)%20upstreams%20%3E%20(items)%20%3E%20(property)%20url">Link to this property</a>

</details>

<a href="#(resource)%20moq.relays%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20config%20%3E%20(schema)%20%3E%20(property)%20upstreams%20%3E%20(property)%20upstreams">Link to this property</a>

</details>

<a href="#(resource)%20moq.relays%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20config%20%3E%20(schema)%20%3E%20(property)%20upstreams">Link to this property</a>

</details>

<a href="#(resource)%20moq.relays%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20config">Link to this property</a>

Name param.Field\[string]Optional

Body param

<a href="#(resource)%20moq.relays%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20name">Link to this property</a>

</details>

[Link to this property](<#(resource)%20moq.relays%20%3E%20(method)%20update%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

type RelayUpdateResponse struct{…}

Full relay details (no tokens).

</summary>

<details>

<summary>

Config RelayUpdateResponseConfig

</summary>

<details>

<summary>

Upstreams RelayUpdateResponseConfigUpstreamsOptional

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

</summary>

Enabled boolOptional

<a href="#(resource)%20moq.relays%20%3E%20(model)%20RelayUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20config%20%3E%20(property)%20upstreams%20%3E%20(property)%20enabled">Link to this property</a>

<details>

<summary>

Upstreams \[]RelayUpdateResponseConfigUpstreamsUpstreamOptional

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.

</summary>

URL string

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

<a href="#(resource)%20moq.relays%20%3E%20(model)%20RelayUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20config%20%3E%20(property)%20upstreams%20%3E%20(property)%20upstreams%20%3E%20(items)%20%3E%20(property)%20url">Link to this property</a>

</details>

<a href="#(resource)%20moq.relays%20%3E%20(model)%20RelayUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20config%20%3E%20(property)%20upstreams%20%3E%20(property)%20upstreams">Link to this property</a>

</details>

<a href="#(resource)%20moq.relays%20%3E%20(model)%20RelayUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20config%20%3E%20(property)%20upstreams">Link to this property</a>

</details>

<a href="#(resource)%20moq.relays%20%3E%20(model)%20RelayUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20config">Link to this property</a>

Created Time

formatdate-time

<a href="#(resource)%20moq.relays%20%3E%20(model)%20RelayUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20created">Link to this property</a>

Modified Time

formatdate-time

<a href="#(resource)%20moq.relays%20%3E%20(model)%20RelayUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20modified">Link to this property</a>

Name string

<a href="#(resource)%20moq.relays%20%3E%20(model)%20RelayUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

UID string

<a href="#(resource)%20moq.relays%20%3E%20(model)%20RelayUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20uid">Link to this property</a>

Status RelayUpdateResponseStatusOptional

“connected” when active, omitted otherwise.

<a href="#(resource)%20moq.relays%20%3E%20(model)%20RelayUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20status">Link to this property</a>

</details>

[Link to this property](<#(resource)%20moq.relays%20%3E%20(model)%20RelayUpdateResponse%20%3E%20(schema)>)

### Update a relay

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/moq"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  relay, err := client.MoQ.Relays.Update(
    context.TODO(),
    "a1b2c3d4e5f67890a1b2c3d4e5f67890",
    moq.RelayUpdateParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", 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"
  }
}
```