2026-10-20
(待译)
Cloudflare Workers-compatible face of Application: the official cloudflare SDK paths for Workers, versions, deployments and static assets. Concepts, differences and limits are described under the Application tag.
Authorization: Bearer <PRAXIS_API_KEY>
GET /cloudflare/client/v4/accounts/{account_id}/workers/workersPOST /cloudflare/client/v4/accounts/{account_id}/workers/workersGET /cloudflare/client/v4/accounts/{account_id}/workers/workers/{worker_id}PUT /cloudflare/client/v4/accounts/{account_id}/workers/workers/{worker_id}PATCH /cloudflare/client/v4/accounts/{account_id}/workers/workers/{worker_id}DELETE /cloudflare/client/v4/accounts/{account_id}/workers/workers/{worker_id}GET /cloudflare/client/v4/accounts/{account_id}/workers/workers/{worker_id}/versionsPOST /cloudflare/client/v4/accounts/{account_id}/workers/workers/{worker_id}/versionsGET /cloudflare/client/v4/accounts/{account_id}/workers/workers/{worker_id}/versions/{version_id}GET /cloudflare/client/v4/accounts/{account_id}/workers/scripts/{script_name}/deploymentsPOST /cloudflare/client/v4/accounts/{account_id}/workers/scripts/{script_name}/deploymentsGET /cloudflare/client/v4/accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}GET /cloudflare/client/v4/accounts/{account_id}/workers/subdomainPUT /cloudflare/client/v4/accounts/{account_id}/workers/subdomainPOST /cloudflare/client/v4/accounts/{account_id}/workers/scripts/{script_name}/assets-upload-sessionPOST /cloudflare/client/v4/accounts/{account_id}/workers/assets/uploadPUT /cloudflare/client/v4/accounts/{account_id}/workers/scripts/{script_name}GET /cloudflare/client/v4/accounts/{account_id}/workers/workers
List Workers. order and order_by are accepted and ignored.
支持状态: partial
List Workers. order and order_by are accepted and ignored.
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
| page | query | integer | false | Page number, from 1. |
| per_page | query | integer | false | Items per page (default 20). |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | array<object> | Workers. |
| result[].id | string | Worker ID, prefixed wkr_. |
| result[].name | string | Unique per account; lowercase letters, digits and single hyphens. |
| result[].subdomain | object | Public address of the Worker. |
| result[].tags | array<string> | Up to 8 tags. |
| result[].observability | object | Observability settings. |
| result[].logpush | boolean | Always false: unlike Cloudflare, Logpush is not offered. |
| result[].created_on | string | When the Worker was created. |
| result[].updated_on | string | When the Worker last changed. |
| result[].deployed_on | string | null | When the current deployment became active; null before the first deployment. |
| result[].praxis | object | Platform fields: lifecycle status, labels, and soft-delete timestamps. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
POST /cloudflare/client/v4/accounts/{account_id}/workers/workers
Create a Worker.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
必填: true
| 名称 | 类型 | 说明 |
|---|---|---|
| name | string | Worker name, unique in your account: 3–40 lowercase letters, digits or hyphens, starting and ending with a letter or digit, with no two hyphens in a row. The names www, api, admin, app, canary, canary-probe, status, docs and console are reserved. |
| tags | array<string> | Up to 8 tags. |
| observability | object | Observability settings. |
| observability.enabled | boolean | Collect logs. |
| subdomain | object | Subdomain settings. |
| subdomain.enabled | boolean | Serve the Worker on its public subdomain (default true). |
| praxis | object | Praxis settings. |
| praxis.labels | object | Up to 16 labels. |
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "Worker name, unique in your account: 3–40 lowercase letters, digits or hyphens, starting and ending with a letter or digit, with no two hyphens in a row. The names www, api, admin, app, canary, canary-probe, status, docs and console are reserved.",
"pattern": "^(?!(?:www|api|admin|app|canary|canary-probe|status|docs|console)$)(?!.*--)[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$",
"example": "my-app"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 8,
"description": "Up to 8 tags."
},
"observability": {
"type": "object",
"description": "Observability settings.",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean",
"description": "Collect logs."
}
}
},
"subdomain": {
"type": "object",
"description": "Subdomain settings.",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean",
"description": "Serve the Worker on its public subdomain (default true)."
}
}
},
"praxis": {
"type": "object",
"description": "Praxis settings.",
"required": [],
"properties": {
"labels": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Up to 16 labels."
}
}
}
}
}Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | object | |
| result.id | string | Worker ID, prefixed wkr_. |
| result.name | string | Unique per account; lowercase letters, digits and single hyphens. |
| result.subdomain | object | Public address of the Worker. |
| result.tags | array<string> | Up to 8 tags. |
| result.observability | object | Observability settings. |
| result.logpush | boolean | Always false: unlike Cloudflare, Logpush is not offered. |
| result.created_on | string | When the Worker was created. |
| result.updated_on | string | When the Worker last changed. |
| result.deployed_on | string | null | When the current deployment became active; null before the first deployment. |
| result.praxis | object | Platform fields: lifecycle status, labels, and soft-delete timestamps. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
GET /cloudflare/client/v4/accounts/{account_id}/workers/workers/{worker_id}
Get a Worker by ID or name.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
| worker_id | path | string | true | Worker ID or name. |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | object | |
| result.id | string | Worker ID, prefixed wkr_. |
| result.name | string | Unique per account; lowercase letters, digits and single hyphens. |
| result.subdomain | object | Public address of the Worker. |
| result.tags | array<string> | Up to 8 tags. |
| result.observability | object | Observability settings. |
| result.logpush | boolean | Always false: unlike Cloudflare, Logpush is not offered. |
| result.created_on | string | When the Worker was created. |
| result.updated_on | string | When the Worker last changed. |
| result.deployed_on | string | null | When the current deployment became active; null before the first deployment. |
| result.praxis | object | Platform fields: lifecycle status, labels, and soft-delete timestamps. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
PUT /cloudflare/client/v4/accounts/{account_id}/workers/workers/{worker_id}
Update a Worker. Omitted fields stay unchanged (same as PATCH).
支持状态: partial
Update a Worker. Omitted fields stay unchanged (same as PATCH).
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
| worker_id | path | string | true | Worker ID or name. |
必填: true
| 名称 | 类型 | 说明 |
|---|---|---|
| name | string | Worker name, unique in your account: 3–40 lowercase letters, digits or hyphens, starting and ending with a letter or digit, with no two hyphens in a row. The names www, api, admin, app, canary, canary-probe, status, docs and console are reserved. |
| tags | array<string> | Replaces the tags. |
| observability | object | Observability settings. |
| observability.enabled | boolean | Collect logs. |
| subdomain | object | Subdomain settings. |
| subdomain.enabled | boolean | Serve the Worker on its public subdomain. |
| praxis | object | Praxis settings. |
| praxis.labels | object | Replaces the labels. |
{
"type": "object",
"required": [],
"properties": {
"name": {
"type": "string",
"description": "Worker name, unique in your account: 3–40 lowercase letters, digits or hyphens, starting and ending with a letter or digit, with no two hyphens in a row. The names www, api, admin, app, canary, canary-probe, status, docs and console are reserved.",
"pattern": "^(?!(?:www|api|admin|app|canary|canary-probe|status|docs|console)$)(?!.*--)[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$",
"example": "my-app"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 8,
"description": "Replaces the tags."
},
"observability": {
"type": "object",
"description": "Observability settings.",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean",
"description": "Collect logs."
}
}
},
"subdomain": {
"type": "object",
"description": "Subdomain settings.",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean",
"description": "Serve the Worker on its public subdomain."
}
}
},
"praxis": {
"type": "object",
"description": "Praxis settings.",
"required": [],
"properties": {
"labels": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Replaces the labels."
}
}
}
}
}Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | object | |
| result.id | string | Worker ID, prefixed wkr_. |
| result.name | string | Unique per account; lowercase letters, digits and single hyphens. |
| result.subdomain | object | Public address of the Worker. |
| result.tags | array<string> | Up to 8 tags. |
| result.observability | object | Observability settings. |
| result.logpush | boolean | Always false: unlike Cloudflare, Logpush is not offered. |
| result.created_on | string | When the Worker was created. |
| result.updated_on | string | When the Worker last changed. |
| result.deployed_on | string | null | When the current deployment became active; null before the first deployment. |
| result.praxis | object | Platform fields: lifecycle status, labels, and soft-delete timestamps. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
PATCH /cloudflare/client/v4/accounts/{account_id}/workers/workers/{worker_id}
Change some fields of a Worker.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
| worker_id | path | string | true | Worker ID or name. |
必填: true
| 名称 | 类型 | 说明 |
|---|---|---|
| name | string | Worker name, unique in your account: 3–40 lowercase letters, digits or hyphens, starting and ending with a letter or digit, with no two hyphens in a row. The names www, api, admin, app, canary, canary-probe, status, docs and console are reserved. |
| tags | array<string> | Replaces the tags. |
| observability | object | Observability settings. |
| observability.enabled | boolean | Collect logs. |
| subdomain | object | Subdomain settings. |
| subdomain.enabled | boolean | Serve the Worker on its public subdomain. |
| praxis | object | Praxis settings. |
| praxis.labels | object | Replaces the labels. |
{
"type": "object",
"required": [],
"properties": {
"name": {
"type": "string",
"description": "Worker name, unique in your account: 3–40 lowercase letters, digits or hyphens, starting and ending with a letter or digit, with no two hyphens in a row. The names www, api, admin, app, canary, canary-probe, status, docs and console are reserved.",
"pattern": "^(?!(?:www|api|admin|app|canary|canary-probe|status|docs|console)$)(?!.*--)[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$",
"example": "my-app"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"maxItems": 8,
"description": "Replaces the tags."
},
"observability": {
"type": "object",
"description": "Observability settings.",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean",
"description": "Collect logs."
}
}
},
"subdomain": {
"type": "object",
"description": "Subdomain settings.",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean",
"description": "Serve the Worker on its public subdomain."
}
}
},
"praxis": {
"type": "object",
"description": "Praxis settings.",
"required": [],
"properties": {
"labels": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Replaces the labels."
}
}
}
}
}Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | object | |
| result.id | string | Worker ID, prefixed wkr_. |
| result.name | string | Unique per account; lowercase letters, digits and single hyphens. |
| result.subdomain | object | Public address of the Worker. |
| result.tags | array<string> | Up to 8 tags. |
| result.observability | object | Observability settings. |
| result.logpush | boolean | Always false: unlike Cloudflare, Logpush is not offered. |
| result.created_on | string | When the Worker was created. |
| result.updated_on | string | When the Worker last changed. |
| result.deployed_on | string | null | When the current deployment became active; null before the first deployment. |
| result.praxis | object | Platform fields: lifecycle status, labels, and soft-delete timestamps. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
DELETE /cloudflare/client/v4/accounts/{account_id}/workers/workers/{worker_id}
Delete a Worker. It can be restored on the native API for 7 days. force is accepted and ignored.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
| worker_id | path | string | true | Worker ID or name. |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | null | No result. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
GET /cloudflare/client/v4/accounts/{account_id}/workers/workers/{worker_id}/versions
List versions, newest first.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
| worker_id | path | string | true | Worker ID or name. |
| page | query | integer | false | Page number, from 1. |
| per_page | query | integer | false | Items per page (default 20). |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | array<object> | Versions. |
| result[].id | string | Version ID, prefixed ver_. |
| result[].number | integer | Per-Worker counter (v1, v2, …). |
| result[].created_on | string | When the version was created. |
| result[].main_module | string | null | Entry module name, or null for a version containing only static assets. |
| result[].modules | array<object> | Module names and types; content is never returned. |
| result[].compatibility_date | string | Workers runtime compatibility date. |
| result[].compatibility_flags | array<string> | Runtime compatibility flags. |
| result[].bindings | array<object> | Bindings; secret values are never returned. |
| result[].assets | object | null | Static asset settings. |
| result[].annotations | object | Free-form annotations. |
| result[].author_id | string | null | Who created the version. |
| result[].source | string | Upload origin, e.g. api or sdk. |
| result[].urls | array<string> | Preview URLs of this version. |
| result[].praxis | object | Platform fields: owning Worker, build source, script size and asset manifest summary. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
POST /cloudflare/client/v4/accounts/{account_id}/workers/workers/{worker_id}/versions
Upload a version. With deploy=true a deployment starts as well. Static assets are declared with assets.manifest; triggers, migrations, containers and placement are refused.
支持状态: partial
Upload a version. With deploy=true a deployment starts as well. Static assets are declared with assets.manifest; triggers, migrations, containers and placement are refused.
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
| worker_id | path | string | true | Worker ID or name. |
| deploy | query | boolean | false | Also deploy this version. |
必填: true
| 名称 | 类型 | 说明 |
|---|---|---|
| deploy | boolean | Also create a deployment of this version (own face only; on the compatible face use the deploy query parameter). |
| main_module | string | Entry module name; must equal the name of one of modules. Defaults to the first module; omit it when there are no modules. |
| modules | array<object> | Inline modules. |
| modules[].name | string | Module file name. |
| modules[].content_type | string | Module content type: application/javascript+module, text/javascript, application/javascript, application/wasm, text/plain, application/octet-stream, application/json or application/x-python. Omit it to use application/javascript+module. |
| modules[].content_base64 | string | Module content, base64. |
| compatibility_date | string | Workers runtime compatibility date: a real date in YYYY-MM-DD form, not later than today (UTC). Defaults to today (UTC). |
| compatibility_flags | array<string> | Runtime compatibility flags. |
| bindings | array<object> | Bindings of this version. |
| bindings[].type | string | Binding type; see the binding description for what each needs and which are unavailable. |
| bindings[].name | string | Name of the binding in the Worker's env: 1–64 letters, digits or underscores, not starting with a digit; unique within a version. |
| assets | object | Static assets. Pass either manifest (every file already uploaded through an upload session) or jwt (the completion token from the last upload batch), not both. |
| assets.config | object | Routing settings for the static assets. |
| assets.manifest | object | Map of static file path to content hash and byte size. Paths start with /; the same hash must declare the same size. The root paths /_headers and /_redirects are response-header and redirect rule files and are not served as assets; same-named files in subdirectories are ordinary assets. _headers allows at most 100 rules and 2000 characters per line (whitespace included); _redirects allows at most 2000 static and 100 dynamic rules and 1000 characters per rule (whitespace included), and rules after the first dynamic rule count toward the dynamic quota. Exceeding a limit makes CreateVersion return INVALID_PARAMS, with violations.field pointing at the manifest entry. |
| assets.jwt | string | Completion token from the last assets/upload batch; it carries this version's manifest, so do not also pass manifest. |
| annotations | object | Free-form annotations. |
| annotations.workers/message | string | Version message. |
| annotations.workers/tag | string | Version tag. |
| praxis | object | Praxis settings. |
| praxis.source | object | Build source: {type:inline}, {type:machine, path} or {type:file, file_id}. |
{
"type": "object",
"required": [],
"properties": {
"deploy": {
"type": "boolean",
"description": "Also create a deployment of this version (own face only; on the compatible face use the deploy query parameter)."
},
"main_module": {
"type": "string",
"description": "Entry module name; must equal the name of one of modules. Defaults to the first module; omit it when there are no modules.",
"example": "index.js"
},
"modules": {
"type": "array",
"items": {
"$ref": "#/components/schemas/cloudflare-Module"
},
"description": "Inline modules."
},
"compatibility_date": {
"type": "string",
"description": "Workers runtime compatibility date: a real date in YYYY-MM-DD form, not later than today (UTC). Defaults to today (UTC).",
"format": "date",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
"example": "2026-01-01"
},
"compatibility_flags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Runtime compatibility flags."
},
"bindings": {
"type": "array",
"items": {
"$ref": "#/components/schemas/cloudflare-Binding"
},
"description": "Bindings of this version."
},
"assets": {
"type": "object",
"description": "Static assets. Pass either manifest (every file already uploaded through an upload session) or jwt (the completion token from the last upload batch), not both.",
"required": [],
"properties": {
"config": {
"$ref": "#/components/schemas/cloudflare-AssetsConfig",
"description": "Routing settings for the static assets."
},
"manifest": {
"$ref": "#/components/schemas/cloudflare-AssetManifest"
},
"jwt": {
"type": "string",
"description": "Completion token from the last assets/upload batch; it carries this version's manifest, so do not also pass manifest."
}
}
},
"annotations": {
"type": "object",
"description": "Free-form annotations.",
"required": [],
"properties": {
"workers/message": {
"type": "string",
"description": "Version message."
},
"workers/tag": {
"type": "string",
"description": "Version tag."
}
}
},
"praxis": {
"type": "object",
"description": "Praxis settings.",
"required": [],
"properties": {
"source": {
"type": "object",
"additionalProperties": true,
"description": "Build source: {type:inline}, {type:machine, path} or {type:file, file_id}."
}
}
}
}
}Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | object | |
| result.id | string | Version ID, prefixed ver_. |
| result.number | integer | Per-Worker counter (v1, v2, …). |
| result.created_on | string | When the version was created. |
| result.main_module | string | null | Entry module name, or null for a version containing only static assets. |
| result.modules | array<object> | Module names and types; content is never returned. |
| result.compatibility_date | string | Workers runtime compatibility date. |
| result.compatibility_flags | array<string> | Runtime compatibility flags. |
| result.bindings | array<object> | Bindings; secret values are never returned. |
| result.assets | object | null | Static asset settings. |
| result.annotations | object | Free-form annotations. |
| result.author_id | string | null | Who created the version. |
| result.source | string | Upload origin, e.g. api or sdk. |
| result.urls | array<string> | Preview URLs of this version. |
| result.praxis | object | Platform fields: owning Worker, build source, script size and asset manifest summary. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
GET /cloudflare/client/v4/accounts/{account_id}/workers/workers/{worker_id}/versions/{version_id}
Get one version.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
| worker_id | path | string | true | Worker ID or name. |
| version_id | path | string | true | Version ID. |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | object | |
| result.id | string | Version ID, prefixed ver_. |
| result.number | integer | Per-Worker counter (v1, v2, …). |
| result.created_on | string | When the version was created. |
| result.main_module | string | null | Entry module name, or null for a version containing only static assets. |
| result.modules | array<object> | Module names and types; content is never returned. |
| result.compatibility_date | string | Workers runtime compatibility date. |
| result.compatibility_flags | array<string> | Runtime compatibility flags. |
| result.bindings | array<object> | Bindings; secret values are never returned. |
| result.assets | object | null | Static asset settings. |
| result.annotations | object | Free-form annotations. |
| result.author_id | string | null | Who created the version. |
| result.source | string | Upload origin, e.g. api or sdk. |
| result.urls | array<string> | Preview URLs of this version. |
| result.praxis | object | Platform fields: owning Worker, build source, script size and asset manifest summary. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
GET /cloudflare/client/v4/accounts/{account_id}/workers/scripts/{script_name}/deployments
List deployments of a Worker, newest first.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
| script_name | path | string | true | Worker name. |
| page | query | integer | false | Page number, from 1. |
| per_page | query | integer | false | Items per page (default 20). |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | object | |
| result.deployments | array<object> | Deployments. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
POST /cloudflare/client/v4/accounts/{account_id}/workers/scripts/{script_name}/deployments
Deploy one version at 100 percent (no gradual rollout). Deployment is asynchronous; read praxis.status.
支持状态: partial
Deploy one version at 100 percent (no gradual rollout). Deployment is asynchronous; read praxis.status.
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
| script_name | path | string | true | Worker name. |
| force | query | boolean | false | Deploy even if the last deployment changed in between. |
必填: true
| 名称 | 类型 | 说明 |
|---|---|---|
| strategy | string | Rollout strategy. |
| versions | array<object> | Exactly one version at 100 percent. |
| versions[].version_id | string | Version to deploy. |
| versions[].percentage | number | Must be 100. |
| force | boolean | Own face only; on the compatible face use the force query parameter. |
| annotations | object | Free-form annotations. |
| annotations.workers/message | string | Deployment message. |
{
"type": "object",
"required": [
"strategy",
"versions"
],
"properties": {
"strategy": {
"type": "string",
"description": "Rollout strategy.",
"enum": [
"percentage"
],
"x-enum-descriptions": {
"percentage": "Split traffic by percentage; only a single version at 100 is accepted."
},
"example": "percentage"
},
"versions": {
"type": "array",
"description": "Exactly one version at 100 percent.",
"items": {
"type": "object",
"required": [
"version_id",
"percentage"
],
"properties": {
"version_id": {
"type": "string",
"description": "Version to deploy."
},
"percentage": {
"type": "number",
"description": "Must be 100."
}
}
}
},
"force": {
"type": "boolean",
"description": "Own face only; on the compatible face use the force query parameter."
},
"annotations": {
"type": "object",
"description": "Free-form annotations.",
"required": [],
"properties": {
"workers/message": {
"type": "string",
"description": "Deployment message."
}
}
}
}
}Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | object | |
| result.id | string | Deployment ID, prefixed dep_. |
| result.created_on | string | When the deployment was created. |
| result.source | string | Origin: api, sdk, console or rollback. |
| result.strategy | string | Rollout strategy. |
| result.versions | array<object> | Exactly one version at 100 percent. |
| result.annotations | object | Free-form annotations. |
| result.author_email | string | null | Who created the deployment. |
| result.praxis | object | Platform fields: deployments run asynchronously, so track status, progress and error here. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
GET /cloudflare/client/v4/accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}
Get one deployment.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
| script_name | path | string | true | Worker name. |
| deployment_id | path | string | true | Deployment ID. |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | object | |
| result.id | string | Deployment ID, prefixed dep_. |
| result.created_on | string | When the deployment was created. |
| result.source | string | Origin: api, sdk, console or rollback. |
| result.strategy | string | Rollout strategy. |
| result.versions | array<object> | Exactly one version at 100 percent. |
| result.annotations | object | Free-form annotations. |
| result.author_email | string | null | Who created the deployment. |
| result.praxis | object | Platform fields: deployments run asynchronously, so track status, progress and error here. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
GET /cloudflare/client/v4/accounts/{account_id}/workers/subdomain
Get the account subdomain.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | object | |
| result.subdomain | string | Account subdomain, 8–32 lowercase letters and digits; part of every Worker URL. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
PUT /cloudflare/client/v4/accounts/{account_id}/workers/subdomain
Change the account subdomain.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
必填: true
| 名称 | 类型 | 说明 |
|---|---|---|
| subdomain | string | Account subdomain, 8–32 lowercase letters and digits; part of every Worker URL. |
{
"type": "object",
"required": [
"subdomain"
],
"properties": {
"subdomain": {
"type": "string",
"description": "Account subdomain, 8–32 lowercase letters and digits; part of every Worker URL.",
"pattern": "^[a-z0-9]{8,32}$",
"example": "acme1234"
}
}
}Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | object | |
| result.subdomain | string | Account subdomain, 8–32 lowercase letters and digits; part of every Worker URL. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
POST /cloudflare/client/v4/accounts/{account_id}/workers/scripts/{script_name}/assets-upload-session
Declare the static file manifest; the answer lists missing hashes in batches and an upload token.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
| script_name | path | string | true | Worker name. |
必填: true
| 名称 | 类型 | 说明 |
|---|---|---|
| manifest | object | Map of static file path to content hash and byte size. Paths start with /; the same hash must declare the same size. The root paths /_headers and /_redirects are response-header and redirect rule files and are not served as assets; same-named files in subdirectories are ordinary assets. _headers allows at most 100 rules and 2000 characters per line (whitespace included); _redirects allows at most 2000 static and 100 dynamic rules and 1000 characters per rule (whitespace included), and rules after the first dynamic rule count toward the dynamic quota. Exceeding a limit makes CreateVersion return INVALID_PARAMS, with violations.field pointing at the manifest entry. |
{
"type": "object",
"required": [
"manifest"
],
"properties": {
"manifest": {
"$ref": "#/components/schemas/cloudflare-AssetManifest"
}
}
}Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | object | |
| result.jwt | string | Upload token, valid for one hour. |
| result.buckets | array<array<string>> | Hashes still missing, grouped into upload batches. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
POST /cloudflare/client/v4/accounts/{account_id}/workers/assets/upload
Upload one batch as multipart form fields (hash → content; base64 when base64=true). Send the upload token as Authorization: Bearer and your API key in X-API-Key. Earlier batches answer 202; the last answers 201 with the completion token.
支持状态: partial
Upload one batch as multipart form fields (hash → content; base64 when base64=true). Send the upload token as Authorization: Bearer and your API key in X-API-Key. Earlier batches answer 202; the last answers 201 with the completion token.
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
| base64 | query | boolean | false | Field values are base64. |
必填: true
| 名称 | 类型 | 说明 |
|---|
{
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "One form field per file: the field name is the hash, the value the content."
}Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | object | |
| result.jwt | string | null | Completion token after the last batch; null for earlier batches. |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
Batch stored; more batches remain (no completion token yet).
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| success | boolean | Always true on success. |
| errors | array<any> | Always empty on success. |
| messages | array<any> | Always empty on success. |
| result | object | |
| result_info | object | Present on list responses. |
| result_info.page | integer | Page number. |
| result_info.per_page | integer | Page size. |
| result_info.count | integer | Items on this page. |
PUT /cloudflare/client/v4/accounts/{account_id}/workers/scripts/{script_name}
Not supported: answers 501. Use POST workers/workers and POST workers/workers/{worker_id}/versions?deploy=true.
支持状态: unsupported
Not supported: answers 501. Use POST workers/workers and POST workers/workers/{worker_id}/versions?deploy=true.
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| account_id | path | string | true | Any value; your account comes from the API key. |
| script_name | path | string | true | Worker name. |
此端点没有声明成功响应。