Skip to main content
POST
/
v3beta1
/
organizations
/
{org_id}
/
sessions
Create Session
curl --request POST \
  --url https://api.devin.ai/v3beta1/organizations/{org_id}/sessions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "advanced_mode": "analyze",
  "bypass_approval": true,
  "child_playbook_id": "<string>",
  "create_as_user_id": "<string>",
  "knowledge_ids": [
    "<string>"
  ],
  "max_acu_limit": 123,
  "playbook_id": "<string>",
  "repos": [
    "<string>"
  ],
  "secret_ids": [
    "<string>"
  ],
  "session_links": [
    "<string>"
  ],
  "tags": [
    "<string>"
  ],
  "title": "<string>"
}
'
{
  "acus_consumed": 123,
  "created_at": 123,
  "org_id": "<string>",
  "pull_requests": [
    {
      "pr_state": "<string>",
      "pr_url": "<string>"
    }
  ],
  "session_id": "<string>",
  "status": "new",
  "tags": [
    "<string>"
  ],
  "updated_at": 123,
  "url": "<string>",
  "child_session_ids": [
    "<string>"
  ],
  "is_advanced": false,
  "is_archived": false,
  "parent_session_id": "<string>",
  "title": "<string>",
  "user_id": "<string>"
}

Permissions

Requires a service user with the ManageOrgSessions permission at the organization level.

Additional permissions for advanced features

FeatureRequired Permission
advanced_modeUseDevinExpert
create_as_user_idImpersonateOrgSessions

Advanced mode

The advanced_mode parameter enables specialized session behaviors for automation workflows. When set, the session uses the advanced persona and the prompt is transformed based on the selected mode.

Available modes

ModeDescriptionRequired Parameters
analyzeAnalyze existing Devin sessions to extract insightssession_links
createCreate a new playbook based on session analysisNone (optional: session_links)
improveImprove an existing playbook based on feedbackchild_playbook_id
batchStart multiple Devin sessions for a list of taskschild_playbook_id
manageManage knowledgeNone

Batch mode options

When using batch mode, you can optionally set bypass_approval to true to skip the approval step for batch session creation. This is useful for fully automated workflows where you want sessions to start immediately without manual approval.

User impersonation

The create_as_user_id parameter allows creating a session on behalf of another user. This requires:
  1. The service user must have ImpersonateOrgSessions permission
  2. The target user must be a member of the organization
  3. The target user must have UseDevinSessions permission

Authorizations

Authorization
string
header
required

Service User credential (prefix: cog_)

Body

application/json
prompt
string
required
advanced_mode
enum<string> | null
Available options:
analyze,
create,
improve,
batch,
manage
bypass_approval
boolean | null
child_playbook_id
string | null
create_as_user_id
string | null
knowledge_ids
string[] | null
max_acu_limit
integer | null
playbook_id
string | null
repos
string[] | null
secret_ids
string[] | null
tags
string[] | null
title
string | null

Response

Successful Response

acus_consumed
number
required
created_at
integer
required
org_id
string
required
pull_requests
SessionPullRequest · object[]
required
session_id
string
required
status
enum<string>
required
Available options:
new,
claimed,
running,
exit,
error,
suspended,
resuming
tags
string[]
required
updated_at
integer
required
url
string
required
child_session_ids
string[] | null
is_advanced
boolean
default:false
is_archived
boolean
default:false
parent_session_id
string | null
title
string | null
user_id
string | null