> ## 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.

> Create a new Devin session. You can optionally specify parameters like snapshot ID and session visibility.

# Create a new session



## OpenAPI

````yaml /v1-openapi.yaml POST /v1/sessions
openapi: 3.1.0
info:
  description: Devin v1 API with Personal and Service API Keys
  title: Devin API v1
  version: 1.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v1/sessions:
    post:
      summary: Create a new session
      description: >-
        Create a new Devin session with the specified prompt and configuration
        options.
      operationId: create_session_endpoint_v1_sessions_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSessionParams'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSessionResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    CreateSessionParams:
      properties:
        idempotent:
          default: false
          title: Idempotent
          type: boolean
        knowledge_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: >-
            List of knowledge IDs to use. If None, use all knowledge. If empty
            list, use no knowledge.
          title: Knowledge Ids
        max_acu_limit:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          description: Maximum ACU limit, must be positive
          title: Max Acu Limit
        playbook_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Playbook Id
        prompt:
          title: Prompt
          type: string
        secret_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: >-
            List of secret IDs to use. If None, use all secrets. If empty list,
            use no secrets.
          title: Secret Ids
        session_secrets:
          anyOf:
            - items:
                $ref: '#/components/schemas/SessionSecretInput'
              type: array
            - type: 'null'
          description: >-
            List of session-specific secrets to use. These secrets are only
            available in this session and are not stored in organization
            secrets.
          title: Session Secrets
        snapshot_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Snapshot Id
        structured_output_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: >-
            JSON Schema (Draft 7) for validating structured output. Max 64KB.
            Must be self-contained (no external $ref).
          title: Structured Output Schema
        tags:
          anyOf:
            - items:
                type: string
              maxItems: 50
              type: array
            - type: 'null'
          description: List of tags to add to the session.
          title: Tags
        title:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Custom title for the session. If None, a title will be generated
            automatically.
          title: Title
        unlisted:
          default: false
          title: Unlisted
          type: boolean
      required:
        - prompt
      title: CreateSessionParams
      type: object
    CreateSessionResponse:
      description: Response body returned when a session is successfully created.
      properties:
        is_new_session:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is New Session
        session_id:
          title: Session Id
          type: string
        url:
          title: Url
          type: string
      required:
        - session_id
        - url
      title: CreateSessionResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    SessionSecretInput:
      description: Input model for a session secret provided via API.
      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
    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: Personal API Key (apk_user_*) or Service API Key (apk_*)
      scheme: bearer
      type: http

````