Skip to content
Start here

Pages

PagesProjects

Get projects
client.pages.projects.list(ProjectListParams { account_id, page, per_page } params, RequestOptionsoptions?): V4PagePaginationArray<Project { id, canonical_deployment, created_on, 13 more } >
GET/accounts/{account_id}/pages/projects
Get project
client.pages.projects.get(stringprojectName, ProjectGetParams { account_id } params, RequestOptionsoptions?): Project { id, canonical_deployment, created_on, 13 more }
GET/accounts/{account_id}/pages/projects/{project_name}
Create project
client.pages.projects.create(ProjectCreateParams { account_id, name, production_branch, 3 more } params, RequestOptionsoptions?): Project { id, canonical_deployment, created_on, 13 more }
POST/accounts/{account_id}/pages/projects
Update project
client.pages.projects.edit(stringprojectName, ProjectEditParams { account_id, build_config, deployment_configs, 3 more } params, RequestOptionsoptions?): Project { id, canonical_deployment, created_on, 13 more }
PATCH/accounts/{account_id}/pages/projects/{project_name}
Delete project
client.pages.projects.delete(stringprojectName, ProjectDeleteParams { account_id } params, RequestOptionsoptions?): ProjectDeleteResponse | null
DELETE/accounts/{account_id}/pages/projects/{project_name}
Purge build cache
client.pages.projects.purgeBuildCache(stringprojectName, ProjectPurgeBuildCacheParams { account_id } params, RequestOptionsoptions?): ProjectPurgeBuildCacheResponse | null
POST/accounts/{account_id}/pages/projects/{project_name}/purge_build_cache
ModelsExpand Collapse
Deployment { id, aliases, build_config, 14 more }
id: string

Id of the deployment.

aliases: Array<string> | null

A list of alias URLs pointing to this deployment.

build_config: BuildConfig { web_analytics_tag, web_analytics_token, build_caching, 3 more }

Configs for the project build process.

web_analytics_tag: string | null

The classifying tag for analytics.

web_analytics_token: string | null

The auth token for analytics.

build_caching?: boolean | null

Enable build caching for the project.

build_command?: string | null

Command used to build project.

destination_dir?: string | null

Assets output directory of the build.

root_dir?: string | null

Directory to run the command.

created_on: string

When the deployment was created.

formatdate-time
deployment_trigger: DeploymentTrigger { metadata, type }

Info about what caused the deployment.

metadata: Metadata { branch, commit_dirty, commit_hash, commit_message }

Additional info about the trigger.

branch: string

Where the trigger happened.

commit_dirty: boolean

Whether the deployment trigger commit was dirty.

commit_hash: string

Hash of the deployment trigger commit.

commit_message: string

Message of the deployment trigger commit.

type: "github:push" | "ad_hoc" | "deploy_hook"

What caused the deployment.

One of the following:
"github:push"
"ad_hoc"
"deploy_hook"
env_vars: Record<string, PagesPlainTextEnvVar { type, value } | null | PagesSecretTextEnvVar { type, value } | null> | null

Environment variables used for builds and Pages Functions.

One of the following:
PagesPlainTextEnvVar { type, value }

A plaintext environment variable.

type: "plain_text"
value: string

Environment variable value.

PagesSecretTextEnvVar { type, value }

An encrypted environment variable.

type: "secret_text"
value: string

Secret value.

environment: "preview" | "production"

Type of deploy.

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

If the deployment has been skipped.

latest_stage: Stage { ended_on, name, started_on, status }

The status of the deployment.

modified_on: string

When the deployment was last modified.

formatdate-time
project_id: string

Id of the project.

project_name: string

Name of the project.

short_id: string

Short Id (8 character) of the deployment.

source: Source { config, type }

Configs for the project source control.

config: Config { deployments_enabled, owner, owner_id, 10 more }
Deprecateddeployments_enabled: boolean
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: string

The owner of the repository.

owner_id: string

The owner ID of the repository.

path_excludes: Array<string>

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

path_includes: Array<string>

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

pr_comments_enabled: boolean

Whether to enable PR comments.

preview_branch_excludes: Array<string>

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: Array<string>

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: "all" | "none" | "custom"

Controls whether commits to preview branches trigger a preview deployment.

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

The production branch of the repository.

production_deployments_enabled: boolean

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

repo_id: string

The ID of the repository.

repo_name: string

The name of the repository.

type: "github" | "gitlab"

The source control management provider.

One of the following:
"github"
"gitlab"
stages: Array<Stage { ended_on, name, started_on, status } >

List of past stages.

ended_on: string | null

When the stage ended.

formatdate-time
name: "queued" | "initialize" | "clone_repo" | 2 more

The current build stage.

One of the following:
"queued"
"initialize"
"clone_repo"
"build"
"deploy"
started_on: string | null

When the stage started.

formatdate-time
status: "success" | "idle" | "active" | 2 more

State of the current stage.

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

The live URL to view this deployment.

uses_functions?: boolean | null

Whether the deployment uses functions.

Project { id, canonical_deployment, created_on, 13 more }
id: string

ID of the project.

canonical_deployment: Deployment { id, aliases, build_config, 14 more } | null

Most recent production deployment of the project.

created_on: string

When the project was created.

formatdate-time
deployment_configs: DeploymentConfigs { preview, production }

Configs for deployments in a project.

preview: Preview { always_use_latest_compatibility_date, build_image_major_version, compatibility_date, 19 more }

Configs for preview deploys.

always_use_latest_compatibility_date: boolean

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

build_image_major_version: number

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

compatibility_date: string

Compatibility date used for Pages Functions.

compatibility_flags: Array<string>

Compatibility flags used for Pages Functions.

env_vars: Record<string, PagesPlainTextEnvVar { type, value } | null | PagesSecretTextEnvVar { type, value } | null> | null

Environment variables used for builds and Pages Functions.

One of the following:
PagesPlainTextEnvVar { type, value }

A plaintext environment variable.

type: "plain_text"
value: string

Environment variable value.

PagesSecretTextEnvVar { type, value }

An encrypted environment variable.

type: "secret_text"
value: string

Secret value.

fail_open: boolean

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

Deprecatedusage_model: "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?: Record<string, AIBindings>

Constellation bindings used for Pages Functions.

project_id: string
analytics_engine_datasets?: Record<string, AnalyticsEngineDatasets>

Analytics Engine bindings used for Pages Functions.

dataset: string

Name of the dataset.

browsers?: Record<string, Browsers | null>

Browser bindings used for Pages Functions.

d1_databases?: Record<string, D1Databases>

D1 databases used for Pages Functions.

id: string

UUID of the D1 database.

durable_object_namespaces?: Record<string, DurableObjectNamespaces>

Durable Object namespaces used for Pages Functions.

namespace_id: string

ID of the Durable Object namespace.

hyperdrive_bindings?: Record<string, HyperdriveBindings>

Hyperdrive bindings used for Pages Functions.

id: string
kv_namespaces?: Record<string, KVNamespaces>

KV namespaces used for Pages Functions.

namespace_id: string

ID of the KV namespace.

limits?: Limits { cpu_ms }

Limits for Pages Functions.

cpu_ms: number

CPU time limit in milliseconds.

mtls_certificates?: Record<string, MTLSCertificates>

mTLS bindings used for Pages Functions.

certificate_id: string
placement?: Placement { mode }

Placement setting used for Pages Functions.

mode: string

Placement mode.

queue_producers?: Record<string, QueueProducers>

Queue Producer bindings used for Pages Functions.

name: string

Name of the Queue.

r2_buckets?: Record<string, R2Buckets>

R2 buckets used for Pages Functions.

name: string

Name of the R2 bucket.

jurisdiction?: string | null

Jurisdiction of the R2 bucket.

services?: Record<string, Services>

Services used for Pages Functions.

environment: string

The Service environment.

service: string

The Service name.

entrypoint?: string | null

The entrypoint to bind to.

vectorize_bindings?: Record<string, VectorizeBindings>

Vectorize bindings used for Pages Functions.

index_name: string
wrangler_config_hash?: string

Hash of the Wrangler configuration used for the deployment.

production: Production { always_use_latest_compatibility_date, build_image_major_version, compatibility_date, 19 more }

Configs for production deploys.

always_use_latest_compatibility_date: boolean

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

build_image_major_version: number

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

compatibility_date: string

Compatibility date used for Pages Functions.

compatibility_flags: Array<string>

Compatibility flags used for Pages Functions.

env_vars: Record<string, PagesPlainTextEnvVar { type, value } | null | PagesSecretTextEnvVar { type, value } | null> | null

Environment variables used for builds and Pages Functions.

One of the following:
PagesPlainTextEnvVar { type, value }

A plaintext environment variable.

type: "plain_text"
value: string

Environment variable value.

PagesSecretTextEnvVar { type, value }

An encrypted environment variable.

type: "secret_text"
value: string

Secret value.

fail_open: boolean

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

Deprecatedusage_model: "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?: Record<string, AIBindings>

Constellation bindings used for Pages Functions.

project_id: string
analytics_engine_datasets?: Record<string, AnalyticsEngineDatasets>

Analytics Engine bindings used for Pages Functions.

dataset: string

Name of the dataset.

browsers?: Record<string, Browsers | null>

Browser bindings used for Pages Functions.

d1_databases?: Record<string, D1Databases>

D1 databases used for Pages Functions.

id: string

UUID of the D1 database.

durable_object_namespaces?: Record<string, DurableObjectNamespaces>

Durable Object namespaces used for Pages Functions.

namespace_id: string

ID of the Durable Object namespace.

hyperdrive_bindings?: Record<string, HyperdriveBindings>

Hyperdrive bindings used for Pages Functions.

id: string
kv_namespaces?: Record<string, KVNamespaces>

KV namespaces used for Pages Functions.

namespace_id: string

ID of the KV namespace.

limits?: Limits { cpu_ms }

Limits for Pages Functions.

cpu_ms: number

CPU time limit in milliseconds.

mtls_certificates?: Record<string, MTLSCertificates>

mTLS bindings used for Pages Functions.

certificate_id: string
placement?: Placement { mode }

Placement setting used for Pages Functions.

mode: string

Placement mode.

queue_producers?: Record<string, QueueProducers>

Queue Producer bindings used for Pages Functions.

name: string

Name of the Queue.

r2_buckets?: Record<string, R2Buckets>

R2 buckets used for Pages Functions.

name: string

Name of the R2 bucket.

jurisdiction?: string | null

Jurisdiction of the R2 bucket.

services?: Record<string, Services>

Services used for Pages Functions.

environment: string

The Service environment.

service: string

The Service name.

entrypoint?: string | null

The entrypoint to bind to.

vectorize_bindings?: Record<string, VectorizeBindings>

Vectorize bindings used for Pages Functions.

index_name: string
wrangler_config_hash?: string

Hash of the Wrangler configuration used for the deployment.

framework: string

Framework the project is using.

framework_version: string

Version of the framework the project is using.

latest_deployment: Deployment { id, aliases, build_config, 14 more } | null

Most recent deployment of the project.

name: string

Name of the project.

preview_script_name: string

Name of the preview script.

production_branch: string

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

production_script_name: string

Name of the production script.

uses_functions: boolean | null

Whether the project uses functions.

build_config?: BuildConfig { web_analytics_tag, web_analytics_token, build_caching, 3 more }

Configs for the project build process.

web_analytics_tag: string | null

The classifying tag for analytics.

web_analytics_token: string | null

The auth token for analytics.

build_caching?: boolean | null

Enable build caching for the project.

build_command?: string | null

Command used to build project.

destination_dir?: string | null

Assets output directory of the build.

root_dir?: string | null

Directory to run the command.

domains?: Array<string>

A list of associated custom domains for the project.

source?: Source { config, type }

Configs for the project source control.

config: Config { deployments_enabled, owner, owner_id, 10 more }
Deprecateddeployments_enabled: boolean
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: string

The owner of the repository.

owner_id: string

The owner ID of the repository.

path_excludes: Array<string>

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

path_includes: Array<string>

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

pr_comments_enabled: boolean

Whether to enable PR comments.

preview_branch_excludes: Array<string>

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: Array<string>

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: "all" | "none" | "custom"

Controls whether commits to preview branches trigger a preview deployment.

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

The production branch of the repository.

production_deployments_enabled: boolean

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

repo_id: string

The ID of the repository.

repo_name: string

The name of the repository.

type: "github" | "gitlab"

The source control management provider.

One of the following:
"github"
"gitlab"
subdomain?: string

The Cloudflare subdomain associated with the project.

Stage { ended_on, name, started_on, status }

The status of the deployment.

ended_on: string | null

When the stage ended.

formatdate-time
name: "queued" | "initialize" | "clone_repo" | 2 more

The current build stage.

One of the following:
"queued"
"initialize"
"clone_repo"
"build"
"deploy"
started_on: string | null

When the stage started.

formatdate-time
status: "success" | "idle" | "active" | 2 more

State of the current stage.

One of the following:
"success"
"idle"
"active"
"failure"
"canceled"
ProjectDeleteResponse = unknown
ProjectPurgeBuildCacheResponse = unknown

PagesProjectsDeployments

Get deployments
client.pages.projects.deployments.list(stringprojectName, DeploymentListParams { account_id, env, page, per_page } params, RequestOptionsoptions?): V4PagePaginationArray<Deployment { id, aliases, build_config, 14 more } >
GET/accounts/{account_id}/pages/projects/{project_name}/deployments
Get deployment info
client.pages.projects.deployments.get(stringprojectName, stringdeploymentId, DeploymentGetParams { account_id } params, RequestOptionsoptions?): Deployment { id, aliases, build_config, 14 more }
GET/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}
Create deployment
client.pages.projects.deployments.create(stringprojectName, DeploymentCreateParams { account_id, _headers, _redirects, 11 more } params, RequestOptionsoptions?): Deployment { id, aliases, build_config, 14 more }
POST/accounts/{account_id}/pages/projects/{project_name}/deployments
Delete deployment
client.pages.projects.deployments.delete(stringprojectName, stringdeploymentId, DeploymentDeleteParams { account_id } params, RequestOptionsoptions?): DeploymentDeleteResponse | null
DELETE/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}
Retry deployment
client.pages.projects.deployments.retry(stringprojectName, stringdeploymentId, DeploymentRetryParams { account_id } params, RequestOptionsoptions?): Deployment { id, aliases, build_config, 14 more }
POST/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/retry
Rollback deployment
client.pages.projects.deployments.rollback(stringprojectName, stringdeploymentId, DeploymentRollbackParams { account_id } params, RequestOptionsoptions?): Deployment { id, aliases, build_config, 14 more }
POST/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/rollback
ModelsExpand Collapse
DeploymentDeleteResponse = unknown

PagesProjectsDeploymentsHistory

PagesProjectsDeploymentsHistoryLogs

Get deployment logs
client.pages.projects.deployments.history.logs.get(stringprojectName, stringdeploymentId, LogGetParams { account_id } params, RequestOptionsoptions?): LogGetResponse { data, includes_container_logs, total }
GET/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/history/logs
ModelsExpand Collapse
LogGetResponse { data, includes_container_logs, total }
data: Array<Data>
line: string
ts: string
includes_container_logs: boolean
total: number

PagesProjectsDomains

Get domains
client.pages.projects.domains.list(stringprojectName, DomainListParams { account_id } params, RequestOptionsoptions?): SinglePage<DomainListResponse { id, certificate_authority, created_on, 6 more } >
GET/accounts/{account_id}/pages/projects/{project_name}/domains
Get domain
client.pages.projects.domains.get(stringprojectName, stringdomainName, DomainGetParams { account_id } params, RequestOptionsoptions?): DomainGetResponse { id, certificate_authority, created_on, 6 more }
GET/accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}
Add domain
client.pages.projects.domains.create(stringprojectName, DomainCreateParams { account_id, name } params, RequestOptionsoptions?): DomainCreateResponse { id, certificate_authority, created_on, 6 more }
POST/accounts/{account_id}/pages/projects/{project_name}/domains
Patch domain
client.pages.projects.domains.edit(stringprojectName, stringdomainName, DomainEditParams { account_id } params, RequestOptionsoptions?): DomainEditResponse { id, certificate_authority, created_on, 6 more }
PATCH/accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}
Delete domain
client.pages.projects.domains.delete(stringprojectName, stringdomainName, DomainDeleteParams { account_id } params, RequestOptionsoptions?): DomainDeleteResponse | null
DELETE/accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}
ModelsExpand Collapse
DomainListResponse { id, certificate_authority, created_on, 6 more }
id: string
certificate_authority: "google" | "lets_encrypt"
One of the following:
"google"
"lets_encrypt"
created_on: string
domain_id: string
name: string

The domain name.

status: "initializing" | "pending" | "active" | 3 more
One of the following:
"initializing"
"pending"
"active"
"deactivated"
"blocked"
"error"
validation_data: ValidationData { method, status, error_message, 2 more }
method: "http" | "txt"
One of the following:
"http"
"txt"
status: "initializing" | "pending" | "active" | 2 more
One of the following:
"initializing"
"pending"
"active"
"deactivated"
"error"
error_message?: string
txt_name?: string
txt_value?: string
verification_data: VerificationData { status, error_message }
status: "pending" | "active" | "deactivated" | 2 more
One of the following:
"pending"
"active"
"deactivated"
"blocked"
"error"
error_message?: string
zone_tag: string
DomainGetResponse { id, certificate_authority, created_on, 6 more }
id: string
certificate_authority: "google" | "lets_encrypt"
One of the following:
"google"
"lets_encrypt"
created_on: string
domain_id: string
name: string

The domain name.

status: "initializing" | "pending" | "active" | 3 more
One of the following:
"initializing"
"pending"
"active"
"deactivated"
"blocked"
"error"
validation_data: ValidationData { method, status, error_message, 2 more }
method: "http" | "txt"
One of the following:
"http"
"txt"
status: "initializing" | "pending" | "active" | 2 more
One of the following:
"initializing"
"pending"
"active"
"deactivated"
"error"
error_message?: string
txt_name?: string
txt_value?: string
verification_data: VerificationData { status, error_message }
status: "pending" | "active" | "deactivated" | 2 more
One of the following:
"pending"
"active"
"deactivated"
"blocked"
"error"
error_message?: string
zone_tag: string
DomainCreateResponse { id, certificate_authority, created_on, 6 more }
id: string
certificate_authority: "google" | "lets_encrypt"
One of the following:
"google"
"lets_encrypt"
created_on: string
domain_id: string
name: string

The domain name.

status: "initializing" | "pending" | "active" | 3 more
One of the following:
"initializing"
"pending"
"active"
"deactivated"
"blocked"
"error"
validation_data: ValidationData { method, status, error_message, 2 more }
method: "http" | "txt"
One of the following:
"http"
"txt"
status: "initializing" | "pending" | "active" | 2 more
One of the following:
"initializing"
"pending"
"active"
"deactivated"
"error"
error_message?: string
txt_name?: string
txt_value?: string
verification_data: VerificationData { status, error_message }
status: "pending" | "active" | "deactivated" | 2 more
One of the following:
"pending"
"active"
"deactivated"
"blocked"
"error"
error_message?: string
zone_tag: string
DomainEditResponse { id, certificate_authority, created_on, 6 more }
id: string
certificate_authority: "google" | "lets_encrypt"
One of the following:
"google"
"lets_encrypt"
created_on: string
domain_id: string
name: string

The domain name.

status: "initializing" | "pending" | "active" | 3 more
One of the following:
"initializing"
"pending"
"active"
"deactivated"
"blocked"
"error"
validation_data: ValidationData { method, status, error_message, 2 more }
method: "http" | "txt"
One of the following:
"http"
"txt"
status: "initializing" | "pending" | "active" | 2 more
One of the following:
"initializing"
"pending"
"active"
"deactivated"
"error"
error_message?: string
txt_name?: string
txt_value?: string
verification_data: VerificationData { status, error_message }
status: "pending" | "active" | "deactivated" | 2 more
One of the following:
"pending"
"active"
"deactivated"
"blocked"
"error"
error_message?: string
zone_tag: string
DomainDeleteResponse = unknown