---
title: List custom pages
---

[Skip to content](#_top)

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

[Custom Pages](https://developers.cloudflare.com/api/go/resources/custom_pages)

Copy Markdown

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

---

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

# List custom pages

client.CustomPages.List(ctx, query) (\*SinglePage\[[CustomPageListResponse](<https://developers.cloudflare.com/api/go/resources/custom_pages#(resource)%20custom_pages%20%3E%20(model)%20CustomPageListResponse%20%3E%20(schema)>)], error)

GET/{accounts\_or\_zones}/{account\_or\_zone\_id}/custom\_pages

Lists all custom page configurations for an account or zone.

##### Security

API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**`X-Auth-Email: user@example.com`

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**`X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194`

##### Accepted Permissions (at least one required)

`Zero Trust: PII Read``Account Custom Pages Write``Account Custom Pages Read``Account Settings Write``Account Settings Read`

##### ParametersExpand Collapse

<details>

<summary>

query CustomPageListParams

</summary>

AccountID param.Field\[string]Optional

The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.

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

ZoneID param.Field\[string]Optional

The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.

<a href="#(resource)%20custom_pages%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20zone_id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20custom_pages%20%3E%20(method)%20list%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

type CustomPageListResponse struct{…}

</summary>

ID stringOptional

<a href="#(resource)%20custom_pages%20%3E%20(model)%20CustomPageListResponse%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

CreatedOn TimeOptional

formatdate-time

<a href="#(resource)%20custom_pages%20%3E%20(model)%20CustomPageListResponse%20%3E%20(schema)%20%3E%20(property)%20created_on">Link to this property</a>

Description stringOptional

<a href="#(resource)%20custom_pages%20%3E%20(model)%20CustomPageListResponse%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

ModifiedOn TimeOptional

formatdate-time

<a href="#(resource)%20custom_pages%20%3E%20(model)%20CustomPageListResponse%20%3E%20(schema)%20%3E%20(property)%20modified_on">Link to this property</a>

PreviewTarget stringOptional

<a href="#(resource)%20custom_pages%20%3E%20(model)%20CustomPageListResponse%20%3E%20(schema)%20%3E%20(property)%20preview_target">Link to this property</a>

RequiredTokens \[]stringOptional

<a href="#(resource)%20custom_pages%20%3E%20(model)%20CustomPageListResponse%20%3E%20(schema)%20%3E%20(property)%20required_tokens">Link to this property</a>

<details>

<summary>

State CustomPageListResponseStateOptional

The custom page state.

</summary>

One of the following:

const CustomPageListResponseStateDefault CustomPageListResponseState = "default"

<a href="#(resource)%20custom_pages%20%3E%20(model)%20CustomPageListResponse%20%3E%20(schema)%20%3E%20(property)%20state%20%3E%20(member)%200">Link to this property</a>

const CustomPageListResponseStateCustomized CustomPageListResponseState = "customized"

<a href="#(resource)%20custom_pages%20%3E%20(model)%20CustomPageListResponse%20%3E%20(schema)%20%3E%20(property)%20state%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20custom_pages%20%3E%20(model)%20CustomPageListResponse%20%3E%20(schema)%20%3E%20(property)%20state">Link to this property</a>

URL stringOptional

The URL associated with the custom page.

formaturi

<a href="#(resource)%20custom_pages%20%3E%20(model)%20CustomPageListResponse%20%3E%20(schema)%20%3E%20(property)%20url">Link to this property</a>

</details>

[Link to this property](<#(resource)%20custom_pages%20%3E%20(model)%20CustomPageListResponse%20%3E%20(schema)>)

### List custom pages

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
    option.WithAPIEmail("user@example.com"),
  )
  page, err := client.CustomPages.List(context.TODO(), custom_pages.CustomPageListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "basic_challenge",
      "created_on": "2014-01-01T05:20:00.12345Z",
      "description": "Basic Challenge",
      "modified_on": "2014-01-01T05:20:00.12345Z",
      "preview_target": "block:basic-sec-captcha",
      "required_tokens": [
        "::CAPTCHA_BOX::"
      ],
      "state": "default",
      "url": "http://www.example.com"
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  }
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "basic_challenge",
      "created_on": "2014-01-01T05:20:00.12345Z",
      "description": "Basic Challenge",
      "modified_on": "2014-01-01T05:20:00.12345Z",
      "preview_target": "block:basic-sec-captcha",
      "required_tokens": [
        "::CAPTCHA_BOX::"
      ],
      "state": "default",
      "url": "http://www.example.com"
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  }
}
```