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

# Receive Inbound Session Bootstrap

> Inbound-call session bootstrap (BYON).

The voice worker, on receiving an inbound job (the dispatch rule fires at
INVITE time), calls this while the caller still hears ringback. The backend
resolves the number's CURRENT inbound agent (dispatch-rule metadata is a
static hint only), enforces concurrency caps, creates the session row, and
mints a fresh per-session agent token — returning the same metadata shape
outbound dispatch embeds in job metadata.

Auth: the deployment HMAC secret (same class as the session-update webhook).
Idempotent by room_name: an agent retry reuses the existing session + lease.



## OpenAPI

````yaml /api-reference/openapi.json post /webhooks/livekit/inbound-session-bootstrap
openapi: 3.1.0
info:
  title: Lehar API
  version: v0
  description: >-
    Customer-facing REST API for the Lehar voice-AI platform. Platform-admin
    endpoints are intentionally excluded from this reference. Regenerate with
    `npm run sync:openapi`.
servers:
  - url: https://api.lehar.ai/ca/api/v0
security:
  - ApiKeyAuth: []
  - BearerAuth: []
paths:
  /webhooks/livekit/inbound-session-bootstrap:
    post:
      tags:
        - Webhooks
      summary: Receive Inbound Session Bootstrap
      description: >-
        Inbound-call session bootstrap (BYON).


        The voice worker, on receiving an inbound job (the dispatch rule fires
        at

        INVITE time), calls this while the caller still hears ringback. The
        backend

        resolves the number's CURRENT inbound agent (dispatch-rule metadata is a

        static hint only), enforces concurrency caps, creates the session row,
        and

        mints a fresh per-session agent token — returning the same metadata
        shape

        outbound dispatch embeds in job metadata.


        Auth: the deployment HMAC secret (same class as the session-update
        webhook).

        Idempotent by room_name: an agent retry reuses the existing session +
        lease.
      operationId: >-
        receive_inbound_session_bootstrap_ca_api_v0_webhooks_livekit_inbound_session_bootstrap_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
    BearerAuth:
      type: http
      scheme: bearer

````