Skip to content
Start here

Projects

Get projects
pages.projects.list(ProjectListParams**kwargs) -> SyncV4PagePaginationArray[Project]
GET/accounts/{account_id}/pages/projects
Get project
pages.projects.get(strproject_name, ProjectGetParams**kwargs) -> Project
GET/accounts/{account_id}/pages/projects/{project_name}
Create project
pages.projects.create(ProjectCreateParams**kwargs) -> Project
POST/accounts/{account_id}/pages/projects
Update project
pages.projects.edit(strproject_name, ProjectEditParams**kwargs) -> Project
PATCH/accounts/{account_id}/pages/projects/{project_name}
Delete project
pages.projects.delete(strproject_name, ProjectDeleteParams**kwargs) -> object
DELETE/accounts/{account_id}/pages/projects/{project_name}
Purge build cache
pages.projects.purge_build_cache(strproject_name, ProjectPurgeBuildCacheParams**kwargs) -> object
POST/accounts/{account_id}/pages/projects/{project_name}/purge_build_cache
ModelsExpand Collapse
class Deployment:
id: str

Id of the deployment.

aliases: Optional[List[str]]

A list of alias URLs pointing to this deployment.

build_config: BuildConfig

Configs for the project build process.

web_analytics_tag: Optional[str]

The classifying tag for analytics.

web_analytics_token: Optional[str]

The auth token for analytics.

build_caching: Optional[bool]

Enable build caching for the project.

build_command: Optional[str]

Command used to build project.

destination_dir: Optional[str]

Assets output directory of the build.

root_dir: Optional[str]

Directory to run the command.

created_on: datetime

When the deployment was created.

formatdate-time
deployment_trigger: DeploymentTrigger

Info about what caused the deployment.

metadata: DeploymentTriggerMetadata

Additional info about the trigger.

branch: str

Where the trigger happened.

commit_dirty: bool

Whether the deployment trigger commit was dirty.

commit_hash: str

Hash of the deployment trigger commit.

commit_message: str

Message of the deployment trigger commit.

type: Literal["github:push", "ad_hoc", "deploy_hook"]

What caused the deployment.

One of the following:
"github:push"
"ad_hoc"
"deploy_hook"
env_vars: Optional[Dict[str, Optional[EnvVars]]]

Environment variables used for builds and Pages Functions.

One of the following:
class EnvVarsPagesPlainTextEnvVar:

A plaintext environment variable.

type: Literal["plain_text"]
value: str

Environment variable value.

class EnvVarsPagesSecretTextEnvVar:

An encrypted environment variable.

type: Literal["secret_text"]
value: str

Secret value.

environment: Literal["preview", "production"]

Type of deploy.

One of the following:
"preview"
"production"
is_skipped: bool

If the deployment has been skipped.

latest_stage: Stage

The status of the deployment.

modified_on: datetime

When the deployment was last modified.

formatdate-time
project_id: str

Id of the project.

project_name: str

Name of the project.

short_id: str

Short Id (8 character) of the deployment.

source: Source

Configs for the project source control.

config: SourceConfig
Deprecateddeployments_enabled: bool
Use `production_deployments_enabled` and `preview_deployment_setting` for more granular control.

Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically.

owner: str

The owner of the repository.

owner_id: str

The owner ID of the repository.

path_excludes: List[str]

A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (*) is supported.

path_includes: List[str]

A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (*) is supported.

pr_comments_enabled: bool

Whether to enable PR comments.

preview_branch_excludes: List[str]

A list of branches that should not trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_branch_includes: List[str]

A list of branches that should trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_deployment_setting: Literal["all", "none", "custom"]

Controls whether commits to preview branches trigger a preview deployment.

One of the following:
"all"
"none"
"custom"
production_branch: str

The production branch of the repository.

production_deployments_enabled: bool

Whether to trigger a production deployment on commits to the production branch.

repo_id: str

The ID of the repository.

repo_name: str

The name of the repository.

type: Literal["github", "gitlab"]

The source control management provider.

One of the following:
"github"
"gitlab"
stages: List[Stage]

List of past stages.

ended_on: Optional[datetime]

When the stage ended.

formatdate-time
name: Literal["queued", "initialize", "clone_repo", 2 more]

The current build stage.

One of the following:
"queued"
"initialize"
"clone_repo"
"build"
"deploy"
started_on: Optional[datetime]

When the stage started.

formatdate-time
status: Literal["success", "idle", "active", 2 more]

State of the current stage.

One of the following:
"success"
"idle"
"active"
"failure"
"canceled"
url: str

The live URL to view this deployment.

uses_functions: Optional[bool]

Whether the deployment uses functions.

class Project:
id: str

ID of the project.

canonical_deployment: Optional[Deployment]

Most recent production deployment of the project.

created_on: datetime

When the project was created.

formatdate-time
deployment_configs: DeploymentConfigs

Configs for deployments in a project.

preview: DeploymentConfigsPreview

Configs for preview deploys.

always_use_latest_compatibility_date: bool

Whether to always use the latest compatibility date for Pages Functions.

build_image_major_version: int

The major version of the build image to use for Pages Functions.

compatibility_date: str

Compatibility date used for Pages Functions.

compatibility_flags: List[str]

Compatibility flags used for Pages Functions.

env_vars: Optional[Dict[str, Optional[DeploymentConfigsPreviewEnvVars]]]

Environment variables used for builds and Pages Functions.

One of the following:
class DeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar:

A plaintext environment variable.

type: Literal["plain_text"]
value: str

Environment variable value.

class DeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar:

An encrypted environment variable.

type: Literal["secret_text"]
value: str

Secret value.

fail_open: bool

Whether to fail open when the deployment config cannot be applied.

Deprecatedusage_model: Literal["standard", "bundled", "unbound"]
All new projects now use the Standard usage model.

The usage model for Pages Functions.

One of the following:
"standard"
"bundled"
"unbound"
ai_bindings: Optional[Dict[str, DeploymentConfigsPreviewAIBindings]]

Constellation bindings used for Pages Functions.

project_id: str
analytics_engine_datasets: Optional[Dict[str, DeploymentConfigsPreviewAnalyticsEngineDatasets]]

Analytics Engine bindings used for Pages Functions.

dataset: str

Name of the dataset.

browsers: Optional[Dict[str, Optional[DeploymentConfigsPreviewBrowsers]]]

Browser bindings used for Pages Functions.

d1_databases: Optional[Dict[str, DeploymentConfigsPreviewD1Databases]]

D1 databases used for Pages Functions.

id: str

UUID of the D1 database.

durable_object_namespaces: Optional[Dict[str, DeploymentConfigsPreviewDurableObjectNamespaces]]

Durable Object namespaces used for Pages Functions.

namespace_id: str

ID of the Durable Object namespace.

hyperdrive_bindings: Optional[Dict[str, DeploymentConfigsPreviewHyperdriveBindings]]

Hyperdrive bindings used for Pages Functions.

id: str
kv_namespaces: Optional[Dict[str, DeploymentConfigsPreviewKVNamespaces]]

KV namespaces used for Pages Functions.

namespace_id: str

ID of the KV namespace.

limits: Optional[DeploymentConfigsPreviewLimits]

Limits for Pages Functions.

cpu_ms: int

CPU time limit in milliseconds.

mtls_certificates: Optional[Dict[str, DeploymentConfigsPreviewMTLSCertificates]]

mTLS bindings used for Pages Functions.

certificate_id: str
placement: Optional[DeploymentConfigsPreviewPlacement]

Placement setting used for Pages Functions.

mode: str

Placement mode.

queue_producers: Optional[Dict[str, DeploymentConfigsPreviewQueueProducers]]

Queue Producer bindings used for Pages Functions.

name: str

Name of the Queue.

r2_buckets: Optional[Dict[str, DeploymentConfigsPreviewR2Buckets]]

R2 buckets used for Pages Functions.

name: str

Name of the R2 bucket.

jurisdiction: Optional[str]

Jurisdiction of the R2 bucket.

services: Optional[Dict[str, DeploymentConfigsPreviewServices]]

Services used for Pages Functions.

environment: str

The Service environment.

service: str

The Service name.

entrypoint: Optional[str]

The entrypoint to bind to.

vectorize_bindings: Optional[Dict[str, DeploymentConfigsPreviewVectorizeBindings]]

Vectorize bindings used for Pages Functions.

index_name: str
wrangler_config_hash: Optional[str]

Hash of the Wrangler configuration used for the deployment.

production: DeploymentConfigsProduction

Configs for production deploys.

always_use_latest_compatibility_date: bool

Whether to always use the latest compatibility date for Pages Functions.

build_image_major_version: int

The major version of the build image to use for Pages Functions.

compatibility_date: str

Compatibility date used for Pages Functions.

compatibility_flags: List[str]

Compatibility flags used for Pages Functions.

env_vars: Optional[Dict[str, Optional[DeploymentConfigsProductionEnvVars]]]

Environment variables used for builds and Pages Functions.

One of the following:
class DeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar:

A plaintext environment variable.

type: Literal["plain_text"]
value: str

Environment variable value.

class DeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar:

An encrypted environment variable.

type: Literal["secret_text"]
value: str

Secret value.

fail_open: bool

Whether to fail open when the deployment config cannot be applied.

Deprecatedusage_model: Literal["standard", "bundled", "unbound"]
All new projects now use the Standard usage model.

The usage model for Pages Functions.

One of the following:
"standard"
"bundled"
"unbound"
ai_bindings: Optional[Dict[str, DeploymentConfigsProductionAIBindings]]

Constellation bindings used for Pages Functions.

project_id: str
analytics_engine_datasets: Optional[Dict[str, DeploymentConfigsProductionAnalyticsEngineDatasets]]

Analytics Engine bindings used for Pages Functions.

dataset: str

Name of the dataset.

browsers: Optional[Dict[str, Optional[DeploymentConfigsProductionBrowsers]]]

Browser bindings used for Pages Functions.

d1_databases: Optional[Dict[str, DeploymentConfigsProductionD1Databases]]

D1 databases used for Pages Functions.

id: str

UUID of the D1 database.

durable_object_namespaces: Optional[Dict[str, DeploymentConfigsProductionDurableObjectNamespaces]]

Durable Object namespaces used for Pages Functions.

namespace_id: str

ID of the Durable Object namespace.

hyperdrive_bindings: Optional[Dict[str, DeploymentConfigsProductionHyperdriveBindings]]

Hyperdrive bindings used for Pages Functions.

id: str
kv_namespaces: Optional[Dict[str, DeploymentConfigsProductionKVNamespaces]]

KV namespaces used for Pages Functions.

namespace_id: str

ID of the KV namespace.

limits: Optional[DeploymentConfigsProductionLimits]

Limits for Pages Functions.

cpu_ms: int

CPU time limit in milliseconds.

mtls_certificates: Optional[Dict[str, DeploymentConfigsProductionMTLSCertificates]]

mTLS bindings used for Pages Functions.

certificate_id: str
placement: Optional[DeploymentConfigsProductionPlacement]

Placement setting used for Pages Functions.

mode: str

Placement mode.

queue_producers: Optional[Dict[str, DeploymentConfigsProductionQueueProducers]]

Queue Producer bindings used for Pages Functions.

name: str

Name of the Queue.

r2_buckets: Optional[Dict[str, DeploymentConfigsProductionR2Buckets]]

R2 buckets used for Pages Functions.

name: str

Name of the R2 bucket.

jurisdiction: Optional[str]

Jurisdiction of the R2 bucket.

services: Optional[Dict[str, DeploymentConfigsProductionServices]]

Services used for Pages Functions.

environment: str

The Service environment.

service: str

The Service name.

entrypoint: Optional[str]

The entrypoint to bind to.

vectorize_bindings: Optional[Dict[str, DeploymentConfigsProductionVectorizeBindings]]

Vectorize bindings used for Pages Functions.

index_name: str
wrangler_config_hash: Optional[str]

Hash of the Wrangler configuration used for the deployment.

framework: str

Framework the project is using.

framework_version: str

Version of the framework the project is using.

latest_deployment: Optional[Deployment]

Most recent deployment of the project.

name: str

Name of the project.

preview_script_name: str

Name of the preview script.

production_branch: str

Production branch of the project. Used to identify production deployments.

production_script_name: str

Name of the production script.

uses_functions: Optional[bool]

Whether the project uses functions.

build_config: Optional[BuildConfig]

Configs for the project build process.

web_analytics_tag: Optional[str]

The classifying tag for analytics.

web_analytics_token: Optional[str]

The auth token for analytics.

build_caching: Optional[bool]

Enable build caching for the project.

build_command: Optional[str]

Command used to build project.

destination_dir: Optional[str]

Assets output directory of the build.

root_dir: Optional[str]

Directory to run the command.

domains: Optional[List[str]]

A list of associated custom domains for the project.

source: Optional[Source]

Configs for the project source control.

config: SourceConfig
Deprecateddeployments_enabled: bool
Use `production_deployments_enabled` and `preview_deployment_setting` for more granular control.

Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically.

owner: str

The owner of the repository.

owner_id: str

The owner ID of the repository.

path_excludes: List[str]

A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (*) is supported.

path_includes: List[str]

A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (*) is supported.

pr_comments_enabled: bool

Whether to enable PR comments.

preview_branch_excludes: List[str]

A list of branches that should not trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_branch_includes: List[str]

A list of branches that should trigger a preview deployment. Wildcard syntax (*) is supported. Must be used with preview_deployment_setting set to custom.

preview_deployment_setting: Literal["all", "none", "custom"]

Controls whether commits to preview branches trigger a preview deployment.

One of the following:
"all"
"none"
"custom"
production_branch: str

The production branch of the repository.

production_deployments_enabled: bool

Whether to trigger a production deployment on commits to the production branch.

repo_id: str

The ID of the repository.

repo_name: str

The name of the repository.

type: Literal["github", "gitlab"]

The source control management provider.

One of the following:
"github"
"gitlab"
subdomain: Optional[str]

The Cloudflare subdomain associated with the project.

class Stage:

The status of the deployment.

ended_on: Optional[datetime]

When the stage ended.

formatdate-time
name: Literal["queued", "initialize", "clone_repo", 2 more]

The current build stage.

One of the following:
"queued"
"initialize"
"clone_repo"
"build"
"deploy"
started_on: Optional[datetime]

When the stage started.

formatdate-time
status: Literal["success", "idle", "active", 2 more]

State of the current stage.

One of the following:
"success"
"idle"
"active"
"failure"
"canceled"

ProjectsDeployments

Get deployments
pages.projects.deployments.list(strproject_name, DeploymentListParams**kwargs) -> SyncV4PagePaginationArray[Deployment]
GET/accounts/{account_id}/pages/projects/{project_name}/deployments
Get deployment info
pages.projects.deployments.get(strdeployment_id, DeploymentGetParams**kwargs) -> Deployment
GET/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}
Create deployment
pages.projects.deployments.create(strproject_name, DeploymentCreateParams**kwargs) -> Deployment
POST/accounts/{account_id}/pages/projects/{project_name}/deployments
Delete deployment
pages.projects.deployments.delete(strdeployment_id, DeploymentDeleteParams**kwargs) -> object
DELETE/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}
Retry deployment
pages.projects.deployments.retry(strdeployment_id, DeploymentRetryParams**kwargs) -> Deployment
POST/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/retry
Rollback deployment
pages.projects.deployments.rollback(strdeployment_id, DeploymentRollbackParams**kwargs) -> Deployment
POST/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/rollback

ProjectsDeploymentsHistory

ProjectsDeploymentsHistoryLogs

Get deployment logs
pages.projects.deployments.history.logs.get(strdeployment_id, LogGetParams**kwargs) -> LogGetResponse
GET/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/history/logs
ModelsExpand Collapse
class LogGetResponse:
data: List[Data]
line: str
ts: str
includes_container_logs: bool
total: int

ProjectsDomains

Get domains
pages.projects.domains.list(strproject_name, DomainListParams**kwargs) -> SyncSinglePage[DomainListResponse]
GET/accounts/{account_id}/pages/projects/{project_name}/domains
Get domain
pages.projects.domains.get(strdomain_name, DomainGetParams**kwargs) -> DomainGetResponse
GET/accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}
Add domain
pages.projects.domains.create(strproject_name, DomainCreateParams**kwargs) -> DomainCreateResponse
POST/accounts/{account_id}/pages/projects/{project_name}/domains
Patch domain
pages.projects.domains.edit(strdomain_name, DomainEditParams**kwargs) -> DomainEditResponse
PATCH/accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}
Delete domain
pages.projects.domains.delete(strdomain_name, DomainDeleteParams**kwargs) -> object
DELETE/accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}
ModelsExpand Collapse
class DomainListResponse:
id: str
certificate_authority: Literal["google", "lets_encrypt"]
One of the following:
"google"
"lets_encrypt"
created_on: str
domain_id: str
name: str

The domain name.

status: Literal["initializing", "pending", "active", 3 more]
One of the following:
"initializing"
"pending"
"active"
"deactivated"
"blocked"
"error"
validation_data: ValidationData
method: Literal["http", "txt"]
One of the following:
"http"
"txt"
status: Literal["initializing", "pending", "active", 2 more]
One of the following:
"initializing"
"pending"
"active"
"deactivated"
"error"
error_message: Optional[str]
txt_name: Optional[str]
txt_value: Optional[str]
verification_data: VerificationData
status: Literal["pending", "active", "deactivated", 2 more]
One of the following:
"pending"
"active"
"deactivated"
"blocked"
"error"
error_message: Optional[str]
zone_tag: str
class DomainGetResponse:
id: str
certificate_authority: Literal["google", "lets_encrypt"]
One of the following:
"google"
"lets_encrypt"
created_on: str
domain_id: str
name: str

The domain name.

status: Literal["initializing", "pending", "active", 3 more]
One of the following:
"initializing"
"pending"
"active"
"deactivated"
"blocked"
"error"
validation_data: ValidationData
method: Literal["http", "txt"]
One of the following:
"http"
"txt"
status: Literal["initializing", "pending", "active", 2 more]
One of the following:
"initializing"
"pending"
"active"
"deactivated"
"error"
error_message: Optional[str]
txt_name: Optional[str]
txt_value: Optional[str]
verification_data: VerificationData
status: Literal["pending", "active", "deactivated", 2 more]
One of the following:
"pending"
"active"
"deactivated"
"blocked"
"error"
error_message: Optional[str]
zone_tag: str
class DomainCreateResponse:
id: str
certificate_authority: Literal["google", "lets_encrypt"]
One of the following:
"google"
"lets_encrypt"
created_on: str
domain_id: str
name: str

The domain name.

status: Literal["initializing", "pending", "active", 3 more]
One of the following:
"initializing"
"pending"
"active"
"deactivated"
"blocked"
"error"
validation_data: ValidationData
method: Literal["http", "txt"]
One of the following:
"http"
"txt"
status: Literal["initializing", "pending", "active", 2 more]
One of the following:
"initializing"
"pending"
"active"
"deactivated"
"error"
error_message: Optional[str]
txt_name: Optional[str]
txt_value: Optional[str]
verification_data: VerificationData
status: Literal["pending", "active", "deactivated", 2 more]
One of the following:
"pending"
"active"
"deactivated"
"blocked"
"error"
error_message: Optional[str]
zone_tag: str
class DomainEditResponse:
id: str
certificate_authority: Literal["google", "lets_encrypt"]
One of the following:
"google"
"lets_encrypt"
created_on: str
domain_id: str
name: str

The domain name.

status: Literal["initializing", "pending", "active", 3 more]
One of the following:
"initializing"
"pending"
"active"
"deactivated"
"blocked"
"error"
validation_data: ValidationData
method: Literal["http", "txt"]
One of the following:
"http"
"txt"
status: Literal["initializing", "pending", "active", 2 more]
One of the following:
"initializing"
"pending"
"active"
"deactivated"
"error"
error_message: Optional[str]
txt_name: Optional[str]
txt_value: Optional[str]
verification_data: VerificationData
status: Literal["pending", "active", "deactivated", 2 more]
One of the following:
"pending"
"active"
"deactivated"
"blocked"
"error"
error_message: Optional[str]
zone_tag: str