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

# Criar ou retomar sessão do visitante

> Inicia sessão do widget com `publicKey`. Opcional: identityPayload + identitySignature.



## OpenAPI

````yaml /es/ai-web-widget/api-reference/openapi-ai-web-widget.json post /public/ai-widget/{publicKey}/session
openapi: 3.0.3
info:
  title: Notifique API Chat no site (widget)
  description: >-
    **Widget de chat AI** API pública en el sitio web del cliente. No utiliza la
    clave API del espacio de trabajo: la seguridad se realiza con **clave
    pública del widget**, **dominios permitidos** y **token de sesión** firmado.


    Base: `https://api.notifique.dev/public/ai-widget`
  version: 1.0.0
servers:
  - url: https://api.notifique.dev
    description: Producción
security: []
tags:
  - name: Widget público
    description: Incrustar configuración, sesión, mensajes y OTP
  - name: Widget admin
    description: CRUD de widgets via API Key (escopos ai_widgets:*)
paths:
  /public/ai-widget/{publicKey}/session:
    post:
      tags:
        - Widget público
      summary: Criar ou retomar sessão do visitante
      description: >-
        Inicia sessão do widget com `publicKey`. Opcional: identityPayload +
        identitySignature.
      operationId: ntfWidget_createSession
      parameters:
        - name: publicKey
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSessionBody'
            example:
              visitorClientId: clxx...
              name: Exemplo
              email: cliente@example.com
              phone: string
              identityPayload: {}
              identitySignature: clxx...
      responses:
        '200':
          description: Sesión creada
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionResponse'
              example:
                success: true
                data:
                  sessionToken: string
                  sessionId: clxx...
                  identityVerified: true
                  messages:
                    - {}
        '403':
          description: Origen no permitido
components:
  schemas:
    CreateSessionBody:
      type: object
      properties:
        visitorClientId:
          type: string
        name:
          type: string
        email:
          type: string
          format: email
        phone:
          type: string
        identityPayload:
          type: object
          properties: {}
        identitySignature:
          type: string
      example:
        visitorClientId: clxx...
        name: Exemplo
        email: cliente@example.com
        phone: string
        identityPayload: {}
        identitySignature: clxx...
    SessionResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
          properties:
            sessionToken:
              type: string
            sessionId:
              type: string
            identityVerified:
              type: boolean
            messages:
              type: array
              items:
                type: object
      example:
        success: true
        data:
          sessionToken: string
          sessionId: clxx...
          identityVerified: true
          messages:
            - {}

````