部署
列出部署
通过 OMA API 列出部署。
GET
/
v1
/
deployments
列出部署
curl --request GET \
--url http://localhost:38080/v1/deployments \
--header 'X-Api-Key: <api-key>' \
--header 'anthropic-beta: <anthropic-beta>' \
--header 'anthropic-version: <anthropic-version>'import requests
url = "http://localhost:38080/v1/deployments"
headers = {
"anthropic-version": "<anthropic-version>",
"anthropic-beta": "<anthropic-beta>",
"X-Api-Key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'anthropic-version': '<anthropic-version>',
'anthropic-beta': '<anthropic-beta>',
'X-Api-Key': '<api-key>'
}
};
fetch('http://localhost:38080/v1/deployments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:38080/v1/deployments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("anthropic-version", "<anthropic-version>")
req.Header.Add("anthropic-beta", "<anthropic-beta>")
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": [
{
"type": "deployment",
"id": "depl_011CZkZcDH3vPqd7xnEfwTai",
"name": "每日订单报告",
"description": "每个工作日早晨将前一天的订单汇总为报告。",
"agent": {
"type": "agent",
"id": "agent_011CZkYpogX7uDKUyvBTophP",
"version": 1
},
"environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
"vault_ids": [
"vlt_011CZkZDLs7fYzm1hXNPeRjv"
],
"initial_events": [
{
"type": "user.message",
"content": [
{
"type": "text",
"text": "将昨天的订单汇总到 report.md。"
}
]
}
],
"resources": [],
"metadata": {},
"schedule": {
"type": "cron",
"expression": "0 9 * * 1-5",
"timezone": "America/Los_Angeles",
"last_run_at": "2026-03-16T16:00:09Z",
"upcoming_runs_at": [
"2026-03-17T16:00:00Z",
"2026-03-18T16:00:00Z"
]
},
"status": "active",
"paused_reason": null,
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z",
"archived_at": null
}
],
"next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}每个请求都必须发送
?beta=true、anthropic-version: 2023-06-01 与 anthropic-beta: managed-agents-2026-04-01。授权
omaApiKeyomaBearer
OMA 工作区 API 密钥。
查询参数
为此接口启用 Beta API 合同,必须为 true。
可用选项:
true 每页最大结果数。默认 20,上限 100。
不透明的分页游标。
按智能体 ID 筛选。
按状态过滤:active 或 paused。省略时返回两者。如需包含已归档的部署,请改用 include_archived;两者不能同时使用。 部署的生命周期状态。
可用选项:
active, paused 返回在此时间或之后创建的部署(含该时间点)。 RFC 3339 格式的时间戳
返回在此时间或之前创建的部署(含该时间点)。 RFC 3339 格式的时间戳
为 true 时包含已归档的部署。默认值:false(不包含已归档的部署)。
响应
请求成功。
部署的分页列表。
部署列表。
Show child attributes
Show child attributes
示例:
[ { "type": "deployment", "id": "depl_011CZkZcDH3vPqd7xnEfwTai", "name": "每日订单报告", "description": "每个工作日早晨将前一天的订单汇总为报告。", "agent": { "type": "agent", "id": "agent_011CZkYpogX7uDKUyvBTophP", "version": 1 }, "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW", "vault_ids": ["vlt_011CZkZDLs7fYzm1hXNPeRjv"], "initial_events": [ { "type": "user.message", "content": [ { "type": "text", "text": "将昨天的订单汇总到 report.md。" } ] } ], "resources": [], "metadata": {}, "schedule": { "type": "cron", "expression": "0 9 * * 1-5", "timezone": "America/Los_Angeles", "last_run_at": "2026-03-16T16:00:09Z", "upcoming_runs_at": [ "2026-03-17T16:00:00Z", "2026-03-18T16:00:00Z" ] }, "status": "active", "paused_reason": null, "created_at": "2026-03-15T10:00:00Z", "updated_at": "2026-03-15T10:00:00Z", "archived_at": null } ]
下一页的不透明游标。没有更多结果时为 null。
示例:
"page_MjAyNS0wNS0xNFQwMDowMDowMFo="
此页面对您有帮助吗?
⌘I
列出部署
curl --request GET \
--url http://localhost:38080/v1/deployments \
--header 'X-Api-Key: <api-key>' \
--header 'anthropic-beta: <anthropic-beta>' \
--header 'anthropic-version: <anthropic-version>'import requests
url = "http://localhost:38080/v1/deployments"
headers = {
"anthropic-version": "<anthropic-version>",
"anthropic-beta": "<anthropic-beta>",
"X-Api-Key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'anthropic-version': '<anthropic-version>',
'anthropic-beta': '<anthropic-beta>',
'X-Api-Key': '<api-key>'
}
};
fetch('http://localhost:38080/v1/deployments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:38080/v1/deployments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("anthropic-version", "<anthropic-version>")
req.Header.Add("anthropic-beta", "<anthropic-beta>")
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": [
{
"type": "deployment",
"id": "depl_011CZkZcDH3vPqd7xnEfwTai",
"name": "每日订单报告",
"description": "每个工作日早晨将前一天的订单汇总为报告。",
"agent": {
"type": "agent",
"id": "agent_011CZkYpogX7uDKUyvBTophP",
"version": 1
},
"environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
"vault_ids": [
"vlt_011CZkZDLs7fYzm1hXNPeRjv"
],
"initial_events": [
{
"type": "user.message",
"content": [
{
"type": "text",
"text": "将昨天的订单汇总到 report.md。"
}
]
}
],
"resources": [],
"metadata": {},
"schedule": {
"type": "cron",
"expression": "0 9 * * 1-5",
"timezone": "America/Los_Angeles",
"last_run_at": "2026-03-16T16:00:09Z",
"upcoming_runs_at": [
"2026-03-17T16:00:00Z",
"2026-03-18T16:00:00Z"
]
},
"status": "active",
"paused_reason": null,
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z",
"archived_at": null
}
],
"next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}