Application

写入密钥

写入密钥

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_idpathstringtrueWorker ID (wkr_…).
namepathstringtrueSecret name as seen in the Worker's env: 1–64 letters, digits or underscores, not starting with a digit.

请求体 (application/json)

必填: true

名称类型说明
sourceobject{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."
    }
  }
}

响应

HTTP 200

Success

application/json

名称类型说明
secretobjectThe secret after the write; its value is not returned.
secret.worker_idstringOwning Worker.
secret.namestringSecret name, as seen by the Worker's env.
secret.sourceobject{type: value} for a stored value, or {type: vault, vault_id, secret} for a vault reference. Values are never returned.
secret.updated_onstringWhen the secret last changed.
deploymentobjectThe deployment of the version derived from this change.
deployment.idstringDeployment ID, prefixed dep_.
deployment.created_onstringWhen the deployment was created.
deployment.sourcestringOrigin: api, sdk, console or rollback.
deployment.strategystringRollout strategy.
deployment.versionsarray<object>Exactly one version at 100 percent.
deployment.annotationsobjectFree-form annotations.
deployment.author_emailstring | nullWho created the deployment.
deployment.praxisobjectPlatform fields: deployments run asynchronously, so track status, progress and error here.
导出

本页内容