> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://devin.ferndocs.com/api-reference/v-3/get-account-sessions/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://devin.ferndocs.com/_mcp/server. # List sessions for account GET https://api.devin.ai/v3/enterprise/sessions List all sessions across the enterprise. Reference: https://devin.ferndocs.com/api-reference/v-3/get-account-sessions ## Authentication - `Authorization` header (bearer token, required) — Personal API Key (apk_user_*) or Service API Key (apk_*) ## Request ### Query parameters - `after` (string, optional, nullable) - `first` (integer, optional, default: 100) - `session_ids` (list of string, optional, nullable) - `created_after` (integer, optional, nullable) - `created_before` (integer, optional, nullable) - `updated_after` (integer, optional, nullable) - `updated_before` (integer, optional, nullable) - `tags` (list of string, optional, nullable) - `playbook_id` (string, optional, nullable) - `origins` (list of enum, optional, nullable) - Allowed values: `webapp`, `slack`, `teams`, `api`, `linear`, `jira`, `automation`, `cli`, `desktop`, `other` - `schedule_id` (string, optional, nullable) - `user_ids` (list of string, optional, nullable) - `service_user_ids` (list of 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` - `org_ids` (list of string, optional, nullable) - `include_deleted_orgs` (boolean, optional, default: false) ## Response ### 200 Successful Response - `items` (list of SessionResponse, 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 ### SessionResponse - `acus_consumed` (double, required) — Total ACUs consumed by this session so far. - `created_at` (integer, required) — Unix timestamp (seconds) when the session was created. - `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-). - `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. - `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) — Devin IDs of child sessions spawned by this session. - `is_archived` (boolean, optional, default: false) — Whether the session has been archived. - `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) — Devin ID of the parent session, if this is a child session. - `playbook_id` (string, optional, nullable) — Playbook running in this session, if any. - `service_user_id` (string, optional, nullable) — Service user ID if the session was created via API key. - `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) — ID of the user who created or owns the session. ### ValidationError - `loc` (list of ValidationErrorLocItems, required) - `msg` (string, required) - `type` (string, required) ### SessionPullRequest - `pr_state` (string, required, nullable) - `pr_url` (string, required) ### ValidationErrorLocItems ## Examples **Request** ```json {} ``` **Response** ```json { "items": [ { "acus_consumed": 12.5, "created_at": 1685606400, "org_id": "org_1234567890abcdef", "pull_requests": [ { "pr_state": "open", "pr_url": "https://github.com/example/repo/pull/42" } ], "session_id": "sess_1234567890abcdef", "status": "new", "tags": [ "urgent", "frontend" ], "updated_at": 1685692800, "url": "https://app.devin.ai/sessions/sess_1234567890abcdef", "category": "bug_fixing", "child_session_ids": [ "sess_9f8b7c6d4e3a2b1c" ], "is_archived": false, "origin": "webapp", "parent_session_id": "sess_abcdef1234567890", "playbook_id": "playbook_9876543210fedcba", "service_user_id": "svcuser_0011223344556677", "status_detail": "working", "structured_output": {}, "subcategory": "frontend_bug", "title": "Fix login button not responding", "user_id": "user_1122334455667788" } ], "end_cursor": "eyJpZCI6IjY1NDMyMSJ9", "has_next_page": false, "total": 1 } ``` **SDK Code** ```python import requests url = "https://api.devin.ai/v3/enterprise/sessions" payload = {} headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.get(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.devin.ai/v3/enterprise/sessions'; const options = { method: 'GET', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{}' }; 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/enterprise/sessions" payload := strings.NewReader("{}") req, _ := http.NewRequest("GET", url, payload) req.Header.Add("Authorization", "Bearer ") 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/enterprise/sessions") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.devin.ai/v3/enterprise/sessions") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('GET', 'https://api.devin.ai/v3/enterprise/sessions', [ 'body' => '{}', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.devin.ai/v3/enterprise/sessions"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.devin.ai/v3/enterprise/sessions")! 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() ```