---
title: List relays
---

[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**

# List relays

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

Lists all MoQ relays for the account. Returns only metadata. Config, status, and tokens are omitted.

Results are cursor-paginated (keyset on the `created` timestamp). Use `created_before` / `created_after` with the `created` value of the first/last item in a page to fetch the adjacent page. `result_info`reports the page `count` and the `total` matching the cursor filters.

##### 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.

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

Sort order by `created`. When true, results are returned oldest-first (ascending); otherwise newest-first (descending, the default).

created\_after: Optional\[Union\[str, datetime\]\]

Cursor for pagination. Returns relays created strictly after this RFC 3339 timestamp (typically the `created` value of the last item on the current page, to fetch the next page).

formatdate-time

created\_before: Optional\[Union\[str, datetime\]\]

Cursor for pagination. Returns relays created strictly before this RFC 3339 timestamp (typically the `created` value of the first item on the current page, to fetch the previous page).

formatdate-time

per\_page: Optional\[int\]

Maximum number of relays to return per page. Values above the maximum are clamped to it rather than rejected.

maximum1000

minimum1

##### ReturnsExpand Collapse 

class RelayListResponse: …

Abbreviated relay for list responses.

created: datetime

formatdate-time

modified: datetime

formatdate-time

name: str

uid: str

### List relays

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
)
page = client.moq.relays.list(
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
page = page.result[0]
print(page.uid)
```

200 example

```
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "success": true,
  "result": [
    {
      "created": "2019-12-27T18:11:19.117Z",
      "modified": "2019-12-27T18:11:19.117Z",
      "name": "name",
      "uid": "a1b2c3d4e5f67890a1b2c3d4e5f67890"
    }
  ],
  "result_info": {
    "count": 0,
    "total": 0
  }
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "success": true,
  "result": [
    {
      "created": "2019-12-27T18:11:19.117Z",
      "modified": "2019-12-27T18:11:19.117Z",
      "name": "name",
      "uid": "a1b2c3d4e5f67890a1b2c3d4e5f67890"
    }
  ],
  "result_info": {
    "count": 0,
    "total": 0
  }
}
```