---
title: Update a custom page
---

[Skip to content](#_top)

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

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

Copy Markdown

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

---

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

# Update a custom page

custom\_pages.update(Literal\["1000\_errors", "500\_errors", "basic\_challenge", 7 more]identifier, CustomPageUpdateParams\*\*kwargs) -> [CustomPageUpdateResponse](<https://developers.cloudflare.com/api/python/resources/custom_pages#(resource)%20custom_pages%20%3E%20(model)%20custom_page_update_response%20%3E%20(schema)>)

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

Updates the configuration for a custom page type.

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

`Account Custom Pages Write``Account Settings Write`

##### ParametersExpand Collapse

<details>

<summary>

identifier: Literal\["1000\_errors", "500\_errors", "basic\_challenge", 7 more]

Custom page type.

</summary>

One of the following:

"1000\_errors"

<a href="#(resource)%20custom_pages%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20identifier%20%3E%20(schema)%20%3E%20(member)%200">Link to this property</a>

"500\_errors"

<a href="#(resource)%20custom_pages%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20identifier%20%3E%20(schema)%20%3E%20(member)%201">Link to this property</a>

"basic\_challenge"

<a href="#(resource)%20custom_pages%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20identifier%20%3E%20(schema)%20%3E%20(member)%202">Link to this property</a>

"country\_challenge"

<a href="#(resource)%20custom_pages%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20identifier%20%3E%20(schema)%20%3E%20(member)%203">Link to this property</a>

"ip\_block"

<a href="#(resource)%20custom_pages%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20identifier%20%3E%20(schema)%20%3E%20(member)%204">Link to this property</a>

"managed\_challenge"

<a href="#(resource)%20custom_pages%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20identifier%20%3E%20(schema)%20%3E%20(member)%205">Link to this property</a>

"ratelimit\_block"

<a href="#(resource)%20custom_pages%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20identifier%20%3E%20(schema)%20%3E%20(member)%206">Link to this property</a>

"under\_attack"

<a href="#(resource)%20custom_pages%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20identifier%20%3E%20(schema)%20%3E%20(member)%207">Link to this property</a>

"waf\_block"

<a href="#(resource)%20custom_pages%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20identifier%20%3E%20(schema)%20%3E%20(member)%208">Link to this property</a>

"waf\_challenge"

<a href="#(resource)%20custom_pages%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20identifier%20%3E%20(schema)%20%3E%20(member)%209">Link to this property</a>

</details>

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

<details>

<summary>

state: Literal\["default", "customized"]

The custom page state.

</summary>

One of the following:

"default"

<a href="#(resource)%20custom_pages%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20state%20%3E%20(schema)%20%3E%20(member)%200">Link to this property</a>

"customized"

<a href="#(resource)%20custom_pages%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20state%20%3E%20(schema)%20%3E%20(member)%201">Link to this property</a>

</details>

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

url: str

The URL associated with the custom page.

formaturi

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

account\_id: Optional\[str]

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

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

zone\_id: Optional\[str]

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

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

##### ReturnsExpand Collapse

<details>

<summary>

class CustomPageUpdateResponse: …

</summary>

id: Optional\[str]

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

created\_on: Optional\[datetime]

formatdate-time

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

description: Optional\[str]

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

modified\_on: Optional\[datetime]

formatdate-time

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

preview\_target: Optional\[str]

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

required\_tokens: Optional\[List\[str]]

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

<details>

<summary>

state: Optional\[Literal\["default", "customized"]]

The custom page state.

</summary>

One of the following:

"default"

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

"customized"

<a href="#(resource)%20custom_pages%20%3E%20(model)%20custom_page_update_response%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)%20custom_page_update_response%20%3E%20(schema)%20%3E%20(property)%20state">Link to this property</a>

url: Optional\[str]

The URL associated with the custom page.

formaturi

<a href="#(resource)%20custom_pages%20%3E%20(model)%20custom_page_update_response%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)%20custom_page_update_response%20%3E%20(schema)>)

### Update a custom page

Python

HTTPTypeScriptPythonGoTerraform

```
import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_email=os.environ.get("CLOUDFLARE_EMAIL"),  # This is the default and can be omitted
    api_key=os.environ.get("CLOUDFLARE_API_KEY"),  # This is the default and can be omitted
)
custom_page = client.custom_pages.update(
    identifier="ratelimit_block",
    state="default",
    url="http://www.example.com",
    account_id="account_id",
)
print(custom_page.id)
```

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"
  }
}
```

##### 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"
  }
}
```