Skip to main content
DELETE
Terminate Session
The devin_id is the session ID prefixed with devin- (e.g., devin-abc123).

Permissions

Requires a service user or personal access token that belongs to the organization and can manage the target session. The caller can manage a session if any of the following apply:
  • It created the session.
  • It holds a session.configure grant on the session.
  • It has the ManageOrgSessions permission at the organization level.
ManageOrgSessions is only needed to terminate sessions the service user neither created nor holds a session.configure grant on.

Notes

Once terminated, a session cannot be resumed. Terminated sessions remain available for reference whether or not you archive them. Set the archive parameter to true to also archive the session and its descendant sessions. Archiving marks them as archived (is_archived: true) and puts any running descendants to sleep; it does not preserve any additional data. See Archive Session for details.

Authorizations

Authorization
string
header
required

Service User credential (prefix: cog_)

Path Parameters

org_id
string | null
required

Organization ID (prefix: org-)

Example:

"org-abc123def456"

devin_id
string | null
required

Devin session ID (prefix: devin-)

Example:

"devin-abc123def456"

Query Parameters

archive
boolean
default:false

Whether to archive the Devin session

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
automation_id
string | null

ID of the automation that created this session, if any.

category
enum<string> | null

The session's assigned use-case category, if categorisation has run. Only populated on get/list endpoints.

Available options:
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,
production_investigation,
refactoring_and_optimization,
research_and_exploration,
security,
unit_test_generation
child_session_ids
string[] | null
devin_mode
enum<string> | null

The Devin agent mode the session was created with, after resolving org/user defaults and parent-session inheritance. None when the session runs an agent preview that has no mode equivalent.

Available options:
normal,
fast,
fusion,
lite,
ultra,
swe-2-medium,
swe-2-high,
swe-2-max
is_archived
boolean
default:false
origin
enum<string> | null

The origin from which the session was created.

Available options:
webapp,
slack,
teams,
api,
linear,
jira,
automation,
cli,
desktop,
code_scan,
other
parent_session_id
string | null
playbook_id
string | null
security_profile
SessionSecurityProfileResponse · object | null

The session's own security-profile binding. Only populated on get/list endpoints.

service_user_id
string | null
status_detail
enum<string> | null

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', 'user_usage_limit_exceeded', 'total_session_limit_exceeded', 'contract_expired', or 'error'. Only populated on get/list endpoints.

Available options:
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,
user_usage_limit_exceeded,
total_session_limit_exceeded,
contract_expired,
error
structured_output
Structured Output · object | null

Validated structured output from the session. Only populated on get/list endpoints.

subcategory
string | null

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 | null
user_id
string | null