Introduction
Lerty is a chat interface that lets you deploy AI agents and automation workflows for yourself or an end user. It's also a notification and approval layer — surface alerts from your workflows and let users approve actions directly from their phone or desktop.
Base URL
https://lerty.ai/api/v1
What's an Agent?
You might call it a bot, assistant, workflow, or automation — in Lerty, we call it an Agent. Think of it as the conversation layer that sits between your users and whatever powers the responses, whether that's an AI model, an n8n workflow, a custom backend, or anything else.
Lerty supports two types of agents:
- Custom Agent - Uses built-in LLM providers (Anthropic, OpenAI, Google, Xai, OpenRouter) to handle conversations automatically
- Webhook Agent - Forwards messages to your backend via HTTP webhooks for custom processing (typically used to surface a front end for automations and agents on platforms like n8n, Flowmattic, Make.com, Zapier, Pipedream, etc.)
Authentication
All API requests require authentication using an API key in the Authorization header.
curl -X GET "https://lerty.ai/api/v1/agents" \
-H "Authorization: Bearer ak_your_api_key_here"
Getting an API Key
- Log in to Lerty at lerty.ai
- Go to the Settings of your organization → API Key
- Copy the api key.
Organizations
Organizations are how you group agents, conversations, and team members in Lerty. Every agent belongs to an organization, and you can invite team members to collaborate.
Sharing Access
Invite team members to your organization so they can:
- Chat with agents and receive notifications on their own devices
- Respond to human-in-the-loop approvals and interactive messages
- View conversation history and agent activity
- Manage agents and settings (admin role)
Member Roles
| Role | Permissions |
|---|---|
| Owner | Full access including billing, can delete organization |
| Admin | Manage agents, organization settings, and invite members |
| Member | Chat with agents, respond to approvals and interactive messages |
Custom Agent
Custom Agents use Lerty's built-in LLM integrations to automatically respond to messages. Agents can be configured with a system prompt to give your agent instructions and you can surface MCP server tools to your agents.
Supported Providers
| Provider | Models | Best For |
|---|---|---|
| Anthropic | Claude | Complex reasoning, long context, best for MCP Servers |
| OpenAI | ChatGPT | General purpose, fast responses |
| Gemini | Large context window | |
| Xai | Grok | Real-time information, unfiltered responses |
| OpenRouter | 100+ models | Model variety, cost optimization, access unique models |
Webhook Agent
Webhook Agents forward user messages to your backend or automation platform via HTTP webhooks. Use this to connect Lerty to n8n, Make.com, Zapier, FlowMattic, Pipedream, or any custom backend.
How It Works
- User sends a message in Lerty
- Lerty POSTs the message to your webhook URL
- Your automation or backend processes the message
- Your workflow calls Lerty's API to send a response
- The user sees the response in real-time
Example Use Cases
- n8n workflow that queries a database and responds with results
- Make.com scenario that creates tickets in your helpdesk
- Custom backend that routes to different AI models based on intent
Webhook Payload
{
"event": "message.created",
"conversationId": "conv-uuid-here",
"messageId": "msg-uuid-here",
"agentId": "agent-uuid-here",
"content": "Hello, I need help",
"userId": "user-uuid-here",
"userEmail": "user@example.com",
"timestamp": "2024-01-15T10:30:00Z"
}
Agents
Retrieve agent configuration, update webhook URLs, and manage agent settings.
/api/v1/agents
List all agents
Query Parameters
detailed
Optional
| Name | Type | Required | Description |
|---|---|---|---|
detailed |
boolean | No | Include detailed agent information |
curl -X GET "https://lerty.ai/api/v1/agents?detailed=true" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"agents": [
{
"id": "agent-uuid-here",
"name": "Support Bot",
"status": "active",
"protocol": "webhook",
"webhook_url": "https://your-server.com/webhook"
}
]
}
/api/v1/agents/:id
Get a specific agent
Query Parameters
detailed
Optional
| Name | Type | Required | Description |
|---|---|---|---|
detailed |
boolean | No | Include detailed agent information |
curl -X GET "https://lerty.ai/api/v1/agents/AGENT_ID?detailed=true" \
-H "Authorization: Bearer YOUR_API_KEY"
/api/v1/agents/:id
Update agent configuration
Body Parameters
name
Optional
webhook_url
Optional
enabled
Optional
test_mode
Optional
| Name | Type | Required | Description |
|---|---|---|---|
name |
string | No | Agent name |
webhook_url |
string | No | Webhook URL for messages |
enabled |
boolean | No | Enable or disable the agent |
test_mode |
boolean | No | Use test webhook URL |
curl -X PATCH "https://lerty.ai/api/v1/agents/AGENT_ID" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"webhook_url": "https://your-new-webhook.com/handle", "enabled": true}'
{
"success": true,
"agent": {
"id": "agent-uuid-here",
"name": "Support Bot",
"webhook_url": "https://your-new-webhook.com/handle",
"enabled": true
}
}
/api/v1/agents/:id/connection-info
Get agent connection information
Get webhook URLs, API endpoints, and conversation list for an agent
curl -X GET "https://lerty.ai/api/v1/agents/AGENT_ID/connection-info" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"connection_info": {
"agent_id": "agent-uuid-here",
"agent_name": "Support Bot",
"webhook_url": "https://your-server.com/webhook",
"protocol": "webhook",
"conversations": [...],
"api_endpoints": {
"send_message": "https://lerty.ai/api/v1/agents/{id}/messages",
"create_conversation": "https://lerty.ai/api/v1/agents/{id}/conversations/create"
}
}
}
Conversations
A conversation is a thread between your agent and a user. Create conversations programmatically to start new threads from your backend.
/api/v1/agents/:agent_id/conversations/create
Create a new conversation
Body Parameters
title
Optional
| Name | Type | Required | Description |
|---|---|---|---|
title |
string | No | Conversation title |
curl -X POST "https://lerty.ai/api/v1/agents/AGENT_ID/conversations/create" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "Support Request"}'
{
"success": true,
"conversation": {
"id": "conv-uuid-here",
"agent_id": "agent-uuid-here",
"title": "Support Request",
"status": "active",
"created_at": "2024-01-15T10:30:00Z"
}
}
/api/v1/agents/:agent_id/conversations
List conversations for an agent
curl -X GET "https://lerty.ai/api/v1/agents/AGENT_ID/conversations" \
-H "Authorization: Bearer YOUR_API_KEY"
Messages
Send messages into conversations. For Webhook Agents, use the
originate
endpoint to send responses back to users.
/api/v1/conversations/:conversation_id/messages
Send a user message
Body Parameters
content
Required
| Name | Type | Required | Description |
|---|---|---|---|
content |
string | Yes | Message content |
curl -X POST "https://lerty.ai/api/v1/conversations/CONV_ID/messages" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content": "Hello, I need help"}'
/api/v1/conversations/:conversation_id/originate
Send an agent message (Webhook Agents)
Use this endpoint to send agent responses back to users when using Webhook Agents.
Body Parameters
content
Required
role
Required
external_message_id
Optional
| Name | Type | Required | Description |
|---|---|---|---|
content |
string | Yes | Message text (supports markdown) |
role |
string | Yes | Must be "assistant" |
external_message_id |
string | No | Unique ID for deduplication |
curl -X POST "https://lerty.ai/api/v1/conversations/CONV_ID/originate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content": "Hi! How can I help you today?", "role": "assistant", "external_message_id": "msg-12345"}'
{
"success": true,
"message": {
"id": "msg-uuid-here",
"content": "Hi! How can I help you today?",
"role": "assistant"
}
}
{
"error": "duplicate_message",
"message": "Message with this external_message_id already exists"
}
Interactive Messages
Interactive messages enable human-in-the-loop workflows — collect approvals, gather structured input, or present choices before your automation proceeds. Perfect for expense approvals, confirmation dialogs, data collection forms, and any workflow that needs human oversight.
Example Use Cases
- Manager approves expense before n8n workflow processes payment
- User confirms shipping address before order is placed
- Team lead selects priority level for incoming support ticket
- Employee submits PTO request form, HR approves in Lerty
How It Works
- Your workflow sends an interactive message to a conversation via the API
- The user sees the interactive UI (buttons, form, or approval prompt) in Lerty
- When the user responds, Lerty POSTs the response to your callback URL
- Your workflow receives the callback and continues processing
Action Types
Each interactive message requires exactly one action element:
approved
(true/false), message
selection
(button value)
data
object with field values
| Type | Description | Callback Data |
|---|---|---|
| Boolean | Approve/Reject buttons with optional message field |
approved
(true/false), message
|
| Buttons | Multiple choice — user picks one option |
selection
(the button's value)
|
| Fields | Form with text, number, email, date inputs |
data
object with field name→value pairs
|
/api/v1/conversations/:conversation_id/interactive
Send an interactive message
Body Parameters
callback_url
Required
callback_id
Required
elements
Required
| Name | Type | Required | Description |
|---|---|---|---|
callback_url |
string | Yes | URL to receive user's response |
callback_id |
string | Yes | Your unique ID for this interaction |
elements |
array | Yes | UI elements to display |
Element Types
header
Large title text
text
Body text for context
divider
Horizontal line separator
boolean
Approve/Reject buttons with optional message
buttons
Multiple choice options
fields
Full form with multiple inputs
| Type | Description |
|---|---|
header |
Large title text |
text |
Body text for context |
divider
|
Horizontal line separator |
boolean
|
Approve/Reject buttons with optional message |
buttons
|
Multiple choice options |
fields |
Full form with multiple inputs |
curl -X POST "https://lerty.ai/api/v1/conversations/CONV_ID/interactive" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"callback_url": "https://your-server.com/callback", "callback_id": "approval-001", "elements": [{"type": "header", "text": "Invoice Approval"}, {"type": "text", "text": "Invoice #1234 for $5,000"}, {"type": "boolean"}]}'
curl -X POST "https://lerty.ai/api/v1/conversations/CONV_ID/interactive" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"callback_url": "https://your-server.com/callback", "callback_id": "expense-001", "elements": [{"type": "header", "text": "Submit Expense"}, {"type": "fields", "submit_label": "Submit", "inputs": [{"name": "amount", "label": "Amount ($)", "input_type": "number", "required": true}]}]}'
Callback Response
When the user submits, Lerty POSTs to your callback_url:
{
"callback_id": "approval-001",
"conversation_id": "conv-uuid",
"message_id": "msg-uuid",
"response_type": "boolean",
"approved": true,
"message": "Looks good",
"responded_at": "2024-01-15T10:30:00Z",
"responded_by": {
"user_id": "user-uuid",
"email": "user@example.com"
}
}
{
"callback_id": "expense-001",
"conversation_id": "conv-uuid",
"response_type": "fields",
"data": {
"amount": 500,
"category": "travel",
"date": "2024-01-15"
},
"responded_at": "2024-01-15T10:30:00Z"
}
Typing Indicators
Show users that your agent is processing their message. Useful for longer-running workflows to keep users informed.
/api/agents/:agent_id/callback
Show or hide typing indicator
Path Parameters
agent_id
Required
| Name | Type | Required | Description |
|---|---|---|---|
agent_id |
string | Yes | The agent ID |
Body Parameters
callback_type
Required
conversation_id
Required
data.typing
Required
data.label
Optional
data.show_dots
Optional
data.timeout
Optional
| Name | Type | Required | Description |
|---|---|---|---|
callback_type |
string | Yes | Must be "typing" |
conversation_id |
string | Yes | The conversation ID to show typing indicator in |
data.typing |
boolean | Yes | true to show, false to hide |
data.label |
string | No | Optional text to display with animated shimmer effect (e.g., "Thinking...", "Searching...") |
data.show_dots |
boolean | No | Whether to show animated dots (default: true). Set to false to show only the label. |
data.timeout |
integer | No | Timeout in milliseconds before auto-clear (default: 30000). Use for long-running operations. |
curl -X POST "https://lerty.ai/api/agents/AGENT_ID/callback" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"callback_type": "typing",
"conversation_id": "CONV_ID",
"data": {
"typing": true,
"label": "Thinking...",
"show_dots": true,
"timeout": 60000
}
}'
Organization API
Manage your organization and team members programmatically. The organization is determined automatically from your API key.
organizations:read
for viewing, members:read
and members:write
for member management.
/api/v1/organization
Get organization details
curl -X GET "https://lerty.ai/api/v1/organization" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"organization": {
"id": "org-uuid-here",
"name": "My Company"
}
}
/api/v1/organization/members
List organization members
curl -X GET "https://lerty.ai/api/v1/organization/members" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"members": [
{"id": "user-uuid", "email": "owner@example.com", "role": "owner"},
{"id": "user-uuid-2", "email": "member@example.com", "role": "member"}
]
}
/api/v1/organization/members
Invite a member by email
Body Parameters
email
Required
| Name | Type | Required | Description |
|---|---|---|---|
email |
string | Yes | Email address to invite |
curl -X POST "https://lerty.ai/api/v1/organization/members" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "newuser@example.com"}'
{
"member": {
"id": "user-uuid-new",
"email": "newuser@example.com",
"role": "member"
}
}
/api/v1/organization/members/:user_id
Remove a member
Path Parameters
user_id
Required
| Name | Type | Required | Description |
|---|---|---|---|
user_id |
string | Yes | User ID to remove |
curl -X DELETE "https://lerty.ai/api/v1/organization/members/USER_ID" \
-H "Authorization: Bearer YOUR_API_KEY"
Push Notifications
Send push notifications to users on the Lerty mobile app. Notify users of important events, approvals needed, or updates from your workflows.
/api/push/send
Send push notification to a user
Body Parameters
email
Required
title
Required
body
Required
priority
Optional
sound
Optional
data
Optional
| Name | Type | Required | Description |
|---|---|---|---|
email |
string | Yes | User's email address |
title |
string | Yes | Notification title |
body |
string | Yes | Notification body |
priority |
string | No | critical, high, medium, normal, low |
sound |
string | No | Notification sound |
data |
object | No | Custom data payload |
curl -X POST "https://lerty.ai/api/push/send" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com", "title": "New Message", "body": "You have a new message", "priority": "high"}'
{
"success": true,
"email": "user@example.com",
"devices_succeeded": 2,
"devices_failed": 0,
"total_devices": 2
}
/api/push/send/bulk
Send push to multiple users
Body Parameters
recipients
Required
title
Required
body
Required
priority
Optional
| Name | Type | Required | Description |
|---|---|---|---|
recipients |
array | Yes | Array of email addresses |
title |
string | Yes | Notification title |
body |
string | Yes | Notification body |
priority |
string | No | Notification priority |
curl -X POST "https://lerty.ai/api/push/send/bulk" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"recipients": ["user1@example.com", "user2@example.com"], "title": "Announcement", "body": "New features available"}'
/api/push/devices
List user's registered devices
Query Parameters
email
Required
| Name | Type | Required | Description |
|---|---|---|---|
email |
string | Yes | User's email address |
curl -X GET "https://lerty.ai/api/push/devices?email=user@example.com" \
-H "Authorization: Bearer YOUR_API_KEY"
Live Activities
iOS Live Activities display real-time updates on the Lock Screen and Dynamic Island. Perfect for order tracking, workflow progress, and time-sensitive notifications.
POST /api/push/send
with workflow_state
in the data payload. See the Quick Start guide for complete examples.
/api/push/live-activity/update
Update a Live Activity
Body Parameters
notification_id
Required
content_state
Required
event
Optional
priority
Optional
dismissal_date
Optional
| Name | Type | Required | Description |
|---|---|---|---|
notification_id |
string | Yes | ID of the Live Activity notification |
content_state |
object | Yes | Live Activity content (itemTitle, status, progressPercent, etc.) |
event |
string | No | "update" (default) or "end" to dismiss |
priority |
string | No | critical, high, normal, low (low = silent update) |
dismissal_date |
integer | No | Unix timestamp for dismissal (only for end event) |
Content State Fields
itemTitle
Required
itemSubtitle
Optional
status
Required
progressPercent
Required
currentStep
Optional
totalSteps
Optional
lastUpdate
Optional
| Name | Type | Required | Description |
|---|---|---|---|
itemTitle |
string | Yes | Main title displayed |
itemSubtitle |
string | No | Subtitle text |
status |
string | Yes | Current status text |
progressPercent |
integer | Yes | Progress percentage (0-100) |
currentStep |
integer | No | Current step number |
totalSteps |
integer | No | Total steps |
lastUpdate |
integer | No | Unix timestamp (auto-dismiss after 2 min without updates) |
curl -X POST "https://lerty.ai/api/push/live-activity/update" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"notification_id": "notif-123", "content_state": {"itemTitle": "Order Status", "status": "In Transit", "progressPercent": 75}}'
{
"success": true,
"tokens_updated": 1,
"notification_id": "notif-123"
}
curl -X POST "https://lerty.ai/api/push/live-activity/update" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"notification_id": "notif-123", "event": "end", "content_state": {"itemTitle": "Complete", "status": "Delivered", "progressPercent": 100}}'
priority: "low"
for frequent updates to avoid sound/banner spam. Live Activities auto-dismiss after 2 minutes without updates.
Errors
Lerty uses standard HTTP status codes and returns JSON error responses.
| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - Not authorized for this resource |
| 404 | Not Found |
| 409 | Conflict - Duplicate resource |
| 422 | Unprocessable Entity - Validation error |
| 429 | Too Many Requests - Rate limited |
| 500 | Internal Server Error |
Error Response Format
{
"error": "unauthorized",
"message": "Invalid or missing API key",
"success": false
}
Getting Clients
If you've made it this far, you already know enough to sell AI agents. The rest is understanding your client's problems and matching them to solutions. This section shows you how to find the right clients, craft your offer, and close the deal.
Ideal Clients
Not all clients are equal. Use this framework to evaluate prospects before you invest time.
|
Sweet Spot
Ongoing, highly personalized, yet simple solutions.
|
|
|---|---|
| What to Sell | How to Pitch It |
| Daily Expense Approvals | 30 min/day → 30 seconds. Manager taps approve or reject. |
| Content Draft Review | LLM drafts 3 versions. Marketing picks one. Publishes daily. |
| Quote Response | Lead fills form. Scored by custom algorithm. LLM drafts reply. Client sends or ignores. |
|
High Maintenance
Ongoing, highly personalized, complex solutions.
|
|
|---|---|
| What to Sell | Why It's Worth More |
| Full Sales Pipeline | Leads scored, enriched, sequenced. Hot leads surfaced. Client approves who to call. |
| Client Onboarding System | Contracts, accounts, welcome sequence triggered. Client approves each kickoff. |
| Hiring Pipeline | Applications screened, ranked, summarized. Top candidates surfaced. Client picks who to interview. |
|
Commodity
Not customized for the client. Readily available elsewhere for much cheaper.
|
|
|---|---|
| Don't Sell This | Why You'll Lose |
| Meeting Transcription | Otter is $10/mo. "Why pay you $500?" |
| Generic Content Generation | ChatGPT is $20/mo. No review = no need for you. |
| Calendar Booking | Calendly is free. They already have it. |
|
Time Sink
Poorly defined requests or processes that don't exist yet and aren't easily understood.
|
|
|---|---|
| Red Flag Request | What They'll Say vs. Reality |
| "Build Me a Jarvis" | "Just make it smart." No specs. Won't pay ongoing. |
| "Automate My Whole Business" | "One system for everything." Scope creeps forever. |
| Web Scraping System | "Just pull the data." Sites change weekly. You maintain forever. |
Cross Selling
Your existing clients are the easiest to sell to. They trust you and you already know their business.
Offer a free workflow audit or strategy session. Frame it as helping them find time or cost savings in their business. Most will say yes.
Questions to ask:
"What do you spend the first hour of your day doing?" "What tasks feel like busywork?" "Where do things get stuck waiting on you?" "What falls through the cracks?"
What to listen for:
Recurring tasks. Approval bottlenecks. Manual data entry. Anything they do daily or weekly that follows a pattern. That's your opportunity.
Outreach
If you're starting fresh, target industries with obvious pain points.
Step 1.) Find industries with built-in demand:
- Real estate: Leads, follow-ups, listing descriptions
- Home services: Quotes, scheduling, follow-ups
- Gyms and fitness: Membership follow-ups, class reminders
- Salons and spas: Booking confirmations, review requests
- Contractors: Project updates, quotes, invoicing
Get creative. Christmas light installers, float tank spas, pondscaping companies. The weirder the niche, the less competition. Long tail is untapped.
Step 2.) Research and identify tells:
Before you reach out, find proof they need help. Fill out their quote form and see if they follow up. Check their Google reviews for complaints about slow responses. See if they're hiring for admin or receptionist roles. These become your anchor points when you pitch.
Step 3.) Cold Looms:
Record a 2-minute Loom showing exactly what you found and a Lerty workflow that fixes it. "I filled out your quote form three days ago and never heard back. Here's what it would look like if you could respond in 30 seconds." Walk them through the agent, show the approval flow. Send the video in an email and offer a free workflow audit call.
Bonus - Upwork: Skip the research. People posting automation or AI jobs already have budget and intent to buy. Make sure their problem is a good fit, if it is, respond to their job listing.
Selling Agents
Use a two-call close. First call is a free strategy session where you assess their workflows and gather info. No pitching, just listening. Second call is where you present the proposal.
This works because you need real numbers to build a compelling proposal. Hourly rates, time spent, pain points. You can't guess that. The first call gives you everything you need to make the second call a no-brainer.
Before the second call, fill out the Proposal Generator below with what you learned. Their hourly costs, hours spent, the workflows you'll build. Have it ready so you can walk them through the numbers live and send the proposal before you get off the call.