> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devinenterprise.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Session erstellen

> Neue Sitzung erstellen

<div id="permissions">
  ## Berechtigungen
</div>

Erfordert einen Servicebenutzer mit der Berechtigung `ManageOrgSessions` auf Organisationsebene.

<div id="additional-permissions-for-advanced-features">
  ### Zusätzliche Berechtigungen für erweiterte Funktionen
</div>

| Funktion            | Erforderliche Berechtigung |
| ------------------- | -------------------------- |
| `create_as_user_id` | `ImpersonateOrgSessions`   |

<div id="devin-mode">
  ## Devin-Modus
</div>

Der Parameter `devin_mode` legt fest, welcher Devin-Agent-Modus für die Sitzung verwendet wird:

| Modus    | Beschreibung                                                        |
| -------- | ------------------------------------------------------------------- |
| `normal` | Der Standard-Agent-Modus. Schnell und gut für langfristige Planung. |
| `fast`   | \~2x schneller, 4x teurer, gleiche Intelligenz.                     |

Wenn der Parameter weggelassen wird, verwendet die Sitzung den Standardmodus der Organisation. Für den schnellen Modus gelten dieselben Einschränkungen hinsichtlich Feature-Flags und der Enterprise-Agent-Preview wie für die Web-App.

<div id="user-impersonation">
  ## Nutzer-Impersonation
</div>

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


## OpenAPI

````yaml de/v3-openapi.yaml POST /v3/organizations/{org_id}/sessions
openapi: 3.1.0
info:
  description: Devin v3 API mit Service-User-Authentifizierung und RBAC
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/organizations/{org_id}/sessions:
    post:
      tags:
        - sessions
      summary: Session erstellen
      description: Neue Sitzung erstellen
      operationId: handle_create_session_v3_organizations__org_id__sessions_post
      parameters:
        - description: 'Organisations-ID (Präfix: org-)'
          in: path
          name: org_id
          required: true
          schema:
            anyOf:
              - type: string
              - type: 'null'
            example: org-abc123def456
            title: Org Id
        - in: query
          name: devin_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Devin Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SessionCreateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionResponse'
          description: Erfolgreiche Antwort
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validierungsfehler
components:
  schemas:
    SessionCreateRequest:
      properties:
        attachment_urls:
          anyOf:
            - items:
                format: uri
                maxLength: 2083
                minLength: 1
                type: string
              type: array
            - type: 'null'
          title: Attachment Urls
        bypass_approval:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Bypass Approval
        child_playbook_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Child Playbook Id
        create_as_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Create As User Id
        devin_mode:
          anyOf:
            - enum:
                - normal
                - fast
                - lite
                - ultra
                - fusion
              type: string
            - type: 'null'
          description: >-
            Überschreibt den Devin Agent-Modus für die Sitzung. 'normal'
            verwendet den Standard-Agent-Modus, 'fast' verwendet den Fast-Modus,
            'lite' verwendet Devin Lite, 'ultra' verwendet Devin Ultra und
            'fusion' verwendet Fusion. Für Preview-Modi gelten dieselben
            Feature-Flag- und Enterprise-Agent-Preview-Einschränkungen wie für
            die Web-App.
          title: Devin Mode
        knowledge_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Knowledge Ids
        max_acu_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Acu Limit
        platform:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Überschreibt die VM-Plattform für die Sitzung (z. B. 'windows').
            Wenn kein Wert angegeben ist (oder 'inherit' gesetzt ist), übernimmt
            eine von einem übergeordneten Devin erstellte Sitzung die Plattform
            des übergeordneten Devin; andernfalls wird die Standardplattform der
            Organisation verwendet. Jeder Wert muss mit einer für Ihre
            Organisation konfigurierten Plattform übereinstimmen
            (Groß-/Kleinschreibung wird nicht beachtet); unbekannte Werte werden
            mit einem 400-Fehler abgelehnt, dessen Fehlertext die für die
            Organisation verfügbaren Plattformbezeichnungen auflistet.
          title: Platform
        playbook_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Playbook Id
        prompt:
          title: Prompt
          type: string
        repos:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Repos
        resumable:
          default: true
          description: >-
            Ob der VM-Status der Sitzung nach dem Beenden beibehalten werden
            soll, damit die Sitzung fortgesetzt werden kann. Für temporäre
            Sitzungen auf false setzen.
          title: Resumable
          type: boolean
        secret_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Secret Ids
        session_links:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Session Links
        session_secrets:
          anyOf:
            - items:
                $ref: '#/components/schemas/SessionSecretInput'
              type: array
            - type: 'null'
          title: Session Secrets
        structured_output_required:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            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.
          title: Structured Output Required
        structured_output_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: >-
            JSON-Schema (Draft 7) zur Validierung strukturierter Ausgaben. Max.
            64 KB. Muss in sich abgeschlossen sein (keine externen
            $ref-Verweise).
          title: Structured Output Schema
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
      required:
        - prompt
      title: SessionCreateRequest
      type: object
    SessionResponse:
      properties:
        acus_consumed:
          title: Acus Consumed
          type: number
        category:
          anyOf:
            - enum:
                - 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
                - refactoring_and_optimization
                - research_and_exploration
                - security
                - unit_test_generation
              type: string
            - type: 'null'
          description: >-
            Die der Sitzung zugewiesene Anwendungsfallkategorie, falls die
            Kategorisierung ausgeführt wurde. Nur bei GET-/List-Endpunkten
            befüllt.
          title: Category
        child_session_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Child Session Ids
        created_at:
          title: Created At
          type: integer
        is_archived:
          default: false
          title: Is Archived
          type: boolean
        org_id:
          title: Org Id
          type: string
        origin:
          anyOf:
            - enum:
                - webapp
                - slack
                - teams
                - api
                - linear
                - jira
                - automation
                - cli
                - desktop
                - code_scan
                - other
              type: string
            - type: 'null'
          description: Die Quelle, aus der die Sitzung erstellt wurde.
          title: Origin
        parent_session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Session Id
        playbook_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Playbook Id
        pull_requests:
          items:
            $ref: '#/components/schemas/SessionPullRequest'
          title: Pull Requests
          type: array
        service_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Service User Id
        session_id:
          title: Session Id
          type: string
        status:
          enum:
            - new
            - claimed
            - running
            - exit
            - error
            - suspended
            - resuming
          title: Status
          type: string
        status_detail:
          anyOf:
            - enum:
                - 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
              type: string
            - type: 'null'
          description: >-
            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.
          title: Status Detail
        structured_output:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: >-
            Validierte strukturierte Ausgabe aus der Session. Wird nur bei
            GET-/LIST-Endpunkten befüllt.
          title: Structured Output
        subcategory:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            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: Subcategory
        tags:
          items:
            type: string
          title: Tags
          type: array
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        updated_at:
          title: Updated At
          type: integer
        url:
          title: Url
          type: string
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
      required:
        - session_id
        - url
        - status
        - tags
        - org_id
        - created_at
        - updated_at
        - acus_consumed
        - pull_requests
      title: SessionResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    SessionSecretInput:
      description: Eingabemodell für ein Session-Secret, das per API bereitgestellt wird.
      properties:
        key:
          maxLength: 256
          minLength: 1
          title: Key
          type: string
        sensitive:
          default: true
          title: Sensitive
          type: boolean
        value:
          maxLength: 65536
          title: Value
          type: string
      required:
        - key
        - value
      title: SessionSecretInput
      type: object
    SessionPullRequest:
      properties:
        pr_state:
          anyOf:
            - type: string
            - type: 'null'
          title: Pr State
        pr_url:
          title: Pr Url
          type: string
      required:
        - pr_url
        - pr_state
      title: SessionPullRequest
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearerAuth:
      description: 'Servicebenutzer-Anmeldedaten (Präfix: cog_)'
      scheme: bearer
      type: http

````