恢复部署
POST
/agent/v1/deployments/{deployment_id}/unpause● 支持请求参数
deployment_idstring必填path: Deployment id (depl_...), returned by deployments.create or deployments.list.
返回
200
支持部署资源创建、读取、过滤、更新、归档、暂停与恢复,固定智能体版本并返回最多五次未来调度时间;初始事件仅 user.message,资源仅 file;vault_ids 最多 50 个、自动去重,须属于当前组织且未归档,不存在或已归档返回 400 vault_ids[<index>] <id> was not found。支持手动运行及每分钟 cron 调度,运行创建的会话携带该部署的 vault_ids;创建失败会记录运行错误并自动暂停,部署保存后保险库被归档记为 vault_archived_error。 自有扩展接受 agent_with_overrides 与 target=computer(仅 general 智能体)。
错误按 Anthropic 错误格式返回(type / message / request_id),参见 错误码
请求示例
curl
curl -X POST https://api.deepraxis.com/agent/v1/deployments/depl_123/unpause \
-H "Authorization: Bearer $PRAXIS_API_KEY"Python
import requests
opts = dict(
base_url="https://api.deepraxis.com/agent",
api_key="$PRAXIS_API_KEY",
)
# /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
resp = requests.post(
f"{opts['base_url']}/v1/deployments/depl_123/unpause",
headers={"Authorization": f"Bearer {opts['api_key']}"},
)
print(resp.status_code, resp.json())TypeScript
const opts = {
baseURL: "https://api.deepraxis.com/agent",
apiKey: "$PRAXIS_API_KEY",
};
// /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
const resp = await fetch(`${opts.baseURL}/v1/deployments/depl_123/unpause`, {
method: "POST",
headers: { Authorization: `Bearer ${opts.apiKey}`, "Content-Type": "application/json" },
});
console.log(resp.status, await resp.json());响应示例 200
{
"id": "depl_b35c07c737fe442d84cef48361cc4354",
"type": "deployment",
"agent": {
"type": "agent",
"id": "agent_f8267029-f09f-45aa-966e-2235af1b9b6e",
"version": 1
},
"target": {
"type": "environment"
},
"environment_id": "env_a450b390e1e14f75aa2464159d56d900",
"name": "文档测试",
"description": null,
"initial_events": [
{
"type": "user.message",
"content": [
{
"type": "text",
"text": "Hi"
}
]
}
],
"resources": [],
"vault_ids": [],
"budget": null,
"schedule": null,
"metadata": {},
"status": "active",
"paused_reason": null,
"created_at": "2026-10-22T15:24:56.043Z",
"updated_at": "2026-10-22T15:24:57.363Z",
"archived_at": null
}响应
HTTP 200
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this deployment. |
| agent | object | Agent reference. Naming a version pins the deployment to it; naming only an id (or a bare id string) makes it follow the agent's active version, so every run uses whichever version is in effect then and a later agent save carries through automatically. The response also carries pinned_version (null while following) and active_version (the agent's currently effective version). The own face also accepts model, permission_mode and cwd overrides for new sessions. |
| agent.id | string | Agent id (agent_...). Pass it as agent when creating a session and as agent_id in agent calls. / The agent ID. |
| agent.type | string | Always agent. An agent definition. / An agent reference with model, permission_mode and cwd overrides for new sessions. |
| agent.version | number | The latest saved version of the agent, the editable head; it differs from active_version after a save with apply false. Starts at 1 and increments each time the agent is modified. / The agent version this deployment uses now; while the deployment follows the agent this is the active version, otherwise the version it is pinned to. |
| agent.pinned_version | integer | null | The version this deployment is pinned to; null when it follows the agent's active version. |
| agent.active_version | integer | null | The agent's currently effective version, the one a run would use now; null when the agent cannot be read. |
| agent.permission_mode | string | null | Permission mode for each new session; omitted or null inherits the agent policies. |
| agent.cwd | string | Working directory for each new session; omitted uses the session default. |
| agent.model | string | object | Replacement model id or model_config. Validated and stored without executing a session. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| description | null | string | Description of what the deployment does. |
| environment_id | string | null | Existing, unarchived environment id; environment_id and target are alternatives, so send at least one. target=environment requires it, target=computer (own face, general agents) may omit it; null is also accepted there. |
| initial_events | array<object> | Events sent to each session immediately after creation. |
| initial_events[].content | array<object> | Array of content blocks for the user message. / System content blocks to append. Text-only. |
| initial_events[].type | string | Always user.message. A message from the user to the agent, with content blocks. / Always user.define_outcome. The user defined the outcome the agent should reach. / Always system.message. A message produced by the platform rather than the user or the agent. |
| initial_events[].description | string | What the agent should produce. This is the task specification. |
| initial_events[].rubric | object | Rubric for grading the quality of an outcome. |
| initial_events[].max_iterations | null | number | Eval→revision cycles before giving up. Default 3, max 20. |
| metadata | object | Arbitrary key-value metadata. Maximum 16 pairs. |
| name | string | Human-readable name. |
| paused_reason | null | object | Why a deployment is paused. Non-null exactly when status is paused. |
| paused_reason.type | string | Always manual. An explicit request triggered this run or paused this deployment. / Always error. A stream error. |
| paused_reason.error | object | The error that triggered an auto-pause. Matches the failed run's error.type. |
| resources | array<object> | Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials. |
| resources[].type | string | Always github_repository. A GitHub repository resource; not supported on this platform. / Always file. A file resource: an uploaded file mounted into the session's machine. / Always memory_store. A memory store resource; not supported on this platform. |
| resources[].url | string | Github URL of the repository |
| resources[].checkout | null | object | Branch or commit to check out. Defaults to the repository's default branch. |
| resources[].mount_path | null | string | Mount path in the container. Defaults to /workspace/<repo-name>. / Mount path in the container. Defaults to /mnt/session/uploads/<file_id>. |
| resources[].file_id | string | ID of a previously uploaded file. |
| resources[].memory_store_id | string | The memory store ID (memstore_...). Must belong to the caller's organization and workspace. |
| resources[].access | null | string | Access mode for an attached memory store. |
| resources[].instructions | null | string | Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. |
| schedule | null | object | 5-field POSIX cron schedule with computed runtime timestamps. |
| schedule.expression | string | 5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily). |
| schedule.timezone | string | IANA timezone identifier (e.g., "America/Los_Angeles", "UTC"). |
| schedule.type | string | Always cron. A five-field POSIX schedule matched in its IANA timezone. |
| schedule.last_run_at | null | string | A timestamp in RFC 3339 format |
| schedule.upcoming_runs_at | array<string> | Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (archived_at set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time. |
| status | string | Lifecycle status of a deployment. |
| type | string | Always deployment. A frozen set of session parameters and an optional schedule. |
| updated_at | string | A timestamp in RFC 3339 format |
| vault_ids | array<string> | Vault IDs supplying stored credentials for sessions created from this deployment. |
| budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches max_list_cost. |
| budget.max_list_cost | object | A monetary amount in a specific currency. |
| budget.type | string | Budget kind; always limit. Any other value, including max_list_cost, returns 400 budget.type must be "limit". |
| target | object | Execution target. environment (default) requires an existing, unarchived environment_id. computer is available only for general agents and permits environment_id to be omitted. |
| target.type | string | environment uses an environment recipe; computer uses the agent computer. |
运行示例前
先创建部署,用返回的 ID 替换 depl_123。部署运行 ID drun_123 取自运行部署的响应。取消暂停前先暂停部署;测试结束后等待生成的会话空闲并删除会话,再归档部署、环境和智能体。