## Create Deployment

**post** `/agents/{agent_id}/deployments`

Create a new deployment record in PENDING status.

### Path Parameters

- `agent_id: string`

### Body Parameters

- `docker_image: string`

  Full Docker image URI.

- `helm_release_name: optional string`

  Helm release name.

- `registration_metadata: optional map[unknown]`

  Git/build metadata (commit_hash, branch_name, author_name, author_email, build_timestamp).

- `sgp_deploy_id: optional string`

  SGP deployment ID.

### Returns

- `id: string`

  The unique identifier of the deployment.

- `agent_id: string`

  The agent this deployment belongs to.

- `docker_image: string`

  Full Docker image URI.

- `is_production: boolean`

  Whether this is the production deployment.

- `status: "Pending" or "Ready" or "Failed"`

  Current deployment status.

  - `"Pending"`

  - `"Ready"`

  - `"Failed"`

- `acp_url: optional string`

  ACP URL set when agent registers.

- `created_at: optional string`

  When the deployment was created.

- `expires_at: optional string`

  When marked for cleanup.

- `helm_release_name: optional string`

  Helm release name for cleanup.

- `promoted_at: optional string`

  When promoted to production.

- `registration_metadata: optional map[unknown]`

  Git/build metadata from the agent pod.

- `sgp_deploy_id: optional string`

  Correlates to SGP's agentex_deploys.id.

### Example

```http
curl http://localhost:5003/agents/$AGENT_ID/deployments \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $AGENTEX_SDK_API_KEY" \
    -d '{
          "docker_image": "docker_image"
        }'
```

#### Response

```json
{
  "id": "id",
  "agent_id": "agent_id",
  "docker_image": "docker_image",
  "is_production": true,
  "status": "Pending",
  "acp_url": "acp_url",
  "created_at": "2019-12-27T18:11:19.117Z",
  "expires_at": "2019-12-27T18:11:19.117Z",
  "helm_release_name": "helm_release_name",
  "promoted_at": "2019-12-27T18:11:19.117Z",
  "registration_metadata": {
    "foo": "bar"
  },
  "sgp_deploy_id": "sgp_deploy_id"
}
```
