创建会话
创建新会话
权限
ManageOrgSessions 权限的服务用户账号。
高级功能的额外权限
| 功能 | 所需权限 |
|---|---|
create_as_user_id | ImpersonateOrgSessions |
Devin 模式
devin_mode 参数用于控制会话使用哪种 Devin Agent 模式:
| 模式 | 说明 |
|---|---|
normal | 默认 Agent 模式。速度快,并且擅长长周期规划。 |
fast | 速度约快 2 倍,价格贵 4 倍,智能水平相同。 |
用户模拟
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”)。如果省略(或设为“inherit”),由父级 Devin 创建的会话会继承父级的平台;否则使用组织默认平台。该值必须与你的组织已配置的平台之一匹配(不区分大小写);如果值无法识别,则会返回 400,且错误响应体中会列出该组织可用的平台标签。
是否在会话停止后保留其虚拟机状态,以便后续恢复会话。对于一次性会话,请将其设为 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, 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 端点中返回。

