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

# Generate SDK Session ID

> Enables users to create a short-lived session ID for SDK initialization.



## OpenAPI

````yaml /api-reference/specs/sdk.json post /v2/api/identity/sdk/liveness/session/generate
openapi: 3.0.3
info:
  title: Youverify SDK Utilities API
  version: 2.0.0
  description: >-
    Server-side helper endpoints used by Youverify's mobile/web Liveness SDKs:
    configuring liveness behavior, minting SDK session tokens, and reviewing
    liveness-check history. Assembled from
    doc.youverify.co/api-reference-sdk/sdk, kept in the exact order they appear
    in the GitBook navigation (SDK Settings → Generate SDK Liveness Token →
    Generate SDK Session ID → Liveness History). 401/429/500 are account-wide
    errors sourced verbatim from Youverify's "Youverify OS Error Codes" page and
    attached to every operation; 402 is attached to POST operations; any error a
    specific page actually showed (e.g. the 404 on SDK Settings and Liveness
    History) is kept exactly as documented there.
  contact:
    name: Youverify Support
    email: support@youverify.co
servers:
  - url: https://api.youverify.co
    description: Production (live, billed)
  - url: https://api.sandbox.youverify.co
    description: Sandbox (test data, not billed)
security:
  - ApiKeyAuth: []
tags:
  - name: SDK Utilities
    description: Server-side helper endpoints used by the mobile/web SDKs.
paths:
  /v2/api/identity/sdk/liveness/session/generate:
    post:
      tags:
        - SDK Utilities
      summary: Generate SDK Session ID
      description: Enables users to create a short-lived session ID for SDK initialization.
      operationId: generateSdkSessionId
      parameters:
        - name: token
          in: header
          required: true
          schema:
            type: string
          description: API secret token
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                ttlSeconds:
                  type: number
                  description: TTL in seconds, default 120, valid range 30-600
                metadata:
                  type: object
                  description: Custom metadata, default empty object
      responses:
        '200':
          description: Success
          content:
            application/json:
              example:
                success: true
                statusCode: 200
                message: SDK session generated
                data:
                  sessionId: 200f5a883713b7ff26f22f489d716ca3
                  expiresAt: '2025-10-05T23:56:48.821Z'
                  status: active
                links: []
        '401':
          $ref: '#/components/responses/Error401Unauthorized'
        '402':
          $ref: '#/components/responses/Error402PaymentRequired'
        '429':
          $ref: '#/components/responses/Error429TooManyRequests'
        '500':
          $ref: '#/components/responses/Error500ServerError'
components:
  responses:
    Error401Unauthorized:
      description: Unauthorized — the token header is missing or invalid.
      content:
        application/json:
          example:
            success: false
            statusCode: 401
            message: Permission denied
            name: UnauthorizedError
            data: {}
    Error402PaymentRequired:
      description: Payment Required — your account balance is too low to run this check.
      content:
        application/json:
          example:
            success: false
            statusCode: 402
            message: Insufficient fund
            name: PaymentRequiredError
            data: {}
    Error429TooManyRequests:
      description: Too Many Requests — you have exceeded the rate limit; wait and retry.
      content:
        application/json:
          example:
            success: false
            statusCode: 429
            message: Too many requests
            name: RateLimitError
            data: {}
    Error500ServerError:
      description: >-
        Internal Server Error — a rare, unexpected failure on Youverify's side.
        Contact support@youverify.co if it persists.
      content:
        application/json:
          example:
            success: false
            statusCode: 500
            message: Internal Server Error
            name: Error
            data: {}
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: token
      description: Your Youverify API secret key. Never expose client-side.

````