> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://devin.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://devin.ferndocs.com/_mcp/server.

# List sessions with insights

GET https://api.devin.ai/v3/organizations/{org_id}/sessions/insights

List sessions with detailed insights including message counts,
session size classification, and AI-generated analysis.

Reference: https://devin.ferndocs.com/api-reference/v-3/get-account-sessions-insights

## Authentication

- `Authorization` header (bearer token, required) — Personal API Key (apk_user_*) or Service API Key (apk_*)

## Request

### Path parameters

- `org_id` (string, required) — Organization ID (prefix: org-)

### Query parameters

- `qs` (SessionsQueryParams, required)
- `devin_id` (string, optional, nullable)

## Response

### 200

Successful Response

- `items` (list of SessionInsightsResponse, required)
- `end_cursor` (string, optional, nullable) — Cursor to fetch the next page, or None if this is the last page.
- `has_next_page` (boolean, optional, default: false) — Whether there are more items available after this page.
- `total` (integer, optional, nullable) — Optional total count (can be omitted for performance).

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### SessionsQueryParams

- `after` (string, optional, nullable)
- `category` (enum, optional, nullable)
  - Allowed values: `bug_fixing`, `ci_cd_and_devops`, `code_quality_and_security`, `code_review_and_analysis`, `data_and_automation`, `documentation_and_content`, `feature_development`, `migrations_and_upgrades`, `other`, `refactoring_and_optimization`, `research_and_exploration`, `unit_test_generation`
- `created_after` (integer, optional, nullable)
- `created_before` (integer, optional, nullable)
- `first` (integer, optional, default: 100)
- `origins` (list of enum, optional, nullable)
  - Allowed values: `webapp`, `slack`, `teams`, `api`, `linear`, `jira`, `automation`, `cli`, `desktop`, `other`
- `playbook_id` (string, optional, nullable)
- `schedule_id` (string, optional, nullable)
- `service_user_ids` (list of string, optional, nullable)
- `session_ids` (list of string, optional, nullable)
- `tags` (list of string, optional, nullable)
- `updated_after` (integer, optional, nullable)
- `updated_before` (integer, optional, nullable)
- `user_ids` (list of string, optional, nullable)

### SessionInsightsResponse

Session details augmented with quantitative metrics and AI analysis. Extends SessionResponse with additional fields that require extra queries.

- `acus_consumed` (double, required) — Total ACUs consumed by this session so far.
- `created_at` (integer, required) — Unix timestamp (seconds) when the session was created.
- `num_devin_messages` (integer, required) — Number of Devin messages sent during the session.
- `num_user_messages` (integer, required) — Number of user messages sent during the session.
- `org_id` (string, required) — Organization that owns this session (prefix org-).
- `pull_requests` (list of SessionPullRequest, required) — Pull requests created by this session.
- `session_id` (string, required) — Unique session identifier (prefix devin-).
- `session_size` (enum, required) — Session size classification based on ACU usage and message count.
  - Allowed values: `xs`, `s`, `m`, `l`, `xl`
- `status` (enum, required) — Current lifecycle status: running, suspended, stopped, or blocked.
  - Allowed values: `new`, `claimed`, `running`, `exit`, `error`, `suspended`, `resuming`
- `tags` (list of string, required) — Tags applied to this session.
- `updated_at` (integer, required) — Unix timestamp (seconds) of the last session update.
- `url` (string, required) — URL to view the session in the Devin web app.
- `analysis` (SessionInsightsAnalysis, optional, nullable) — AI-generated session analysis. None if analysis has not completed.
- `category` (enum, optional, nullable) — The session's assigned use-case category, if categorisation has run. Only populated on get/list endpoints.
  - Allowed values: `bug_fixing`, `ci_cd_and_devops`, `code_quality_and_security`, `code_review_and_analysis`, `data_and_automation`, `documentation_and_content`, `feature_development`, `migrations_and_upgrades`, `other`, `refactoring_and_optimization`, `research_and_exploration`, `unit_test_generation`
- `child_session_ids` (list of string, optional, nullable)
- `is_archived` (boolean, optional, default: false)
- `origin` (enum, optional, nullable) — The origin from which the session was created.
  - Allowed values: `webapp`, `slack`, `teams`, `api`, `linear`, `jira`, `automation`, `cli`, `desktop`, `other`
- `parent_session_id` (string, optional, nullable)
- `playbook_id` (string, optional, nullable)
- `service_user_id` (string, optional, nullable)
- `status_detail` (enum, optional, nullable) — Additional detail about the session's current status. When status is 'running': 'working' (actively working), 'waiting_for_user' (needs user input), 'waiting_for_approval' (awaiting action approval in safe mode), or 'finished' (task complete). When status is 'suspended': the reason for suspension such as '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', or 'error'. Only populated on get/list endpoints.
  - Allowed values: `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`
- `structured_output` (map from string to any, optional, nullable) — Validated structured output from the session. Only populated on get/list endpoints.
- `subcategory` (string, optional, nullable) — The session's assigned subcategory display name. 'Other' when a category is set but no subcategory was assigned or resolved. Only populated on get/list endpoints.
- `title` (string, optional, nullable) — Human-readable session title.
- `user_id` (string, optional, nullable)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### SessionPullRequest

- `pr_state` (string, required, nullable)
- `pr_url` (string, required)

### SessionInsightsAnalysis

AI-generated analysis data from a completed session analysis.

- `action_items` (list of SessionInsightsActionItem, optional, default: [])
- `classification` (SessionInsightsClassification, optional, nullable)
- `issues` (list of SessionInsightsIssue, optional, default: [])
- `note_usage` (SessionInsightsNoteUsage, optional, nullable)
- `suggested_prompt` (SessionInsightsSuggestedPrompt, optional, nullable)
- `timeline` (list of SessionInsightsTimelineEvent, optional, default: [])

### ValidationErrorLocItems

### SessionInsightsActionItem

- `action_item` (string, required)
- `issue_id` (string, optional, nullable)
- `type` (enum, optional, default: other)
  - Allowed values: `machine_setup`, `repo_config`, `knowledge`, `prompt_improvement`, `other`

### SessionInsightsClassification

- `category` (string, required)
- `confidence` (double, required)
- `programming_languages` (list of string, optional, default: [])
- `tools_and_frameworks` (list of string, optional, default: [])

### SessionInsightsIssue

- `impact` (string, required)
- `issue` (string, required)
- `label` (string, required)
- `id` (string, optional, default: )

### SessionInsightsNoteUsage

- `bad_usages` (list of SessionInsightsNoteUsageItem, optional, default: [])
- `good_usages` (list of SessionInsightsNoteUsageItem, optional, default: [])

### SessionInsightsSuggestedPrompt

- `original_prompt` (string, required)
- `suggested_prompt` (string, required)
- `feedback_items` (list of SessionInsightsFeedbackItem, optional, default: [])

### SessionInsightsTimelineEvent

- `description` (string, required)
- `title` (string, required)
- `color` (string, optional, default: )
- `issue_id` (string, optional, nullable)

### SessionInsightsNoteUsageItem

- `message` (string, required)
- `note_id` (string, required)
- `reason` (string, required)

### SessionInsightsFeedbackItem

- `details` (string, required)
- `excerpt` (string, required)
- `summary` (string, required)
- `issue_id` (string, optional, nullable)

## Examples

**Request**

```json
{
  "first": 50,
  "category": "bug_fixing",
  "origins": [
    "webapp",
    "cli"
  ],
  "tags": [
    "urgent",
    "backend"
  ],
  "user_ids": [
    "user-1234abcd",
    "user-5678efgh"
  ],
  "service_user_ids": [
    "svc-9012ijkl"
  ],
  "session_ids": [
    "sess-3456mnop",
    "sess-7890qrst"
  ],
  "created_after": 1680307200,
  "created_before": 1682899200,
  "updated_after": 1680393600,
  "updated_before": 1682985600,
  "playbook_id": "pb-1122aabb",
  "schedule_id": "sch-3344ccdd",
  "after": "cursor-xyz789"
}
```

**Response**

```json
{
  "items": [
    {
      "acus_consumed": 12.7,
      "created_at": 1680412800,
      "num_devin_messages": 15,
      "num_user_messages": 8,
      "org_id": "org-abc123def456",
      "pull_requests": [
        {
          "state": "open",
          "url": "https://github.com/org/repo/pull/42"
        }
      ],
      "session_id": "sess-3456mnop",
      "session_size": "m",
      "status": "running",
      "tags": [
        "urgent",
        "backend",
        "security"
      ],
      "updated_at": 1680499200,
      "url": "https://app.devin.ai/sessions/sess-3456mnop",
      "analysis": {
        "action_items": [
          {
            "action_item": "Refactor authentication module to improve security",
            "issue_id": "issue-7890",
            "type": "refactoring_and_optimization"
          },
          {
            "action_item": "Update CI pipeline to include security scans",
            "issue_id": null,
            "type": "ci_cd_and_devops"
          }
        ],
        "classification": {
          "category": "bug_fixing",
          "confidence": 0.92,
          "programming_languages": [
            "Python",
            "JavaScript"
          ],
          "tools_and_frameworks": [
            "Django",
            "React",
            "Jenkins"
          ]
        },
        "issues": [
          {
            "impact": "High",
            "issue": "Authentication bypass vulnerability",
            "label": "security",
            "id": "issue-7890"
          }
        ],
        "note_usage": {
          "bad_usages": [
            {
              "message": "Note was outdated and referenced deprecated API",
              "note_id": "note-1234",
              "reason": "Outdated information"
            }
          ],
          "good_usages": [
            {
              "message": "Note clearly explained the bug reproduction steps",
              "note_id": "note-5678",
              "reason": "Clear and actionable"
            }
          ]
        },
        "suggested_prompt": {
          "original_prompt": "Fix the bug in the login flow",
          "suggested_prompt": "Fix the authentication bug causing login failures under certain conditions",
          "feedback_items": [
            {
              "details": "Prompt could be more specific about the error context",
              "excerpt": "Fix the bug in the login flow",
              "summary": "Improve prompt specificity",
              "issue_id": null
            }
          ]
        },
        "timeline": [
          {
            "description": "Session started and initial analysis began",
            "title": "Session Start",
            "color": "green",
            "issue_id": null
          },
          {
            "description": "Waiting for user input on bug details",
            "title": "User Input Required",
            "color": "yellow",
            "issue_id": null
          }
        ]
      },
      "category": "bug_fixing",
      "child_session_ids": [
        "sess-child-001",
        "sess-child-002"
      ],
      "is_archived": false,
      "origin": "webapp",
      "parent_session_id": null,
      "playbook_id": "pb-1122aabb",
      "service_user_id": "svc-9012ijkl",
      "status_detail": "working",
      "structured_output": {
        "summary": "Fixed authentication bug and updated CI pipeline",
        "tests_passed": true
      },
      "subcategory": "security",
      "title": "Authentication Bug Fix Session",
      "user_id": "user-1234abcd"
    }
  ],
  "end_cursor": "cursor-abc123",
  "has_next_page": true,
  "total": 125
}
```

**SDK Code**

```python
import requests

url = "https://api.devin.ai/v3/organizations/org-abc123def456/sessions/insights"

querystring = {"qs":"{}"}

payload = {
    "first": 50,
    "category": "bug_fixing",
    "origins": ["webapp", "cli"],
    "tags": ["urgent", "backend"],
    "user_ids": ["user-1234abcd", "user-5678efgh"],
    "service_user_ids": ["svc-9012ijkl"],
    "session_ids": ["sess-3456mnop", "sess-7890qrst"],
    "created_after": 1680307200,
    "created_before": 1682899200,
    "updated_after": 1680393600,
    "updated_before": 1682985600,
    "playbook_id": "pb-1122aabb",
    "schedule_id": "sch-3344ccdd",
    "after": "cursor-xyz789"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.get(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.devin.ai/v3/organizations/org-abc123def456/sessions/insights?qs=%7B%7D';
const options = {
  method: 'GET',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"first":50,"category":"bug_fixing","origins":["webapp","cli"],"tags":["urgent","backend"],"user_ids":["user-1234abcd","user-5678efgh"],"service_user_ids":["svc-9012ijkl"],"session_ids":["sess-3456mnop","sess-7890qrst"],"created_after":1680307200,"created_before":1682899200,"updated_after":1680393600,"updated_before":1682985600,"playbook_id":"pb-1122aabb","schedule_id":"sch-3344ccdd","after":"cursor-xyz789"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.devin.ai/v3/organizations/org-abc123def456/sessions/insights?qs=%7B%7D"

	payload := strings.NewReader("{\n  \"first\": 50,\n  \"category\": \"bug_fixing\",\n  \"origins\": [\n    \"webapp\",\n    \"cli\"\n  ],\n  \"tags\": [\n    \"urgent\",\n    \"backend\"\n  ],\n  \"user_ids\": [\n    \"user-1234abcd\",\n    \"user-5678efgh\"\n  ],\n  \"service_user_ids\": [\n    \"svc-9012ijkl\"\n  ],\n  \"session_ids\": [\n    \"sess-3456mnop\",\n    \"sess-7890qrst\"\n  ],\n  \"created_after\": 1680307200,\n  \"created_before\": 1682899200,\n  \"updated_after\": 1680393600,\n  \"updated_before\": 1682985600,\n  \"playbook_id\": \"pb-1122aabb\",\n  \"schedule_id\": \"sch-3344ccdd\",\n  \"after\": \"cursor-xyz789\"\n}")

	req, _ := http.NewRequest("GET", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.devin.ai/v3/organizations/org-abc123def456/sessions/insights?qs=%7B%7D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"first\": 50,\n  \"category\": \"bug_fixing\",\n  \"origins\": [\n    \"webapp\",\n    \"cli\"\n  ],\n  \"tags\": [\n    \"urgent\",\n    \"backend\"\n  ],\n  \"user_ids\": [\n    \"user-1234abcd\",\n    \"user-5678efgh\"\n  ],\n  \"service_user_ids\": [\n    \"svc-9012ijkl\"\n  ],\n  \"session_ids\": [\n    \"sess-3456mnop\",\n    \"sess-7890qrst\"\n  ],\n  \"created_after\": 1680307200,\n  \"created_before\": 1682899200,\n  \"updated_after\": 1680393600,\n  \"updated_before\": 1682985600,\n  \"playbook_id\": \"pb-1122aabb\",\n  \"schedule_id\": \"sch-3344ccdd\",\n  \"after\": \"cursor-xyz789\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.devin.ai/v3/organizations/org-abc123def456/sessions/insights?qs=%7B%7D")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"first\": 50,\n  \"category\": \"bug_fixing\",\n  \"origins\": [\n    \"webapp\",\n    \"cli\"\n  ],\n  \"tags\": [\n    \"urgent\",\n    \"backend\"\n  ],\n  \"user_ids\": [\n    \"user-1234abcd\",\n    \"user-5678efgh\"\n  ],\n  \"service_user_ids\": [\n    \"svc-9012ijkl\"\n  ],\n  \"session_ids\": [\n    \"sess-3456mnop\",\n    \"sess-7890qrst\"\n  ],\n  \"created_after\": 1680307200,\n  \"created_before\": 1682899200,\n  \"updated_after\": 1680393600,\n  \"updated_before\": 1682985600,\n  \"playbook_id\": \"pb-1122aabb\",\n  \"schedule_id\": \"sch-3344ccdd\",\n  \"after\": \"cursor-xyz789\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.devin.ai/v3/organizations/org-abc123def456/sessions/insights?qs=%7B%7D', [
  'body' => '{
  "first": 50,
  "category": "bug_fixing",
  "origins": [
    "webapp",
    "cli"
  ],
  "tags": [
    "urgent",
    "backend"
  ],
  "user_ids": [
    "user-1234abcd",
    "user-5678efgh"
  ],
  "service_user_ids": [
    "svc-9012ijkl"
  ],
  "session_ids": [
    "sess-3456mnop",
    "sess-7890qrst"
  ],
  "created_after": 1680307200,
  "created_before": 1682899200,
  "updated_after": 1680393600,
  "updated_before": 1682985600,
  "playbook_id": "pb-1122aabb",
  "schedule_id": "sch-3344ccdd",
  "after": "cursor-xyz789"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.devin.ai/v3/organizations/org-abc123def456/sessions/insights?qs=%7B%7D");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"first\": 50,\n  \"category\": \"bug_fixing\",\n  \"origins\": [\n    \"webapp\",\n    \"cli\"\n  ],\n  \"tags\": [\n    \"urgent\",\n    \"backend\"\n  ],\n  \"user_ids\": [\n    \"user-1234abcd\",\n    \"user-5678efgh\"\n  ],\n  \"service_user_ids\": [\n    \"svc-9012ijkl\"\n  ],\n  \"session_ids\": [\n    \"sess-3456mnop\",\n    \"sess-7890qrst\"\n  ],\n  \"created_after\": 1680307200,\n  \"created_before\": 1682899200,\n  \"updated_after\": 1680393600,\n  \"updated_before\": 1682985600,\n  \"playbook_id\": \"pb-1122aabb\",\n  \"schedule_id\": \"sch-3344ccdd\",\n  \"after\": \"cursor-xyz789\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "first": 50,
  "category": "bug_fixing",
  "origins": ["webapp", "cli"],
  "tags": ["urgent", "backend"],
  "user_ids": ["user-1234abcd", "user-5678efgh"],
  "service_user_ids": ["svc-9012ijkl"],
  "session_ids": ["sess-3456mnop", "sess-7890qrst"],
  "created_after": 1680307200,
  "created_before": 1682899200,
  "updated_after": 1680393600,
  "updated_before": 1682985600,
  "playbook_id": "pb-1122aabb",
  "schedule_id": "sch-3344ccdd",
  "after": "cursor-xyz789"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.devin.ai/v3/organizations/org-abc123def456/sessions/insights?qs=%7B%7D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```