Skip to content
Start here

Projects

Get projects
GET/accounts/{account_id}/pages/projects
Get project
GET/accounts/{account_id}/pages/projects/{project_name}
Create project
POST/accounts/{account_id}/pages/projects
Update project
PATCH/accounts/{account_id}/pages/projects/{project_name}
Delete project
DELETE/accounts/{account_id}/pages/projects/{project_name}
Purge build cache
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 of string

A list of alias URLs pointing to this deployment.

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

Configs for the project build process.

web_analytics_tag: string

The classifying tag for analytics.

web_analytics_token: string

The auth token for analytics.

build_caching: optional boolean

Enable build caching for the project.

build_command: optional string

Command used to build project.

destination_dir: optional string

Assets output directory of the build.

root_dir: optional string

Directory to run the command.

created_on: string

When the deployment was created.

formatdate-time
deployment_trigger: { metadata, type }

Info about what caused the deployment.

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" or "ad_hoc" or "deploy_hook"

What caused the deployment.

One of the following:
"github:push"
"ad_hoc"
"deploy_hook"
env_vars: map[ { type, value } or { type, value } ]

Environment variables used for builds and Pages Functions.

One of the following:
PlainText { type, value }

A plaintext environment variable.

type: "plain_text"
value: string

Environment variable value.

SecretText { type, value }

An encrypted environment variable.

type: "secret_text"
value: string

Secret value.

environment: "preview" or "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: { config, type }

Configs for the project source control.

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 of string

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

path_includes: array of 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 of 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 of 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" or "none" or "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" or "gitlab"

The source control management provider.

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

List of past stages.

ended_on: string

When the stage ended.

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

The current build stage.

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

When the stage started.

formatdate-time
status: "success" or "idle" or "active" or 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: optional boolean

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 }

Most recent production deployment of the project.

created_on: string

When the project was created.

formatdate-time
deployment_configs: { preview, production }

Configs for deployments in a project.

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 of string

Compatibility flags used for Pages Functions.

env_vars: map[ { type, value } or { type, value } ]

Environment variables used for builds and Pages Functions.

One of the following:
PlainText { type, value }

A plaintext environment variable.

type: "plain_text"
value: string

Environment variable value.

SecretText { 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" or "bundled" or "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 map[ { project_id } ]

Constellation bindings used for Pages Functions.

project_id: string
analytics_engine_datasets: optional map[ { dataset } ]

Analytics Engine bindings used for Pages Functions.

dataset: string

Name of the dataset.

browsers: optional map[ { } ]

Browser bindings used for Pages Functions.

d1_databases: optional map[ { id } ]

D1 databases used for Pages Functions.

id: string

UUID of the D1 database.

durable_object_namespaces: optional map[ { namespace_id } ]

Durable Object namespaces used for Pages Functions.

namespace_id: string

ID of the Durable Object namespace.

hyperdrive_bindings: optional map[ { id } ]

Hyperdrive bindings used for Pages Functions.

id: string
kv_namespaces: optional map[ { namespace_id } ]

KV namespaces used for Pages Functions.

namespace_id: string

ID of the KV namespace.

limits: optional { cpu_ms }

Limits for Pages Functions.

cpu_ms: number

CPU time limit in milliseconds.

mtls_certificates: optional map[ { certificate_id } ]

mTLS bindings used for Pages Functions.

certificate_id: string
placement: optional { mode }

Placement setting used for Pages Functions.

mode: string

Placement mode.

queue_producers: optional map[ { name } ]

Queue Producer bindings used for Pages Functions.

name: string

Name of the Queue.

r2_buckets: optional map[ { name, jurisdiction } ]

R2 buckets used for Pages Functions.

name: string

Name of the R2 bucket.

jurisdiction: optional string

Jurisdiction of the R2 bucket.

services: optional map[ { environment, service, entrypoint } ]

Services used for Pages Functions.

environment: string

The Service environment.

service: string

The Service name.

entrypoint: optional string

The entrypoint to bind to.

vectorize_bindings: optional map[ { index_name } ]

Vectorize bindings used for Pages Functions.

index_name: string
wrangler_config_hash: optional string

Hash of the Wrangler configuration used for the deployment.

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 of string

Compatibility flags used for Pages Functions.

env_vars: map[ { type, value } or { type, value } ]

Environment variables used for builds and Pages Functions.

One of the following:
PlainText { type, value }

A plaintext environment variable.

type: "plain_text"
value: string

Environment variable value.

SecretText { 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" or "bundled" or "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 map[ { project_id } ]

Constellation bindings used for Pages Functions.

project_id: string
analytics_engine_datasets: optional map[ { dataset } ]

Analytics Engine bindings used for Pages Functions.

dataset: string

Name of the dataset.

browsers: optional map[ { } ]

Browser bindings used for Pages Functions.

d1_databases: optional map[ { id } ]

D1 databases used for Pages Functions.

id: string

UUID of the D1 database.

durable_object_namespaces: optional map[ { namespace_id } ]

Durable Object namespaces used for Pages Functions.

namespace_id: string

ID of the Durable Object namespace.

hyperdrive_bindings: optional map[ { id } ]

Hyperdrive bindings used for Pages Functions.

id: string
kv_namespaces: optional map[ { namespace_id } ]

KV namespaces used for Pages Functions.

namespace_id: string

ID of the KV namespace.

limits: optional { cpu_ms }

Limits for Pages Functions.

cpu_ms: number

CPU time limit in milliseconds.

mtls_certificates: optional map[ { certificate_id } ]

mTLS bindings used for Pages Functions.

certificate_id: string
placement: optional { mode }

Placement setting used for Pages Functions.

mode: string

Placement mode.

queue_producers: optional map[ { name } ]

Queue Producer bindings used for Pages Functions.

name: string

Name of the Queue.

r2_buckets: optional map[ { name, jurisdiction } ]

R2 buckets used for Pages Functions.

name: string

Name of the R2 bucket.

jurisdiction: optional string

Jurisdiction of the R2 bucket.

services: optional map[ { environment, service, entrypoint } ]

Services used for Pages Functions.

environment: string

The Service environment.

service: string

The Service name.

entrypoint: optional string

The entrypoint to bind to.

vectorize_bindings: optional map[ { index_name } ]

Vectorize bindings used for Pages Functions.

index_name: string
wrangler_config_hash: optional 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 }

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

Whether the project uses functions.

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

Configs for the project build process.

web_analytics_tag: string

The classifying tag for analytics.

web_analytics_token: string

The auth token for analytics.

build_caching: optional boolean

Enable build caching for the project.

build_command: optional string

Command used to build project.

destination_dir: optional string

Assets output directory of the build.

root_dir: optional string

Directory to run the command.

domains: optional array of string

A list of associated custom domains for the project.

source: optional { config, type }

Configs for the project source control.

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 of string

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

path_includes: array of 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 of 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 of 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" or "none" or "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" or "gitlab"

The source control management provider.

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

The Cloudflare subdomain associated with the project.

Stage { ended_on, name, started_on, status }

The status of the deployment.

ended_on: string

When the stage ended.

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

The current build stage.

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

When the stage started.

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

State of the current stage.

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

ProjectsDeployments

Get deployments
GET/accounts/{account_id}/pages/projects/{project_name}/deployments
Get deployment info
GET/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}
Create deployment
POST/accounts/{account_id}/pages/projects/{project_name}/deployments
Delete deployment
DELETE/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}
Retry deployment
POST/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/retry
Rollback deployment
POST/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/rollback
ModelsExpand Collapse
DeploymentDeleteResponse = unknown

ProjectsDeploymentsHistory

ProjectsDeploymentsHistoryLogs

Get deployment logs
GET/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/history/logs
ModelsExpand Collapse
LogGetResponse { data, includes_container_logs, total }
data: array of { line, ts }
line: string
ts: string
includes_container_logs: boolean
total: number

ProjectsDomains

Get domains
GET/accounts/{account_id}/pages/projects/{project_name}/domains
Get domain
GET/accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}
Add domain
POST/accounts/{account_id}/pages/projects/{project_name}/domains
Patch domain
PATCH/accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}
Delete domain
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" or "lets_encrypt"
One of the following:
"google"
"lets_encrypt"
created_on: string
domain_id: string
name: string

The domain name.

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

The domain name.

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

The domain name.

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

The domain name.

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