2026-10-20
(待译)
Application hosts your Workers: upload code and static assets as a version, deploy it, and serve it on its own *.praxisusercontent.com URL (use the url that publish returns). Concepts and behavior follow Cloudflare Workers (Workers, versions, deployments, static assets with _headers/_redirects, secrets, bindings), so Cloudflare experience applies. Differences: there are no Service Bindings, so applications call each other with fetch on their public URL; a deployment runs exactly one version at 100 percent (no gradual rollout); changing a secret creates a new version and deploys it. Application runtime data belongs in its own d1, kv or r2 components; Database, File and Knowledge are shared content stores that applications can read through public APIs, not private runtime storage. Start with praxis.application.publish, which uploads, versions and deploys in one call.
Authorization: Bearer <PRAXIS_API_KEY>
GET /application/v1/subdomainPUT /application/v1/subdomainGET /application/v1/workersPOST /application/v1/workersGET /application/v1/workers/{worker_id}PATCH /application/v1/workers/{worker_id}DELETE /application/v1/workers/{worker_id}POST /application/v1/workers/{worker_id}/restoreGET /application/v1/workers/{worker_id}/versionsPOST /application/v1/workers/{worker_id}/versionsGET /application/v1/workers/{worker_id}/versions/{version_id}GET /application/v1/workers/{worker_id}/deploymentsPOST /application/v1/workers/{worker_id}/deploymentsGET /application/v1/workers/{worker_id}/deployments/{deployment_id}GET /application/v1/workers/{worker_id}/componentsGET /application/v1/workers/{worker_id}/secretsPUT /application/v1/workers/{worker_id}/secrets/{name}DELETE /application/v1/workers/{worker_id}/secrets/{name}GET /application/v1/workers/{worker_id}/grantsPOST /application/v1/workers/{worker_id}/grantsDELETE /application/v1/workers/{worker_id}/grants/{grant_id}GET /application/v1/workers/{worker_id}/eventsPOST /application/v1/workers/{worker_id}/assets-upload-sessionPOST /application/v1/assets/uploadPUT /application/v1/subdomain
Change the account subdomain. Every Worker moves to the new address at once; old addresses stop resolving.
支持状态: supported
必填: 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
| 名称 | 类型 | 说明 |
|---|---|---|
| subdomain | string | Account subdomain, 8–32 lowercase letters and digits; part of every Worker URL. |
GET /application/v1/workers
List Workers in your account. Filter by status or by label with label.<key>=<value>.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| cursor | query | string | false | next_cursor from the previous page. |
| limit | query | integer | false | Items per page. |
| status | query | string | false | Worker status: draft (no deployment yet), active (serving), suspended (stopped by an administrator), deleted (soft-deleted, restorable for 7 days), purging (resources being removed), purged (gone). |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | Workers. |
| data[].id | string | Worker ID, prefixed wkr_. |
| data[].name | string | Unique per account; lowercase letters, digits and single hyphens. |
| data[].subdomain | object | Public address of the Worker. |
| data[].tags | array<string> | Up to 8 tags. |
| data[].observability | object | Observability settings. |
| data[].logpush | boolean | Always false: unlike Cloudflare, Logpush is not offered. |
| data[].created_on | string | When the Worker was created. |
| data[].updated_on | string | When the Worker last changed. |
| data[].deployed_on | string | null | When the current deployment became active; null before the first deployment. |
| data[].praxis | object | Platform fields: lifecycle status, labels, and soft-delete timestamps. |
| next_cursor | string | null | Cursor for the next page; null on the last page. |
POST /application/v1/workers
Create a Worker. It serves nothing until a version is deployed.
支持状态: supported
必填: 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
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Worker ID, prefixed wkr_. |
| name | string | Unique per account; lowercase letters, digits and single hyphens. |
| subdomain | object | Public address of the Worker. |
| subdomain.enabled | boolean | Whether the public subdomain serves this Worker. |
| subdomain.url | string | Public URL of the Worker. |
| tags | array<string> | Up to 8 tags. |
| observability | object | Observability settings. |
| observability.enabled | boolean | Whether logs are collected. |
| logpush | boolean | Always false: unlike Cloudflare, Logpush is not offered. |
| created_on | string | When the Worker was created. |
| updated_on | string | When the Worker last changed. |
| deployed_on | string | null | When the current deployment became active; null before the first deployment. |
| praxis | object | Platform fields: lifecycle status, labels, and soft-delete timestamps. |
| praxis.status | string | Worker status: draft (no deployment yet), active (serving), suspended (stopped by an administrator), deleted (soft-deleted, restorable for 7 days), purging (resources being removed), purged (gone). |
| praxis.current_deployment_id | string | null | ID of the active deployment. |
| praxis.labels | object | Up to 16 key-value labels for your own grouping. |
| praxis.deleted_on | string | null | When the Worker was deleted. |
| praxis.purge_on | string | null | When a deleted Worker is permanently removed. |
| praxis.suspended_reason | string | null | Why an administrator suspended the Worker. |
GET /application/v1/workers/{worker_id}
Get a Worker. expand returns related objects in the same response.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
| expand | query | string | false | Comma-separated: versions, deployments, components, secrets, grants. |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Worker ID, prefixed wkr_. |
| name | string | Unique per account; lowercase letters, digits and single hyphens. |
| subdomain | object | Public address of the Worker. |
| subdomain.enabled | boolean | Whether the public subdomain serves this Worker. |
| subdomain.url | string | Public URL of the Worker. |
| tags | array<string> | Up to 8 tags. |
| observability | object | Observability settings. |
| observability.enabled | boolean | Whether logs are collected. |
| logpush | boolean | Always false: unlike Cloudflare, Logpush is not offered. |
| created_on | string | When the Worker was created. |
| updated_on | string | When the Worker last changed. |
| deployed_on | string | null | When the current deployment became active; null before the first deployment. |
| praxis | object | Platform fields: lifecycle status, labels, and soft-delete timestamps. |
| praxis.status | string | Worker status: draft (no deployment yet), active (serving), suspended (stopped by an administrator), deleted (soft-deleted, restorable for 7 days), purging (resources being removed), purged (gone). |
| praxis.current_deployment_id | string | null | ID of the active deployment. |
| praxis.labels | object | Up to 16 key-value labels for your own grouping. |
| praxis.deleted_on | string | null | When the Worker was deleted. |
| praxis.purge_on | string | null | When a deleted Worker is permanently removed. |
| praxis.suspended_reason | string | null | Why an administrator suspended the Worker. |
| expanded | object | Present only for the members named in expand. |
| expanded.versions | object | Versions of the Worker, newest first. |
| expanded.deployments | object | Deployments of the Worker, newest first. |
| expanded.components | array<object> | Components of the Worker. |
| expanded.secrets | array<object> | Secrets of the Worker (names only). |
| expanded.grants | array<object> | Grants of the Worker. |
PATCH /application/v1/workers/{worker_id}
Change name, tags, observability, subdomain or labels. Omitted fields stay unchanged.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
必填: 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
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Worker ID, prefixed wkr_. |
| name | string | Unique per account; lowercase letters, digits and single hyphens. |
| subdomain | object | Public address of the Worker. |
| subdomain.enabled | boolean | Whether the public subdomain serves this Worker. |
| subdomain.url | string | Public URL of the Worker. |
| tags | array<string> | Up to 8 tags. |
| observability | object | Observability settings. |
| observability.enabled | boolean | Whether logs are collected. |
| logpush | boolean | Always false: unlike Cloudflare, Logpush is not offered. |
| created_on | string | When the Worker was created. |
| updated_on | string | When the Worker last changed. |
| deployed_on | string | null | When the current deployment became active; null before the first deployment. |
| praxis | object | Platform fields: lifecycle status, labels, and soft-delete timestamps. |
| praxis.status | string | Worker status: draft (no deployment yet), active (serving), suspended (stopped by an administrator), deleted (soft-deleted, restorable for 7 days), purging (resources being removed), purged (gone). |
| praxis.current_deployment_id | string | null | ID of the active deployment. |
| praxis.labels | object | Up to 16 key-value labels for your own grouping. |
| praxis.deleted_on | string | null | When the Worker was deleted. |
| praxis.purge_on | string | null | When a deleted Worker is permanently removed. |
| praxis.suspended_reason | string | null | Why an administrator suspended the Worker. |
DELETE /application/v1/workers/{worker_id}
Soft-delete a Worker. Unlike Cloudflare, deletion is reversible: it stops serving at once and can be restored with RestoreWorker for 7 days, after which it is purged.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Worker ID, prefixed wkr_. |
| name | string | Unique per account; lowercase letters, digits and single hyphens. |
| subdomain | object | Public address of the Worker. |
| subdomain.enabled | boolean | Whether the public subdomain serves this Worker. |
| subdomain.url | string | Public URL of the Worker. |
| tags | array<string> | Up to 8 tags. |
| observability | object | Observability settings. |
| observability.enabled | boolean | Whether logs are collected. |
| logpush | boolean | Always false: unlike Cloudflare, Logpush is not offered. |
| created_on | string | When the Worker was created. |
| updated_on | string | When the Worker last changed. |
| deployed_on | string | null | When the current deployment became active; null before the first deployment. |
| praxis | object | Platform fields: lifecycle status, labels, and soft-delete timestamps. |
| praxis.status | string | Worker status: draft (no deployment yet), active (serving), suspended (stopped by an administrator), deleted (soft-deleted, restorable for 7 days), purging (resources being removed), purged (gone). |
| praxis.current_deployment_id | string | null | ID of the active deployment. |
| praxis.labels | object | Up to 16 key-value labels for your own grouping. |
| praxis.deleted_on | string | null | When the Worker was deleted. |
| praxis.purge_on | string | null | When a deleted Worker is permanently removed. |
| praxis.suspended_reason | string | null | Why an administrator suspended the Worker. |
POST /application/v1/workers/{worker_id}/restore
Bring back a soft-deleted Worker within 7 days of deletion, with its versions and deployments. Cloudflare has no equivalent.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Worker ID, prefixed wkr_. |
| name | string | Unique per account; lowercase letters, digits and single hyphens. |
| subdomain | object | Public address of the Worker. |
| subdomain.enabled | boolean | Whether the public subdomain serves this Worker. |
| subdomain.url | string | Public URL of the Worker. |
| tags | array<string> | Up to 8 tags. |
| observability | object | Observability settings. |
| observability.enabled | boolean | Whether logs are collected. |
| logpush | boolean | Always false: unlike Cloudflare, Logpush is not offered. |
| created_on | string | When the Worker was created. |
| updated_on | string | When the Worker last changed. |
| deployed_on | string | null | When the current deployment became active; null before the first deployment. |
| praxis | object | Platform fields: lifecycle status, labels, and soft-delete timestamps. |
| praxis.status | string | Worker status: draft (no deployment yet), active (serving), suspended (stopped by an administrator), deleted (soft-deleted, restorable for 7 days), purging (resources being removed), purged (gone). |
| praxis.current_deployment_id | string | null | ID of the active deployment. |
| praxis.labels | object | Up to 16 key-value labels for your own grouping. |
| praxis.deleted_on | string | null | When the Worker was deleted. |
| praxis.purge_on | string | null | When a deleted Worker is permanently removed. |
| praxis.suspended_reason | string | null | Why an administrator suspended the Worker. |
GET /application/v1/workers/{worker_id}/versions
List the versions of a Worker, newest first, to pick one to deploy or inspect. Page with next_cursor.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
| cursor | query | string | false | next_cursor from the previous page. |
| limit | query | integer | false | Items per page. |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | Versions, newest first. |
| data[].id | string | Version ID, prefixed ver_. |
| data[].number | integer | Per-Worker counter (v1, v2, …). |
| data[].created_on | string | When the version was created. |
| data[].main_module | string | null | Entry module name, or null for a version containing only static assets. |
| data[].modules | array<object> | Module names and types; content is never returned. |
| data[].compatibility_date | string | Workers runtime compatibility date. |
| data[].compatibility_flags | array<string> | Runtime compatibility flags. |
| data[].bindings | array<object> | Bindings; secret values are never returned. |
| data[].assets | object | null | Static asset settings. |
| data[].annotations | object | Free-form annotations. |
| data[].author_id | string | null | Who created the version. |
| data[].source | string | Upload origin, e.g. api or sdk. |
| data[].urls | array<string> | Preview URLs of this version. |
| data[].praxis | object | Platform fields: owning Worker, build source, script size and asset manifest summary. |
| next_cursor | string | null | Cursor for the next page; null on the last page. |
POST /application/v1/workers/{worker_id}/versions
Upload code and bindings as a new version; a version serves nothing until deployed. Set deploy true to create the pending deployment in the same call. Rejected binding types return UNSUPPORTED.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
必填: 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/application-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/application-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/application-AssetsConfig",
"description": "Routing settings for the static assets."
},
"manifest": {
"$ref": "#/components/schemas/application-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
| 名称 | 类型 | 说明 |
|---|---|---|
| version | object | The version that was created. |
| version.id | string | Version ID, prefixed ver_. |
| version.number | integer | Per-Worker counter (v1, v2, …). |
| version.created_on | string | When the version was created. |
| version.main_module | string | null | Entry module name, or null for a version containing only static assets. |
| version.modules | array<object> | Module names and types; content is never returned. |
| version.compatibility_date | string | Workers runtime compatibility date. |
| version.compatibility_flags | array<string> | Runtime compatibility flags. |
| version.bindings | array<object> | Bindings; secret values are never returned. |
| version.assets | object | null | Static asset settings. |
| version.annotations | object | Free-form annotations. |
| version.author_id | string | null | Who created the version. |
| version.source | string | Upload origin, e.g. api or sdk. |
| version.urls | array<string> | Preview URLs of this version. |
| version.praxis | object | Platform fields: owning Worker, build source, script size and asset manifest summary. |
| deployment | object | null | The pending deployment; null unless deploy was requested. |
| deployment.id | string | Deployment ID, prefixed dep_. |
| deployment.created_on | string | When the deployment was created. |
| deployment.source | string | Origin: api, sdk, console or rollback. |
| deployment.strategy | string | Rollout strategy. |
| deployment.versions | array<object> | Exactly one version at 100 percent. |
| deployment.annotations | object | Free-form annotations. |
| deployment.author_email | string | null | Who created the deployment. |
| deployment.praxis | object | Platform fields: deployments run asynchronously, so track status, progress and error here. |
GET /application/v1/workers/{worker_id}/versions/{version_id}
Get one version of a Worker with its modules, bindings and asset settings; secret values are never returned.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
| version_id | path | string | true | Version ID (ver_…). |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Version ID, prefixed ver_. |
| number | integer | Per-Worker counter (v1, v2, …). |
| created_on | string | When the version was created. |
| main_module | string | null | Entry module name, or null for a version containing only static assets. |
| modules | array<object> | Module names and types; content is never returned. |
| modules[].name | string | Module name. |
| modules[].content_type | string | MIME type. |
| compatibility_date | string | Workers runtime compatibility date. |
| compatibility_flags | array<string> | Runtime compatibility flags. |
| bindings | array<object> | Bindings; secret values are never returned. |
| 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 | null | Static asset settings. |
| assets.config | object | Routing settings for the static assets. |
| annotations | object | Free-form annotations. |
| annotations.workers/message | string | Version message. |
| annotations.workers/tag | string | Version tag. |
| author_id | string | null | Who created the version. |
| source | string | Upload origin, e.g. api or sdk. |
| urls | array<string> | Preview URLs of this version. |
| praxis | object | Platform fields: owning Worker, build source, script size and asset manifest summary. |
| praxis.worker_id | string | Owning Worker. |
| praxis.source | object | Where the build came from: inline, machine (a tar.gz on a session machine) or file (an uploaded tar.gz). |
| praxis.size_bytes | integer | Script size in bytes. |
| praxis.assets_manifest | object | null | Static asset manifest summary. |
GET /application/v1/workers/{worker_id}/deployments
List the deployments of a Worker, newest first; the first active one is serving. Page with next_cursor.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
| cursor | query | string | false | next_cursor from the previous page. |
| limit | query | integer | false | Items per page. |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | Deployments, newest first. |
| data[].id | string | Deployment ID, prefixed dep_. |
| data[].created_on | string | When the deployment was created. |
| data[].source | string | Origin: api, sdk, console or rollback. |
| data[].strategy | string | Rollout strategy. |
| data[].versions | array<object> | Exactly one version at 100 percent. |
| data[].annotations | object | Free-form annotations. |
| data[].author_email | string | null | Who created the deployment. |
| data[].praxis | object | Platform fields: deployments run asynchronously, so track status, progress and error here. |
| next_cursor | string | null | Cursor for the next page; null on the last page. |
POST /application/v1/workers/{worker_id}/deployments
Deploy one version to serve the Worker. Unlike Cloudflare, a deployment holds exactly one version at 100 percent (no gradual rollout), so strategy must be percentage. Deployment is asynchronous; poll the deployment until praxis.status is active or failed.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
必填: 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
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Deployment ID, prefixed dep_. |
| created_on | string | When the deployment was created. |
| source | string | Origin: api, sdk, console or rollback. |
| strategy | string | Rollout strategy. |
| versions | array<object> | Exactly one version at 100 percent. |
| versions[].version_id | string | Deployed version. |
| versions[].percentage | number | Traffic share; always 100. |
| annotations | object | Free-form annotations. |
| annotations.workers/message | string | Deployment message. |
| annotations.workers/triggered_by | string | What triggered the deployment. |
| author_email | string | null | Who created the deployment. |
| praxis | object | Platform fields: deployments run asynchronously, so track status, progress and error here. |
| praxis.worker_id | string | Owning Worker. |
| praxis.status | string | Deployment status: pending (queued), uploading (pushing components and assets), activating (switching traffic), active (serving), superseded (replaced by a later deployment), failed (see error), cancelled (replaced before it finished). |
| praxis.progress | object | null | Upload progress. |
| praxis.error | object | null | Why the deployment failed. |
| praxis.finished_on | string | null | When the deployment reached a final status. |
GET /application/v1/workers/{worker_id}/deployments/{deployment_id}
Get one deployment with its status and upload progress; poll this after CreateDeployment until praxis.status is active or failed.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
| deployment_id | path | string | true | ID from the id of CreateDeployment or ListDeployments, prefixed dep_. |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Deployment ID, prefixed dep_. |
| created_on | string | When the deployment was created. |
| source | string | Origin: api, sdk, console or rollback. |
| strategy | string | Rollout strategy. |
| versions | array<object> | Exactly one version at 100 percent. |
| versions[].version_id | string | Deployed version. |
| versions[].percentage | number | Traffic share; always 100. |
| annotations | object | Free-form annotations. |
| annotations.workers/message | string | Deployment message. |
| annotations.workers/triggered_by | string | What triggered the deployment. |
| author_email | string | null | Who created the deployment. |
| praxis | object | Platform fields: deployments run asynchronously, so track status, progress and error here. |
| praxis.worker_id | string | Owning Worker. |
| praxis.status | string | Deployment status: pending (queued), uploading (pushing components and assets), activating (switching traffic), active (serving), superseded (replaced by a later deployment), failed (see error), cancelled (replaced before it finished). |
| praxis.progress | object | null | Upload progress. |
| praxis.error | object | null | Why the deployment failed. |
| praxis.finished_on | string | null | When the deployment reached a final status. |
GET /application/v1/workers/{worker_id}/components
List the databases, namespaces and buckets this Worker owns.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| [].id | string | Component ID, prefixed cmp_. |
| [].worker_id | string | Owning Worker. |
| [].binding | string | Binding name in the Worker's env. |
| [].type | string | Component type: d1 database, kv namespace or r2 bucket. |
| [].status | string | Component status: provisioning, ready, failed, deleting or deleted. |
| [].location_hint | string | Always apac. |
| [].usage | object | null | Storage usage. |
| [].usage.bytes | integer | Stored bytes. |
| [].usage.items | integer | Stored items. |
| [].created_on | string | When the component was created. |
GET /application/v1/workers/{worker_id}/secrets
List secret names and sources. Values are never returned.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| [].worker_id | string | Owning Worker. |
| [].name | string | Secret name, as seen by the Worker's env. |
| [].source | object | {type: value} for a stored value, or {type: vault, vault_id, secret} for a vault reference. Values are never returned. |
| [].updated_on | string | When the secret last changed. |
PUT /application/v1/workers/{worker_id}/secrets/{name}
Create or replace a secret by value or vault reference. Unlike Cloudflare, this derives a new version from the current one and deploys it, so the change is live only once that deployment is active.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
| name | path | string | true | Secret name as seen in the Worker's env: 1–64 letters, digits or underscores, not starting with a digit. |
必填: true
| 名称 | 类型 | 说明 |
|---|---|---|
| source | object | {type: value, text} stores a value; {type: vault, vault_id, secret} references a vault secret. |
{
"type": "object",
"required": [
"source"
],
"properties": {
"source": {
"type": "object",
"additionalProperties": true,
"description": "{type: value, text} stores a value; {type: vault, vault_id, secret} references a vault secret."
}
}
}Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| secret | object | The secret after the write; its value is not returned. |
| secret.worker_id | string | Owning Worker. |
| secret.name | string | Secret name, as seen by the Worker's env. |
| secret.source | object | {type: value} for a stored value, or {type: vault, vault_id, secret} for a vault reference. Values are never returned. |
| secret.updated_on | string | When the secret last changed. |
| deployment | object | The deployment of the version derived from this change. |
| deployment.id | string | Deployment ID, prefixed dep_. |
| deployment.created_on | string | When the deployment was created. |
| deployment.source | string | Origin: api, sdk, console or rollback. |
| deployment.strategy | string | Rollout strategy. |
| deployment.versions | array<object> | Exactly one version at 100 percent. |
| deployment.annotations | object | Free-form annotations. |
| deployment.author_email | string | null | Who created the deployment. |
| deployment.praxis | object | Platform fields: deployments run asynchronously, so track status, progress and error here. |
DELETE /application/v1/workers/{worker_id}/secrets/{name}
Delete a secret. Unlike Cloudflare, this derives a new version without it and deploys that version.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
| name | path | string | true | Secret name as seen in the Worker's env: 1–64 letters, digits or underscores, not starting with a digit. |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| deployment | object | The deployment of the version derived without this secret. |
| deployment.id | string | Deployment ID, prefixed dep_. |
| deployment.created_on | string | When the deployment was created. |
| deployment.source | string | Origin: api, sdk, console or rollback. |
| deployment.strategy | string | Rollout strategy. |
| deployment.versions | array<object> | Exactly one version at 100 percent. |
| deployment.annotations | object | Free-form annotations. |
| deployment.author_email | string | null | Who created the deployment. |
| deployment.praxis | object | Platform fields: deployments run asynchronously, so track status, progress and error here. |
GET /application/v1/workers/{worker_id}/grants
List resources this Worker's platform token may access.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| [].id | string | Grant ID, prefixed grt_. |
| [].worker_id | string | Owning Worker. |
| [].resource | object | Granted resource. |
| [].resource.type | string | Resource type. |
| [].resource.id | string | Resource ID. |
| [].access | string | Access level. |
| [].created_on | string | When the grant was created. |
POST /application/v1/workers/{worker_id}/grants
Let this Worker's platform token access one of your databases, folders or knowledge bases.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
必填: true
| 名称 | 类型 | 说明 |
|---|---|---|
| resource | object | Resource to grant. |
| resource.type | string | Resource type. |
| resource.id | string | Resource ID in your account. |
| access | string | Access level. |
{
"type": "object",
"required": [
"resource",
"access"
],
"properties": {
"resource": {
"type": "object",
"description": "Resource to grant.",
"required": [
"type",
"id"
],
"properties": {
"type": {
"type": "string",
"description": "Resource type.",
"enum": [
"database",
"folder",
"knowledge"
],
"x-enum-descriptions": {
"database": "A database.",
"folder": "A file folder.",
"knowledge": "A knowledge base."
},
"example": "database"
},
"id": {
"type": "string",
"description": "Resource ID in your account.",
"example": "db_01example"
}
}
},
"access": {
"type": "string",
"description": "Access level.",
"enum": [
"read",
"read_write"
],
"x-enum-descriptions": {
"read": "Read only.",
"read_write": "Read and write."
},
"example": "read"
}
}
}Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Grant ID, prefixed grt_. |
| worker_id | string | Owning Worker. |
| resource | object | Granted resource. |
| resource.type | string | Resource type. |
| resource.id | string | Resource ID. |
| access | string | Access level. |
| created_on | string | When the grant was created. |
DELETE /application/v1/workers/{worker_id}/grants/{grant_id}
Revoke a grant so this Worker's platform token can no longer access the granted resource. Takes effect for new requests at once.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
| grant_id | path | string | true | Grant ID (grt_…). |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| deleted | boolean | Always true. |
GET /application/v1/workers/{worker_id}/events
List lifecycle events of a Worker in sequence order.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
| after_seq | query | integer | false | Return events after this sequence number. |
| limit | query | integer | false | Items per page. |
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | Events in sequence order. |
| data[].seq | integer | Monotonic sequence within the Worker. |
| data[].id | string | Event ID. |
| data[].type | string | Event type, e.g. deployment.status_active. |
| data[].processed_at | string | When the event was recorded. |
| data[].worker_id | string | Worker the event belongs to. |
| data[].version_id | string | Related version. |
| data[].deployment_id | string | Related deployment. |
| data[].component_id | string | Related component. |
| data[].detail | object | Event-specific detail. |
| next_cursor | string | null | Cursor for the next page; null on the last page. |
POST /application/v1/workers/{worker_id}/assets-upload-session
Declare the static file manifest. The answer lists the hashes still missing, grouped into upload batches, and an upload token.
支持状态: supported
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| worker_id | path | string | true | Worker ID (wkr_…). |
必填: 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/application-AssetManifest"
}
}
}Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| jwt | string | Upload token, valid for one hour. |
| buckets | array<array<string>> | Hashes still missing, grouped into upload batches. |
POST /application/v1/assets/upload
Upload one batch: files maps hash to base64 content. The last batch returns the completion token.
支持状态: supported
必填: true
| 名称 | 类型 | 说明 |
|---|---|---|
| jwt | string | Upload token from the session. |
| files | object | Hash → base64 file content. |
{
"type": "object",
"required": [
"jwt",
"files"
],
"properties": {
"jwt": {
"type": "string",
"description": "Upload token from the session."
},
"files": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Hash → base64 file content."
}
}
}Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| jwt | string | null | Completion token after the last batch; null for earlier batches. |