components:
  schemas:
    AllKnowledgeResponse:
      properties:
        folders:
          items:
            $ref: '#/components/schemas/FolderResponse'
          title: Folders
          type: array
        knowledge:
          items:
            $ref: '#/components/schemas/KnowledgeResponse'
          title: Knowledge
          type: array
      required:
      - knowledge
      - folders
      title: AllKnowledgeResponse
      type: object
    Body_upload_attachment_customer_endpoint_v1_attachments_post:
      properties:
        file:
          format: binary
          title: File
          type: string
      required:
      - file
      title: Body_upload_attachment_customer_endpoint_v1_attachments_post
      type: object
    ConsumptionCycle:
      description: Billing cycle information.
      properties:
        end:
          title: End
          type: string
        start:
          title: Start
          type: string
      required:
      - start
      - end
      title: ConsumptionCycle
      type: object
    ConsumptionPullRequest:
      description: Pull request data in consumption response.
      properties:
        pr_status:
          enum:
          - open
          - closed
          - merged
          title: Pr Status
          type: string
        pr_url:
          title: Pr Url
          type: string
      required:
      - pr_url
      - pr_status
      title: ConsumptionPullRequest
      type: object
    ConsumptionSessionData:
      description: Session consumption data.
      properties:
        acu_used:
          title: Acu Used
          type: number
        created_at:
          title: Created At
          type: string
        org_id:
          title: Org Id
          type: string
        org_name:
          title: Org Name
          type: string
        pull_requests:
          items:
            $ref: '#/components/schemas/ConsumptionPullRequest'
          title: Pull Requests
          type: array
        session_name:
          title: Session Name
          type: string
        url:
          title: Url
          type: string
        user_email:
          anyOf:
          - type: string
          - type: 'null'
          title: User Email
        user_name:
          anyOf:
          - type: string
          - type: 'null'
          title: User Name
      required:
      - session_name
      - created_at
      - acu_used
      - url
      - org_id
      - org_name
      - pull_requests
      title: ConsumptionSessionData
      type: object
    CreateKnowledgeParams:
      properties:
        body:
          title: Body
          type: string
        macro:
          anyOf:
          - type: string
          - type: 'null'
          title: Macro
        name:
          title: Name
          type: string
        parent_folder_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Parent Folder Id
        pinned_repo:
          anyOf:
          - type: string
          - type: 'null'
          title: Pinned Repo
        trigger_description:
          title: Trigger Description
          type: string
      required:
      - name
      - body
      - trigger_description
      title: CreateKnowledgeParams
      type: object
    CreatePlaybookRequest:
      properties:
        body:
          minLength: 1
          title: Body
          type: string
        macro:
          anyOf:
          - type: string
          - type: 'null'
          title: Macro
        title:
          minLength: 1
          title: Title
          type: string
      required:
      - title
      - body
      title: CreatePlaybookRequest
      type: object
    CreateSecretResponse:
      description: Response for successful secret creation.
      properties:
        id:
          title: Id
          type: string
      required:
      - id
      title: CreateSecretResponse
      type: object
    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.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
    DeletePlaybookResponse:
      description: Response for successful playbook deletion.
      properties:
        status:
          title: Status
          type: string
      required:
      - status
      title: DeletePlaybookResponse
      type: object
    DeleteSecretResponse:
      description: Response for successful secret deletion.
      properties:
        message:
          title: Message
          type: string
      required:
      - message
      title: DeleteSecretResponse
      type: object
    EditSessionTagsParams:
      properties:
        tags:
          items:
            type: string
          maxItems: 50
          title: Tags
          type: array
      required:
      - tags
      title: EditSessionTagsParams
      type: object
    EditTagsResponse:
      description: Response for successful tag update.
      properties:
        detail:
          title: Detail
          type: string
      required:
      - detail
      title: EditTagsResponse
      type: object
    EnterpriseConsumptionResponse:
      description: Response containing enterprise consumption data.
      properties:
        cycle:
          $ref: '#/components/schemas/ConsumptionCycle'
        sessions:
          items:
            $ref: '#/components/schemas/ConsumptionSessionData'
          title: Sessions
          type: array
      required:
      - sessions
      - cycle
      title: EnterpriseConsumptionResponse
      type: object
    FolderResponse:
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        description:
          title: Description
          type: string
        id:
          title: Id
          type: string
        name:
          title: Name
          type: string
      required:
      - id
      - name
      - description
      - created_at
      title: FolderResponse
      type: object
    GetSessionResponse:
      description: Detailed information about an existing session.
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        messages:
          default: []
          items:
            $ref: '#/components/schemas/SessionMessage'
          title: Messages
          type: array
        playbook_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Playbook Id
        pull_request:
          anyOf:
          - $ref: '#/components/schemas/PullRequestInfo'
          - type: 'null'
        session_id:
          title: Session Id
          type: string
        snapshot_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Snapshot Id
        status:
          title: Status
          type: string
        status_enum:
          anyOf:
          - enum:
            - working
            - blocked
            - expired
            - finished
            - suspend_requested
            - suspend_requested_frontend
            - resume_requested
            - resume_requested_frontend
            - resumed
            type: string
          - type: 'null'
          title: Status Enum
        structured_output:
          anyOf:
          - {}
          - type: 'null'
          title: Structured Output
        tags:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Tags
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        updated_at:
          format: date-time
          title: Updated At
          type: string
      required:
      - session_id
      - status
      - created_at
      - updated_at
      title: GetSessionResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    KnowledgeCreatedBy:
      description: Information about who created a knowledge entry.
      properties:
        full_name:
          title: Full Name
          type: string
        id:
          anyOf:
          - type: string
          - type: 'null'
          title: Id
        image_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Image Url
      required:
      - full_name
      title: KnowledgeCreatedBy
      type: object
    KnowledgeResponse:
      properties:
        body:
          title: Body
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        created_by:
          anyOf:
          - $ref: '#/components/schemas/KnowledgeCreatedBy'
          - type: 'null'
        id:
          title: Id
          type: string
        macro:
          anyOf:
          - type: string
          - type: 'null'
          title: Macro
        name:
          title: Name
          type: string
        parent_folder_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Parent Folder Id
        pinned_repo:
          anyOf:
          - type: string
          - type: 'null'
          title: Pinned Repo
        trigger_description:
          title: Trigger Description
          type: string
      required:
      - name
      - body
      - trigger_description
      - id
      - created_at
      title: KnowledgeResponse
      type: object
    ListSessionsResponse:
      description: Response containing a list of sessions.
      properties:
        sessions:
          items:
            $ref: '#/components/schemas/SessionSummary'
          title: Sessions
          type: array
      required:
      - sessions
      title: ListSessionsResponse
      type: object
    MessageSentResponse:
      description: Response when a message is sent to a session that is already in
        a specific state.
      properties:
        detail:
          title: Detail
          type: string
      required:
      - detail
      title: MessageSentResponse
      type: object
    PlaybookResponse:
      properties:
        access_type:
          title: Access Type
          type: string
        body:
          title: Body
          type: string
        created_at:
          anyOf:
          - format: date-time
            type: string
          - type: 'null'
          title: Created At
        created_by_user_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Created By User Id
        created_by_user_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Created By User Name
        macro:
          anyOf:
          - type: string
          - type: 'null'
          title: Macro
        org_id:
          title: Org Id
          type: string
        playbook_id:
          title: Playbook Id
          type: string
        status:
          title: Status
          type: string
        title:
          title: Title
          type: string
        updated_at:
          anyOf:
          - format: date-time
            type: string
          - type: 'null'
          title: Updated At
        updated_by_user_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Updated By User Id
        updated_by_user_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Updated By User Name
      required:
      - playbook_id
      - title
      - body
      - status
      - access_type
      - org_id
      - created_at
      - updated_at
      - created_by_user_id
      - created_by_user_name
      - updated_by_user_id
      - updated_by_user_name
      title: PlaybookResponse
      type: object
    PostMessageParams:
      properties:
        message:
          title: Message
          type: string
      required:
      - message
      title: PostMessageParams
      type: object
    PullRequestInfo:
      description: Pull request information associated with a session.
      properties:
        url:
          title: Url
          type: string
      required:
      - url
      title: PullRequestInfo
      type: object
    Secret:
      properties:
        key:
          title: Key
          type: string
        note:
          title: Note
          type: string
        scope:
          default: org
          enum:
          - org
          - personal
          title: Scope
          type: string
        sensitive:
          title: Sensitive
          type: boolean
        type:
          enum:
          - cookie
          - key-value
          - dictionary
          - totp
          title: Type
          type: string
        value:
          title: Value
          type: string
      required:
      - type
      - key
      - value
      - sensitive
      - note
      title: Secret
      type: object
    SecretMetadata:
      description: Metadata about a stored secret.
      properties:
        created_at:
          anyOf:
          - format: date-time
            type: string
          - type: 'null'
          title: Created At
        id:
          title: Id
          type: string
        key:
          anyOf:
          - type: string
          - type: 'null'
          title: Key
        type:
          enum:
          - cookie
          - key-value
          - dictionary
          - totp
          title: Type
          type: string
      required:
      - id
      - type
      title: SecretMetadata
      type: object
    SessionMessage:
      description: A message in a Devin session.
      properties:
        event_id:
          title: Event Id
          type: string
        message:
          title: Message
          type: string
        origin:
          anyOf:
          - type: string
          - type: 'null'
          title: Origin
        timestamp:
          title: Timestamp
          type: string
        type:
          title: Type
          type: string
        user_id:
          anyOf:
          - type: string
          - type: 'null'
          title: User Id
        username:
          anyOf:
          - type: string
          - type: 'null'
          title: Username
      required:
      - type
      - event_id
      - message
      - timestamp
      title: SessionMessage
      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
    SessionSummary:
      description: Summary information about a session for list responses.
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        playbook_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Playbook Id
        pull_request:
          anyOf:
          - $ref: '#/components/schemas/PullRequestInfo'
          - type: 'null'
        requesting_user_email:
          anyOf:
          - type: string
          - type: 'null'
          title: Requesting User Email
        session_id:
          title: Session Id
          type: string
        snapshot_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Snapshot Id
        status:
          title: Status
          type: string
        status_enum:
          anyOf:
          - enum:
            - working
            - blocked
            - expired
            - finished
            - suspend_requested
            - suspend_requested_frontend
            - resume_requested
            - resume_requested_frontend
            - resumed
            type: string
          - type: 'null'
          title: Status Enum
        structured_output:
          anyOf:
          - {}
          - type: 'null'
          title: Structured Output
        tags:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Tags
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        updated_at:
          format: date-time
          title: Updated At
          type: string
      required:
      - session_id
      - status
      - created_at
      - updated_at
      title: SessionSummary
      type: object
    TerminateSessionResponse:
      description: Response for successful session termination.
      properties:
        detail:
          title: Detail
          type: string
      required:
      - detail
      title: TerminateSessionResponse
      type: object
    UpdatePlaybookResponse:
      description: Response for successful playbook update.
      properties:
        status:
          title: Status
          type: string
      required:
      - status
      title: UpdatePlaybookResponse
      type: object
    V1SessionAttachment:
      description: An attachment sent during a session (v1 contract).
      properties:
        attachment_id:
          title: Attachment Id
          type: string
        content_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Content Type
        name:
          title: Name
          type: string
        source:
          title: Source
          type: string
        url:
          title: Url
          type: string
      required:
      - attachment_id
      - name
      - url
      - source
      title: V1SessionAttachment
      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
info:
  description: Devin v1 API with Personal and Service API Keys
  title: Devin API v1
  version: 1.0.0
openapi: 3.1.0
paths:
  /v1/attachments:
    post:
      description: Upload a file attachment that can be used in Devin sessions. Returns
        the URL of the uploaded attachment as a string.
      operationId: upload_attachment_customer_endpoint_v1_attachments_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_upload_attachment_customer_endpoint_v1_attachments_post'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                title: Response Upload Attachment Customer Endpoint V1 Attachments
                  Post
                type: string
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Upload an attachment
  /v1/attachments/{uuid}/{name}:
    get:
      description: Download a file attachment using API key authentication. Returns
        a redirect to a presigned URL.
      operationId: download_attachment_customer_endpoint_v1_attachments__uuid___name__get
      parameters:
      - in: path
        name: uuid
        required: true
        schema:
          title: Uuid
          type: string
      - in: path
        name: name
        required: true
        schema:
          title: Name
          type: string
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: Successful Response
        '307':
          description: Redirect to presigned download URL
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Download an attachment
  /v1/enterprise/consumption:
    get:
      description: Retrieve detailed enterprise consumption data for a date range.
      operationId: get_enterprise_consumption_v1_enterprise_consumption_get
      parameters:
      - in: query
        name: start_date
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Start Date
      - in: query
        name: end_date
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: End Date
      - in: query
        name: start
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Start
      - in: query
        name: end
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: End
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnterpriseConsumptionResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Get enterprise consumption
  /v1/knowledge:
    get:
      description: List all knowledge entries and folders for the organization.
      operationId: get_all_knowledge_v1_knowledge_get
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllKnowledgeResponse'
          description: Successful Response
      summary: List all knowledge
    post:
      description: Create a new knowledge entry for the organization.
      operationId: create_knowledge_v1_knowledge_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateKnowledgeParams'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Create knowledge entry
  /v1/knowledge/{note_id}:
    delete:
      description: Delete a knowledge entry from the organization.
      operationId: delete_knowledge_v1_knowledge__note_id__delete
      parameters:
      - in: path
        name: note_id
        required: true
        schema:
          title: Note Id
          type: string
      responses:
        '204':
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Delete knowledge entry
    put:
      description: Update an existing knowledge entry.
      operationId: update_knowledge_v1_knowledge__note_id__put
      parameters:
      - in: path
        name: note_id
        required: true
        schema:
          title: Note Id
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateKnowledgeParams'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Update knowledge entry
  /v1/playbooks:
    get:
      description: List all team playbooks for the organization.
      operationId: get_playbooks_v1_playbooks_get
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PlaybookResponse'
                title: Response Get Playbooks V1 Playbooks Get
                type: array
          description: Successful Response
      summary: List playbooks
    post:
      description: Create a new team playbook for the organization.
      operationId: create_playbook_v1_playbooks_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePlaybookRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlaybookResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Create playbook
  /v1/playbooks/{playbook_id}:
    delete:
      description: Delete a team playbook from the organization.
      operationId: delete_playbook_v1_playbooks__playbook_id__delete
      parameters:
      - in: path
        name: playbook_id
        required: true
        schema:
          title: Playbook Id
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeletePlaybookResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Delete playbook
    get:
      description: Get a specific team playbook by ID.
      operationId: get_playbook_v1_playbooks__playbook_id__get
      parameters:
      - in: path
        name: playbook_id
        required: true
        schema:
          title: Playbook Id
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlaybookResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Get playbook
    put:
      description: Update an existing team playbook.
      operationId: update_playbook_v1_playbooks__playbook_id__put
      parameters:
      - in: path
        name: playbook_id
        required: true
        schema:
          title: Playbook Id
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePlaybookRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdatePlaybookResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Update playbook
  /v1/secrets:
    get:
      description: List all secrets for the organization. Returns metadata only, not
        the secret values.
      operationId: get_secrets_v1_secrets_get
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/SecretMetadata'
                title: Response Get Secrets V1 Secrets Get
                type: array
          description: Successful Response
      summary: List secrets
    post:
      description: Create a new secret for the organization. Supports cookie, key-value,
        and TOTP secret types.
      operationId: create_secret_v1_secrets_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Secret'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSecretResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Create a secret
  /v1/secrets/{secret_id}:
    delete:
      description: Delete a secret from the organization.
      operationId: delete_secret_v1_secrets__secret_id__delete
      parameters:
      - in: path
        name: secret_id
        required: true
        schema:
          title: Secret Id
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteSecretResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Delete a secret
  /v1/sessions:
    get:
      description: List all Devin sessions for your organization. Supports pagination
        and filtering by tags and user email.
      operationId: list_sessions_endpoint_v1_sessions_get
      parameters:
      - in: query
        name: limit
        required: false
        schema:
          default: 100
          title: Limit
          type: integer
      - in: query
        name: offset
        required: false
        schema:
          default: 0
          title: Offset
          type: integer
      - in: query
        name: skip
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          title: Skip
      - description: List of tags to filter sessions by.
        in: query
        name: tags
        required: false
        schema:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          description: List of tags to filter sessions by.
          title: Tags
      - description: Filter sessions by the creator's email address.
        in: query
        name: user_email
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Filter sessions by the creator's email address.
          title: User Email
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListSessionsResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: List sessions
    post:
      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
      summary: Create a new session
  /v1/sessions/{session_id}:
    delete:
      description: Terminate an active Devin session. The session must not already
        be in an exited state.
      operationId: terminate_session_endpoint_v1_sessions__session_id__delete
      parameters:
      - in: path
        name: session_id
        required: true
        schema:
          title: Session Id
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminateSessionResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Terminate a session
    get:
      description: Retrieve detailed information about an existing Devin session,
        including its status, output, and metadata.
      operationId: get_session_endpoint_v1_sessions__session_id__get
      parameters:
      - in: path
        name: session_id
        required: true
        schema:
          title: Session Id
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSessionResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Retrieve details about an existing session
  /v1/sessions/{session_id}/attachments:
    get:
      description: List all attachments for a session, including both Devin-generated
        and user-uploaded files.
      operationId: get_session_attachments_endpoint_v1_sessions__session_id__attachments_get
      parameters:
      - in: path
        name: session_id
        required: true
        schema:
          title: Session Id
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/V1SessionAttachment'
                title: Response Get Session Attachments Endpoint V1 Sessions  Session
                  Id  Attachments Get
                type: array
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: List session attachments
  /v1/sessions/{session_id}/message:
    post:
      description: Send a message to an active Devin session. The session must be
        in a running state to receive messages. Returns null on success, or a detail
        message if the session is already suspended.
      operationId: post_message_to_session_v1_sessions__session_id__message_post
      parameters:
      - in: path
        name: session_id
        required: true
        schema:
          title: Session Id
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostMessageParams'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/MessageSentResponse'
                - type: 'null'
                title: Response Post Message To Session V1 Sessions  Session Id  Message
                  Post
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Send a message to a session
  /v1/sessions/{session_id}/tags:
    put:
      description: Update the tags associated with a Devin session.
      operationId: edit_session_tags_v1_sessions__session_id__tags_put
      parameters:
      - in: path
        name: session_id
        required: true
        schema:
          title: Session Id
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditSessionTagsParams'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EditTagsResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      summary: Update session tags
security:
- bearerAuth: []
