Helper
Conversation API/API Reference

Create Session

Creates a new authentication session for Helper

POST
/api/widget/session

Request Body

application/jsonRequired
emailstring

Email address of the user

Format: "email"
emailHashstring

HMAC hash of the email and timestamp

mailboxSlugRequiredstring

Slug of the mailbox to connect to

timestampinteger

Current timestamp in milliseconds

Format: "int64"
customerMetadataobject

Additional metadata about the customer

experimentalReadPageboolean

Whether to enable experimental page reading

currentURLRequiredstring

The current URL where the chat is being initiated

Response Body

Session created successfully

validRequiredboolean

Whether the authentication was successful

tokenRequiredstring

JWT token to use for subsequent API calls

showWidgetRequiredboolean

Whether the chat widget should be shown to this customer

notificationsarray<object>

Optional array of unread notifications for the customer

experimentalReadPageboolean | null

Whether experimental page reading is enabled

export interface Response {
  /**
   * Whether the authentication was successful
   */
  valid: boolean;
  /**
   * JWT token to use for subsequent API calls
   */
  token: string;
  /**
   * Whether the chat widget should be shown to this customer
   */
  showWidget: boolean;
  /**
   * Optional array of unread notifications for the customer
   */
  notifications?: {}[];
  /**
   * Whether experimental page reading is enabled
   */
  experimentalReadPage?: boolean | null;
}
 
curl -X POST "https://helper.ai/api/widget/session" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "customer@example.com",
    "emailHash": "a1b2c3d4e5f6...",
    "mailboxSlug": "your-mailbox",
    "timestamp": 1693324800000,
    "customerMetadata": {
      "value": 500,
      "name": "John Doe",
      "links": {
        "Profile": "https://example.com/users/john",
        "Orders": "https://example.com/users/john/orders"
      }
    },
    "currentURL": "https://example.com/products"
  }'
{
  "valid": true,
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "showWidget": true,
  "notifications": []
}