# 创建部署 (/docs/api/native/application/createDeployment)



`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\_…). |

## 请求体 (application/json) [#请求体-applicationjson]

必填: 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.                                                  |

```json
{
  "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."
        }
      }
    }
  }
}
```

## 响应 [#响应]

### HTTP 200 [#http-200]

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&lt;object&gt; | 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 &#124; 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 &#124; null | Upload progress. |
| praxis.error | object &#124; null | Why the deployment failed. |
| praxis.finished_on | string &#124; null | When the deployment reached a final status. |
