Skip to content
Start here

Create project

client.Pages.Projects.New(ctx, params) (*ProjectNewResponse, error)
POST/accounts/{account_id}/pages/projects

Create a new project.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
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)
Pages Write
ParametersExpand Collapse
params ProjectNewParams
AccountID param.Field[string]

Path param: Identifier.

maxLength32
Name param.Field[string]

Body param: Name of the project.

ProductionBranch param.Field[string]

Body param: Production branch of the project. Used to identify production deployments.

BuildConfig param.Field[ProjectNewParamsBuildConfig]Optional

Body param: Configs for the project build process.

BuildCaching boolOptional

Enable build caching for the project.

BuildCommand stringOptional

Command used to build project.

DestinationDir stringOptional

Output directory of the build.

RootDir stringOptional

Directory to run the command.

WebAnalyticsTag stringOptional

The classifying tag for analytics.

WebAnalyticsToken stringOptional

The auth token for analytics.

DeploymentConfigs param.Field[ProjectNewParamsDeploymentConfigs]Optional

Body param: Configs for deployments in a project.

Preview ProjectNewParamsDeploymentConfigsPreviewOptional

Configs for preview deploys.

AIBindings map[string, ProjectNewParamsDeploymentConfigsPreviewAIBindings]Optional

Constellation bindings used for Pages Functions.

ProjectID string
AlwaysUseLatestCompatibilityDate boolOptional

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

AnalyticsEngineDatasets map[string, ProjectNewParamsDeploymentConfigsPreviewAnalyticsEngineDatasets]Optional

Analytics Engine bindings used for Pages Functions.

Dataset string

Name of the dataset.

Browsers map[string, ProjectNewParamsDeploymentConfigsPreviewBrowsers]Optional

Browser bindings used for Pages Functions.

BuildImageMajorVersion int64Optional

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

CompatibilityDate stringOptional

Compatibility date used for Pages Functions.

CompatibilityFlags []stringOptional

Compatibility flags used for Pages Functions.

D1Databases map[string, ProjectNewParamsDeploymentConfigsPreviewD1Databases]Optional

D1 databases used for Pages Functions.

ID string

UUID of the D1 database.

DurableObjectNamespaces map[string, ProjectNewParamsDeploymentConfigsPreviewDurableObjectNamespaces]Optional

Durable Object namespaces used for Pages Functions.

NamespaceID string

ID of the Durable Object namespace.

EnvVars map[string, ProjectNewParamsDeploymentConfigsPreviewEnvVars]Optional

Environment variables used for builds and Pages Functions.

One of the following:
type ProjectNewParamsDeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar struct{…}

A plaintext environment variable.

Type ProjectNewParamsDeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVarType
Value string

Environment variable value.

type ProjectNewParamsDeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar struct{…}

An encrypted environment variable.

Type ProjectNewParamsDeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVarType
Value string

Secret value.

FailOpen boolOptional

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

HyperdriveBindings map[string, ProjectNewParamsDeploymentConfigsPreviewHyperdriveBindings]Optional

Hyperdrive bindings used for Pages Functions.

ID string
KVNamespaces map[string, ProjectNewParamsDeploymentConfigsPreviewKVNamespaces]Optional

KV namespaces used for Pages Functions.

NamespaceID string

ID of the KV namespace.

Limits ProjectNewParamsDeploymentConfigsPreviewLimitsOptional

Limits for Pages Functions.

CPUMs int64

CPU time limit in milliseconds.

MTLSCertificates map[string, ProjectNewParamsDeploymentConfigsPreviewMTLSCertificates]Optional

mTLS bindings used for Pages Functions.

CertificateID string
Placement ProjectNewParamsDeploymentConfigsPreviewPlacementOptional

Placement setting used for Pages Functions.

Mode string

Placement mode.

QueueProducers map[string, ProjectNewParamsDeploymentConfigsPreviewQueueProducers]Optional

Queue Producer bindings used for Pages Functions.

Name string

Name of the Queue.

R2Buckets map[string, ProjectNewParamsDeploymentConfigsPreviewR2Buckets]Optional

R2 buckets used for Pages Functions.

Name string

Name of the R2 bucket.

Jurisdiction stringOptional

Jurisdiction of the R2 bucket.

Services map[string, ProjectNewParamsDeploymentConfigsPreviewServices]Optional

Services used for Pages Functions.

Service string

The Service name.

Entrypoint stringOptional

The entrypoint to bind to.

Environment stringOptional

The Service environment.

DeprecatedUsageModel ProjectNewParamsDeploymentConfigsPreviewUsageModelOptional
All new projects now use the Standard usage model.

The usage model for Pages Functions.

One of the following:
const ProjectNewParamsDeploymentConfigsPreviewUsageModelStandard ProjectNewParamsDeploymentConfigsPreviewUsageModel = "standard"
const ProjectNewParamsDeploymentConfigsPreviewUsageModelBundled ProjectNewParamsDeploymentConfigsPreviewUsageModel = "bundled"
const ProjectNewParamsDeploymentConfigsPreviewUsageModelUnbound ProjectNewParamsDeploymentConfigsPreviewUsageModel = "unbound"
VectorizeBindings map[string, ProjectNewParamsDeploymentConfigsPreviewVectorizeBindings]Optional

Vectorize bindings used for Pages Functions.

IndexName string
WranglerConfigHash stringOptional

Hash of the Wrangler configuration used for the deployment.

Production ProjectNewParamsDeploymentConfigsProductionOptional

Configs for production deploys.

AIBindings map[string, ProjectNewParamsDeploymentConfigsProductionAIBindings]Optional

Constellation bindings used for Pages Functions.

ProjectID string
AlwaysUseLatestCompatibilityDate boolOptional

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

AnalyticsEngineDatasets map[string, ProjectNewParamsDeploymentConfigsProductionAnalyticsEngineDatasets]Optional

Analytics Engine bindings used for Pages Functions.

Dataset string

Name of the dataset.

Browsers map[string, ProjectNewParamsDeploymentConfigsProductionBrowsers]Optional

Browser bindings used for Pages Functions.

BuildImageMajorVersion int64Optional

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

CompatibilityDate stringOptional

Compatibility date used for Pages Functions.

CompatibilityFlags []stringOptional

Compatibility flags used for Pages Functions.

D1Databases map[string, ProjectNewParamsDeploymentConfigsProductionD1Databases]Optional

D1 databases used for Pages Functions.

ID string

UUID of the D1 database.

DurableObjectNamespaces map[string, ProjectNewParamsDeploymentConfigsProductionDurableObjectNamespaces]Optional

Durable Object namespaces used for Pages Functions.

NamespaceID string

ID of the Durable Object namespace.

EnvVars map[string, ProjectNewParamsDeploymentConfigsProductionEnvVars]Optional

Environment variables used for builds and Pages Functions.

One of the following:
type ProjectNewParamsDeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar struct{…}

A plaintext environment variable.

Type ProjectNewParamsDeploymentConfigsProductionEnvVarsPagesPlainTextEnvVarType
Value string

Environment variable value.

type ProjectNewParamsDeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar struct{…}

An encrypted environment variable.

Type ProjectNewParamsDeploymentConfigsProductionEnvVarsPagesSecretTextEnvVarType
Value string

Secret value.

FailOpen boolOptional

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

HyperdriveBindings map[string, ProjectNewParamsDeploymentConfigsProductionHyperdriveBindings]Optional

Hyperdrive bindings used for Pages Functions.

ID string
KVNamespaces map[string, ProjectNewParamsDeploymentConfigsProductionKVNamespaces]Optional

KV namespaces used for Pages Functions.

NamespaceID string

ID of the KV namespace.

Limits ProjectNewParamsDeploymentConfigsProductionLimitsOptional

Limits for Pages Functions.

CPUMs int64

CPU time limit in milliseconds.

MTLSCertificates map[string, ProjectNewParamsDeploymentConfigsProductionMTLSCertificates]Optional

mTLS bindings used for Pages Functions.

CertificateID string
Placement ProjectNewParamsDeploymentConfigsProductionPlacementOptional

Placement setting used for Pages Functions.

Mode string

Placement mode.

QueueProducers map[string, ProjectNewParamsDeploymentConfigsProductionQueueProducers]Optional

Queue Producer bindings used for Pages Functions.

Name string

Name of the Queue.

R2Buckets map[string, ProjectNewParamsDeploymentConfigsProductionR2Buckets]Optional

R2 buckets used for Pages Functions.

Name string

Name of the R2 bucket.

Jurisdiction stringOptional

Jurisdiction of the R2 bucket.

Services map[string, ProjectNewParamsDeploymentConfigsProductionServices]Optional

Services used for Pages Functions.

Service string

The Service name.

Entrypoint stringOptional

The entrypoint to bind to.

Environment stringOptional

The Service environment.

DeprecatedUsageModel ProjectNewParamsDeploymentConfigsProductionUsageModelOptional
All new projects now use the Standard usage model.

The usage model for Pages Functions.

One of the following:
const ProjectNewParamsDeploymentConfigsProductionUsageModelStandard ProjectNewParamsDeploymentConfigsProductionUsageModel = "standard"
const ProjectNewParamsDeploymentConfigsProductionUsageModelBundled ProjectNewParamsDeploymentConfigsProductionUsageModel = "bundled"
const ProjectNewParamsDeploymentConfigsProductionUsageModelUnbound ProjectNewParamsDeploymentConfigsProductionUsageModel = "unbound"
VectorizeBindings map[string, ProjectNewParamsDeploymentConfigsProductionVectorizeBindings]Optional

Vectorize bindings used for Pages Functions.

IndexName string
WranglerConfigHash stringOptional

Hash of the Wrangler configuration used for the deployment.

Source param.Field[ProjectNewParamsSource]Optional

Body param: Configs for the project source control.

Config ProjectNewParamsSourceConfig
DeprecatedDeploymentsEnabled boolOptional
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 stringOptional

The owner of the repository.

OwnerID stringOptional

The owner ID of the repository.

PathExcludes []stringOptional

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

PathIncludes []stringOptional

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

PrCommentsEnabled boolOptional

Whether to enable PR comments.

PreviewBranchExcludes []stringOptional

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.

PreviewBranchIncludes []stringOptional

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

PreviewDeploymentSetting ProjectNewParamsSourceConfigPreviewDeploymentSettingOptional

Controls whether commits to preview branches trigger a preview deployment.

One of the following:
const ProjectNewParamsSourceConfigPreviewDeploymentSettingAll ProjectNewParamsSourceConfigPreviewDeploymentSetting = "all"
const ProjectNewParamsSourceConfigPreviewDeploymentSettingNone ProjectNewParamsSourceConfigPreviewDeploymentSetting = "none"
const ProjectNewParamsSourceConfigPreviewDeploymentSettingCustom ProjectNewParamsSourceConfigPreviewDeploymentSetting = "custom"
ProductionBranch stringOptional

The production branch of the repository.

ProductionDeploymentsEnabled boolOptional

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

RepoID stringOptional

The ID of the repository.

RepoName stringOptional

The name of the repository.

Type ProjectNewParamsSourceType

The source control management provider.

One of the following:
const ProjectNewParamsSourceTypeGitHub ProjectNewParamsSourceType = "github"
const ProjectNewParamsSourceTypeGitlab ProjectNewParamsSourceType = "gitlab"
ReturnsExpand Collapse
type ProjectNewResponse struct{…}
ID string

ID of the project.

CanonicalDeployment ProjectNewResponseCanonicalDeployment

Most recent production deployment of the project.

ID string

Id of the deployment.

Aliases []string

A list of alias URLs pointing to this deployment.

BuildConfig ProjectNewResponseCanonicalDeploymentBuildConfig

Configs for the project build process.

WebAnalyticsTag string

The classifying tag for analytics.

WebAnalyticsToken string

The auth token for analytics.

BuildCaching boolOptional

Enable build caching for the project.

BuildCommand stringOptional

Command used to build project.

DestinationDir stringOptional

Assets output directory of the build.

RootDir stringOptional

Directory to run the command.

CreatedOn Time

When the deployment was created.

formatdate-time
DeploymentTrigger ProjectNewResponseCanonicalDeploymentDeploymentTrigger

Info about what caused the deployment.

Metadata ProjectNewResponseCanonicalDeploymentDeploymentTriggerMetadata

Additional info about the trigger.

Branch string

Where the trigger happened.

CommitDirty bool

Whether the deployment trigger commit was dirty.

CommitHash string

Hash of the deployment trigger commit.

CommitMessage string

Message of the deployment trigger commit.

Type ProjectNewResponseCanonicalDeploymentDeploymentTriggerType

What caused the deployment.

One of the following:
const ProjectNewResponseCanonicalDeploymentDeploymentTriggerTypeGitHubPush ProjectNewResponseCanonicalDeploymentDeploymentTriggerType = "github:push"
const ProjectNewResponseCanonicalDeploymentDeploymentTriggerTypeADHoc ProjectNewResponseCanonicalDeploymentDeploymentTriggerType = "ad_hoc"
const ProjectNewResponseCanonicalDeploymentDeploymentTriggerTypeDeployHook ProjectNewResponseCanonicalDeploymentDeploymentTriggerType = "deploy_hook"
EnvVars map[string, ProjectNewResponseCanonicalDeploymentEnvVar]

Environment variables used for builds and Pages Functions.

One of the following:
type ProjectNewResponseCanonicalDeploymentEnvVarsPagesPlainTextEnvVar struct{…}

A plaintext environment variable.

Type ProjectNewResponseCanonicalDeploymentEnvVarsPagesPlainTextEnvVarType
Value string

Environment variable value.

type ProjectNewResponseCanonicalDeploymentEnvVarsPagesSecretTextEnvVar struct{…}

An encrypted environment variable.

Type ProjectNewResponseCanonicalDeploymentEnvVarsPagesSecretTextEnvVarType
Value string

Secret value.

Environment ProjectNewResponseCanonicalDeploymentEnvironment

Type of deploy.

One of the following:
const ProjectNewResponseCanonicalDeploymentEnvironmentPreview ProjectNewResponseCanonicalDeploymentEnvironment = "preview"
const ProjectNewResponseCanonicalDeploymentEnvironmentProduction ProjectNewResponseCanonicalDeploymentEnvironment = "production"
IsSkipped bool

If the deployment has been skipped.

LatestStage Stage

The status of the deployment.

EndedOn Time

When the stage ended.

formatdate-time
Name StageName

The current build stage.

One of the following:
const StageNameQueued StageName = "queued"
const StageNameInitialize StageName = "initialize"
const StageNameCloneRepo StageName = "clone_repo"
const StageNameBuild StageName = "build"
const StageNameDeploy StageName = "deploy"
StartedOn Time

When the stage started.

formatdate-time
Status StageStatus

State of the current stage.

One of the following:
const StageStatusSuccess StageStatus = "success"
const StageStatusIdle StageStatus = "idle"
const StageStatusActive StageStatus = "active"
const StageStatusFailure StageStatus = "failure"
const StageStatusCanceled StageStatus = "canceled"
ModifiedOn Time

When the deployment was last modified.

formatdate-time
ProjectID string

Id of the project.

ProjectName string

Name of the project.

ShortID string

Short Id (8 character) of the deployment.

Source ProjectNewResponseCanonicalDeploymentSource

Configs for the project source control.

Config ProjectNewResponseCanonicalDeploymentSourceConfig
DeprecatedDeploymentsEnabled 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 string

The owner of the repository.

OwnerID string

The owner ID of the repository.

PathExcludes []string

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

PathIncludes []string

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

PrCommentsEnabled bool

Whether to enable PR comments.

PreviewBranchExcludes []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.

PreviewBranchIncludes []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.

PreviewDeploymentSetting ProjectNewResponseCanonicalDeploymentSourceConfigPreviewDeploymentSetting

Controls whether commits to preview branches trigger a preview deployment.

One of the following:
const ProjectNewResponseCanonicalDeploymentSourceConfigPreviewDeploymentSettingAll ProjectNewResponseCanonicalDeploymentSourceConfigPreviewDeploymentSetting = "all"
const ProjectNewResponseCanonicalDeploymentSourceConfigPreviewDeploymentSettingNone ProjectNewResponseCanonicalDeploymentSourceConfigPreviewDeploymentSetting = "none"
const ProjectNewResponseCanonicalDeploymentSourceConfigPreviewDeploymentSettingCustom ProjectNewResponseCanonicalDeploymentSourceConfigPreviewDeploymentSetting = "custom"
ProductionBranch string

The production branch of the repository.

ProductionDeploymentsEnabled bool

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

RepoID string

The ID of the repository.

RepoName string

The name of the repository.

Type ProjectNewResponseCanonicalDeploymentSourceType

The source control management provider.

One of the following:
const ProjectNewResponseCanonicalDeploymentSourceTypeGitHub ProjectNewResponseCanonicalDeploymentSourceType = "github"
const ProjectNewResponseCanonicalDeploymentSourceTypeGitlab ProjectNewResponseCanonicalDeploymentSourceType = "gitlab"
Stages []Stage

List of past stages.

EndedOn Time

When the stage ended.

formatdate-time
Name StageName

The current build stage.

One of the following:
const StageNameQueued StageName = "queued"
const StageNameInitialize StageName = "initialize"
const StageNameCloneRepo StageName = "clone_repo"
const StageNameBuild StageName = "build"
const StageNameDeploy StageName = "deploy"
StartedOn Time

When the stage started.

formatdate-time
Status StageStatus

State of the current stage.

One of the following:
const StageStatusSuccess StageStatus = "success"
const StageStatusIdle StageStatus = "idle"
const StageStatusActive StageStatus = "active"
const StageStatusFailure StageStatus = "failure"
const StageStatusCanceled StageStatus = "canceled"
URL string

The live URL to view this deployment.

UsesFunctions boolOptional

Whether the deployment uses functions.

CreatedOn Time

When the project was created.

formatdate-time
DeploymentConfigs ProjectNewResponseDeploymentConfigs

Configs for deployments in a project.

Preview ProjectNewResponseDeploymentConfigsPreview

Configs for preview deploys.

AlwaysUseLatestCompatibilityDate bool

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

BuildImageMajorVersion int64

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

CompatibilityDate string

Compatibility date used for Pages Functions.

CompatibilityFlags []string

Compatibility flags used for Pages Functions.

EnvVars map[string, ProjectNewResponseDeploymentConfigsPreviewEnvVar]

Environment variables used for builds and Pages Functions.

One of the following:
type ProjectNewResponseDeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar struct{…}

A plaintext environment variable.

Type ProjectNewResponseDeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVarType
Value string

Environment variable value.

type ProjectNewResponseDeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar struct{…}

An encrypted environment variable.

Type ProjectNewResponseDeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVarType
Value string

Secret value.

FailOpen bool

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

DeprecatedUsageModel ProjectNewResponseDeploymentConfigsPreviewUsageModel
All new projects now use the Standard usage model.

The usage model for Pages Functions.

One of the following:
const ProjectNewResponseDeploymentConfigsPreviewUsageModelStandard ProjectNewResponseDeploymentConfigsPreviewUsageModel = "standard"
const ProjectNewResponseDeploymentConfigsPreviewUsageModelBundled ProjectNewResponseDeploymentConfigsPreviewUsageModel = "bundled"
const ProjectNewResponseDeploymentConfigsPreviewUsageModelUnbound ProjectNewResponseDeploymentConfigsPreviewUsageModel = "unbound"
AIBindings map[string, ProjectNewResponseDeploymentConfigsPreviewAIBinding]Optional

Constellation bindings used for Pages Functions.

ProjectID string
AnalyticsEngineDatasets map[string, ProjectNewResponseDeploymentConfigsPreviewAnalyticsEngineDataset]Optional

Analytics Engine bindings used for Pages Functions.

Dataset string

Name of the dataset.

Browsers map[string, ProjectNewResponseDeploymentConfigsPreviewBrowser]Optional

Browser bindings used for Pages Functions.

D1Databases map[string, ProjectNewResponseDeploymentConfigsPreviewD1Database]Optional

D1 databases used for Pages Functions.

ID string

UUID of the D1 database.

DurableObjectNamespaces map[string, ProjectNewResponseDeploymentConfigsPreviewDurableObjectNamespace]Optional

Durable Object namespaces used for Pages Functions.

NamespaceID string

ID of the Durable Object namespace.

HyperdriveBindings map[string, ProjectNewResponseDeploymentConfigsPreviewHyperdriveBinding]Optional

Hyperdrive bindings used for Pages Functions.

ID string
KVNamespaces map[string, ProjectNewResponseDeploymentConfigsPreviewKVNamespace]Optional

KV namespaces used for Pages Functions.

NamespaceID string

ID of the KV namespace.

Limits ProjectNewResponseDeploymentConfigsPreviewLimitsOptional

Limits for Pages Functions.

CPUMs int64

CPU time limit in milliseconds.

MTLSCertificates map[string, ProjectNewResponseDeploymentConfigsPreviewMTLSCertificate]Optional

mTLS bindings used for Pages Functions.

CertificateID string
Placement ProjectNewResponseDeploymentConfigsPreviewPlacementOptional

Placement setting used for Pages Functions.

Mode string

Placement mode.

QueueProducers map[string, ProjectNewResponseDeploymentConfigsPreviewQueueProducer]Optional

Queue Producer bindings used for Pages Functions.

Name string

Name of the Queue.

R2Buckets map[string, ProjectNewResponseDeploymentConfigsPreviewR2Bucket]Optional

R2 buckets used for Pages Functions.

Name string

Name of the R2 bucket.

Jurisdiction stringOptional

Jurisdiction of the R2 bucket.

Services map[string, ProjectNewResponseDeploymentConfigsPreviewService]Optional

Services used for Pages Functions.

Environment string

The Service environment.

Service string

The Service name.

Entrypoint stringOptional

The entrypoint to bind to.

VectorizeBindings map[string, ProjectNewResponseDeploymentConfigsPreviewVectorizeBinding]Optional

Vectorize bindings used for Pages Functions.

IndexName string
WranglerConfigHash stringOptional

Hash of the Wrangler configuration used for the deployment.

Production ProjectNewResponseDeploymentConfigsProduction

Configs for production deploys.

AlwaysUseLatestCompatibilityDate bool

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

BuildImageMajorVersion int64

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

CompatibilityDate string

Compatibility date used for Pages Functions.

CompatibilityFlags []string

Compatibility flags used for Pages Functions.

EnvVars map[string, ProjectNewResponseDeploymentConfigsProductionEnvVar]

Environment variables used for builds and Pages Functions.

One of the following:
type ProjectNewResponseDeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar struct{…}

A plaintext environment variable.

Type ProjectNewResponseDeploymentConfigsProductionEnvVarsPagesPlainTextEnvVarType
Value string

Environment variable value.

type ProjectNewResponseDeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar struct{…}

An encrypted environment variable.

Type ProjectNewResponseDeploymentConfigsProductionEnvVarsPagesSecretTextEnvVarType
Value string

Secret value.

FailOpen bool

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

DeprecatedUsageModel ProjectNewResponseDeploymentConfigsProductionUsageModel
All new projects now use the Standard usage model.

The usage model for Pages Functions.

One of the following:
const ProjectNewResponseDeploymentConfigsProductionUsageModelStandard ProjectNewResponseDeploymentConfigsProductionUsageModel = "standard"
const ProjectNewResponseDeploymentConfigsProductionUsageModelBundled ProjectNewResponseDeploymentConfigsProductionUsageModel = "bundled"
const ProjectNewResponseDeploymentConfigsProductionUsageModelUnbound ProjectNewResponseDeploymentConfigsProductionUsageModel = "unbound"
AIBindings map[string, ProjectNewResponseDeploymentConfigsProductionAIBinding]Optional

Constellation bindings used for Pages Functions.

ProjectID string
AnalyticsEngineDatasets map[string, ProjectNewResponseDeploymentConfigsProductionAnalyticsEngineDataset]Optional

Analytics Engine bindings used for Pages Functions.

Dataset string

Name of the dataset.

Browsers map[string, ProjectNewResponseDeploymentConfigsProductionBrowser]Optional

Browser bindings used for Pages Functions.

D1Databases map[string, ProjectNewResponseDeploymentConfigsProductionD1Database]Optional

D1 databases used for Pages Functions.

ID string

UUID of the D1 database.

DurableObjectNamespaces map[string, ProjectNewResponseDeploymentConfigsProductionDurableObjectNamespace]Optional

Durable Object namespaces used for Pages Functions.

NamespaceID string

ID of the Durable Object namespace.

HyperdriveBindings map[string, ProjectNewResponseDeploymentConfigsProductionHyperdriveBinding]Optional

Hyperdrive bindings used for Pages Functions.

ID string
KVNamespaces map[string, ProjectNewResponseDeploymentConfigsProductionKVNamespace]Optional

KV namespaces used for Pages Functions.

NamespaceID string

ID of the KV namespace.

Limits ProjectNewResponseDeploymentConfigsProductionLimitsOptional

Limits for Pages Functions.

CPUMs int64

CPU time limit in milliseconds.

MTLSCertificates map[string, ProjectNewResponseDeploymentConfigsProductionMTLSCertificate]Optional

mTLS bindings used for Pages Functions.

CertificateID string
Placement ProjectNewResponseDeploymentConfigsProductionPlacementOptional

Placement setting used for Pages Functions.

Mode string

Placement mode.

QueueProducers map[string, ProjectNewResponseDeploymentConfigsProductionQueueProducer]Optional

Queue Producer bindings used for Pages Functions.

Name string

Name of the Queue.

R2Buckets map[string, ProjectNewResponseDeploymentConfigsProductionR2Bucket]Optional

R2 buckets used for Pages Functions.

Name string

Name of the R2 bucket.

Jurisdiction stringOptional

Jurisdiction of the R2 bucket.

Services map[string, ProjectNewResponseDeploymentConfigsProductionService]Optional

Services used for Pages Functions.

Environment string

The Service environment.

Service string

The Service name.

Entrypoint stringOptional

The entrypoint to bind to.

VectorizeBindings map[string, ProjectNewResponseDeploymentConfigsProductionVectorizeBinding]Optional

Vectorize bindings used for Pages Functions.

IndexName string
WranglerConfigHash stringOptional

Hash of the Wrangler configuration used for the deployment.

Framework string

Framework the project is using.

FrameworkVersion string

Version of the framework the project is using.

LatestDeployment ProjectNewResponseLatestDeployment

Most recent deployment of the project.

ID string

Id of the deployment.

Aliases []string

A list of alias URLs pointing to this deployment.

BuildConfig ProjectNewResponseLatestDeploymentBuildConfig

Configs for the project build process.

WebAnalyticsTag string

The classifying tag for analytics.

WebAnalyticsToken string

The auth token for analytics.

BuildCaching boolOptional

Enable build caching for the project.

BuildCommand stringOptional

Command used to build project.

DestinationDir stringOptional

Assets output directory of the build.

RootDir stringOptional

Directory to run the command.

CreatedOn Time

When the deployment was created.

formatdate-time
DeploymentTrigger ProjectNewResponseLatestDeploymentDeploymentTrigger

Info about what caused the deployment.

Metadata ProjectNewResponseLatestDeploymentDeploymentTriggerMetadata

Additional info about the trigger.

Branch string

Where the trigger happened.

CommitDirty bool

Whether the deployment trigger commit was dirty.

CommitHash string

Hash of the deployment trigger commit.

CommitMessage string

Message of the deployment trigger commit.

Type ProjectNewResponseLatestDeploymentDeploymentTriggerType

What caused the deployment.

One of the following:
const ProjectNewResponseLatestDeploymentDeploymentTriggerTypeGitHubPush ProjectNewResponseLatestDeploymentDeploymentTriggerType = "github:push"
const ProjectNewResponseLatestDeploymentDeploymentTriggerTypeADHoc ProjectNewResponseLatestDeploymentDeploymentTriggerType = "ad_hoc"
const ProjectNewResponseLatestDeploymentDeploymentTriggerTypeDeployHook ProjectNewResponseLatestDeploymentDeploymentTriggerType = "deploy_hook"
EnvVars map[string, ProjectNewResponseLatestDeploymentEnvVar]

Environment variables used for builds and Pages Functions.

One of the following:
type ProjectNewResponseLatestDeploymentEnvVarsPagesPlainTextEnvVar struct{…}

A plaintext environment variable.

Type ProjectNewResponseLatestDeploymentEnvVarsPagesPlainTextEnvVarType
Value string

Environment variable value.

type ProjectNewResponseLatestDeploymentEnvVarsPagesSecretTextEnvVar struct{…}

An encrypted environment variable.

Type ProjectNewResponseLatestDeploymentEnvVarsPagesSecretTextEnvVarType
Value string

Secret value.

Environment ProjectNewResponseLatestDeploymentEnvironment

Type of deploy.

One of the following:
const ProjectNewResponseLatestDeploymentEnvironmentPreview ProjectNewResponseLatestDeploymentEnvironment = "preview"
const ProjectNewResponseLatestDeploymentEnvironmentProduction ProjectNewResponseLatestDeploymentEnvironment = "production"
IsSkipped bool

If the deployment has been skipped.

LatestStage Stage

The status of the deployment.

EndedOn Time

When the stage ended.

formatdate-time
Name StageName

The current build stage.

One of the following:
const StageNameQueued StageName = "queued"
const StageNameInitialize StageName = "initialize"
const StageNameCloneRepo StageName = "clone_repo"
const StageNameBuild StageName = "build"
const StageNameDeploy StageName = "deploy"
StartedOn Time

When the stage started.

formatdate-time
Status StageStatus

State of the current stage.

One of the following:
const StageStatusSuccess StageStatus = "success"
const StageStatusIdle StageStatus = "idle"
const StageStatusActive StageStatus = "active"
const StageStatusFailure StageStatus = "failure"
const StageStatusCanceled StageStatus = "canceled"
ModifiedOn Time

When the deployment was last modified.

formatdate-time
ProjectID string

Id of the project.

ProjectName string

Name of the project.

ShortID string

Short Id (8 character) of the deployment.

Source ProjectNewResponseLatestDeploymentSource

Configs for the project source control.

Config ProjectNewResponseLatestDeploymentSourceConfig
DeprecatedDeploymentsEnabled 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 string

The owner of the repository.

OwnerID string

The owner ID of the repository.

PathExcludes []string

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

PathIncludes []string

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

PrCommentsEnabled bool

Whether to enable PR comments.

PreviewBranchExcludes []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.

PreviewBranchIncludes []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.

PreviewDeploymentSetting ProjectNewResponseLatestDeploymentSourceConfigPreviewDeploymentSetting

Controls whether commits to preview branches trigger a preview deployment.

One of the following:
const ProjectNewResponseLatestDeploymentSourceConfigPreviewDeploymentSettingAll ProjectNewResponseLatestDeploymentSourceConfigPreviewDeploymentSetting = "all"
const ProjectNewResponseLatestDeploymentSourceConfigPreviewDeploymentSettingNone ProjectNewResponseLatestDeploymentSourceConfigPreviewDeploymentSetting = "none"
const ProjectNewResponseLatestDeploymentSourceConfigPreviewDeploymentSettingCustom ProjectNewResponseLatestDeploymentSourceConfigPreviewDeploymentSetting = "custom"
ProductionBranch string

The production branch of the repository.

ProductionDeploymentsEnabled bool

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

RepoID string

The ID of the repository.

RepoName string

The name of the repository.

Type ProjectNewResponseLatestDeploymentSourceType

The source control management provider.

One of the following:
const ProjectNewResponseLatestDeploymentSourceTypeGitHub ProjectNewResponseLatestDeploymentSourceType = "github"
const ProjectNewResponseLatestDeploymentSourceTypeGitlab ProjectNewResponseLatestDeploymentSourceType = "gitlab"
Stages []Stage

List of past stages.

EndedOn Time

When the stage ended.

formatdate-time
Name StageName

The current build stage.

One of the following:
const StageNameQueued StageName = "queued"
const StageNameInitialize StageName = "initialize"
const StageNameCloneRepo StageName = "clone_repo"
const StageNameBuild StageName = "build"
const StageNameDeploy StageName = "deploy"
StartedOn Time

When the stage started.

formatdate-time
Status StageStatus

State of the current stage.

One of the following:
const StageStatusSuccess StageStatus = "success"
const StageStatusIdle StageStatus = "idle"
const StageStatusActive StageStatus = "active"
const StageStatusFailure StageStatus = "failure"
const StageStatusCanceled StageStatus = "canceled"
URL string

The live URL to view this deployment.

UsesFunctions boolOptional

Whether the deployment uses functions.

Name string

Name of the project.

PreviewScriptName string

Name of the preview script.

ProductionBranch string

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

ProductionScriptName string

Name of the production script.

UsesFunctions bool

Whether the project uses functions.

BuildConfig ProjectNewResponseBuildConfigOptional

Configs for the project build process.

WebAnalyticsTag string

The classifying tag for analytics.

WebAnalyticsToken string

The auth token for analytics.

BuildCaching boolOptional

Enable build caching for the project.

BuildCommand stringOptional

Command used to build project.

DestinationDir stringOptional

Assets output directory of the build.

RootDir stringOptional

Directory to run the command.

Domains []stringOptional

A list of associated custom domains for the project.

Source ProjectNewResponseSourceOptional

Configs for the project source control.

Config ProjectNewResponseSourceConfig
DeprecatedDeploymentsEnabled 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 string

The owner of the repository.

OwnerID string

The owner ID of the repository.

PathExcludes []string

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

PathIncludes []string

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

PrCommentsEnabled bool

Whether to enable PR comments.

PreviewBranchExcludes []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.

PreviewBranchIncludes []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.

PreviewDeploymentSetting ProjectNewResponseSourceConfigPreviewDeploymentSetting

Controls whether commits to preview branches trigger a preview deployment.

One of the following:
const ProjectNewResponseSourceConfigPreviewDeploymentSettingAll ProjectNewResponseSourceConfigPreviewDeploymentSetting = "all"
const ProjectNewResponseSourceConfigPreviewDeploymentSettingNone ProjectNewResponseSourceConfigPreviewDeploymentSetting = "none"
const ProjectNewResponseSourceConfigPreviewDeploymentSettingCustom ProjectNewResponseSourceConfigPreviewDeploymentSetting = "custom"
ProductionBranch string

The production branch of the repository.

ProductionDeploymentsEnabled bool

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

RepoID string

The ID of the repository.

RepoName string

The name of the repository.

Type ProjectNewResponseSourceType

The source control management provider.

One of the following:
const ProjectNewResponseSourceTypeGitHub ProjectNewResponseSourceType = "github"
const ProjectNewResponseSourceTypeGitlab ProjectNewResponseSourceType = "gitlab"
Subdomain stringOptional

The Cloudflare subdomain associated with the project.

Create project

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  project, err := client.Pages.Projects.New(context.TODO(), pages.ProjectNewParams{
    AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    Name: cloudflare.F("my-pages-app"),
    ProductionBranch: cloudflare.F("main"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", project.ID)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "id": "7b162ea7-7367-4d67-bcde-1160995d5",
    "canonical_deployment": {
      "id": "f64788e9-fccd-4d4a-a28a-cb84f88f6",
      "aliases": [
        "https://branchname.projectname.pages.dev"
      ],
      "build_config": {
        "web_analytics_tag": "cee1c73f6e4743d0b5e6bb1a0bcaabcc",
        "web_analytics_token": "021e1057c18547eca7b79f2516f06o7x",
        "build_caching": true,
        "build_command": "npm run build",
        "destination_dir": "build",
        "root_dir": "/"
      },
      "created_on": "2021-03-09T00:55:03.923456Z",
      "deployment_trigger": {
        "metadata": {
          "branch": "main",
          "commit_dirty": false,
          "commit_hash": "ad9ccd918a81025731e10e40267e11273a263421",
          "commit_message": "Update index.html"
        },
        "type": "ad_hoc"
      },
      "env_vars": {
        "foo": {
          "type": "plain_text",
          "value": "hello world"
        }
      },
      "environment": "preview",
      "is_skipped": true,
      "latest_stage": {
        "ended_on": "2021-03-09T00:58:59.045655Z",
        "name": "deploy",
        "started_on": "2021-03-09T00:55:03.923456Z",
        "status": "success"
      },
      "modified_on": "2021-03-09T00:58:59.045655Z",
      "project_id": "7b162ea7-7367-4d67-bcde-1160995d5",
      "project_name": "this-is-my-project-01",
      "short_id": "f64788e9",
      "source": {
        "config": {
          "deployments_enabled": true,
          "owner": "my-org",
          "owner_id": "12345678",
          "path_excludes": [
            "string"
          ],
          "path_includes": [
            "string"
          ],
          "pr_comments_enabled": true,
          "preview_branch_excludes": [
            "string"
          ],
          "preview_branch_includes": [
            "string"
          ],
          "preview_deployment_setting": "all",
          "production_branch": "main",
          "production_deployments_enabled": true,
          "repo_id": "12345678",
          "repo_name": "my-repo"
        },
        "type": "github"
      },
      "stages": [
        {
          "ended_on": "2021-06-03T15:39:03.134378Z",
          "name": "queued",
          "started_on": "2021-06-03T15:38:15.608194Z",
          "status": "active"
        },
        {
          "ended_on": null,
          "name": "initialize",
          "started_on": null,
          "status": "idle"
        },
        {
          "ended_on": null,
          "name": "clone_repo",
          "started_on": null,
          "status": "idle"
        },
        {
          "ended_on": null,
          "name": "build",
          "started_on": null,
          "status": "idle"
        },
        {
          "ended_on": null,
          "name": "deploy",
          "started_on": null,
          "status": "idle"
        }
      ],
      "url": "https://f64788e9.ninjakittens.pages.dev",
      "uses_functions": true
    },
    "created_on": "2017-01-01T00:00:00Z",
    "deployment_configs": {
      "preview": {
        "always_use_latest_compatibility_date": false,
        "build_image_major_version": 3,
        "compatibility_date": "2025-01-01",
        "compatibility_flags": [
          "url_standard"
        ],
        "env_vars": {
          "foo": {
            "type": "plain_text",
            "value": "hello world"
          }
        },
        "fail_open": true,
        "usage_model": "standard",
        "ai_bindings": {
          "AI_BINDING": {
            "project_id": "some-project-id"
          }
        },
        "analytics_engine_datasets": {
          "ANALYTICS_ENGINE_BINDING": {
            "dataset": "api_analytics"
          }
        },
        "browsers": {
          "BROWSER": {}
        },
        "d1_databases": {
          "D1_BINDING": {
            "id": "445e2955-951a-43f8-a35b-a4d0c8138f63"
          }
        },
        "durable_object_namespaces": {
          "DO_BINDING": {
            "namespace_id": "5eb63bbbe01eeed093cb22bb8f5acdc3"
          }
        },
        "hyperdrive_bindings": {
          "HYPERDRIVE": {
            "id": "a76a99bc342644deb02c38d66082262a"
          }
        },
        "kv_namespaces": {
          "KV_BINDING": {
            "namespace_id": "5eb63bbbe01eeed093cb22bb8f5acdc3"
          }
        },
        "limits": {
          "cpu_ms": 100
        },
        "mtls_certificates": {
          "MTLS": {
            "certificate_id": "d7cdd17c-916f-4cb7-aabe-585eb382ec4e"
          }
        },
        "placement": {
          "mode": "smart"
        },
        "queue_producers": {
          "QUEUE_PRODUCER_BINDING": {
            "name": "some-queue"
          }
        },
        "r2_buckets": {
          "R2_BINDING": {
            "name": "some-bucket",
            "jurisdiction": "eu"
          }
        },
        "services": {
          "SERVICE_BINDING": {
            "environment": "production",
            "service": "example-worker",
            "entrypoint": "MyHandler"
          }
        },
        "vectorize_bindings": {
          "VECTORIZE": {
            "index_name": "my_index"
          }
        },
        "wrangler_config_hash": "abc123def456"
      },
      "production": {
        "always_use_latest_compatibility_date": false,
        "build_image_major_version": 3,
        "compatibility_date": "2025-01-01",
        "compatibility_flags": [
          "url_standard"
        ],
        "env_vars": {
          "foo": {
            "type": "plain_text",
            "value": "hello world"
          }
        },
        "fail_open": true,
        "usage_model": "standard",
        "ai_bindings": {
          "AI_BINDING": {
            "project_id": "some-project-id"
          }
        },
        "analytics_engine_datasets": {
          "ANALYTICS_ENGINE_BINDING": {
            "dataset": "api_analytics"
          }
        },
        "browsers": {
          "BROWSER": {}
        },
        "d1_databases": {
          "D1_BINDING": {
            "id": "445e2955-951a-43f8-a35b-a4d0c8138f63"
          }
        },
        "durable_object_namespaces": {
          "DO_BINDING": {
            "namespace_id": "5eb63bbbe01eeed093cb22bb8f5acdc3"
          }
        },
        "hyperdrive_bindings": {
          "HYPERDRIVE": {
            "id": "a76a99bc342644deb02c38d66082262a"
          }
        },
        "kv_namespaces": {
          "KV_BINDING": {
            "namespace_id": "5eb63bbbe01eeed093cb22bb8f5acdc3"
          }
        },
        "limits": {
          "cpu_ms": 100
        },
        "mtls_certificates": {
          "MTLS": {
            "certificate_id": "d7cdd17c-916f-4cb7-aabe-585eb382ec4e"
          }
        },
        "placement": {
          "mode": "smart"
        },
        "queue_producers": {
          "QUEUE_PRODUCER_BINDING": {
            "name": "some-queue"
          }
        },
        "r2_buckets": {
          "R2_BINDING": {
            "name": "some-bucket",
            "jurisdiction": "eu"
          }
        },
        "services": {
          "SERVICE_BINDING": {
            "environment": "production",
            "service": "example-worker",
            "entrypoint": "MyHandler"
          }
        },
        "vectorize_bindings": {
          "VECTORIZE": {
            "index_name": "my_index"
          }
        },
        "wrangler_config_hash": "abc123def456"
      }
    },
    "framework": "framework",
    "framework_version": "framework_version",
    "latest_deployment": {
      "id": "f64788e9-fccd-4d4a-a28a-cb84f88f6",
      "aliases": [
        "https://branchname.projectname.pages.dev"
      ],
      "build_config": {
        "web_analytics_tag": "cee1c73f6e4743d0b5e6bb1a0bcaabcc",
        "web_analytics_token": "021e1057c18547eca7b79f2516f06o7x",
        "build_caching": true,
        "build_command": "npm run build",
        "destination_dir": "build",
        "root_dir": "/"
      },
      "created_on": "2021-03-09T00:55:03.923456Z",
      "deployment_trigger": {
        "metadata": {
          "branch": "main",
          "commit_dirty": false,
          "commit_hash": "ad9ccd918a81025731e10e40267e11273a263421",
          "commit_message": "Update index.html"
        },
        "type": "ad_hoc"
      },
      "env_vars": {
        "foo": {
          "type": "plain_text",
          "value": "hello world"
        }
      },
      "environment": "preview",
      "is_skipped": true,
      "latest_stage": {
        "ended_on": "2021-03-09T00:58:59.045655Z",
        "name": "deploy",
        "started_on": "2021-03-09T00:55:03.923456Z",
        "status": "success"
      },
      "modified_on": "2021-03-09T00:58:59.045655Z",
      "project_id": "7b162ea7-7367-4d67-bcde-1160995d5",
      "project_name": "this-is-my-project-01",
      "short_id": "f64788e9",
      "source": {
        "config": {
          "deployments_enabled": true,
          "owner": "my-org",
          "owner_id": "12345678",
          "path_excludes": [
            "string"
          ],
          "path_includes": [
            "string"
          ],
          "pr_comments_enabled": true,
          "preview_branch_excludes": [
            "string"
          ],
          "preview_branch_includes": [
            "string"
          ],
          "preview_deployment_setting": "all",
          "production_branch": "main",
          "production_deployments_enabled": true,
          "repo_id": "12345678",
          "repo_name": "my-repo"
        },
        "type": "github"
      },
      "stages": [
        {
          "ended_on": "2021-06-03T15:39:03.134378Z",
          "name": "queued",
          "started_on": "2021-06-03T15:38:15.608194Z",
          "status": "active"
        },
        {
          "ended_on": null,
          "name": "initialize",
          "started_on": null,
          "status": "idle"
        },
        {
          "ended_on": null,
          "name": "clone_repo",
          "started_on": null,
          "status": "idle"
        },
        {
          "ended_on": null,
          "name": "build",
          "started_on": null,
          "status": "idle"
        },
        {
          "ended_on": null,
          "name": "deploy",
          "started_on": null,
          "status": "idle"
        }
      ],
      "url": "https://f64788e9.ninjakittens.pages.dev",
      "uses_functions": true
    },
    "name": "this-is-my-project-01",
    "preview_script_name": "pages-worker--1234567-preview",
    "production_branch": "main",
    "production_script_name": "pages-worker--1234567-production",
    "uses_functions": true,
    "build_config": {
      "web_analytics_tag": "cee1c73f6e4743d0b5e6bb1a0bcaabcc",
      "web_analytics_token": "021e1057c18547eca7b79f2516f06o7x",
      "build_caching": true,
      "build_command": "npm run build",
      "destination_dir": "build",
      "root_dir": "/"
    },
    "domains": [
      "customdomain.com",
      "customdomain.org"
    ],
    "source": {
      "config": {
        "deployments_enabled": true,
        "owner": "my-org",
        "owner_id": "12345678",
        "path_excludes": [
          "string"
        ],
        "path_includes": [
          "string"
        ],
        "pr_comments_enabled": true,
        "preview_branch_excludes": [
          "string"
        ],
        "preview_branch_includes": [
          "string"
        ],
        "preview_deployment_setting": "all",
        "production_branch": "main",
        "production_deployments_enabled": true,
        "repo_id": "12345678",
        "repo_name": "my-repo"
      },
      "type": "github"
    },
    "subdomain": "helloworld.pages.dev"
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "id": "7b162ea7-7367-4d67-bcde-1160995d5",
    "canonical_deployment": {
      "id": "f64788e9-fccd-4d4a-a28a-cb84f88f6",
      "aliases": [
        "https://branchname.projectname.pages.dev"
      ],
      "build_config": {
        "web_analytics_tag": "cee1c73f6e4743d0b5e6bb1a0bcaabcc",
        "web_analytics_token": "021e1057c18547eca7b79f2516f06o7x",
        "build_caching": true,
        "build_command": "npm run build",
        "destination_dir": "build",
        "root_dir": "/"
      },
      "created_on": "2021-03-09T00:55:03.923456Z",
      "deployment_trigger": {
        "metadata": {
          "branch": "main",
          "commit_dirty": false,
          "commit_hash": "ad9ccd918a81025731e10e40267e11273a263421",
          "commit_message": "Update index.html"
        },
        "type": "ad_hoc"
      },
      "env_vars": {
        "foo": {
          "type": "plain_text",
          "value": "hello world"
        }
      },
      "environment": "preview",
      "is_skipped": true,
      "latest_stage": {
        "ended_on": "2021-03-09T00:58:59.045655Z",
        "name": "deploy",
        "started_on": "2021-03-09T00:55:03.923456Z",
        "status": "success"
      },
      "modified_on": "2021-03-09T00:58:59.045655Z",
      "project_id": "7b162ea7-7367-4d67-bcde-1160995d5",
      "project_name": "this-is-my-project-01",
      "short_id": "f64788e9",
      "source": {
        "config": {
          "deployments_enabled": true,
          "owner": "my-org",
          "owner_id": "12345678",
          "path_excludes": [
            "string"
          ],
          "path_includes": [
            "string"
          ],
          "pr_comments_enabled": true,
          "preview_branch_excludes": [
            "string"
          ],
          "preview_branch_includes": [
            "string"
          ],
          "preview_deployment_setting": "all",
          "production_branch": "main",
          "production_deployments_enabled": true,
          "repo_id": "12345678",
          "repo_name": "my-repo"
        },
        "type": "github"
      },
      "stages": [
        {
          "ended_on": "2021-06-03T15:39:03.134378Z",
          "name": "queued",
          "started_on": "2021-06-03T15:38:15.608194Z",
          "status": "active"
        },
        {
          "ended_on": null,
          "name": "initialize",
          "started_on": null,
          "status": "idle"
        },
        {
          "ended_on": null,
          "name": "clone_repo",
          "started_on": null,
          "status": "idle"
        },
        {
          "ended_on": null,
          "name": "build",
          "started_on": null,
          "status": "idle"
        },
        {
          "ended_on": null,
          "name": "deploy",
          "started_on": null,
          "status": "idle"
        }
      ],
      "url": "https://f64788e9.ninjakittens.pages.dev",
      "uses_functions": true
    },
    "created_on": "2017-01-01T00:00:00Z",
    "deployment_configs": {
      "preview": {
        "always_use_latest_compatibility_date": false,
        "build_image_major_version": 3,
        "compatibility_date": "2025-01-01",
        "compatibility_flags": [
          "url_standard"
        ],
        "env_vars": {
          "foo": {
            "type": "plain_text",
            "value": "hello world"
          }
        },
        "fail_open": true,
        "usage_model": "standard",
        "ai_bindings": {
          "AI_BINDING": {
            "project_id": "some-project-id"
          }
        },
        "analytics_engine_datasets": {
          "ANALYTICS_ENGINE_BINDING": {
            "dataset": "api_analytics"
          }
        },
        "browsers": {
          "BROWSER": {}
        },
        "d1_databases": {
          "D1_BINDING": {
            "id": "445e2955-951a-43f8-a35b-a4d0c8138f63"
          }
        },
        "durable_object_namespaces": {
          "DO_BINDING": {
            "namespace_id": "5eb63bbbe01eeed093cb22bb8f5acdc3"
          }
        },
        "hyperdrive_bindings": {
          "HYPERDRIVE": {
            "id": "a76a99bc342644deb02c38d66082262a"
          }
        },
        "kv_namespaces": {
          "KV_BINDING": {
            "namespace_id": "5eb63bbbe01eeed093cb22bb8f5acdc3"
          }
        },
        "limits": {
          "cpu_ms": 100
        },
        "mtls_certificates": {
          "MTLS": {
            "certificate_id": "d7cdd17c-916f-4cb7-aabe-585eb382ec4e"
          }
        },
        "placement": {
          "mode": "smart"
        },
        "queue_producers": {
          "QUEUE_PRODUCER_BINDING": {
            "name": "some-queue"
          }
        },
        "r2_buckets": {
          "R2_BINDING": {
            "name": "some-bucket",
            "jurisdiction": "eu"
          }
        },
        "services": {
          "SERVICE_BINDING": {
            "environment": "production",
            "service": "example-worker",
            "entrypoint": "MyHandler"
          }
        },
        "vectorize_bindings": {
          "VECTORIZE": {
            "index_name": "my_index"
          }
        },
        "wrangler_config_hash": "abc123def456"
      },
      "production": {
        "always_use_latest_compatibility_date": false,
        "build_image_major_version": 3,
        "compatibility_date": "2025-01-01",
        "compatibility_flags": [
          "url_standard"
        ],
        "env_vars": {
          "foo": {
            "type": "plain_text",
            "value": "hello world"
          }
        },
        "fail_open": true,
        "usage_model": "standard",
        "ai_bindings": {
          "AI_BINDING": {
            "project_id": "some-project-id"
          }
        },
        "analytics_engine_datasets": {
          "ANALYTICS_ENGINE_BINDING": {
            "dataset": "api_analytics"
          }
        },
        "browsers": {
          "BROWSER": {}
        },
        "d1_databases": {
          "D1_BINDING": {
            "id": "445e2955-951a-43f8-a35b-a4d0c8138f63"
          }
        },
        "durable_object_namespaces": {
          "DO_BINDING": {
            "namespace_id": "5eb63bbbe01eeed093cb22bb8f5acdc3"
          }
        },
        "hyperdrive_bindings": {
          "HYPERDRIVE": {
            "id": "a76a99bc342644deb02c38d66082262a"
          }
        },
        "kv_namespaces": {
          "KV_BINDING": {
            "namespace_id": "5eb63bbbe01eeed093cb22bb8f5acdc3"
          }
        },
        "limits": {
          "cpu_ms": 100
        },
        "mtls_certificates": {
          "MTLS": {
            "certificate_id": "d7cdd17c-916f-4cb7-aabe-585eb382ec4e"
          }
        },
        "placement": {
          "mode": "smart"
        },
        "queue_producers": {
          "QUEUE_PRODUCER_BINDING": {
            "name": "some-queue"
          }
        },
        "r2_buckets": {
          "R2_BINDING": {
            "name": "some-bucket",
            "jurisdiction": "eu"
          }
        },
        "services": {
          "SERVICE_BINDING": {
            "environment": "production",
            "service": "example-worker",
            "entrypoint": "MyHandler"
          }
        },
        "vectorize_bindings": {
          "VECTORIZE": {
            "index_name": "my_index"
          }
        },
        "wrangler_config_hash": "abc123def456"
      }
    },
    "framework": "framework",
    "framework_version": "framework_version",
    "latest_deployment": {
      "id": "f64788e9-fccd-4d4a-a28a-cb84f88f6",
      "aliases": [
        "https://branchname.projectname.pages.dev"
      ],
      "build_config": {
        "web_analytics_tag": "cee1c73f6e4743d0b5e6bb1a0bcaabcc",
        "web_analytics_token": "021e1057c18547eca7b79f2516f06o7x",
        "build_caching": true,
        "build_command": "npm run build",
        "destination_dir": "build",
        "root_dir": "/"
      },
      "created_on": "2021-03-09T00:55:03.923456Z",
      "deployment_trigger": {
        "metadata": {
          "branch": "main",
          "commit_dirty": false,
          "commit_hash": "ad9ccd918a81025731e10e40267e11273a263421",
          "commit_message": "Update index.html"
        },
        "type": "ad_hoc"
      },
      "env_vars": {
        "foo": {
          "type": "plain_text",
          "value": "hello world"
        }
      },
      "environment": "preview",
      "is_skipped": true,
      "latest_stage": {
        "ended_on": "2021-03-09T00:58:59.045655Z",
        "name": "deploy",
        "started_on": "2021-03-09T00:55:03.923456Z",
        "status": "success"
      },
      "modified_on": "2021-03-09T00:58:59.045655Z",
      "project_id": "7b162ea7-7367-4d67-bcde-1160995d5",
      "project_name": "this-is-my-project-01",
      "short_id": "f64788e9",
      "source": {
        "config": {
          "deployments_enabled": true,
          "owner": "my-org",
          "owner_id": "12345678",
          "path_excludes": [
            "string"
          ],
          "path_includes": [
            "string"
          ],
          "pr_comments_enabled": true,
          "preview_branch_excludes": [
            "string"
          ],
          "preview_branch_includes": [
            "string"
          ],
          "preview_deployment_setting": "all",
          "production_branch": "main",
          "production_deployments_enabled": true,
          "repo_id": "12345678",
          "repo_name": "my-repo"
        },
        "type": "github"
      },
      "stages": [
        {
          "ended_on": "2021-06-03T15:39:03.134378Z",
          "name": "queued",
          "started_on": "2021-06-03T15:38:15.608194Z",
          "status": "active"
        },
        {
          "ended_on": null,
          "name": "initialize",
          "started_on": null,
          "status": "idle"
        },
        {
          "ended_on": null,
          "name": "clone_repo",
          "started_on": null,
          "status": "idle"
        },
        {
          "ended_on": null,
          "name": "build",
          "started_on": null,
          "status": "idle"
        },
        {
          "ended_on": null,
          "name": "deploy",
          "started_on": null,
          "status": "idle"
        }
      ],
      "url": "https://f64788e9.ninjakittens.pages.dev",
      "uses_functions": true
    },
    "name": "this-is-my-project-01",
    "preview_script_name": "pages-worker--1234567-preview",
    "production_branch": "main",
    "production_script_name": "pages-worker--1234567-production",
    "uses_functions": true,
    "build_config": {
      "web_analytics_tag": "cee1c73f6e4743d0b5e6bb1a0bcaabcc",
      "web_analytics_token": "021e1057c18547eca7b79f2516f06o7x",
      "build_caching": true,
      "build_command": "npm run build",
      "destination_dir": "build",
      "root_dir": "/"
    },
    "domains": [
      "customdomain.com",
      "customdomain.org"
    ],
    "source": {
      "config": {
        "deployments_enabled": true,
        "owner": "my-org",
        "owner_id": "12345678",
        "path_excludes": [
          "string"
        ],
        "path_includes": [
          "string"
        ],
        "pr_comments_enabled": true,
        "preview_branch_excludes": [
          "string"
        ],
        "preview_branch_includes": [
          "string"
        ],
        "preview_deployment_setting": "all",
        "production_branch": "main",
        "production_deployments_enabled": true,
        "repo_id": "12345678",
        "repo_name": "my-repo"
      },
      "type": "github"
    },
    "subdomain": "helloworld.pages.dev"
  },
  "success": true
}