创建会话
创建新会话
权限
ManageOrgSessions 权限的服务用户账号。
高级功能的额外权限
Devin 模式
devin_mode 参数用于控制会话使用哪种 Devin Agent 模式:
用户模拟
create_as_user_id 参数允许代表其他用户创建会话。前提条件如下:
- 服务用户必须具有
ImpersonateOrgSessions权限 - 目标用户必须是该组织的成员
- 目标用户必须具有
UseDevinSessions权限
授权
服务用户凭据(前缀:cog_)
路径参数
组织 ID(前缀:org-)
"org-abc123def456"
查询参数
请求体
1 - 2083覆盖该会话的 Devin Agent mode。normal 使用默认 Agent mode,fast 使用 Fast mode,lite 使用 Devin Lite,ultra 使用 Devin Ultra,fusion 使用 Fusion。预览模式受与 web app 相同的功能开关和 Enterprise Agent preview 限制。
normal, fast, lite, ultra, fusion 覆盖此会话的 VM 平台(例如“windows”),或指定一个 outpost(BYOB)池名称,以便让该会话在你自己的某台机器上运行。省略此值时(或将其设为“inherit”时),由父 Devin 创建的会话会继承父级的放置位置——包括其平台和 outpost 池,因此放置在 outpost 上的父会话会在同一池中生成子会话;否则将使用组织默认设置。所填的值必须与为你的组织配置的平台之一或某个 outpost 池名称匹配(不区分大小写)——如果某个名称同时匹配两者,则内置平台优先。无法识别的值会被拒绝,并返回 400;其错误响应体会列出该组织可用的平台标签和 outpost 池名称。
是否在会话停止后保留其虚拟机状态,以便后续恢复会话。对于一次性会话,请将其设为 false。
为 true 时(默认),Agent 必须在当前轮次结束前调用 provide_structured_output,且 is_final=true。为 false 时,该工具可用但非必需——不保证会在某一轮次中被调用。
用于验证结构化输出的 JSON Schema(Draft 7),最大 64KB。必须是自包含的(不允许外部 $ref)。
响应
成功响应
new, claimed, running, exit, error, suspended, resuming 如果已完成分类,则为会话分配的用例类别。仅在 get/list 端点中返回。
bug_fixing, ci_cd_and_devops, code_quality_and_security, code_review, code_review_and_analysis, data_and_automation, documentation_and_content, feature_development, migrations_and_upgrades, other, production_investigation, refactoring_and_optimization, research_and_exploration, security, unit_test_generation 该会话的创建来源。
webapp, slack, teams, api, linear, jira, automation, cli, desktop, code_scan, other 会话当前状态的附加信息。当 status 为“running”时:可为“working”(正在处理)、“waiting_for_user”(需要用户输入)、“waiting_for_approval”(在安全模式下等待操作批准)或“finished”(任务已完成)。当 status 为“suspended”时:表示挂起原因,例如“inactivity”“user_request”“usage_limit_exceeded”“out_of_credits”“out_of_quota”“no_quota_allocation”“payment_declined”“org_usage_limit_exceeded”“total_session_limit_exceeded”或“error”。仅在 get/list 端点中返回。
working, waiting_for_user, waiting_for_approval, finished, inactivity, user_request, usage_limit_exceeded, out_of_credits, out_of_quota, no_quota_allocation, payment_declined, org_usage_limit_exceeded, total_session_limit_exceeded, error 来自会话的已验证结构化输出。仅在 GET/LIST 端点中返回。
为会话分配的子类别显示名称。若已设置类别但未分配或未解析出子类别,则为“Other”。仅在 get/list 端点中返回。

