跳转到主要内容
GET
/
v2
/
enterprise
/
sessions
/
insights
curl -X GET "https://api.devin.ai/v2/enterprise/sessions/insights?limit=10&skip=0" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "items": [
    {
      "session_id": "abc123",
      "url": "https://app.devin.ai/sessions/abc123",
      "status": "exit",
      "title": "Fix authentication bug",
      "tags": ["bug-fix", "auth"],
      "user_id": "user_456",
      "org_id": "org_789",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T11:45:00Z",
      "acus_consumed": 25.5,
      "pull_requests": [
        {
          "pr_url": "https://github.com/example/repo/pull/123",
          "pr_state": "merged",
          "state": "merged"
        }
      ],
      "session_analysis": {
        "issues": [
          {
            "issue": "Missing environment variables",
            "impact": "High",
            "label": "Configuration"
          }
        ],
        "timeline": [
          {
            "title": "Started repository setup",
            "description": "Devin began setting up the development environment"
          }
        ],
        "action_items": [
          {
            "issue_id": "issue_1",
            "type": "machine_setup",
            "action_item": "Configure environment variables for database connection"
          }
        ],
        "suggested_prompt": {
          "original_prompt": "Fix the bug",
          "suggested_prompt": "Fix the authentication bug in the login endpoint by checking the JWT token validation",
          "feedback_items": [
            {
              "issue_id": "issue_1",
              "summary": "Prompt too vague",
              "excerpt": "Fix the bug",
              "details": "The prompt should specify which bug and provide more context"
            }
          ]
        }
      },
      "initial_user_message": "Please fix the authentication issue in our login system"
    }
  ],
  "total": 150,
  "skip": 0,
  "limit": 10,
  "has_more": true,
  "next_cursor": 10
}
返回企业范围内所有 Devin 会话的分页列表,包括全面的会话分析、初始用户消息、Pull Request 信息以及 ACU 使用数据。相比基础版的 列出企业会话 接口,该端点提供的信息更加详细。

查询参数

skip
integer
default:"0"
分页时要跳过的条目数量(最小值:0)
limit
integer
default:"100"
要返回的最大条目数量(最小值:1,最大值:200)
created_date_from
string
筛选在此日期之后创建的会话(ISO 8601 格式)
created_date_to
string
筛选在此日期之前创建的会话(ISO 8601 格式)
updated_date_from
string
筛选在此日期之后更新的会话(ISO 8601 格式)
updated_date_to
string
筛选在此日期之前更新的会话(ISO 8601 格式)
org_ids
array
按组织 ID 筛选会话(字符串数组)
user_ids
array
按用户 ID 筛选会话(字符串数组)
session_ids
array
按特定 Devin 会话 ID 筛选会话(字符串数组)
tags
array
按标签筛选会话(字符串数组)
order
string
default:"desc"
按创建日期对结果排序。可选值:“asc” 或 “desc”

响应

array
required
会话详情对象数组
total
integer
required
可用的会话总数
skip
integer
required
跳过的条目数量
limit
integer
required
每页的最大条目数
has_more
boolean
required
是否有更多条目可用
next_cursor
integer
下一页的游标(如果适用)
curl -X GET "https://api.devin.ai/v2/enterprise/sessions/insights?limit=10&skip=0" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "items": [
    {
      "session_id": "abc123",
      "url": "https://app.devin.ai/sessions/abc123",
      "status": "exit",
      "title": "Fix authentication bug",
      "tags": ["bug-fix", "auth"],
      "user_id": "user_456",
      "org_id": "org_789",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T11:45:00Z",
      "acus_consumed": 25.5,
      "pull_requests": [
        {
          "pr_url": "https://github.com/example/repo/pull/123",
          "pr_state": "merged",
          "state": "merged"
        }
      ],
      "session_analysis": {
        "issues": [
          {
            "issue": "Missing environment variables",
            "impact": "High",
            "label": "Configuration"
          }
        ],
        "timeline": [
          {
            "title": "Started repository setup",
            "description": "Devin began setting up the development environment"
          }
        ],
        "action_items": [
          {
            "issue_id": "issue_1",
            "type": "machine_setup",
            "action_item": "Configure environment variables for database connection"
          }
        ],
        "suggested_prompt": {
          "original_prompt": "Fix the bug",
          "suggested_prompt": "Fix the authentication bug in the login endpoint by checking the JWT token validation",
          "feedback_items": [
            {
              "issue_id": "issue_1",
              "summary": "Prompt too vague",
              "excerpt": "Fix the bug",
              "details": "The prompt should specify which bug and provide more context"
            }
          ]
        }
      },
      "initial_user_message": "Please fix the authentication issue in our login system"
    }
  ],
  "total": 150,
  "skip": 0,
  "limit": 10,
  "has_more": true,
  "next_cursor": 10
}