## Update a relay `client.MoQ.Relays.Update(ctx, relayID, params) (*RelayUpdateResponse, error)` **put** `/accounts/{account_id}/moq/relays/{relay_id}` Updates a relay's name and/or configuration. Partial updates: omitted fields are preserved. Config sub-objects replace as whole objects when present. ### Parameters - `relayID string` - `params RelayUpdateParams` - `AccountID param.Field[string]` Path param: Cloudflare account identifier. - `Config param.Field[RelayUpdateParamsConfig]` Body param - `Upstreams RelayUpdateParamsConfigUpstreams` Upstreams are external MOQT server publishers that a relay falls back to when it has no local publisher for a requested namespace/track. - `Enabled bool` - `Upstreams []RelayUpdateParamsConfigUpstreamsUpstream` 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 string` Upstream MOQT server publisher URL. - `Name param.Field[string]` Body param ### Returns - `type RelayUpdateResponse struct{…}` Full relay details (no tokens). - `Config RelayUpdateResponseConfig` - `Upstreams RelayUpdateResponseConfigUpstreams` Upstreams are external MOQT server publishers that a relay falls back to when it has no local publisher for a requested namespace/track. - `Enabled bool` - `Upstreams []RelayUpdateResponseConfigUpstreamsUpstream` 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 string` Upstream MOQT server publisher URL. - `Created Time` - `Modified Time` - `Name string` - `UID string` - `Status RelayUpdateResponseStatus` "connected" when active, omitted otherwise. - `const RelayUpdateResponseStatusConnected RelayUpdateResponseStatus = "connected"` ### Example ```go 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) } ``` #### Response ```json { "errors": [ { "code": 0, "message": "message" } ], "messages": [ { "code": 0, "message": "message" } ], "success": true, "result": { "config": { "upstreams": { "enabled": true, "upstreams": [ { "url": "url" } ] } }, "created": "2019-12-27T18:11:19.117Z", "modified": "2019-12-27T18:11:19.117Z", "name": "Production Live Stream", "uid": "a1b2c3d4e5f67890a1b2c3d4e5f67890", "status": "connected" } } ```