Skip to main content

InitSession initializes a widget session.

POST 

/api/v1/auth/widget/session

Called when webchat widget loads on a page.

Parameters

  • widget_key: Required, public widget embed key
  • visitor_id: Required, client-generated visitor UUID
  • engagement_id: Optional, resume existing conversation
  • visitor_name: Optional, visitor's name
  • visitor_email: Optional, visitor's email
  • metadata: Optional, additional context

Response

  • session_token: JWT for widget API calls
  • expires_at: Token expiration time
  • organization_id: Organization ID for reference
  • engagement_id: Conversation ID (0 if new)
  • scopes: Allowed operations
  • upload_constraints: File upload limits

Errors

  • INVALID_ARGUMENT: Invalid widget key format
  • NOT_FOUND: Widget key not found
  • FAILED_PRECONDITION: Widget disabled

Request

Responses

A successful response.