# Projects ## Get projects `pages.projects.list(ProjectListParams**kwargs) -> SyncV4PagePaginationArray[Project]` **get** `/accounts/{account_id}/pages/projects` Fetch a list of all user projects. ### Parameters - `account_id: str` Identifier. - `page: Optional[int]` Which page of projects to fetch. - `per_page: Optional[int]` How many projects to return per page. ### Returns - `class Project: …` - `id: str` ID of the project. - `canonical_deployment: Optional[Deployment]` Most recent production deployment of the project. - `id: str` Id of the deployment. - `aliases: Optional[List[str]]` A list of alias URLs pointing to this deployment. - `build_config: BuildConfig` Configs for the project build process. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Assets output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `created_on: datetime` When the deployment was created. - `deployment_trigger: DeploymentTrigger` Info about what caused the deployment. - `metadata: DeploymentTriggerMetadata` Additional info about the trigger. - `branch: str` Where the trigger happened. - `commit_dirty: bool` Whether the deployment trigger commit was dirty. - `commit_hash: str` Hash of the deployment trigger commit. - `commit_message: str` Message of the deployment trigger commit. - `type: Literal["github:push", "ad_hoc", "deploy_hook"]` What caused the deployment. - `"github:push"` - `"ad_hoc"` - `"deploy_hook"` - `env_vars: Optional[Dict[str, Optional[EnvVars]]]` Environment variables used for builds and Pages Functions. - `class EnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class EnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `environment: Literal["preview", "production"]` Type of deploy. - `"preview"` - `"production"` - `is_skipped: bool` If the deployment has been skipped. - `latest_stage: Stage` The status of the deployment. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `"queued"` - `"initialize"` - `"clone_repo"` - `"build"` - `"deploy"` - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `"success"` - `"idle"` - `"active"` - `"failure"` - `"canceled"` - `modified_on: datetime` When the deployment was last modified. - `project_id: str` Id of the project. - `project_name: str` Name of the project. - `short_id: str` Short Id (8 character) of the deployment. - `source: Source` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: bool` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: str` The owner of the repository. - `owner_id: str` The owner ID of the repository. - `path_excludes: List[str]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: List[str]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: bool` Whether to enable PR comments. - `preview_branch_excludes: List[str]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: List[str]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Literal["all", "none", "custom"]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: str` The production branch of the repository. - `production_deployments_enabled: bool` Whether to trigger a production deployment on commits to the production branch. - `repo_id: str` The ID of the repository. - `repo_name: str` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` - `stages: List[Stage]` List of past stages. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `url: str` The live URL to view this deployment. - `uses_functions: Optional[bool]` Whether the deployment uses functions. - `created_on: datetime` When the project was created. - `deployment_configs: DeploymentConfigs` Configs for deployments in a project. - `preview: DeploymentConfigsPreview` Configs for preview deploys. - `always_use_latest_compatibility_date: bool` Whether to always use the latest compatibility date for Pages Functions. - `build_image_major_version: int` The major version of the build image to use for Pages Functions. - `compatibility_date: str` Compatibility date used for Pages Functions. - `compatibility_flags: List[str]` Compatibility flags used for Pages Functions. - `env_vars: Optional[Dict[str, Optional[DeploymentConfigsPreviewEnvVars]]]` Environment variables used for builds and Pages Functions. - `class DeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class DeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `fail_open: bool` Whether to fail open when the deployment config cannot be applied. - `usage_model: Literal["standard", "bundled", "unbound"]` The usage model for Pages Functions. - `"standard"` - `"bundled"` - `"unbound"` - `ai_bindings: Optional[Dict[str, DeploymentConfigsPreviewAIBindings]]` Constellation bindings used for Pages Functions. - `project_id: str` - `analytics_engine_datasets: Optional[Dict[str, DeploymentConfigsPreviewAnalyticsEngineDatasets]]` Analytics Engine bindings used for Pages Functions. - `dataset: str` Name of the dataset. - `browsers: Optional[Dict[str, Optional[DeploymentConfigsPreviewBrowsers]]]` Browser bindings used for Pages Functions. - `d1_databases: Optional[Dict[str, DeploymentConfigsPreviewD1Databases]]` D1 databases used for Pages Functions. - `id: str` UUID of the D1 database. - `durable_object_namespaces: Optional[Dict[str, DeploymentConfigsPreviewDurableObjectNamespaces]]` Durable Object namespaces used for Pages Functions. - `namespace_id: str` ID of the Durable Object namespace. - `hyperdrive_bindings: Optional[Dict[str, DeploymentConfigsPreviewHyperdriveBindings]]` Hyperdrive bindings used for Pages Functions. - `id: str` - `kv_namespaces: Optional[Dict[str, DeploymentConfigsPreviewKVNamespaces]]` KV namespaces used for Pages Functions. - `namespace_id: str` ID of the KV namespace. - `limits: Optional[DeploymentConfigsPreviewLimits]` Limits for Pages Functions. - `cpu_ms: int` CPU time limit in milliseconds. - `mtls_certificates: Optional[Dict[str, DeploymentConfigsPreviewMTLSCertificates]]` mTLS bindings used for Pages Functions. - `certificate_id: str` - `placement: Optional[DeploymentConfigsPreviewPlacement]` Placement setting used for Pages Functions. - `mode: str` Placement mode. - `queue_producers: Optional[Dict[str, DeploymentConfigsPreviewQueueProducers]]` Queue Producer bindings used for Pages Functions. - `name: str` Name of the Queue. - `r2_buckets: Optional[Dict[str, DeploymentConfigsPreviewR2Buckets]]` R2 buckets used for Pages Functions. - `name: str` Name of the R2 bucket. - `jurisdiction: Optional[str]` Jurisdiction of the R2 bucket. - `services: Optional[Dict[str, DeploymentConfigsPreviewServices]]` Services used for Pages Functions. - `environment: str` The Service environment. - `service: str` The Service name. - `entrypoint: Optional[str]` The entrypoint to bind to. - `vectorize_bindings: Optional[Dict[str, DeploymentConfigsPreviewVectorizeBindings]]` Vectorize bindings used for Pages Functions. - `index_name: str` - `wrangler_config_hash: Optional[str]` Hash of the Wrangler configuration used for the deployment. - `production: DeploymentConfigsProduction` Configs for production deploys. - `always_use_latest_compatibility_date: bool` Whether to always use the latest compatibility date for Pages Functions. - `build_image_major_version: int` The major version of the build image to use for Pages Functions. - `compatibility_date: str` Compatibility date used for Pages Functions. - `compatibility_flags: List[str]` Compatibility flags used for Pages Functions. - `env_vars: Optional[Dict[str, Optional[DeploymentConfigsProductionEnvVars]]]` Environment variables used for builds and Pages Functions. - `class DeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class DeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `fail_open: bool` Whether to fail open when the deployment config cannot be applied. - `usage_model: Literal["standard", "bundled", "unbound"]` The usage model for Pages Functions. - `"standard"` - `"bundled"` - `"unbound"` - `ai_bindings: Optional[Dict[str, DeploymentConfigsProductionAIBindings]]` Constellation bindings used for Pages Functions. - `project_id: str` - `analytics_engine_datasets: Optional[Dict[str, DeploymentConfigsProductionAnalyticsEngineDatasets]]` Analytics Engine bindings used for Pages Functions. - `dataset: str` Name of the dataset. - `browsers: Optional[Dict[str, Optional[DeploymentConfigsProductionBrowsers]]]` Browser bindings used for Pages Functions. - `d1_databases: Optional[Dict[str, DeploymentConfigsProductionD1Databases]]` D1 databases used for Pages Functions. - `id: str` UUID of the D1 database. - `durable_object_namespaces: Optional[Dict[str, DeploymentConfigsProductionDurableObjectNamespaces]]` Durable Object namespaces used for Pages Functions. - `namespace_id: str` ID of the Durable Object namespace. - `hyperdrive_bindings: Optional[Dict[str, DeploymentConfigsProductionHyperdriveBindings]]` Hyperdrive bindings used for Pages Functions. - `id: str` - `kv_namespaces: Optional[Dict[str, DeploymentConfigsProductionKVNamespaces]]` KV namespaces used for Pages Functions. - `namespace_id: str` ID of the KV namespace. - `limits: Optional[DeploymentConfigsProductionLimits]` Limits for Pages Functions. - `cpu_ms: int` CPU time limit in milliseconds. - `mtls_certificates: Optional[Dict[str, DeploymentConfigsProductionMTLSCertificates]]` mTLS bindings used for Pages Functions. - `certificate_id: str` - `placement: Optional[DeploymentConfigsProductionPlacement]` Placement setting used for Pages Functions. - `mode: str` Placement mode. - `queue_producers: Optional[Dict[str, DeploymentConfigsProductionQueueProducers]]` Queue Producer bindings used for Pages Functions. - `name: str` Name of the Queue. - `r2_buckets: Optional[Dict[str, DeploymentConfigsProductionR2Buckets]]` R2 buckets used for Pages Functions. - `name: str` Name of the R2 bucket. - `jurisdiction: Optional[str]` Jurisdiction of the R2 bucket. - `services: Optional[Dict[str, DeploymentConfigsProductionServices]]` Services used for Pages Functions. - `environment: str` The Service environment. - `service: str` The Service name. - `entrypoint: Optional[str]` The entrypoint to bind to. - `vectorize_bindings: Optional[Dict[str, DeploymentConfigsProductionVectorizeBindings]]` Vectorize bindings used for Pages Functions. - `index_name: str` - `wrangler_config_hash: Optional[str]` Hash of the Wrangler configuration used for the deployment. - `framework: str` Framework the project is using. - `framework_version: str` Version of the framework the project is using. - `latest_deployment: Optional[Deployment]` Most recent deployment of the project. - `name: str` Name of the project. - `preview_script_name: str` Name of the preview script. - `production_branch: str` Production branch of the project. Used to identify production deployments. - `production_script_name: str` Name of the production script. - `uses_functions: Optional[bool]` Whether the project uses functions. - `build_config: Optional[BuildConfig]` Configs for the project build process. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Assets output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `domains: Optional[List[str]]` A list of associated custom domains for the project. - `source: Optional[Source]` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: bool` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: str` The owner of the repository. - `owner_id: str` The owner ID of the repository. - `path_excludes: List[str]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: List[str]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: bool` Whether to enable PR comments. - `preview_branch_excludes: List[str]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: List[str]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Literal["all", "none", "custom"]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: str` The production branch of the repository. - `production_deployments_enabled: bool` Whether to trigger a production deployment on commits to the production branch. - `repo_id: str` The ID of the repository. - `repo_name: str` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` - `subdomain: Optional[str]` The Cloudflare subdomain associated with the project. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.pages.projects.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.id) ``` #### Response ```json { "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, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Get project `pages.projects.get(strproject_name, ProjectGetParams**kwargs) -> Project` **get** `/accounts/{account_id}/pages/projects/{project_name}` Fetch a project by name. ### Parameters - `account_id: str` Identifier. - `project_name: str` Name of the project. ### Returns - `class Project: …` - `id: str` ID of the project. - `canonical_deployment: Optional[Deployment]` Most recent production deployment of the project. - `id: str` Id of the deployment. - `aliases: Optional[List[str]]` A list of alias URLs pointing to this deployment. - `build_config: BuildConfig` Configs for the project build process. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Assets output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `created_on: datetime` When the deployment was created. - `deployment_trigger: DeploymentTrigger` Info about what caused the deployment. - `metadata: DeploymentTriggerMetadata` Additional info about the trigger. - `branch: str` Where the trigger happened. - `commit_dirty: bool` Whether the deployment trigger commit was dirty. - `commit_hash: str` Hash of the deployment trigger commit. - `commit_message: str` Message of the deployment trigger commit. - `type: Literal["github:push", "ad_hoc", "deploy_hook"]` What caused the deployment. - `"github:push"` - `"ad_hoc"` - `"deploy_hook"` - `env_vars: Optional[Dict[str, Optional[EnvVars]]]` Environment variables used for builds and Pages Functions. - `class EnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class EnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `environment: Literal["preview", "production"]` Type of deploy. - `"preview"` - `"production"` - `is_skipped: bool` If the deployment has been skipped. - `latest_stage: Stage` The status of the deployment. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `"queued"` - `"initialize"` - `"clone_repo"` - `"build"` - `"deploy"` - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `"success"` - `"idle"` - `"active"` - `"failure"` - `"canceled"` - `modified_on: datetime` When the deployment was last modified. - `project_id: str` Id of the project. - `project_name: str` Name of the project. - `short_id: str` Short Id (8 character) of the deployment. - `source: Source` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: bool` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: str` The owner of the repository. - `owner_id: str` The owner ID of the repository. - `path_excludes: List[str]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: List[str]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: bool` Whether to enable PR comments. - `preview_branch_excludes: List[str]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: List[str]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Literal["all", "none", "custom"]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: str` The production branch of the repository. - `production_deployments_enabled: bool` Whether to trigger a production deployment on commits to the production branch. - `repo_id: str` The ID of the repository. - `repo_name: str` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` - `stages: List[Stage]` List of past stages. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `url: str` The live URL to view this deployment. - `uses_functions: Optional[bool]` Whether the deployment uses functions. - `created_on: datetime` When the project was created. - `deployment_configs: DeploymentConfigs` Configs for deployments in a project. - `preview: DeploymentConfigsPreview` Configs for preview deploys. - `always_use_latest_compatibility_date: bool` Whether to always use the latest compatibility date for Pages Functions. - `build_image_major_version: int` The major version of the build image to use for Pages Functions. - `compatibility_date: str` Compatibility date used for Pages Functions. - `compatibility_flags: List[str]` Compatibility flags used for Pages Functions. - `env_vars: Optional[Dict[str, Optional[DeploymentConfigsPreviewEnvVars]]]` Environment variables used for builds and Pages Functions. - `class DeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class DeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `fail_open: bool` Whether to fail open when the deployment config cannot be applied. - `usage_model: Literal["standard", "bundled", "unbound"]` The usage model for Pages Functions. - `"standard"` - `"bundled"` - `"unbound"` - `ai_bindings: Optional[Dict[str, DeploymentConfigsPreviewAIBindings]]` Constellation bindings used for Pages Functions. - `project_id: str` - `analytics_engine_datasets: Optional[Dict[str, DeploymentConfigsPreviewAnalyticsEngineDatasets]]` Analytics Engine bindings used for Pages Functions. - `dataset: str` Name of the dataset. - `browsers: Optional[Dict[str, Optional[DeploymentConfigsPreviewBrowsers]]]` Browser bindings used for Pages Functions. - `d1_databases: Optional[Dict[str, DeploymentConfigsPreviewD1Databases]]` D1 databases used for Pages Functions. - `id: str` UUID of the D1 database. - `durable_object_namespaces: Optional[Dict[str, DeploymentConfigsPreviewDurableObjectNamespaces]]` Durable Object namespaces used for Pages Functions. - `namespace_id: str` ID of the Durable Object namespace. - `hyperdrive_bindings: Optional[Dict[str, DeploymentConfigsPreviewHyperdriveBindings]]` Hyperdrive bindings used for Pages Functions. - `id: str` - `kv_namespaces: Optional[Dict[str, DeploymentConfigsPreviewKVNamespaces]]` KV namespaces used for Pages Functions. - `namespace_id: str` ID of the KV namespace. - `limits: Optional[DeploymentConfigsPreviewLimits]` Limits for Pages Functions. - `cpu_ms: int` CPU time limit in milliseconds. - `mtls_certificates: Optional[Dict[str, DeploymentConfigsPreviewMTLSCertificates]]` mTLS bindings used for Pages Functions. - `certificate_id: str` - `placement: Optional[DeploymentConfigsPreviewPlacement]` Placement setting used for Pages Functions. - `mode: str` Placement mode. - `queue_producers: Optional[Dict[str, DeploymentConfigsPreviewQueueProducers]]` Queue Producer bindings used for Pages Functions. - `name: str` Name of the Queue. - `r2_buckets: Optional[Dict[str, DeploymentConfigsPreviewR2Buckets]]` R2 buckets used for Pages Functions. - `name: str` Name of the R2 bucket. - `jurisdiction: Optional[str]` Jurisdiction of the R2 bucket. - `services: Optional[Dict[str, DeploymentConfigsPreviewServices]]` Services used for Pages Functions. - `environment: str` The Service environment. - `service: str` The Service name. - `entrypoint: Optional[str]` The entrypoint to bind to. - `vectorize_bindings: Optional[Dict[str, DeploymentConfigsPreviewVectorizeBindings]]` Vectorize bindings used for Pages Functions. - `index_name: str` - `wrangler_config_hash: Optional[str]` Hash of the Wrangler configuration used for the deployment. - `production: DeploymentConfigsProduction` Configs for production deploys. - `always_use_latest_compatibility_date: bool` Whether to always use the latest compatibility date for Pages Functions. - `build_image_major_version: int` The major version of the build image to use for Pages Functions. - `compatibility_date: str` Compatibility date used for Pages Functions. - `compatibility_flags: List[str]` Compatibility flags used for Pages Functions. - `env_vars: Optional[Dict[str, Optional[DeploymentConfigsProductionEnvVars]]]` Environment variables used for builds and Pages Functions. - `class DeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class DeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `fail_open: bool` Whether to fail open when the deployment config cannot be applied. - `usage_model: Literal["standard", "bundled", "unbound"]` The usage model for Pages Functions. - `"standard"` - `"bundled"` - `"unbound"` - `ai_bindings: Optional[Dict[str, DeploymentConfigsProductionAIBindings]]` Constellation bindings used for Pages Functions. - `project_id: str` - `analytics_engine_datasets: Optional[Dict[str, DeploymentConfigsProductionAnalyticsEngineDatasets]]` Analytics Engine bindings used for Pages Functions. - `dataset: str` Name of the dataset. - `browsers: Optional[Dict[str, Optional[DeploymentConfigsProductionBrowsers]]]` Browser bindings used for Pages Functions. - `d1_databases: Optional[Dict[str, DeploymentConfigsProductionD1Databases]]` D1 databases used for Pages Functions. - `id: str` UUID of the D1 database. - `durable_object_namespaces: Optional[Dict[str, DeploymentConfigsProductionDurableObjectNamespaces]]` Durable Object namespaces used for Pages Functions. - `namespace_id: str` ID of the Durable Object namespace. - `hyperdrive_bindings: Optional[Dict[str, DeploymentConfigsProductionHyperdriveBindings]]` Hyperdrive bindings used for Pages Functions. - `id: str` - `kv_namespaces: Optional[Dict[str, DeploymentConfigsProductionKVNamespaces]]` KV namespaces used for Pages Functions. - `namespace_id: str` ID of the KV namespace. - `limits: Optional[DeploymentConfigsProductionLimits]` Limits for Pages Functions. - `cpu_ms: int` CPU time limit in milliseconds. - `mtls_certificates: Optional[Dict[str, DeploymentConfigsProductionMTLSCertificates]]` mTLS bindings used for Pages Functions. - `certificate_id: str` - `placement: Optional[DeploymentConfigsProductionPlacement]` Placement setting used for Pages Functions. - `mode: str` Placement mode. - `queue_producers: Optional[Dict[str, DeploymentConfigsProductionQueueProducers]]` Queue Producer bindings used for Pages Functions. - `name: str` Name of the Queue. - `r2_buckets: Optional[Dict[str, DeploymentConfigsProductionR2Buckets]]` R2 buckets used for Pages Functions. - `name: str` Name of the R2 bucket. - `jurisdiction: Optional[str]` Jurisdiction of the R2 bucket. - `services: Optional[Dict[str, DeploymentConfigsProductionServices]]` Services used for Pages Functions. - `environment: str` The Service environment. - `service: str` The Service name. - `entrypoint: Optional[str]` The entrypoint to bind to. - `vectorize_bindings: Optional[Dict[str, DeploymentConfigsProductionVectorizeBindings]]` Vectorize bindings used for Pages Functions. - `index_name: str` - `wrangler_config_hash: Optional[str]` Hash of the Wrangler configuration used for the deployment. - `framework: str` Framework the project is using. - `framework_version: str` Version of the framework the project is using. - `latest_deployment: Optional[Deployment]` Most recent deployment of the project. - `name: str` Name of the project. - `preview_script_name: str` Name of the preview script. - `production_branch: str` Production branch of the project. Used to identify production deployments. - `production_script_name: str` Name of the production script. - `uses_functions: Optional[bool]` Whether the project uses functions. - `build_config: Optional[BuildConfig]` Configs for the project build process. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Assets output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `domains: Optional[List[str]]` A list of associated custom domains for the project. - `source: Optional[Source]` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: bool` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: str` The owner of the repository. - `owner_id: str` The owner ID of the repository. - `path_excludes: List[str]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: List[str]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: bool` Whether to enable PR comments. - `preview_branch_excludes: List[str]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: List[str]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Literal["all", "none", "custom"]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: str` The production branch of the repository. - `production_deployments_enabled: bool` Whether to trigger a production deployment on commits to the production branch. - `repo_id: str` The ID of the repository. - `repo_name: str` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` - `subdomain: Optional[str]` The Cloudflare subdomain associated with the project. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) project = client.pages.projects.get( project_name="this-is-my-project-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(project.id) ``` #### Response ```json { "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 } ``` ## Create project `pages.projects.create(ProjectCreateParams**kwargs) -> Project` **post** `/accounts/{account_id}/pages/projects` Create a new project. ### Parameters - `account_id: str` Identifier. - `name: str` Name of the project. - `production_branch: str` Production branch of the project. Used to identify production deployments. - `build_config: Optional[BuildConfig]` Configs for the project build process. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `deployment_configs: Optional[DeploymentConfigs]` Configs for deployments in a project. - `preview: Optional[DeploymentConfigsPreview]` Configs for preview deploys. - `ai_bindings: Optional[Dict[str, Optional[DeploymentConfigsPreviewAIBindings]]]` Constellation bindings used for Pages Functions. - `project_id: str` - `always_use_latest_compatibility_date: Optional[bool]` Whether to always use the latest compatibility date for Pages Functions. - `analytics_engine_datasets: Optional[Dict[str, Optional[DeploymentConfigsPreviewAnalyticsEngineDatasets]]]` Analytics Engine bindings used for Pages Functions. - `dataset: str` Name of the dataset. - `browsers: Optional[Dict[str, Optional[DeploymentConfigsPreviewBrowsers]]]` Browser bindings used for Pages Functions. - `build_image_major_version: Optional[int]` The major version of the build image to use for Pages Functions. - `compatibility_date: Optional[str]` Compatibility date used for Pages Functions. - `compatibility_flags: Optional[SequenceNotStr[str]]` Compatibility flags used for Pages Functions. - `d1_databases: Optional[Dict[str, Optional[DeploymentConfigsPreviewD1Databases]]]` D1 databases used for Pages Functions. - `id: str` UUID of the D1 database. - `durable_object_namespaces: Optional[Dict[str, Optional[DeploymentConfigsPreviewDurableObjectNamespaces]]]` Durable Object namespaces used for Pages Functions. - `namespace_id: str` ID of the Durable Object namespace. - `env_vars: Optional[Dict[str, Optional[DeploymentConfigsPreviewEnvVars]]]` Environment variables used for builds and Pages Functions. - `class DeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class DeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `fail_open: Optional[bool]` Whether to fail open when the deployment config cannot be applied. - `hyperdrive_bindings: Optional[Dict[str, Optional[DeploymentConfigsPreviewHyperdriveBindings]]]` Hyperdrive bindings used for Pages Functions. - `id: str` - `kv_namespaces: Optional[Dict[str, Optional[DeploymentConfigsPreviewKVNamespaces]]]` KV namespaces used for Pages Functions. - `namespace_id: str` ID of the KV namespace. - `limits: Optional[DeploymentConfigsPreviewLimits]` Limits for Pages Functions. - `cpu_ms: int` CPU time limit in milliseconds. - `mtls_certificates: Optional[Dict[str, Optional[DeploymentConfigsPreviewMTLSCertificates]]]` mTLS bindings used for Pages Functions. - `certificate_id: str` - `placement: Optional[DeploymentConfigsPreviewPlacement]` Placement setting used for Pages Functions. - `mode: str` Placement mode. - `queue_producers: Optional[Dict[str, Optional[DeploymentConfigsPreviewQueueProducers]]]` Queue Producer bindings used for Pages Functions. - `name: str` Name of the Queue. - `r2_buckets: Optional[Dict[str, Optional[DeploymentConfigsPreviewR2Buckets]]]` R2 buckets used for Pages Functions. - `name: str` Name of the R2 bucket. - `jurisdiction: Optional[str]` Jurisdiction of the R2 bucket. - `services: Optional[Dict[str, Optional[DeploymentConfigsPreviewServices]]]` Services used for Pages Functions. - `service: str` The Service name. - `entrypoint: Optional[str]` The entrypoint to bind to. - `environment: Optional[str]` The Service environment. - `usage_model: Optional[Literal["standard", "bundled", "unbound"]]` The usage model for Pages Functions. - `"standard"` - `"bundled"` - `"unbound"` - `vectorize_bindings: Optional[Dict[str, Optional[DeploymentConfigsPreviewVectorizeBindings]]]` Vectorize bindings used for Pages Functions. - `index_name: str` - `wrangler_config_hash: Optional[str]` Hash of the Wrangler configuration used for the deployment. - `production: Optional[DeploymentConfigsProduction]` Configs for production deploys. - `ai_bindings: Optional[Dict[str, Optional[DeploymentConfigsProductionAIBindings]]]` Constellation bindings used for Pages Functions. - `project_id: str` - `always_use_latest_compatibility_date: Optional[bool]` Whether to always use the latest compatibility date for Pages Functions. - `analytics_engine_datasets: Optional[Dict[str, Optional[DeploymentConfigsProductionAnalyticsEngineDatasets]]]` Analytics Engine bindings used for Pages Functions. - `dataset: str` Name of the dataset. - `browsers: Optional[Dict[str, Optional[DeploymentConfigsProductionBrowsers]]]` Browser bindings used for Pages Functions. - `build_image_major_version: Optional[int]` The major version of the build image to use for Pages Functions. - `compatibility_date: Optional[str]` Compatibility date used for Pages Functions. - `compatibility_flags: Optional[SequenceNotStr[str]]` Compatibility flags used for Pages Functions. - `d1_databases: Optional[Dict[str, Optional[DeploymentConfigsProductionD1Databases]]]` D1 databases used for Pages Functions. - `id: str` UUID of the D1 database. - `durable_object_namespaces: Optional[Dict[str, Optional[DeploymentConfigsProductionDurableObjectNamespaces]]]` Durable Object namespaces used for Pages Functions. - `namespace_id: str` ID of the Durable Object namespace. - `env_vars: Optional[Dict[str, Optional[DeploymentConfigsProductionEnvVars]]]` Environment variables used for builds and Pages Functions. - `class DeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class DeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `fail_open: Optional[bool]` Whether to fail open when the deployment config cannot be applied. - `hyperdrive_bindings: Optional[Dict[str, Optional[DeploymentConfigsProductionHyperdriveBindings]]]` Hyperdrive bindings used for Pages Functions. - `id: str` - `kv_namespaces: Optional[Dict[str, Optional[DeploymentConfigsProductionKVNamespaces]]]` KV namespaces used for Pages Functions. - `namespace_id: str` ID of the KV namespace. - `limits: Optional[DeploymentConfigsProductionLimits]` Limits for Pages Functions. - `cpu_ms: int` CPU time limit in milliseconds. - `mtls_certificates: Optional[Dict[str, Optional[DeploymentConfigsProductionMTLSCertificates]]]` mTLS bindings used for Pages Functions. - `certificate_id: str` - `placement: Optional[DeploymentConfigsProductionPlacement]` Placement setting used for Pages Functions. - `mode: str` Placement mode. - `queue_producers: Optional[Dict[str, Optional[DeploymentConfigsProductionQueueProducers]]]` Queue Producer bindings used for Pages Functions. - `name: str` Name of the Queue. - `r2_buckets: Optional[Dict[str, Optional[DeploymentConfigsProductionR2Buckets]]]` R2 buckets used for Pages Functions. - `name: str` Name of the R2 bucket. - `jurisdiction: Optional[str]` Jurisdiction of the R2 bucket. - `services: Optional[Dict[str, Optional[DeploymentConfigsProductionServices]]]` Services used for Pages Functions. - `service: str` The Service name. - `entrypoint: Optional[str]` The entrypoint to bind to. - `environment: Optional[str]` The Service environment. - `usage_model: Optional[Literal["standard", "bundled", "unbound"]]` The usage model for Pages Functions. - `"standard"` - `"bundled"` - `"unbound"` - `vectorize_bindings: Optional[Dict[str, Optional[DeploymentConfigsProductionVectorizeBindings]]]` Vectorize bindings used for Pages Functions. - `index_name: str` - `wrangler_config_hash: Optional[str]` Hash of the Wrangler configuration used for the deployment. - `source: Optional[Source]` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: Optional[bool]` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: Optional[str]` The owner of the repository. - `owner_id: Optional[str]` The owner ID of the repository. - `path_excludes: Optional[SequenceNotStr[str]]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: Optional[SequenceNotStr[str]]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: Optional[bool]` Whether to enable PR comments. - `preview_branch_excludes: Optional[SequenceNotStr[str]]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: Optional[SequenceNotStr[str]]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Optional[Literal["all", "none", "custom"]]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: Optional[str]` The production branch of the repository. - `production_deployments_enabled: Optional[bool]` Whether to trigger a production deployment on commits to the production branch. - `repo_id: Optional[str]` The ID of the repository. - `repo_name: Optional[str]` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` ### Returns - `class Project: …` - `id: str` ID of the project. - `canonical_deployment: Optional[Deployment]` Most recent production deployment of the project. - `id: str` Id of the deployment. - `aliases: Optional[List[str]]` A list of alias URLs pointing to this deployment. - `build_config: BuildConfig` Configs for the project build process. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Assets output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `created_on: datetime` When the deployment was created. - `deployment_trigger: DeploymentTrigger` Info about what caused the deployment. - `metadata: DeploymentTriggerMetadata` Additional info about the trigger. - `branch: str` Where the trigger happened. - `commit_dirty: bool` Whether the deployment trigger commit was dirty. - `commit_hash: str` Hash of the deployment trigger commit. - `commit_message: str` Message of the deployment trigger commit. - `type: Literal["github:push", "ad_hoc", "deploy_hook"]` What caused the deployment. - `"github:push"` - `"ad_hoc"` - `"deploy_hook"` - `env_vars: Optional[Dict[str, Optional[EnvVars]]]` Environment variables used for builds and Pages Functions. - `class EnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class EnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `environment: Literal["preview", "production"]` Type of deploy. - `"preview"` - `"production"` - `is_skipped: bool` If the deployment has been skipped. - `latest_stage: Stage` The status of the deployment. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `"queued"` - `"initialize"` - `"clone_repo"` - `"build"` - `"deploy"` - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `"success"` - `"idle"` - `"active"` - `"failure"` - `"canceled"` - `modified_on: datetime` When the deployment was last modified. - `project_id: str` Id of the project. - `project_name: str` Name of the project. - `short_id: str` Short Id (8 character) of the deployment. - `source: Source` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: bool` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: str` The owner of the repository. - `owner_id: str` The owner ID of the repository. - `path_excludes: List[str]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: List[str]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: bool` Whether to enable PR comments. - `preview_branch_excludes: List[str]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: List[str]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Literal["all", "none", "custom"]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: str` The production branch of the repository. - `production_deployments_enabled: bool` Whether to trigger a production deployment on commits to the production branch. - `repo_id: str` The ID of the repository. - `repo_name: str` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` - `stages: List[Stage]` List of past stages. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `url: str` The live URL to view this deployment. - `uses_functions: Optional[bool]` Whether the deployment uses functions. - `created_on: datetime` When the project was created. - `deployment_configs: DeploymentConfigs` Configs for deployments in a project. - `preview: DeploymentConfigsPreview` Configs for preview deploys. - `always_use_latest_compatibility_date: bool` Whether to always use the latest compatibility date for Pages Functions. - `build_image_major_version: int` The major version of the build image to use for Pages Functions. - `compatibility_date: str` Compatibility date used for Pages Functions. - `compatibility_flags: List[str]` Compatibility flags used for Pages Functions. - `env_vars: Optional[Dict[str, Optional[DeploymentConfigsPreviewEnvVars]]]` Environment variables used for builds and Pages Functions. - `class DeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class DeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `fail_open: bool` Whether to fail open when the deployment config cannot be applied. - `usage_model: Literal["standard", "bundled", "unbound"]` The usage model for Pages Functions. - `"standard"` - `"bundled"` - `"unbound"` - `ai_bindings: Optional[Dict[str, DeploymentConfigsPreviewAIBindings]]` Constellation bindings used for Pages Functions. - `project_id: str` - `analytics_engine_datasets: Optional[Dict[str, DeploymentConfigsPreviewAnalyticsEngineDatasets]]` Analytics Engine bindings used for Pages Functions. - `dataset: str` Name of the dataset. - `browsers: Optional[Dict[str, Optional[DeploymentConfigsPreviewBrowsers]]]` Browser bindings used for Pages Functions. - `d1_databases: Optional[Dict[str, DeploymentConfigsPreviewD1Databases]]` D1 databases used for Pages Functions. - `id: str` UUID of the D1 database. - `durable_object_namespaces: Optional[Dict[str, DeploymentConfigsPreviewDurableObjectNamespaces]]` Durable Object namespaces used for Pages Functions. - `namespace_id: str` ID of the Durable Object namespace. - `hyperdrive_bindings: Optional[Dict[str, DeploymentConfigsPreviewHyperdriveBindings]]` Hyperdrive bindings used for Pages Functions. - `id: str` - `kv_namespaces: Optional[Dict[str, DeploymentConfigsPreviewKVNamespaces]]` KV namespaces used for Pages Functions. - `namespace_id: str` ID of the KV namespace. - `limits: Optional[DeploymentConfigsPreviewLimits]` Limits for Pages Functions. - `cpu_ms: int` CPU time limit in milliseconds. - `mtls_certificates: Optional[Dict[str, DeploymentConfigsPreviewMTLSCertificates]]` mTLS bindings used for Pages Functions. - `certificate_id: str` - `placement: Optional[DeploymentConfigsPreviewPlacement]` Placement setting used for Pages Functions. - `mode: str` Placement mode. - `queue_producers: Optional[Dict[str, DeploymentConfigsPreviewQueueProducers]]` Queue Producer bindings used for Pages Functions. - `name: str` Name of the Queue. - `r2_buckets: Optional[Dict[str, DeploymentConfigsPreviewR2Buckets]]` R2 buckets used for Pages Functions. - `name: str` Name of the R2 bucket. - `jurisdiction: Optional[str]` Jurisdiction of the R2 bucket. - `services: Optional[Dict[str, DeploymentConfigsPreviewServices]]` Services used for Pages Functions. - `environment: str` The Service environment. - `service: str` The Service name. - `entrypoint: Optional[str]` The entrypoint to bind to. - `vectorize_bindings: Optional[Dict[str, DeploymentConfigsPreviewVectorizeBindings]]` Vectorize bindings used for Pages Functions. - `index_name: str` - `wrangler_config_hash: Optional[str]` Hash of the Wrangler configuration used for the deployment. - `production: DeploymentConfigsProduction` Configs for production deploys. - `always_use_latest_compatibility_date: bool` Whether to always use the latest compatibility date for Pages Functions. - `build_image_major_version: int` The major version of the build image to use for Pages Functions. - `compatibility_date: str` Compatibility date used for Pages Functions. - `compatibility_flags: List[str]` Compatibility flags used for Pages Functions. - `env_vars: Optional[Dict[str, Optional[DeploymentConfigsProductionEnvVars]]]` Environment variables used for builds and Pages Functions. - `class DeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class DeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `fail_open: bool` Whether to fail open when the deployment config cannot be applied. - `usage_model: Literal["standard", "bundled", "unbound"]` The usage model for Pages Functions. - `"standard"` - `"bundled"` - `"unbound"` - `ai_bindings: Optional[Dict[str, DeploymentConfigsProductionAIBindings]]` Constellation bindings used for Pages Functions. - `project_id: str` - `analytics_engine_datasets: Optional[Dict[str, DeploymentConfigsProductionAnalyticsEngineDatasets]]` Analytics Engine bindings used for Pages Functions. - `dataset: str` Name of the dataset. - `browsers: Optional[Dict[str, Optional[DeploymentConfigsProductionBrowsers]]]` Browser bindings used for Pages Functions. - `d1_databases: Optional[Dict[str, DeploymentConfigsProductionD1Databases]]` D1 databases used for Pages Functions. - `id: str` UUID of the D1 database. - `durable_object_namespaces: Optional[Dict[str, DeploymentConfigsProductionDurableObjectNamespaces]]` Durable Object namespaces used for Pages Functions. - `namespace_id: str` ID of the Durable Object namespace. - `hyperdrive_bindings: Optional[Dict[str, DeploymentConfigsProductionHyperdriveBindings]]` Hyperdrive bindings used for Pages Functions. - `id: str` - `kv_namespaces: Optional[Dict[str, DeploymentConfigsProductionKVNamespaces]]` KV namespaces used for Pages Functions. - `namespace_id: str` ID of the KV namespace. - `limits: Optional[DeploymentConfigsProductionLimits]` Limits for Pages Functions. - `cpu_ms: int` CPU time limit in milliseconds. - `mtls_certificates: Optional[Dict[str, DeploymentConfigsProductionMTLSCertificates]]` mTLS bindings used for Pages Functions. - `certificate_id: str` - `placement: Optional[DeploymentConfigsProductionPlacement]` Placement setting used for Pages Functions. - `mode: str` Placement mode. - `queue_producers: Optional[Dict[str, DeploymentConfigsProductionQueueProducers]]` Queue Producer bindings used for Pages Functions. - `name: str` Name of the Queue. - `r2_buckets: Optional[Dict[str, DeploymentConfigsProductionR2Buckets]]` R2 buckets used for Pages Functions. - `name: str` Name of the R2 bucket. - `jurisdiction: Optional[str]` Jurisdiction of the R2 bucket. - `services: Optional[Dict[str, DeploymentConfigsProductionServices]]` Services used for Pages Functions. - `environment: str` The Service environment. - `service: str` The Service name. - `entrypoint: Optional[str]` The entrypoint to bind to. - `vectorize_bindings: Optional[Dict[str, DeploymentConfigsProductionVectorizeBindings]]` Vectorize bindings used for Pages Functions. - `index_name: str` - `wrangler_config_hash: Optional[str]` Hash of the Wrangler configuration used for the deployment. - `framework: str` Framework the project is using. - `framework_version: str` Version of the framework the project is using. - `latest_deployment: Optional[Deployment]` Most recent deployment of the project. - `name: str` Name of the project. - `preview_script_name: str` Name of the preview script. - `production_branch: str` Production branch of the project. Used to identify production deployments. - `production_script_name: str` Name of the production script. - `uses_functions: Optional[bool]` Whether the project uses functions. - `build_config: Optional[BuildConfig]` Configs for the project build process. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Assets output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `domains: Optional[List[str]]` A list of associated custom domains for the project. - `source: Optional[Source]` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: bool` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: str` The owner of the repository. - `owner_id: str` The owner ID of the repository. - `path_excludes: List[str]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: List[str]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: bool` Whether to enable PR comments. - `preview_branch_excludes: List[str]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: List[str]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Literal["all", "none", "custom"]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: str` The production branch of the repository. - `production_deployments_enabled: bool` Whether to trigger a production deployment on commits to the production branch. - `repo_id: str` The ID of the repository. - `repo_name: str` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` - `subdomain: Optional[str]` The Cloudflare subdomain associated with the project. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) project = client.pages.projects.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", name="my-pages-app", production_branch="main", ) print(project.id) ``` #### Response ```json { "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 } ``` ## Update project `pages.projects.edit(strproject_name, ProjectEditParams**kwargs) -> Project` **patch** `/accounts/{account_id}/pages/projects/{project_name}` Set new attributes for an existing project. Modify environment variables. To delete an environment variable, set the key to null. ### Parameters - `account_id: str` Identifier. - `project_name: str` Name of the project. - `build_config: Optional[BuildConfig]` Configs for the project build process. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `deployment_configs: Optional[DeploymentConfigs]` Configs for deployments in a project. - `preview: Optional[DeploymentConfigsPreview]` Configs for preview deploys. - `ai_bindings: Optional[Dict[str, Optional[DeploymentConfigsPreviewAIBindings]]]` Constellation bindings used for Pages Functions. - `project_id: str` - `always_use_latest_compatibility_date: Optional[bool]` Whether to always use the latest compatibility date for Pages Functions. - `analytics_engine_datasets: Optional[Dict[str, Optional[DeploymentConfigsPreviewAnalyticsEngineDatasets]]]` Analytics Engine bindings used for Pages Functions. - `dataset: str` Name of the dataset. - `browsers: Optional[Dict[str, Optional[DeploymentConfigsPreviewBrowsers]]]` Browser bindings used for Pages Functions. - `build_image_major_version: Optional[int]` The major version of the build image to use for Pages Functions. - `compatibility_date: Optional[str]` Compatibility date used for Pages Functions. - `compatibility_flags: Optional[SequenceNotStr[str]]` Compatibility flags used for Pages Functions. - `d1_databases: Optional[Dict[str, Optional[DeploymentConfigsPreviewD1Databases]]]` D1 databases used for Pages Functions. - `id: str` UUID of the D1 database. - `durable_object_namespaces: Optional[Dict[str, Optional[DeploymentConfigsPreviewDurableObjectNamespaces]]]` Durable Object namespaces used for Pages Functions. - `namespace_id: str` ID of the Durable Object namespace. - `env_vars: Optional[Dict[str, Optional[DeploymentConfigsPreviewEnvVars]]]` Environment variables used for builds and Pages Functions. - `class DeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class DeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `fail_open: Optional[bool]` Whether to fail open when the deployment config cannot be applied. - `hyperdrive_bindings: Optional[Dict[str, Optional[DeploymentConfigsPreviewHyperdriveBindings]]]` Hyperdrive bindings used for Pages Functions. - `id: str` - `kv_namespaces: Optional[Dict[str, Optional[DeploymentConfigsPreviewKVNamespaces]]]` KV namespaces used for Pages Functions. - `namespace_id: str` ID of the KV namespace. - `limits: Optional[DeploymentConfigsPreviewLimits]` Limits for Pages Functions. - `cpu_ms: int` CPU time limit in milliseconds. - `mtls_certificates: Optional[Dict[str, Optional[DeploymentConfigsPreviewMTLSCertificates]]]` mTLS bindings used for Pages Functions. - `certificate_id: str` - `placement: Optional[DeploymentConfigsPreviewPlacement]` Placement setting used for Pages Functions. - `mode: str` Placement mode. - `queue_producers: Optional[Dict[str, Optional[DeploymentConfigsPreviewQueueProducers]]]` Queue Producer bindings used for Pages Functions. - `name: str` Name of the Queue. - `r2_buckets: Optional[Dict[str, Optional[DeploymentConfigsPreviewR2Buckets]]]` R2 buckets used for Pages Functions. - `name: str` Name of the R2 bucket. - `jurisdiction: Optional[str]` Jurisdiction of the R2 bucket. - `services: Optional[Dict[str, Optional[DeploymentConfigsPreviewServices]]]` Services used for Pages Functions. - `service: str` The Service name. - `entrypoint: Optional[str]` The entrypoint to bind to. - `environment: Optional[str]` The Service environment. - `usage_model: Optional[Literal["standard", "bundled", "unbound"]]` The usage model for Pages Functions. - `"standard"` - `"bundled"` - `"unbound"` - `vectorize_bindings: Optional[Dict[str, Optional[DeploymentConfigsPreviewVectorizeBindings]]]` Vectorize bindings used for Pages Functions. - `index_name: str` - `wrangler_config_hash: Optional[str]` Hash of the Wrangler configuration used for the deployment. - `production: Optional[DeploymentConfigsProduction]` Configs for production deploys. - `ai_bindings: Optional[Dict[str, Optional[DeploymentConfigsProductionAIBindings]]]` Constellation bindings used for Pages Functions. - `project_id: str` - `always_use_latest_compatibility_date: Optional[bool]` Whether to always use the latest compatibility date for Pages Functions. - `analytics_engine_datasets: Optional[Dict[str, Optional[DeploymentConfigsProductionAnalyticsEngineDatasets]]]` Analytics Engine bindings used for Pages Functions. - `dataset: str` Name of the dataset. - `browsers: Optional[Dict[str, Optional[DeploymentConfigsProductionBrowsers]]]` Browser bindings used for Pages Functions. - `build_image_major_version: Optional[int]` The major version of the build image to use for Pages Functions. - `compatibility_date: Optional[str]` Compatibility date used for Pages Functions. - `compatibility_flags: Optional[SequenceNotStr[str]]` Compatibility flags used for Pages Functions. - `d1_databases: Optional[Dict[str, Optional[DeploymentConfigsProductionD1Databases]]]` D1 databases used for Pages Functions. - `id: str` UUID of the D1 database. - `durable_object_namespaces: Optional[Dict[str, Optional[DeploymentConfigsProductionDurableObjectNamespaces]]]` Durable Object namespaces used for Pages Functions. - `namespace_id: str` ID of the Durable Object namespace. - `env_vars: Optional[Dict[str, Optional[DeploymentConfigsProductionEnvVars]]]` Environment variables used for builds and Pages Functions. - `class DeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class DeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `fail_open: Optional[bool]` Whether to fail open when the deployment config cannot be applied. - `hyperdrive_bindings: Optional[Dict[str, Optional[DeploymentConfigsProductionHyperdriveBindings]]]` Hyperdrive bindings used for Pages Functions. - `id: str` - `kv_namespaces: Optional[Dict[str, Optional[DeploymentConfigsProductionKVNamespaces]]]` KV namespaces used for Pages Functions. - `namespace_id: str` ID of the KV namespace. - `limits: Optional[DeploymentConfigsProductionLimits]` Limits for Pages Functions. - `cpu_ms: int` CPU time limit in milliseconds. - `mtls_certificates: Optional[Dict[str, Optional[DeploymentConfigsProductionMTLSCertificates]]]` mTLS bindings used for Pages Functions. - `certificate_id: str` - `placement: Optional[DeploymentConfigsProductionPlacement]` Placement setting used for Pages Functions. - `mode: str` Placement mode. - `queue_producers: Optional[Dict[str, Optional[DeploymentConfigsProductionQueueProducers]]]` Queue Producer bindings used for Pages Functions. - `name: str` Name of the Queue. - `r2_buckets: Optional[Dict[str, Optional[DeploymentConfigsProductionR2Buckets]]]` R2 buckets used for Pages Functions. - `name: str` Name of the R2 bucket. - `jurisdiction: Optional[str]` Jurisdiction of the R2 bucket. - `services: Optional[Dict[str, Optional[DeploymentConfigsProductionServices]]]` Services used for Pages Functions. - `service: str` The Service name. - `entrypoint: Optional[str]` The entrypoint to bind to. - `environment: Optional[str]` The Service environment. - `usage_model: Optional[Literal["standard", "bundled", "unbound"]]` The usage model for Pages Functions. - `"standard"` - `"bundled"` - `"unbound"` - `vectorize_bindings: Optional[Dict[str, Optional[DeploymentConfigsProductionVectorizeBindings]]]` Vectorize bindings used for Pages Functions. - `index_name: str` - `wrangler_config_hash: Optional[str]` Hash of the Wrangler configuration used for the deployment. - `name: Optional[str]` Name of the project. - `production_branch: Optional[str]` Production branch of the project. Used to identify production deployments. - `source: Optional[Source]` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: Optional[bool]` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: Optional[str]` The owner of the repository. - `owner_id: Optional[str]` The owner ID of the repository. - `path_excludes: Optional[SequenceNotStr[str]]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: Optional[SequenceNotStr[str]]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: Optional[bool]` Whether to enable PR comments. - `preview_branch_excludes: Optional[SequenceNotStr[str]]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: Optional[SequenceNotStr[str]]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Optional[Literal["all", "none", "custom"]]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: Optional[str]` The production branch of the repository. - `production_deployments_enabled: Optional[bool]` Whether to trigger a production deployment on commits to the production branch. - `repo_id: Optional[str]` The ID of the repository. - `repo_name: Optional[str]` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` ### Returns - `class Project: …` - `id: str` ID of the project. - `canonical_deployment: Optional[Deployment]` Most recent production deployment of the project. - `id: str` Id of the deployment. - `aliases: Optional[List[str]]` A list of alias URLs pointing to this deployment. - `build_config: BuildConfig` Configs for the project build process. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Assets output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `created_on: datetime` When the deployment was created. - `deployment_trigger: DeploymentTrigger` Info about what caused the deployment. - `metadata: DeploymentTriggerMetadata` Additional info about the trigger. - `branch: str` Where the trigger happened. - `commit_dirty: bool` Whether the deployment trigger commit was dirty. - `commit_hash: str` Hash of the deployment trigger commit. - `commit_message: str` Message of the deployment trigger commit. - `type: Literal["github:push", "ad_hoc", "deploy_hook"]` What caused the deployment. - `"github:push"` - `"ad_hoc"` - `"deploy_hook"` - `env_vars: Optional[Dict[str, Optional[EnvVars]]]` Environment variables used for builds and Pages Functions. - `class EnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class EnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `environment: Literal["preview", "production"]` Type of deploy. - `"preview"` - `"production"` - `is_skipped: bool` If the deployment has been skipped. - `latest_stage: Stage` The status of the deployment. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `"queued"` - `"initialize"` - `"clone_repo"` - `"build"` - `"deploy"` - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `"success"` - `"idle"` - `"active"` - `"failure"` - `"canceled"` - `modified_on: datetime` When the deployment was last modified. - `project_id: str` Id of the project. - `project_name: str` Name of the project. - `short_id: str` Short Id (8 character) of the deployment. - `source: Source` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: bool` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: str` The owner of the repository. - `owner_id: str` The owner ID of the repository. - `path_excludes: List[str]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: List[str]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: bool` Whether to enable PR comments. - `preview_branch_excludes: List[str]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: List[str]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Literal["all", "none", "custom"]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: str` The production branch of the repository. - `production_deployments_enabled: bool` Whether to trigger a production deployment on commits to the production branch. - `repo_id: str` The ID of the repository. - `repo_name: str` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` - `stages: List[Stage]` List of past stages. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `url: str` The live URL to view this deployment. - `uses_functions: Optional[bool]` Whether the deployment uses functions. - `created_on: datetime` When the project was created. - `deployment_configs: DeploymentConfigs` Configs for deployments in a project. - `preview: DeploymentConfigsPreview` Configs for preview deploys. - `always_use_latest_compatibility_date: bool` Whether to always use the latest compatibility date for Pages Functions. - `build_image_major_version: int` The major version of the build image to use for Pages Functions. - `compatibility_date: str` Compatibility date used for Pages Functions. - `compatibility_flags: List[str]` Compatibility flags used for Pages Functions. - `env_vars: Optional[Dict[str, Optional[DeploymentConfigsPreviewEnvVars]]]` Environment variables used for builds and Pages Functions. - `class DeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class DeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `fail_open: bool` Whether to fail open when the deployment config cannot be applied. - `usage_model: Literal["standard", "bundled", "unbound"]` The usage model for Pages Functions. - `"standard"` - `"bundled"` - `"unbound"` - `ai_bindings: Optional[Dict[str, DeploymentConfigsPreviewAIBindings]]` Constellation bindings used for Pages Functions. - `project_id: str` - `analytics_engine_datasets: Optional[Dict[str, DeploymentConfigsPreviewAnalyticsEngineDatasets]]` Analytics Engine bindings used for Pages Functions. - `dataset: str` Name of the dataset. - `browsers: Optional[Dict[str, Optional[DeploymentConfigsPreviewBrowsers]]]` Browser bindings used for Pages Functions. - `d1_databases: Optional[Dict[str, DeploymentConfigsPreviewD1Databases]]` D1 databases used for Pages Functions. - `id: str` UUID of the D1 database. - `durable_object_namespaces: Optional[Dict[str, DeploymentConfigsPreviewDurableObjectNamespaces]]` Durable Object namespaces used for Pages Functions. - `namespace_id: str` ID of the Durable Object namespace. - `hyperdrive_bindings: Optional[Dict[str, DeploymentConfigsPreviewHyperdriveBindings]]` Hyperdrive bindings used for Pages Functions. - `id: str` - `kv_namespaces: Optional[Dict[str, DeploymentConfigsPreviewKVNamespaces]]` KV namespaces used for Pages Functions. - `namespace_id: str` ID of the KV namespace. - `limits: Optional[DeploymentConfigsPreviewLimits]` Limits for Pages Functions. - `cpu_ms: int` CPU time limit in milliseconds. - `mtls_certificates: Optional[Dict[str, DeploymentConfigsPreviewMTLSCertificates]]` mTLS bindings used for Pages Functions. - `certificate_id: str` - `placement: Optional[DeploymentConfigsPreviewPlacement]` Placement setting used for Pages Functions. - `mode: str` Placement mode. - `queue_producers: Optional[Dict[str, DeploymentConfigsPreviewQueueProducers]]` Queue Producer bindings used for Pages Functions. - `name: str` Name of the Queue. - `r2_buckets: Optional[Dict[str, DeploymentConfigsPreviewR2Buckets]]` R2 buckets used for Pages Functions. - `name: str` Name of the R2 bucket. - `jurisdiction: Optional[str]` Jurisdiction of the R2 bucket. - `services: Optional[Dict[str, DeploymentConfigsPreviewServices]]` Services used for Pages Functions. - `environment: str` The Service environment. - `service: str` The Service name. - `entrypoint: Optional[str]` The entrypoint to bind to. - `vectorize_bindings: Optional[Dict[str, DeploymentConfigsPreviewVectorizeBindings]]` Vectorize bindings used for Pages Functions. - `index_name: str` - `wrangler_config_hash: Optional[str]` Hash of the Wrangler configuration used for the deployment. - `production: DeploymentConfigsProduction` Configs for production deploys. - `always_use_latest_compatibility_date: bool` Whether to always use the latest compatibility date for Pages Functions. - `build_image_major_version: int` The major version of the build image to use for Pages Functions. - `compatibility_date: str` Compatibility date used for Pages Functions. - `compatibility_flags: List[str]` Compatibility flags used for Pages Functions. - `env_vars: Optional[Dict[str, Optional[DeploymentConfigsProductionEnvVars]]]` Environment variables used for builds and Pages Functions. - `class DeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class DeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `fail_open: bool` Whether to fail open when the deployment config cannot be applied. - `usage_model: Literal["standard", "bundled", "unbound"]` The usage model for Pages Functions. - `"standard"` - `"bundled"` - `"unbound"` - `ai_bindings: Optional[Dict[str, DeploymentConfigsProductionAIBindings]]` Constellation bindings used for Pages Functions. - `project_id: str` - `analytics_engine_datasets: Optional[Dict[str, DeploymentConfigsProductionAnalyticsEngineDatasets]]` Analytics Engine bindings used for Pages Functions. - `dataset: str` Name of the dataset. - `browsers: Optional[Dict[str, Optional[DeploymentConfigsProductionBrowsers]]]` Browser bindings used for Pages Functions. - `d1_databases: Optional[Dict[str, DeploymentConfigsProductionD1Databases]]` D1 databases used for Pages Functions. - `id: str` UUID of the D1 database. - `durable_object_namespaces: Optional[Dict[str, DeploymentConfigsProductionDurableObjectNamespaces]]` Durable Object namespaces used for Pages Functions. - `namespace_id: str` ID of the Durable Object namespace. - `hyperdrive_bindings: Optional[Dict[str, DeploymentConfigsProductionHyperdriveBindings]]` Hyperdrive bindings used for Pages Functions. - `id: str` - `kv_namespaces: Optional[Dict[str, DeploymentConfigsProductionKVNamespaces]]` KV namespaces used for Pages Functions. - `namespace_id: str` ID of the KV namespace. - `limits: Optional[DeploymentConfigsProductionLimits]` Limits for Pages Functions. - `cpu_ms: int` CPU time limit in milliseconds. - `mtls_certificates: Optional[Dict[str, DeploymentConfigsProductionMTLSCertificates]]` mTLS bindings used for Pages Functions. - `certificate_id: str` - `placement: Optional[DeploymentConfigsProductionPlacement]` Placement setting used for Pages Functions. - `mode: str` Placement mode. - `queue_producers: Optional[Dict[str, DeploymentConfigsProductionQueueProducers]]` Queue Producer bindings used for Pages Functions. - `name: str` Name of the Queue. - `r2_buckets: Optional[Dict[str, DeploymentConfigsProductionR2Buckets]]` R2 buckets used for Pages Functions. - `name: str` Name of the R2 bucket. - `jurisdiction: Optional[str]` Jurisdiction of the R2 bucket. - `services: Optional[Dict[str, DeploymentConfigsProductionServices]]` Services used for Pages Functions. - `environment: str` The Service environment. - `service: str` The Service name. - `entrypoint: Optional[str]` The entrypoint to bind to. - `vectorize_bindings: Optional[Dict[str, DeploymentConfigsProductionVectorizeBindings]]` Vectorize bindings used for Pages Functions. - `index_name: str` - `wrangler_config_hash: Optional[str]` Hash of the Wrangler configuration used for the deployment. - `framework: str` Framework the project is using. - `framework_version: str` Version of the framework the project is using. - `latest_deployment: Optional[Deployment]` Most recent deployment of the project. - `name: str` Name of the project. - `preview_script_name: str` Name of the preview script. - `production_branch: str` Production branch of the project. Used to identify production deployments. - `production_script_name: str` Name of the production script. - `uses_functions: Optional[bool]` Whether the project uses functions. - `build_config: Optional[BuildConfig]` Configs for the project build process. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Assets output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `domains: Optional[List[str]]` A list of associated custom domains for the project. - `source: Optional[Source]` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: bool` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: str` The owner of the repository. - `owner_id: str` The owner ID of the repository. - `path_excludes: List[str]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: List[str]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: bool` Whether to enable PR comments. - `preview_branch_excludes: List[str]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: List[str]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Literal["all", "none", "custom"]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: str` The production branch of the repository. - `production_deployments_enabled: bool` Whether to trigger a production deployment on commits to the production branch. - `repo_id: str` The ID of the repository. - `repo_name: str` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` - `subdomain: Optional[str]` The Cloudflare subdomain associated with the project. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) project = client.pages.projects.edit( project_name="this-is-my-project-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(project.id) ``` #### Response ```json { "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 } ``` ## Delete project `pages.projects.delete(strproject_name, ProjectDeleteParams**kwargs) -> object` **delete** `/accounts/{account_id}/pages/projects/{project_name}` Delete a project by name. ### Parameters - `account_id: str` Identifier. - `project_name: str` Name of the project. ### Returns - `object` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) project = client.pages.projects.delete( project_name="this-is-my-project-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(project) ``` #### Response ```json { "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": {}, "success": true } ``` ## Purge build cache `pages.projects.purge_build_cache(strproject_name, ProjectPurgeBuildCacheParams**kwargs) -> object` **post** `/accounts/{account_id}/pages/projects/{project_name}/purge_build_cache` Purge all cached build artifacts for a Pages project ### Parameters - `account_id: str` Identifier. - `project_name: str` Name of the project. ### Returns - `object` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.pages.projects.purge_build_cache( project_name="this-is-my-project-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(response) ``` #### Response ```json { "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": {}, "success": true } ``` ## Domain Types ### Deployment - `class Deployment: …` - `id: str` Id of the deployment. - `aliases: Optional[List[str]]` A list of alias URLs pointing to this deployment. - `build_config: BuildConfig` Configs for the project build process. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Assets output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `created_on: datetime` When the deployment was created. - `deployment_trigger: DeploymentTrigger` Info about what caused the deployment. - `metadata: DeploymentTriggerMetadata` Additional info about the trigger. - `branch: str` Where the trigger happened. - `commit_dirty: bool` Whether the deployment trigger commit was dirty. - `commit_hash: str` Hash of the deployment trigger commit. - `commit_message: str` Message of the deployment trigger commit. - `type: Literal["github:push", "ad_hoc", "deploy_hook"]` What caused the deployment. - `"github:push"` - `"ad_hoc"` - `"deploy_hook"` - `env_vars: Optional[Dict[str, Optional[EnvVars]]]` Environment variables used for builds and Pages Functions. - `class EnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class EnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `environment: Literal["preview", "production"]` Type of deploy. - `"preview"` - `"production"` - `is_skipped: bool` If the deployment has been skipped. - `latest_stage: Stage` The status of the deployment. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `"queued"` - `"initialize"` - `"clone_repo"` - `"build"` - `"deploy"` - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `"success"` - `"idle"` - `"active"` - `"failure"` - `"canceled"` - `modified_on: datetime` When the deployment was last modified. - `project_id: str` Id of the project. - `project_name: str` Name of the project. - `short_id: str` Short Id (8 character) of the deployment. - `source: Source` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: bool` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: str` The owner of the repository. - `owner_id: str` The owner ID of the repository. - `path_excludes: List[str]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: List[str]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: bool` Whether to enable PR comments. - `preview_branch_excludes: List[str]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: List[str]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Literal["all", "none", "custom"]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: str` The production branch of the repository. - `production_deployments_enabled: bool` Whether to trigger a production deployment on commits to the production branch. - `repo_id: str` The ID of the repository. - `repo_name: str` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` - `stages: List[Stage]` List of past stages. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `url: str` The live URL to view this deployment. - `uses_functions: Optional[bool]` Whether the deployment uses functions. ### Project - `class Project: …` - `id: str` ID of the project. - `canonical_deployment: Optional[Deployment]` Most recent production deployment of the project. - `id: str` Id of the deployment. - `aliases: Optional[List[str]]` A list of alias URLs pointing to this deployment. - `build_config: BuildConfig` Configs for the project build process. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Assets output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `created_on: datetime` When the deployment was created. - `deployment_trigger: DeploymentTrigger` Info about what caused the deployment. - `metadata: DeploymentTriggerMetadata` Additional info about the trigger. - `branch: str` Where the trigger happened. - `commit_dirty: bool` Whether the deployment trigger commit was dirty. - `commit_hash: str` Hash of the deployment trigger commit. - `commit_message: str` Message of the deployment trigger commit. - `type: Literal["github:push", "ad_hoc", "deploy_hook"]` What caused the deployment. - `"github:push"` - `"ad_hoc"` - `"deploy_hook"` - `env_vars: Optional[Dict[str, Optional[EnvVars]]]` Environment variables used for builds and Pages Functions. - `class EnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class EnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `environment: Literal["preview", "production"]` Type of deploy. - `"preview"` - `"production"` - `is_skipped: bool` If the deployment has been skipped. - `latest_stage: Stage` The status of the deployment. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `"queued"` - `"initialize"` - `"clone_repo"` - `"build"` - `"deploy"` - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `"success"` - `"idle"` - `"active"` - `"failure"` - `"canceled"` - `modified_on: datetime` When the deployment was last modified. - `project_id: str` Id of the project. - `project_name: str` Name of the project. - `short_id: str` Short Id (8 character) of the deployment. - `source: Source` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: bool` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: str` The owner of the repository. - `owner_id: str` The owner ID of the repository. - `path_excludes: List[str]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: List[str]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: bool` Whether to enable PR comments. - `preview_branch_excludes: List[str]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: List[str]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Literal["all", "none", "custom"]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: str` The production branch of the repository. - `production_deployments_enabled: bool` Whether to trigger a production deployment on commits to the production branch. - `repo_id: str` The ID of the repository. - `repo_name: str` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` - `stages: List[Stage]` List of past stages. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `url: str` The live URL to view this deployment. - `uses_functions: Optional[bool]` Whether the deployment uses functions. - `created_on: datetime` When the project was created. - `deployment_configs: DeploymentConfigs` Configs for deployments in a project. - `preview: DeploymentConfigsPreview` Configs for preview deploys. - `always_use_latest_compatibility_date: bool` Whether to always use the latest compatibility date for Pages Functions. - `build_image_major_version: int` The major version of the build image to use for Pages Functions. - `compatibility_date: str` Compatibility date used for Pages Functions. - `compatibility_flags: List[str]` Compatibility flags used for Pages Functions. - `env_vars: Optional[Dict[str, Optional[DeploymentConfigsPreviewEnvVars]]]` Environment variables used for builds and Pages Functions. - `class DeploymentConfigsPreviewEnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class DeploymentConfigsPreviewEnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `fail_open: bool` Whether to fail open when the deployment config cannot be applied. - `usage_model: Literal["standard", "bundled", "unbound"]` The usage model for Pages Functions. - `"standard"` - `"bundled"` - `"unbound"` - `ai_bindings: Optional[Dict[str, DeploymentConfigsPreviewAIBindings]]` Constellation bindings used for Pages Functions. - `project_id: str` - `analytics_engine_datasets: Optional[Dict[str, DeploymentConfigsPreviewAnalyticsEngineDatasets]]` Analytics Engine bindings used for Pages Functions. - `dataset: str` Name of the dataset. - `browsers: Optional[Dict[str, Optional[DeploymentConfigsPreviewBrowsers]]]` Browser bindings used for Pages Functions. - `d1_databases: Optional[Dict[str, DeploymentConfigsPreviewD1Databases]]` D1 databases used for Pages Functions. - `id: str` UUID of the D1 database. - `durable_object_namespaces: Optional[Dict[str, DeploymentConfigsPreviewDurableObjectNamespaces]]` Durable Object namespaces used for Pages Functions. - `namespace_id: str` ID of the Durable Object namespace. - `hyperdrive_bindings: Optional[Dict[str, DeploymentConfigsPreviewHyperdriveBindings]]` Hyperdrive bindings used for Pages Functions. - `id: str` - `kv_namespaces: Optional[Dict[str, DeploymentConfigsPreviewKVNamespaces]]` KV namespaces used for Pages Functions. - `namespace_id: str` ID of the KV namespace. - `limits: Optional[DeploymentConfigsPreviewLimits]` Limits for Pages Functions. - `cpu_ms: int` CPU time limit in milliseconds. - `mtls_certificates: Optional[Dict[str, DeploymentConfigsPreviewMTLSCertificates]]` mTLS bindings used for Pages Functions. - `certificate_id: str` - `placement: Optional[DeploymentConfigsPreviewPlacement]` Placement setting used for Pages Functions. - `mode: str` Placement mode. - `queue_producers: Optional[Dict[str, DeploymentConfigsPreviewQueueProducers]]` Queue Producer bindings used for Pages Functions. - `name: str` Name of the Queue. - `r2_buckets: Optional[Dict[str, DeploymentConfigsPreviewR2Buckets]]` R2 buckets used for Pages Functions. - `name: str` Name of the R2 bucket. - `jurisdiction: Optional[str]` Jurisdiction of the R2 bucket. - `services: Optional[Dict[str, DeploymentConfigsPreviewServices]]` Services used for Pages Functions. - `environment: str` The Service environment. - `service: str` The Service name. - `entrypoint: Optional[str]` The entrypoint to bind to. - `vectorize_bindings: Optional[Dict[str, DeploymentConfigsPreviewVectorizeBindings]]` Vectorize bindings used for Pages Functions. - `index_name: str` - `wrangler_config_hash: Optional[str]` Hash of the Wrangler configuration used for the deployment. - `production: DeploymentConfigsProduction` Configs for production deploys. - `always_use_latest_compatibility_date: bool` Whether to always use the latest compatibility date for Pages Functions. - `build_image_major_version: int` The major version of the build image to use for Pages Functions. - `compatibility_date: str` Compatibility date used for Pages Functions. - `compatibility_flags: List[str]` Compatibility flags used for Pages Functions. - `env_vars: Optional[Dict[str, Optional[DeploymentConfigsProductionEnvVars]]]` Environment variables used for builds and Pages Functions. - `class DeploymentConfigsProductionEnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class DeploymentConfigsProductionEnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `fail_open: bool` Whether to fail open when the deployment config cannot be applied. - `usage_model: Literal["standard", "bundled", "unbound"]` The usage model for Pages Functions. - `"standard"` - `"bundled"` - `"unbound"` - `ai_bindings: Optional[Dict[str, DeploymentConfigsProductionAIBindings]]` Constellation bindings used for Pages Functions. - `project_id: str` - `analytics_engine_datasets: Optional[Dict[str, DeploymentConfigsProductionAnalyticsEngineDatasets]]` Analytics Engine bindings used for Pages Functions. - `dataset: str` Name of the dataset. - `browsers: Optional[Dict[str, Optional[DeploymentConfigsProductionBrowsers]]]` Browser bindings used for Pages Functions. - `d1_databases: Optional[Dict[str, DeploymentConfigsProductionD1Databases]]` D1 databases used for Pages Functions. - `id: str` UUID of the D1 database. - `durable_object_namespaces: Optional[Dict[str, DeploymentConfigsProductionDurableObjectNamespaces]]` Durable Object namespaces used for Pages Functions. - `namespace_id: str` ID of the Durable Object namespace. - `hyperdrive_bindings: Optional[Dict[str, DeploymentConfigsProductionHyperdriveBindings]]` Hyperdrive bindings used for Pages Functions. - `id: str` - `kv_namespaces: Optional[Dict[str, DeploymentConfigsProductionKVNamespaces]]` KV namespaces used for Pages Functions. - `namespace_id: str` ID of the KV namespace. - `limits: Optional[DeploymentConfigsProductionLimits]` Limits for Pages Functions. - `cpu_ms: int` CPU time limit in milliseconds. - `mtls_certificates: Optional[Dict[str, DeploymentConfigsProductionMTLSCertificates]]` mTLS bindings used for Pages Functions. - `certificate_id: str` - `placement: Optional[DeploymentConfigsProductionPlacement]` Placement setting used for Pages Functions. - `mode: str` Placement mode. - `queue_producers: Optional[Dict[str, DeploymentConfigsProductionQueueProducers]]` Queue Producer bindings used for Pages Functions. - `name: str` Name of the Queue. - `r2_buckets: Optional[Dict[str, DeploymentConfigsProductionR2Buckets]]` R2 buckets used for Pages Functions. - `name: str` Name of the R2 bucket. - `jurisdiction: Optional[str]` Jurisdiction of the R2 bucket. - `services: Optional[Dict[str, DeploymentConfigsProductionServices]]` Services used for Pages Functions. - `environment: str` The Service environment. - `service: str` The Service name. - `entrypoint: Optional[str]` The entrypoint to bind to. - `vectorize_bindings: Optional[Dict[str, DeploymentConfigsProductionVectorizeBindings]]` Vectorize bindings used for Pages Functions. - `index_name: str` - `wrangler_config_hash: Optional[str]` Hash of the Wrangler configuration used for the deployment. - `framework: str` Framework the project is using. - `framework_version: str` Version of the framework the project is using. - `latest_deployment: Optional[Deployment]` Most recent deployment of the project. - `name: str` Name of the project. - `preview_script_name: str` Name of the preview script. - `production_branch: str` Production branch of the project. Used to identify production deployments. - `production_script_name: str` Name of the production script. - `uses_functions: Optional[bool]` Whether the project uses functions. - `build_config: Optional[BuildConfig]` Configs for the project build process. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Assets output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `domains: Optional[List[str]]` A list of associated custom domains for the project. - `source: Optional[Source]` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: bool` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: str` The owner of the repository. - `owner_id: str` The owner ID of the repository. - `path_excludes: List[str]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: List[str]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: bool` Whether to enable PR comments. - `preview_branch_excludes: List[str]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: List[str]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Literal["all", "none", "custom"]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: str` The production branch of the repository. - `production_deployments_enabled: bool` Whether to trigger a production deployment on commits to the production branch. - `repo_id: str` The ID of the repository. - `repo_name: str` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` - `subdomain: Optional[str]` The Cloudflare subdomain associated with the project. ### Stage - `class Stage: …` The status of the deployment. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `"queued"` - `"initialize"` - `"clone_repo"` - `"build"` - `"deploy"` - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `"success"` - `"idle"` - `"active"` - `"failure"` - `"canceled"` # Deployments ## Get deployments `pages.projects.deployments.list(strproject_name, DeploymentListParams**kwargs) -> SyncV4PagePaginationArray[Deployment]` **get** `/accounts/{account_id}/pages/projects/{project_name}/deployments` Fetch a list of project deployments. ### Parameters - `account_id: str` Identifier. - `project_name: str` Name of the project. - `env: Optional[Literal["production", "preview"]]` What type of deployments to fetch. - `"production"` - `"preview"` - `page: Optional[int]` Which page of deployments to fetch. - `per_page: Optional[int]` How many deployments to return per page. ### Returns - `class Deployment: …` - `id: str` Id of the deployment. - `aliases: Optional[List[str]]` A list of alias URLs pointing to this deployment. - `build_config: BuildConfig` Configs for the project build process. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Assets output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `created_on: datetime` When the deployment was created. - `deployment_trigger: DeploymentTrigger` Info about what caused the deployment. - `metadata: DeploymentTriggerMetadata` Additional info about the trigger. - `branch: str` Where the trigger happened. - `commit_dirty: bool` Whether the deployment trigger commit was dirty. - `commit_hash: str` Hash of the deployment trigger commit. - `commit_message: str` Message of the deployment trigger commit. - `type: Literal["github:push", "ad_hoc", "deploy_hook"]` What caused the deployment. - `"github:push"` - `"ad_hoc"` - `"deploy_hook"` - `env_vars: Optional[Dict[str, Optional[EnvVars]]]` Environment variables used for builds and Pages Functions. - `class EnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class EnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `environment: Literal["preview", "production"]` Type of deploy. - `"preview"` - `"production"` - `is_skipped: bool` If the deployment has been skipped. - `latest_stage: Stage` The status of the deployment. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `"queued"` - `"initialize"` - `"clone_repo"` - `"build"` - `"deploy"` - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `"success"` - `"idle"` - `"active"` - `"failure"` - `"canceled"` - `modified_on: datetime` When the deployment was last modified. - `project_id: str` Id of the project. - `project_name: str` Name of the project. - `short_id: str` Short Id (8 character) of the deployment. - `source: Source` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: bool` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: str` The owner of the repository. - `owner_id: str` The owner ID of the repository. - `path_excludes: List[str]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: List[str]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: bool` Whether to enable PR comments. - `preview_branch_excludes: List[str]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: List[str]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Literal["all", "none", "custom"]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: str` The production branch of the repository. - `production_deployments_enabled: bool` Whether to trigger a production deployment on commits to the production branch. - `repo_id: str` The ID of the repository. - `repo_name: str` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` - `stages: List[Stage]` List of past stages. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `url: str` The live URL to view this deployment. - `uses_functions: Optional[bool]` Whether the deployment uses functions. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.pages.projects.deployments.list( project_name="this-is-my-project-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.id) ``` #### Response ```json { "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": "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 } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Get deployment info `pages.projects.deployments.get(strdeployment_id, DeploymentGetParams**kwargs) -> Deployment` **get** `/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}` Fetch information about a deployment. ### Parameters - `account_id: str` Identifier. - `project_name: str` Name of the project. - `deployment_id: str` Identifier. ### Returns - `class Deployment: …` - `id: str` Id of the deployment. - `aliases: Optional[List[str]]` A list of alias URLs pointing to this deployment. - `build_config: BuildConfig` Configs for the project build process. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Assets output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `created_on: datetime` When the deployment was created. - `deployment_trigger: DeploymentTrigger` Info about what caused the deployment. - `metadata: DeploymentTriggerMetadata` Additional info about the trigger. - `branch: str` Where the trigger happened. - `commit_dirty: bool` Whether the deployment trigger commit was dirty. - `commit_hash: str` Hash of the deployment trigger commit. - `commit_message: str` Message of the deployment trigger commit. - `type: Literal["github:push", "ad_hoc", "deploy_hook"]` What caused the deployment. - `"github:push"` - `"ad_hoc"` - `"deploy_hook"` - `env_vars: Optional[Dict[str, Optional[EnvVars]]]` Environment variables used for builds and Pages Functions. - `class EnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class EnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `environment: Literal["preview", "production"]` Type of deploy. - `"preview"` - `"production"` - `is_skipped: bool` If the deployment has been skipped. - `latest_stage: Stage` The status of the deployment. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `"queued"` - `"initialize"` - `"clone_repo"` - `"build"` - `"deploy"` - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `"success"` - `"idle"` - `"active"` - `"failure"` - `"canceled"` - `modified_on: datetime` When the deployment was last modified. - `project_id: str` Id of the project. - `project_name: str` Name of the project. - `short_id: str` Short Id (8 character) of the deployment. - `source: Source` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: bool` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: str` The owner of the repository. - `owner_id: str` The owner ID of the repository. - `path_excludes: List[str]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: List[str]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: bool` Whether to enable PR comments. - `preview_branch_excludes: List[str]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: List[str]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Literal["all", "none", "custom"]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: str` The production branch of the repository. - `production_deployments_enabled: bool` Whether to trigger a production deployment on commits to the production branch. - `repo_id: str` The ID of the repository. - `repo_name: str` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` - `stages: List[Stage]` List of past stages. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `url: str` The live URL to view this deployment. - `uses_functions: Optional[bool]` Whether the deployment uses functions. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) deployment = client.pages.projects.deployments.get( deployment_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="this-is-my-project-01", ) print(deployment.id) ``` #### Response ```json { "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": "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 }, "success": true } ``` ## Create deployment `pages.projects.deployments.create(strproject_name, DeploymentCreateParams**kwargs) -> Deployment` **post** `/accounts/{account_id}/pages/projects/{project_name}/deployments` Start a new deployment from production. The repository and account must have already been authorized on the Cloudflare Pages dashboard. ### Parameters - `account_id: str` Identifier. - `project_name: str` Name of the project. - `_headers: Optional[FileTypes]` Headers configuration file for the deployment. - `_redirects: Optional[FileTypes]` Redirects configuration file for the deployment. - `_routes_json: Optional[FileTypes]` Routes configuration file defining routing rules. - `_worker_bundle: Optional[FileTypes]` Worker bundle file in multipart/form-data format. Mutually exclusive with `_worker.js`. Cannot specify both `_worker.js` and `_worker.bundle` in the same request. Maximum size: 25 MiB. - `_worker_js: Optional[FileTypes]` Worker JavaScript file. Mutually exclusive with `_worker.bundle`. Cannot specify both `_worker.js` and `_worker.bundle` in the same request. - `branch: Optional[str]` The branch to build the new deployment from. The `HEAD` of the branch will be used. If omitted, the production branch will be used by default. - `commit_dirty: Optional[Literal["true", "false"]]` Boolean string indicating if the working directory has uncommitted changes. - `"true"` - `"false"` - `commit_hash: Optional[str]` Git commit SHA associated with this deployment. - `commit_message: Optional[str]` Git commit message associated with this deployment. - `functions_filepath_routing_config_json: Optional[FileTypes]` Functions routing configuration file. - `manifest: Optional[str]` JSON string containing a manifest of files to deploy. Maps file paths to their content hashes. Required for direct upload deployments. Maximum 20,000 entries. - `pages_build_output_dir: Optional[str]` The build output directory path. - `wrangler_config_hash: Optional[str]` Hash of the Wrangler configuration file used for this deployment. ### Returns - `class Deployment: …` - `id: str` Id of the deployment. - `aliases: Optional[List[str]]` A list of alias URLs pointing to this deployment. - `build_config: BuildConfig` Configs for the project build process. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Assets output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `created_on: datetime` When the deployment was created. - `deployment_trigger: DeploymentTrigger` Info about what caused the deployment. - `metadata: DeploymentTriggerMetadata` Additional info about the trigger. - `branch: str` Where the trigger happened. - `commit_dirty: bool` Whether the deployment trigger commit was dirty. - `commit_hash: str` Hash of the deployment trigger commit. - `commit_message: str` Message of the deployment trigger commit. - `type: Literal["github:push", "ad_hoc", "deploy_hook"]` What caused the deployment. - `"github:push"` - `"ad_hoc"` - `"deploy_hook"` - `env_vars: Optional[Dict[str, Optional[EnvVars]]]` Environment variables used for builds and Pages Functions. - `class EnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class EnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `environment: Literal["preview", "production"]` Type of deploy. - `"preview"` - `"production"` - `is_skipped: bool` If the deployment has been skipped. - `latest_stage: Stage` The status of the deployment. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `"queued"` - `"initialize"` - `"clone_repo"` - `"build"` - `"deploy"` - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `"success"` - `"idle"` - `"active"` - `"failure"` - `"canceled"` - `modified_on: datetime` When the deployment was last modified. - `project_id: str` Id of the project. - `project_name: str` Name of the project. - `short_id: str` Short Id (8 character) of the deployment. - `source: Source` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: bool` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: str` The owner of the repository. - `owner_id: str` The owner ID of the repository. - `path_excludes: List[str]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: List[str]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: bool` Whether to enable PR comments. - `preview_branch_excludes: List[str]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: List[str]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Literal["all", "none", "custom"]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: str` The production branch of the repository. - `production_deployments_enabled: bool` Whether to trigger a production deployment on commits to the production branch. - `repo_id: str` The ID of the repository. - `repo_name: str` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` - `stages: List[Stage]` List of past stages. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `url: str` The live URL to view this deployment. - `uses_functions: Optional[bool]` Whether the deployment uses functions. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) deployment = client.pages.projects.deployments.create( project_name="this-is-my-project-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(deployment.id) ``` #### Response ```json { "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": "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 }, "success": true } ``` ## Delete deployment `pages.projects.deployments.delete(strdeployment_id, DeploymentDeleteParams**kwargs) -> object` **delete** `/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}` Delete a deployment. ### Parameters - `account_id: str` Identifier. - `project_name: str` Name of the project. - `deployment_id: str` Identifier. ### Returns - `object` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) deployment = client.pages.projects.deployments.delete( deployment_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="this-is-my-project-01", ) print(deployment) ``` #### Response ```json { "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": {}, "success": true } ``` ## Retry deployment `pages.projects.deployments.retry(strdeployment_id, DeploymentRetryParams**kwargs) -> Deployment` **post** `/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/retry` Retry a previous deployment. ### Parameters - `account_id: str` Identifier. - `project_name: str` Name of the project. - `deployment_id: str` Identifier. ### Returns - `class Deployment: …` - `id: str` Id of the deployment. - `aliases: Optional[List[str]]` A list of alias URLs pointing to this deployment. - `build_config: BuildConfig` Configs for the project build process. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Assets output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `created_on: datetime` When the deployment was created. - `deployment_trigger: DeploymentTrigger` Info about what caused the deployment. - `metadata: DeploymentTriggerMetadata` Additional info about the trigger. - `branch: str` Where the trigger happened. - `commit_dirty: bool` Whether the deployment trigger commit was dirty. - `commit_hash: str` Hash of the deployment trigger commit. - `commit_message: str` Message of the deployment trigger commit. - `type: Literal["github:push", "ad_hoc", "deploy_hook"]` What caused the deployment. - `"github:push"` - `"ad_hoc"` - `"deploy_hook"` - `env_vars: Optional[Dict[str, Optional[EnvVars]]]` Environment variables used for builds and Pages Functions. - `class EnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class EnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `environment: Literal["preview", "production"]` Type of deploy. - `"preview"` - `"production"` - `is_skipped: bool` If the deployment has been skipped. - `latest_stage: Stage` The status of the deployment. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `"queued"` - `"initialize"` - `"clone_repo"` - `"build"` - `"deploy"` - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `"success"` - `"idle"` - `"active"` - `"failure"` - `"canceled"` - `modified_on: datetime` When the deployment was last modified. - `project_id: str` Id of the project. - `project_name: str` Name of the project. - `short_id: str` Short Id (8 character) of the deployment. - `source: Source` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: bool` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: str` The owner of the repository. - `owner_id: str` The owner ID of the repository. - `path_excludes: List[str]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: List[str]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: bool` Whether to enable PR comments. - `preview_branch_excludes: List[str]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: List[str]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Literal["all", "none", "custom"]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: str` The production branch of the repository. - `production_deployments_enabled: bool` Whether to trigger a production deployment on commits to the production branch. - `repo_id: str` The ID of the repository. - `repo_name: str` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` - `stages: List[Stage]` List of past stages. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `url: str` The live URL to view this deployment. - `uses_functions: Optional[bool]` Whether the deployment uses functions. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) deployment = client.pages.projects.deployments.retry( deployment_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="this-is-my-project-01", ) print(deployment.id) ``` #### Response ```json { "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": "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 }, "success": true } ``` ## Rollback deployment `pages.projects.deployments.rollback(strdeployment_id, DeploymentRollbackParams**kwargs) -> Deployment` **post** `/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/rollback` Rollback the production deployment to a previous deployment. You can only rollback to succesful builds on production. ### Parameters - `account_id: str` Identifier. - `project_name: str` Name of the project. - `deployment_id: str` Identifier. ### Returns - `class Deployment: …` - `id: str` Id of the deployment. - `aliases: Optional[List[str]]` A list of alias URLs pointing to this deployment. - `build_config: BuildConfig` Configs for the project build process. - `web_analytics_tag: Optional[str]` The classifying tag for analytics. - `web_analytics_token: Optional[str]` The auth token for analytics. - `build_caching: Optional[bool]` Enable build caching for the project. - `build_command: Optional[str]` Command used to build project. - `destination_dir: Optional[str]` Assets output directory of the build. - `root_dir: Optional[str]` Directory to run the command. - `created_on: datetime` When the deployment was created. - `deployment_trigger: DeploymentTrigger` Info about what caused the deployment. - `metadata: DeploymentTriggerMetadata` Additional info about the trigger. - `branch: str` Where the trigger happened. - `commit_dirty: bool` Whether the deployment trigger commit was dirty. - `commit_hash: str` Hash of the deployment trigger commit. - `commit_message: str` Message of the deployment trigger commit. - `type: Literal["github:push", "ad_hoc", "deploy_hook"]` What caused the deployment. - `"github:push"` - `"ad_hoc"` - `"deploy_hook"` - `env_vars: Optional[Dict[str, Optional[EnvVars]]]` Environment variables used for builds and Pages Functions. - `class EnvVarsPagesPlainTextEnvVar: …` A plaintext environment variable. - `type: Literal["plain_text"]` - `"plain_text"` - `value: str` Environment variable value. - `class EnvVarsPagesSecretTextEnvVar: …` An encrypted environment variable. - `type: Literal["secret_text"]` - `"secret_text"` - `value: str` Secret value. - `environment: Literal["preview", "production"]` Type of deploy. - `"preview"` - `"production"` - `is_skipped: bool` If the deployment has been skipped. - `latest_stage: Stage` The status of the deployment. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `"queued"` - `"initialize"` - `"clone_repo"` - `"build"` - `"deploy"` - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `"success"` - `"idle"` - `"active"` - `"failure"` - `"canceled"` - `modified_on: datetime` When the deployment was last modified. - `project_id: str` Id of the project. - `project_name: str` Name of the project. - `short_id: str` Short Id (8 character) of the deployment. - `source: Source` Configs for the project source control. - `config: SourceConfig` - `deployments_enabled: bool` Whether to enable automatic deployments when pushing to the source repository. When disabled, no deployments (production or preview) will be triggered automatically. - `owner: str` The owner of the repository. - `owner_id: str` The owner ID of the repository. - `path_excludes: List[str]` A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported. - `path_includes: List[str]` A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported. - `pr_comments_enabled: bool` Whether to enable PR comments. - `preview_branch_excludes: List[str]` A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_branch_includes: List[str]` A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`. - `preview_deployment_setting: Literal["all", "none", "custom"]` Controls whether commits to preview branches trigger a preview deployment. - `"all"` - `"none"` - `"custom"` - `production_branch: str` The production branch of the repository. - `production_deployments_enabled: bool` Whether to trigger a production deployment on commits to the production branch. - `repo_id: str` The ID of the repository. - `repo_name: str` The name of the repository. - `type: Literal["github", "gitlab"]` The source control management provider. - `"github"` - `"gitlab"` - `stages: List[Stage]` List of past stages. - `ended_on: Optional[datetime]` When the stage ended. - `name: Literal["queued", "initialize", "clone_repo", 2 more]` The current build stage. - `started_on: Optional[datetime]` When the stage started. - `status: Literal["success", "idle", "active", 2 more]` State of the current stage. - `url: str` The live URL to view this deployment. - `uses_functions: Optional[bool]` Whether the deployment uses functions. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) deployment = client.pages.projects.deployments.rollback( deployment_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="this-is-my-project-01", ) print(deployment.id) ``` #### Response ```json { "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": "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 }, "success": true } ``` # History # Logs ## Get deployment logs `pages.projects.deployments.history.logs.get(strdeployment_id, LogGetParams**kwargs) -> LogGetResponse` **get** `/accounts/{account_id}/pages/projects/{project_name}/deployments/{deployment_id}/history/logs` Fetch deployment logs for a project. ### Parameters - `account_id: str` Identifier. - `project_name: str` Name of the project. - `deployment_id: str` Identifier. ### Returns - `class LogGetResponse: …` - `data: List[Data]` - `line: str` - `ts: str` - `includes_container_logs: bool` - `total: int` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) log = client.pages.projects.deployments.history.logs.get( deployment_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="this-is-my-project-01", ) print(log.data) ``` #### Response ```json { "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": { "data": [ { "line": "Cloning repository...", "ts": "2021-04-20T19:35:29.0749819Z" }, { "line": "From https://github.com/cloudflare/example", "ts": "2021-04-20T19:35:30.0749819Z" }, { "line": " * branch 209c5bb11d89533f426b2f8469bcae12fdccf71b -> FETCH_HEAD", "ts": "2021-04-20T19:35:30.0749819Z" }, { "line": "", "ts": "2021-04-20T19:35:30.0749819Z" }, { "line": "HEAD is now at 209c5bb Update index.html", "ts": "2021-04-20T19:35:30.0749819Z" }, { "line": "", "ts": "2021-04-20T19:35:30.0749819Z" }, { "line": "", "ts": "2021-04-20T19:35:30.0749819Z" }, { "line": "Success: Finished cloning repository files", "ts": "2021-04-20T19:35:30.0749819Z" }, { "line": "Installing dependencies", "ts": "2021-04-20T19:35:59.0749819Z" }, { "line": "Python version set to 2.7", "ts": "2021-04-20T19:35:59.0931208Z" }, { "line": "v12.18.0 is already installed.", "ts": "2021-04-20T19:36:02.2369501Z" }, { "line": "Now using node v12.18.0 (npm v6.14.4)", "ts": "2021-04-20T19:36:02.6028886Z" }, { "line": "Started restoring cached build plugins", "ts": "2021-04-20T19:36:02.624555Z" }, { "line": "Finished restoring cached build plugins", "ts": "2021-04-20T19:36:02.6340688Z" }, { "line": "Attempting ruby version 2.7.1, read from environment", "ts": "2021-04-20T19:36:02.963095Z" }, { "line": "Using ruby version 2.7.1", "ts": "2021-04-20T19:36:04.2236084Z" }, { "line": "Using PHP version 5.6", "ts": "2021-04-20T19:36:04.5450152Z" }, { "line": "5.2 is already installed.", "ts": "2021-04-20T19:36:04.5740509Z" }, { "line": "Using Swift version 5.2", "ts": "2021-04-20T19:36:04.577035Z" }, { "line": "Installing Hugo 0.54.0", "ts": "2021-04-20T19:36:04.5771615Z" }, { "line": "Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z", "ts": "2021-04-20T19:36:05.4786868Z" }, { "line": "Started restoring cached go cache", "ts": "2021-04-20T19:36:05.4794366Z" }, { "line": "Finished restoring cached go cache", "ts": "2021-04-20T19:36:05.481977Z" }, { "line": "go version go1.14.4 linux/amd64", "ts": "2021-04-20T19:36:05.9049776Z" }, { "line": "go version go1.14.4 linux/amd64", "ts": "2021-04-20T19:36:05.9086053Z" }, { "line": "Installing missing commands", "ts": "2021-04-20T19:36:05.9163568Z" }, { "line": "Verify run directory", "ts": "2021-04-20T19:36:05.9163934Z" }, { "line": "Executing user command: echo \"skipping build step: no build command specified\"", "ts": "2021-04-20T19:36:05.9164636Z" }, { "line": "skipping build step: no build command specified", "ts": "2021-04-20T19:36:05.9165087Z" }, { "line": "Finished", "ts": "2021-04-20T19:36:05.917412Z" } ], "includes_container_logs": true, "total": 30 }, "success": true } ``` ## Domain Types ### Log Get Response - `class LogGetResponse: …` - `data: List[Data]` - `line: str` - `ts: str` - `includes_container_logs: bool` - `total: int` # Domains ## Get domains `pages.projects.domains.list(strproject_name, DomainListParams**kwargs) -> SyncSinglePage[DomainListResponse]` **get** `/accounts/{account_id}/pages/projects/{project_name}/domains` Fetch a list of all domains associated with a Pages project. ### Parameters - `account_id: str` Identifier. - `project_name: str` Name of the project. ### Returns - `class DomainListResponse: …` - `id: str` - `certificate_authority: Literal["google", "lets_encrypt"]` - `"google"` - `"lets_encrypt"` - `created_on: str` - `domain_id: str` - `name: str` The domain name. - `status: Literal["initializing", "pending", "active", 3 more]` - `"initializing"` - `"pending"` - `"active"` - `"deactivated"` - `"blocked"` - `"error"` - `validation_data: ValidationData` - `method: Literal["http", "txt"]` - `"http"` - `"txt"` - `status: Literal["initializing", "pending", "active", 2 more]` - `"initializing"` - `"pending"` - `"active"` - `"deactivated"` - `"error"` - `error_message: Optional[str]` - `txt_name: Optional[str]` - `txt_value: Optional[str]` - `verification_data: VerificationData` - `status: Literal["pending", "active", "deactivated", 2 more]` - `"pending"` - `"active"` - `"deactivated"` - `"blocked"` - `"error"` - `error_message: Optional[str]` - `zone_tag: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.pages.projects.domains.list( project_name="this-is-my-project-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.id) ``` #### Response ```json { "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": "id", "certificate_authority": "lets_encrypt", "created_on": "created_on", "domain_id": "domain_id", "name": "this-is-my-domain-01.com", "status": "initializing", "validation_data": { "method": "http", "status": "initializing", "error_message": "error_message", "txt_name": "txt_name", "txt_value": "txt_value" }, "verification_data": { "status": "pending", "error_message": "error_message" }, "zone_tag": "zone_tag" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Get domain `pages.projects.domains.get(strdomain_name, DomainGetParams**kwargs) -> DomainGetResponse` **get** `/accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}` Fetch a single domain. ### Parameters - `account_id: str` Identifier. - `project_name: str` Name of the project. - `domain_name: str` The domain name. ### Returns - `class DomainGetResponse: …` - `id: str` - `certificate_authority: Literal["google", "lets_encrypt"]` - `"google"` - `"lets_encrypt"` - `created_on: str` - `domain_id: str` - `name: str` The domain name. - `status: Literal["initializing", "pending", "active", 3 more]` - `"initializing"` - `"pending"` - `"active"` - `"deactivated"` - `"blocked"` - `"error"` - `validation_data: ValidationData` - `method: Literal["http", "txt"]` - `"http"` - `"txt"` - `status: Literal["initializing", "pending", "active", 2 more]` - `"initializing"` - `"pending"` - `"active"` - `"deactivated"` - `"error"` - `error_message: Optional[str]` - `txt_name: Optional[str]` - `txt_value: Optional[str]` - `verification_data: VerificationData` - `status: Literal["pending", "active", "deactivated", 2 more]` - `"pending"` - `"active"` - `"deactivated"` - `"blocked"` - `"error"` - `error_message: Optional[str]` - `zone_tag: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) domain = client.pages.projects.domains.get( domain_name="this-is-my-domain-01.com", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="this-is-my-project-01", ) print(domain.id) ``` #### Response ```json { "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": "id", "certificate_authority": "lets_encrypt", "created_on": "created_on", "domain_id": "domain_id", "name": "this-is-my-domain-01.com", "status": "initializing", "validation_data": { "method": "http", "status": "initializing", "error_message": "error_message", "txt_name": "txt_name", "txt_value": "txt_value" }, "verification_data": { "status": "pending", "error_message": "error_message" }, "zone_tag": "zone_tag" }, "success": true } ``` ## Add domain `pages.projects.domains.create(strproject_name, DomainCreateParams**kwargs) -> DomainCreateResponse` **post** `/accounts/{account_id}/pages/projects/{project_name}/domains` Add a new domain for the Pages project. ### Parameters - `account_id: str` Identifier. - `project_name: str` Name of the project. - `name: str` The domain name. ### Returns - `class DomainCreateResponse: …` - `id: str` - `certificate_authority: Literal["google", "lets_encrypt"]` - `"google"` - `"lets_encrypt"` - `created_on: str` - `domain_id: str` - `name: str` The domain name. - `status: Literal["initializing", "pending", "active", 3 more]` - `"initializing"` - `"pending"` - `"active"` - `"deactivated"` - `"blocked"` - `"error"` - `validation_data: ValidationData` - `method: Literal["http", "txt"]` - `"http"` - `"txt"` - `status: Literal["initializing", "pending", "active", 2 more]` - `"initializing"` - `"pending"` - `"active"` - `"deactivated"` - `"error"` - `error_message: Optional[str]` - `txt_name: Optional[str]` - `txt_value: Optional[str]` - `verification_data: VerificationData` - `status: Literal["pending", "active", "deactivated", 2 more]` - `"pending"` - `"active"` - `"deactivated"` - `"blocked"` - `"error"` - `error_message: Optional[str]` - `zone_tag: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) domain = client.pages.projects.domains.create( project_name="this-is-my-project-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", name="this-is-my-domain-01.com", ) print(domain.id) ``` #### Response ```json { "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": "id", "certificate_authority": "lets_encrypt", "created_on": "created_on", "domain_id": "domain_id", "name": "this-is-my-domain-01.com", "status": "initializing", "validation_data": { "method": "http", "status": "initializing", "error_message": "error_message", "txt_name": "txt_name", "txt_value": "txt_value" }, "verification_data": { "status": "pending", "error_message": "error_message" }, "zone_tag": "zone_tag" }, "success": true } ``` ## Patch domain `pages.projects.domains.edit(strdomain_name, DomainEditParams**kwargs) -> DomainEditResponse` **patch** `/accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}` Retry the validation status of a single domain. ### Parameters - `account_id: str` Identifier. - `project_name: str` Name of the project. - `domain_name: str` The domain name. ### Returns - `class DomainEditResponse: …` - `id: str` - `certificate_authority: Literal["google", "lets_encrypt"]` - `"google"` - `"lets_encrypt"` - `created_on: str` - `domain_id: str` - `name: str` The domain name. - `status: Literal["initializing", "pending", "active", 3 more]` - `"initializing"` - `"pending"` - `"active"` - `"deactivated"` - `"blocked"` - `"error"` - `validation_data: ValidationData` - `method: Literal["http", "txt"]` - `"http"` - `"txt"` - `status: Literal["initializing", "pending", "active", 2 more]` - `"initializing"` - `"pending"` - `"active"` - `"deactivated"` - `"error"` - `error_message: Optional[str]` - `txt_name: Optional[str]` - `txt_value: Optional[str]` - `verification_data: VerificationData` - `status: Literal["pending", "active", "deactivated", 2 more]` - `"pending"` - `"active"` - `"deactivated"` - `"blocked"` - `"error"` - `error_message: Optional[str]` - `zone_tag: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.pages.projects.domains.edit( domain_name="this-is-my-domain-01.com", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="this-is-my-project-01", ) print(response.id) ``` #### Response ```json { "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": "id", "certificate_authority": "lets_encrypt", "created_on": "created_on", "domain_id": "domain_id", "name": "this-is-my-domain-01.com", "status": "initializing", "validation_data": { "method": "http", "status": "initializing", "error_message": "error_message", "txt_name": "txt_name", "txt_value": "txt_value" }, "verification_data": { "status": "pending", "error_message": "error_message" }, "zone_tag": "zone_tag" }, "success": true } ``` ## Delete domain `pages.projects.domains.delete(strdomain_name, DomainDeleteParams**kwargs) -> object` **delete** `/accounts/{account_id}/pages/projects/{project_name}/domains/{domain_name}` Delete a Pages project's domain. ### Parameters - `account_id: str` Identifier. - `project_name: str` Name of the project. - `domain_name: str` The domain name. ### Returns - `object` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) domain = client.pages.projects.domains.delete( domain_name="this-is-my-domain-01.com", account_id="023e105f4ecef8ad9ca31a8372d0c353", project_name="this-is-my-project-01", ) print(domain) ``` #### Response ```json { "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": {}, "success": true } ``` ## Domain Types ### Domain List Response - `class DomainListResponse: …` - `id: str` - `certificate_authority: Literal["google", "lets_encrypt"]` - `"google"` - `"lets_encrypt"` - `created_on: str` - `domain_id: str` - `name: str` The domain name. - `status: Literal["initializing", "pending", "active", 3 more]` - `"initializing"` - `"pending"` - `"active"` - `"deactivated"` - `"blocked"` - `"error"` - `validation_data: ValidationData` - `method: Literal["http", "txt"]` - `"http"` - `"txt"` - `status: Literal["initializing", "pending", "active", 2 more]` - `"initializing"` - `"pending"` - `"active"` - `"deactivated"` - `"error"` - `error_message: Optional[str]` - `txt_name: Optional[str]` - `txt_value: Optional[str]` - `verification_data: VerificationData` - `status: Literal["pending", "active", "deactivated", 2 more]` - `"pending"` - `"active"` - `"deactivated"` - `"blocked"` - `"error"` - `error_message: Optional[str]` - `zone_tag: str` ### Domain Get Response - `class DomainGetResponse: …` - `id: str` - `certificate_authority: Literal["google", "lets_encrypt"]` - `"google"` - `"lets_encrypt"` - `created_on: str` - `domain_id: str` - `name: str` The domain name. - `status: Literal["initializing", "pending", "active", 3 more]` - `"initializing"` - `"pending"` - `"active"` - `"deactivated"` - `"blocked"` - `"error"` - `validation_data: ValidationData` - `method: Literal["http", "txt"]` - `"http"` - `"txt"` - `status: Literal["initializing", "pending", "active", 2 more]` - `"initializing"` - `"pending"` - `"active"` - `"deactivated"` - `"error"` - `error_message: Optional[str]` - `txt_name: Optional[str]` - `txt_value: Optional[str]` - `verification_data: VerificationData` - `status: Literal["pending", "active", "deactivated", 2 more]` - `"pending"` - `"active"` - `"deactivated"` - `"blocked"` - `"error"` - `error_message: Optional[str]` - `zone_tag: str` ### Domain Create Response - `class DomainCreateResponse: …` - `id: str` - `certificate_authority: Literal["google", "lets_encrypt"]` - `"google"` - `"lets_encrypt"` - `created_on: str` - `domain_id: str` - `name: str` The domain name. - `status: Literal["initializing", "pending", "active", 3 more]` - `"initializing"` - `"pending"` - `"active"` - `"deactivated"` - `"blocked"` - `"error"` - `validation_data: ValidationData` - `method: Literal["http", "txt"]` - `"http"` - `"txt"` - `status: Literal["initializing", "pending", "active", 2 more]` - `"initializing"` - `"pending"` - `"active"` - `"deactivated"` - `"error"` - `error_message: Optional[str]` - `txt_name: Optional[str]` - `txt_value: Optional[str]` - `verification_data: VerificationData` - `status: Literal["pending", "active", "deactivated", 2 more]` - `"pending"` - `"active"` - `"deactivated"` - `"blocked"` - `"error"` - `error_message: Optional[str]` - `zone_tag: str` ### Domain Edit Response - `class DomainEditResponse: …` - `id: str` - `certificate_authority: Literal["google", "lets_encrypt"]` - `"google"` - `"lets_encrypt"` - `created_on: str` - `domain_id: str` - `name: str` The domain name. - `status: Literal["initializing", "pending", "active", 3 more]` - `"initializing"` - `"pending"` - `"active"` - `"deactivated"` - `"blocked"` - `"error"` - `validation_data: ValidationData` - `method: Literal["http", "txt"]` - `"http"` - `"txt"` - `status: Literal["initializing", "pending", "active", 2 more]` - `"initializing"` - `"pending"` - `"active"` - `"deactivated"` - `"error"` - `error_message: Optional[str]` - `txt_name: Optional[str]` - `txt_value: Optional[str]` - `verification_data: VerificationData` - `status: Literal["pending", "active", "deactivated", 2 more]` - `"pending"` - `"active"` - `"deactivated"` - `"blocked"` - `"error"` - `error_message: Optional[str]` - `zone_tag: str`