Skip to main content
Lehar gives your product programmable AI agents for web voice, outbound phone calls, and WhatsApp — plus bulk campaigns and post-call analytics. Create and publish an agent, start sessions or campaigns from your backend, and receive results through webhooks.
Use your X-API-KEY only from trusted server-side code. Never ship a workspace API key in browser or mobile source.

Choose your path

Backend / API

Create agents, start sessions, run campaigns, receive webhooks, and query history.

Browser voice

Start a web voice session and connect a browser participant with a session token.

Dashboard

Create assistants, knowledge bases, and campaigns without writing code first.

5-minute integration path

1

Get an API key

In the dashboard, open Settings → API keys and create a key. Send it on every request as X-API-KEY.
2

Check workspace access

Call GET /workspace to verify the key, workspace, and scopes.
3

Pick an agent

Call GET /agent/all and choose a published agent for your channel.
4

Start a session

Call POST /sessions with the agent, participant, and any custom_variables your prompt uses.
5

Connect & process results

Connect the returned participant_token to the media room, then use webhooks or GET /sessions for results.

Copy-paste starter

API basics

Design for production

  • Keep API keys in server secrets; rotate on team changes.
  • Store Lehar IDs: agent_id, session_id, campaign_id.
  • Outbound phone calls use POST /calls with an API key. Web sessions (POST /sessions) need a bearer login session instead — see Authentication.
  • Register an outbound webhook rather than polling; make the handler idempotent on event_id and return 2xx quickly.

Next steps

Quickstart

Make your first session.

Authentication

API keys, bearer sessions, scopes.

Platform

How the pieces fit together.

API Reference

Resources, errors, pagination.