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

> Cria uma nova sessão do Devin. Você pode, opcionalmente, especificar parâmetros como o ID do snapshot e a visibilidade da sessão.

# Criar nova sessão



## OpenAPI

````yaml pt-BR/v1-openapi.yaml POST /v1/sessions
openapi: 3.1.0
info:
  description: API do Devin v1 com chaves de API pessoais e de serviço
  title: Devin API v1
  version: 1.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v1/sessions:
    post:
      summary: Criar nova sessão
      description: >-
        Crie uma nova sessão do Devin com o prompt e as opções de configuração
        especificados.
      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: Resposta bem-sucedida
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Erro de validação
components:
  schemas:
    CreateSessionParams:
      properties:
        idempotent:
          default: false
          title: Idempotent
          type: boolean
        knowledge_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: >-
            Lista de IDs de Knowledge a serem usados. Se for None, use todo o
            Knowledge. Se for uma lista vazia, não use nenhum Knowledge.
          title: Knowledge Ids
        max_acu_limit:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          description: Limite máximo de ACU; deve ser um valor positivo
          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: >-
            Lista de IDs de segredos a utilizar. Se for None, use todos os
            segredos. Se for uma lista vazia, não use nenhum segredo.
          title: Secret Ids
        session_secrets:
          anyOf:
            - items:
                $ref: '#/components/schemas/SessionSecretInput'
              type: array
            - type: 'null'
          description: >-
            Lista de segredos específicos da sessão para uso. Esses segredos
            ficam disponíveis apenas nesta sessão e não são armazenados nos
            segredos da organização.
          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) para validar saídas estruturadas. Máx. 64 KB.
            Deve ser autocontido (sem $ref externo).
          title: Structured Output Schema
        tags:
          anyOf:
            - items:
                type: string
              maxItems: 50
              type: array
            - type: 'null'
          description: Lista de tags a serem adicionadas à sessão.
          title: Tags
        title:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Título personalizado para a sessão. Se for None, um título será
            gerado automaticamente.
          title: Title
        unlisted:
          default: false
          title: Unlisted
          type: boolean
      required:
        - prompt
      title: CreateSessionParams
      type: object
    CreateSessionResponse:
      description: Corpo da resposta retornado quando uma sessão é criada com sucesso.
      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: Modelo de entrada para um segredo de sessão fornecido pela 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: Chave de API pessoal (apk_user_\*) ou chave de API de serviço (apk_\*)
      scheme: bearer
      type: http

````