---
title: Relays
---

[Skip to content](#%5Ftop) 

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

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

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Relays

##### [List relays](https://developers.cloudflare.com/api/python/resources/moq/subresources/relays/methods/list)

moq.relays.list(RelayListParams\*\*kwargs)  \-> SyncSinglePage\[[RelayListResponse](https://developers.cloudflare.com/api/python/resources/moq#%28resource%29%20moq.relays%20%3E%20%28model%29%20relay%5Flist%5Fresponse%20%3E%20%28schema%29)\]

GET/accounts/{account\_id}/moq/relays

##### [Get a relay](https://developers.cloudflare.com/api/python/resources/moq/subresources/relays/methods/get)

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

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

##### [Create a relay](https://developers.cloudflare.com/api/python/resources/moq/subresources/relays/methods/create)

moq.relays.create(RelayCreateParams\*\*kwargs)  \-> [RelayCreateResponse](https://developers.cloudflare.com/api/python/resources/moq#%28resource%29%20moq.relays%20%3E%20%28model%29%20relay%5Fcreate%5Fresponse%20%3E%20%28schema%29)

POST/accounts/{account\_id}/moq/relays

##### [Update a relay](https://developers.cloudflare.com/api/python/resources/moq/subresources/relays/methods/update)

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}

##### [Delete a relay](https://developers.cloudflare.com/api/python/resources/moq/subresources/relays/methods/delete)

moq.relays.delete(strrelay\_id, RelayDeleteParams\*\*kwargs)  \-> object

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

##### ModelsExpand Collapse 

class RelayListResponse: …

Abbreviated relay for list responses.

created: datetime

formatdate-time

modified: datetime

formatdate-time

name: str

uid: str

class RelayGetResponse: …

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.

class RelayCreateResponse: …

Relay with its auto-created default token pair (one full-access \[publish, subscribe\] and one \[subscribe\]-only), each with its one-time secret, wrapped in the issuers envelope.

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

issuers: List\[Issuer\]

Token collection (discriminated union on `type`). On create this holds the auto-created default pair, each including its one-time secret.

cloudflare\_tokens: List\[IssuerCloudflareToken\]

Always present (\[\] when empty).

created: datetime

formatdate-time

expires: datetime

Mandatory; no more than 1 year after `created`.

formatdate-time

jti: str

Token identity and registry key (32 hex chars).

operations: List\[Literal\["publish", "subscribe"\]\]

Signed allowlist of what the token may do. V1 coarse roles; the array form extends to fine-grained MoQT message names later without a breaking change.

One of the following:

"publish"

"subscribe"

label: Optional\[str\]

Optional, customer-set.

secret: Optional\[str\]

The signed JWT. Present ONLY in create / auto-create responses (shown once); never returned by list, never stored.

issuer: Literal\["cloudflare"\]

type: Literal\["cloudflare\_jwt"\]

modified: datetime

formatdate-time

name: str

uid: str

Server-generated unique identifier (32 hex chars).

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.

#### RelaysTokens

##### [Create a token](https://developers.cloudflare.com/api/python/resources/moq/subresources/relays/subresources/tokens/methods/create)

moq.relays.tokens.create(strrelay\_id, TokenCreateParams\*\*kwargs)  \-> [TokenCreateResponse](https://developers.cloudflare.com/api/python/resources/moq#%28resource%29%20moq.relays.tokens%20%3E%20%28model%29%20token%5Fcreate%5Fresponse%20%3E%20%28schema%29)

POST/accounts/{account\_id}/moq/relays/{relay\_id}/tokens

##### [List tokens](https://developers.cloudflare.com/api/python/resources/moq/subresources/relays/subresources/tokens/methods/list)

moq.relays.tokens.list(strrelay\_id, TokenListParams\*\*kwargs)  \-> [TokenListResponse](https://developers.cloudflare.com/api/python/resources/moq#%28resource%29%20moq.relays.tokens%20%3E%20%28model%29%20token%5Flist%5Fresponse%20%3E%20%28schema%29)

GET/accounts/{account\_id}/moq/relays/{relay\_id}/tokens

##### [Revoke a token](https://developers.cloudflare.com/api/python/resources/moq/subresources/relays/subresources/tokens/methods/delete)

moq.relays.tokens.delete(strjti, TokenDeleteParams\*\*kwargs)  \-> [TokenDeleteResponse](https://developers.cloudflare.com/api/python/resources/moq#%28resource%29%20moq.relays.tokens%20%3E%20%28model%29%20token%5Fdelete%5Fresponse%20%3E%20%28schema%29)

DELETE/accounts/{account\_id}/moq/relays/{relay\_id}/tokens/{jti}

##### ModelsExpand Collapse 

class TokenCreateResponse: …

A relay’s token collection, keyed on issuer `type` (a discriminated union). V1 ships exactly one arm (`cloudflare_jwt`). Clients iterate `issuers`, switch on `type`, and ignore unknown types — that contract is what makes adding or removing an arm non-breaking.

issuers: List\[Issuer\]

cloudflare\_tokens: List\[IssuerCloudflareToken\]

Always present (\[\] when empty).

created: datetime

formatdate-time

expires: datetime

Mandatory; no more than 1 year after `created`.

formatdate-time

jti: str

Token identity and registry key (32 hex chars).

operations: List\[Literal\["publish", "subscribe"\]\]

Signed allowlist of what the token may do. V1 coarse roles; the array form extends to fine-grained MoQT message names later without a breaking change.

One of the following:

"publish"

"subscribe"

label: Optional\[str\]

Optional, customer-set.

secret: Optional\[str\]

The signed JWT. Present ONLY in create / auto-create responses (shown once); never returned by list, never stored.

issuer: Literal\["cloudflare"\]

type: Literal\["cloudflare\_jwt"\]

class TokenListResponse: …

A relay’s token collection, keyed on issuer `type` (a discriminated union). V1 ships exactly one arm (`cloudflare_jwt`). Clients iterate `issuers`, switch on `type`, and ignore unknown types — that contract is what makes adding or removing an arm non-breaking.

issuers: List\[Issuer\]

cloudflare\_tokens: List\[IssuerCloudflareToken\]

Always present (\[\] when empty).

created: datetime

formatdate-time

expires: datetime

Mandatory; no more than 1 year after `created`.

formatdate-time

jti: str

Token identity and registry key (32 hex chars).

operations: List\[Literal\["publish", "subscribe"\]\]

Signed allowlist of what the token may do. V1 coarse roles; the array form extends to fine-grained MoQT message names later without a breaking change.

One of the following:

"publish"

"subscribe"

label: Optional\[str\]

Optional, customer-set.

secret: Optional\[str\]

The signed JWT. Present ONLY in create / auto-create responses (shown once); never returned by list, never stored.

issuer: Literal\["cloudflare"\]

type: Literal\["cloudflare\_jwt"\]

class TokenDeleteResponse: …

errors: List\[Error\]

code: Optional\[int\]

message: Optional\[str\]

messages: List\[Message\]

code: Optional\[int\]

message: Optional\[str\]

success: bool