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

# Create a session

> Creates a session and returns short-lived LiveKit connection credentials. Retry the same logical request with the same idempotency key.



## OpenAPI

````yaml /openapi/public-api.json post /v1/sessions
openapi: 3.1.0
info:
  title: Digital Human API
  version: 1.0.0
  description: >-
    Create and manage realtime digital-human sessions. API keys must be used
    only from trusted server code.
servers:
  - url: https://api.livefaces.ai
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Authentication
    description: Inspect the authenticated API-key principal.
  - name: Sessions
    description: Create, refresh, inspect, and end digital-human sessions.
paths:
  /v1/sessions:
    post:
      tags:
        - Sessions
      summary: Create a session
      description: >-
        Creates a session and returns short-lived LiveKit connection
        credentials. Retry the same logical request with the same idempotency
        key.
      operationId: createSession
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          description: A caller-generated identifier for this logical create operation.
          schema:
            type: string
            minLength: 1
            maxLength: 200
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SessionCreate'
      responses:
        '201':
          description: Session created
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Session'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/ValidationError'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  schemas:
    SessionCreate:
      type: object
      additionalProperties: false
      properties:
        participant_identity:
          type: string
          minLength: 1
          maxLength: 100
          description: Identity assigned to the browser participant.
        digital_human_id:
          type: string
          format: uuid
          description: Digital human to join the session.
        tags:
          type: array
          maxItems: 20
          items:
            type: string
        metadata:
          type: object
          additionalProperties: true
    Session:
      type: object
      additionalProperties: false
      required:
        - id
        - status
        - room_name
        - livekit_url
        - participant_token
        - created_at
        - started_at
        - ended_at
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - created
            - active
            - completed
            - failed
            - cancelled
        room_name:
          type: string
        livekit_url:
          type: string
          format: uri
        participant_token:
          type:
            - string
            - 'null'
          description: Short-lived room token. Null after the session becomes terminal.
        created_at:
          type: string
          format: date-time
        started_at:
          type:
            - string
            - 'null'
          format: date-time
        ended_at:
          type:
            - string
            - 'null'
          format: date-time
    ApiError:
      type: object
      additionalProperties: false
      required:
        - code
        - detail
        - request_id
      properties:
        code:
          type: string
        detail: {}
        request_id:
          type: string
  headers:
    RequestId:
      description: Identifier for support and request correlation.
      schema:
        type: string
  responses:
    Unauthorized:
      $ref: '#/components/responses/ErrorBody'
      description: Missing or invalid API key
    Forbidden:
      $ref: '#/components/responses/ErrorBody'
      description: API key lacks the required scope
    Conflict:
      $ref: '#/components/responses/ErrorBody'
      description: Idempotency key conflicts with an earlier request
    ValidationError:
      $ref: '#/components/responses/ErrorBody'
      description: Request validation failed
    Unavailable:
      $ref: '#/components/responses/ErrorBody'
      description: Session service is temporarily unavailable
    ErrorBody:
      description: API error
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: A server-side Digital Human API key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.