Zum Hauptinhalt springen
POST
/
v3
/
organizations
/
{org_id}
/
sessions
Session erstellen
curl --request POST \
  --url https://api.devin.ai/v3/organizations/{org_id}/sessions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "attachment_urls": [
    "<string>"
  ],
  "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>"
  ],
  "session_secrets": [
    {
      "key": "<string>",
      "value": "<string>",
      "sensitive": true
    }
  ],
  "structured_output_required": true,
  "structured_output_schema": {},
  "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>",
  "category": "bug_fixing",
  "child_session_ids": [
    "<string>"
  ],
  "is_archived": false,
  "origin": "webapp",
  "parent_session_id": "<string>",
  "playbook_id": "<string>",
  "service_user_id": "<string>",
  "status_detail": "working",
  "structured_output": {},
  "subcategory": "<string>",
  "title": "<string>",
  "user_id": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.devin.ai/llms.txt

Use this file to discover all available pages before exploring further.

Berechtigungen

Erfordert einen Servicebenutzer mit der Berechtigung ManageOrgSessions auf Organisationsebene.

Zusätzliche Berechtigungen für erweiterte Funktionen

FunktionErforderliche Berechtigung
create_as_user_idImpersonateOrgSessions

Nutzer-Impersonation

Der Parameter create_as_user_id ermöglicht das Erstellen einer Sitzung im Namen eines anderen Nutzers. Dafür ist Folgendes erforderlich:
  1. Der Servicebenutzer muss die Berechtigung ImpersonateOrgSessions haben
  2. Der Zielnutzer muss Mitglied der Organisation sein
  3. Der Zielnutzer muss die Berechtigung UseDevinSessions haben

Autorisierungen

Authorization
string
header
erforderlich

Servicebenutzer-Anmeldedaten (Präfix: cog_)

Pfadparameter

org_id
string | null
erforderlich

Organisations-ID (Präfix: org-)

Beispiel:

"org-abc123def456"

Abfrageparameter

devin_id
string | null

Body

application/json
prompt
string
erforderlich
attachment_urls
string<uri>[] | null
Required string length: 1 - 2083
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
session_secrets
SessionSecretInput · object[] | null
structured_output_required
boolean | null

Wenn „true“ (Standard), MUSS der Agent provide_structured_output mit is_final=true aufrufen, bevor sein Turn endet. Wenn „false“, ist das Tool verfügbar, aber nicht erforderlich — es ist nicht garantiert, dass es in einem bestimmten Turn aufgerufen wird.

structured_output_schema
Structured Output Schema · object

JSON-Schema (Draft 7) zur Validierung strukturierter Ausgaben. Max. 64 KB. Muss in sich abgeschlossen sein (keine externen $ref-Verweise).

tags
string[] | null
title
string | null

Antwort

Erfolgreiche Antwort

acus_consumed
number
erforderlich
created_at
integer
erforderlich
org_id
string
erforderlich
pull_requests
SessionPullRequest · object[]
erforderlich
session_id
string
erforderlich
status
enum<string>
erforderlich
Verfügbare Optionen:
new,
claimed,
running,
exit,
error,
suspended,
resuming
tags
string[]
erforderlich
updated_at
integer
erforderlich
url
string
erforderlich
category
enum<string> | null

Die der Sitzung zugewiesene Anwendungsfallkategorie, falls die Kategorisierung ausgeführt wurde. Nur bei GET-/List-Endpunkten befüllt.

Verfügbare Optionen:
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
string[] | null
is_archived
boolean
Standard:false
origin
enum<string> | null

Die Quelle, aus der die Sitzung erstellt wurde.

Verfügbare Optionen:
webapp,
slack,
teams,
api,
linear,
jira,
scheduled,
automation,
cli,
desktop,
other
parent_session_id
string | null
playbook_id
string | null
service_user_id
string | null
status_detail
enum<string> | null

Zusätzliche Details zum aktuellen Status der Sitzung. Wenn der Status „running“ ist: „working“ (arbeitet aktiv), „waiting_for_user“ (benötigt Eingaben des Nutzers), „waiting_for_approval“ (wartet im abgesicherten Modus auf die Genehmigung einer Aktion) oder „finished“ (Aufgabe abgeschlossen). Wenn der Status „suspended“ ist: der Grund für die Unterbrechung, z. B. „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“ oder „error“. Nur bei GET-/List-Endpunkten befüllt.

Verfügbare Optionen:
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
Structured Output · object

Validierte strukturierte Ausgabe aus der Session. Wird nur bei GET-/LIST-Endpunkten befüllt.

subcategory
string | null

Der Anzeigename der der Sitzung zugewiesenen Unterkategorie. „Other“, wenn eine Kategorie festgelegt ist, aber keine Unterkategorie zugewiesen oder bezogen werden konnte. Nur bei GET-/List-Endpunkten befüllt.

title
string | null
user_id
string | null