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.

Example Request
curl -X GET "https://lerty.ai/api/v1/agents" \
  -H "Authorization: Bearer ak_your_api_key_here"

Getting an API Key

  1. Log in to Lerty at lerty.ai
  2. Go to the Settings of your organization → API Key
  3. 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.

Personal organizations are private to the account owner and cannot be shared. To collaborate with others, create a new organization from the organization switcher.

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

Owner
Full access, billing, can delete organization
Admin
Manage agents, settings, and members
Member
Chat with agents, respond to approvals
To invite members, go to Settings → Users in your organization dashboard and send an invite by email.

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

Anthropic
Claude
Complex reasoning, long context, best models for MCP Servers
OpenAI
ChatGPT
General purpose, fast responses
Google
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

  1. User sends a message in Lerty
  2. Lerty POSTs the message to your webhook URL
  3. Your automation or backend processes the message
  4. Your workflow calls Lerty's API to send a response
  5. 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

Incoming Webhook
{
  "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.

GET /api/v1/agents

List all agents

Query Parameters

detailed Optional
boolean
Include detailed agent information
Request

          curl -X GET "https://lerty.ai/api/v1/agents?detailed=true" \
  -H "Authorization: Bearer YOUR_API_KEY"

        
200 Success

          {
  "agents": [
    {
      "id": "agent-uuid-here",
      "name": "Support Bot",
      "status": "active",
      "protocol": "webhook",
      "webhook_url": "https://your-server.com/webhook"
    }
  ]
}

        
GET /api/v1/agents/:id

Get a specific agent

Query Parameters

detailed Optional
boolean
Include detailed agent information
Request

          curl -X GET "https://lerty.ai/api/v1/agents/AGENT_ID?detailed=true" \
  -H "Authorization: Bearer YOUR_API_KEY"

        
PATCH /api/v1/agents/:id

Update agent configuration

Body Parameters

name Optional
string
Agent name
webhook_url Optional
string
Webhook URL for messages
enabled Optional
boolean
Enable or disable the agent
test_mode Optional
boolean
Use test webhook URL
Request

          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}'

        
200 Success

          {
  "success": true,
  "agent": {
    "id": "agent-uuid-here",
    "name": "Support Bot",
    "webhook_url": "https://your-new-webhook.com/handle",
    "enabled": true
  }
}

        
GET /api/v1/agents/:id/connection-info

Get agent connection information

Get webhook URLs, API endpoints, and conversation list for an agent

Request

          curl -X GET "https://lerty.ai/api/v1/agents/AGENT_ID/connection-info" \
  -H "Authorization: Bearer YOUR_API_KEY"

        
200 Success

          {
  "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.

POST /api/v1/agents/:agent_id/conversations/create

Create a new conversation

Body Parameters

title Optional
string
Conversation title
Request

          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"}'

        
201 Created

          {
  "success": true,
  "conversation": {
    "id": "conv-uuid-here",
    "agent_id": "agent-uuid-here",
    "title": "Support Request",
    "status": "active",
    "created_at": "2024-01-15T10:30:00Z"
  }
}

        
GET /api/v1/agents/:agent_id/conversations

List conversations for an agent

Request

          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.

POST /api/v1/conversations/:conversation_id/messages

Send a user message

Body Parameters

content Required
string
Message content
Request

          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"}'

        
POST /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
string
Message text (supports markdown)
role Required
string
Must be "assistant"
external_message_id Optional
string
Unique ID for deduplication
Request

          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"}'

        
200 Success

          {
  "success": true,
  "message": {
    "id": "msg-uuid-here",
    "content": "Hi! How can I help you today?",
    "role": "assistant"
  }
}

        
409 Duplicate Message

          {
  "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

  1. Your workflow sends an interactive message to a conversation via the API
  2. The user sees the interactive UI (buttons, form, or approval prompt) in Lerty
  3. When the user responds, Lerty POSTs the response to your callback URL
  4. Your workflow receives the callback and continues processing

Action Types

Each interactive message requires exactly one action element:

Boolean
Approve/Reject with optional message
Callback receives: approved (true/false), message
Buttons
Multiple choice selection
Callback receives: selection (button value)
Fields
Form with multiple inputs
Callback receives: data object with field values
The callback_url is where Lerty sends the user's response. The callback_id is your reference ID to correlate the response with your original request.
POST /api/v1/conversations/:conversation_id/interactive

Send an interactive message

Body Parameters

callback_url Required
string
URL to receive user's response
callback_id Required
string
Your unique ID for this interaction
elements Required
array
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
Boolean Example

          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"}]}'

        
Fields Form Example

          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:

200 Boolean Response

          {
  "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"
  }
}

        
200 Fields Response

          {
  "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.

POST /api/agents/:agent_id/callback

Show or hide typing indicator

Path Parameters

agent_id Required
string
The agent ID

Body Parameters

callback_type Required
string
Must be "typing"
conversation_id Required
string
The conversation ID to show typing indicator in
data.typing Required
boolean
true to show, false to hide
data.label Optional
string
Optional text to display with animated shimmer effect (e.g., "Thinking...", "Searching...")
data.show_dots Optional
boolean
Whether to show animated dots (default: true). Set to false to show only the label.
data.timeout Optional
integer
Timeout in milliseconds before auto-clear (default: 30000). Use for long-running operations.
Request
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
    }
  }'
Typing indicators auto-clear after the specified timeout (default: 30 seconds). Send typing: false when done processing. The optional label field displays animated text next to the typing dots.

Organization API

Manage your organization and team members programmatically. The organization is determined automatically from your API key.

Required permissions: organizations:read for viewing, members:read and members:write for member management.
GET /api/v1/organization

Get organization details

Request
curl -X GET "https://lerty.ai/api/v1/organization" \
  -H "Authorization: Bearer YOUR_API_KEY"
200 Success

          {
  "organization": {
    "id": "org-uuid-here",
    "name": "My Company"
  }
}

        
GET /api/v1/organization/members

List organization members

Request

          curl -X GET "https://lerty.ai/api/v1/organization/members" \
  -H "Authorization: Bearer YOUR_API_KEY"

        
200 Success

          {
  "members": [
    {"id": "user-uuid", "email": "owner@example.com", "role": "owner"},
    {"id": "user-uuid-2", "email": "member@example.com", "role": "member"}
  ]
}

        
POST /api/v1/organization/members

Invite a member by email

Body Parameters

email Required
string
Email address to invite
Request

          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"}'

        
201 Member invited

          {
  "member": {
    "id": "user-uuid-new",
    "email": "newuser@example.com",
    "role": "member"
  }
}

        
New members are always assigned the member role. Use the dashboard to promote to admin.
DELETE /api/v1/organization/members/:user_id

Remove a member

Path Parameters

user_id Required
string
User ID to remove
Request

          curl -X DELETE "https://lerty.ai/api/v1/organization/members/USER_ID" \
  -H "Authorization: Bearer YOUR_API_KEY"

        
Cannot remove owners or admins via API. Only members with the member role can be removed.

Push Notifications

Send push notifications to users on the Lerty mobile app. Notify users of important events, approvals needed, or updates from your workflows.

POST /api/push/send

Send push notification to a user

Body Parameters

email Required
string
User's email address
title Required
string
Notification title
body Required
string
Notification body
priority Optional
string
critical, high, medium, normal, low
sound Optional
string
Notification sound
data Optional
object
Custom data payload
Request

          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"}'

        
200 Success
{
  "success": true,
  "email": "user@example.com",
  "devices_succeeded": 2,
  "devices_failed": 0,
  "total_devices": 2
}
POST /api/push/send/bulk

Send push to multiple users

Body Parameters

recipients Required
array
Array of email addresses
title Required
string
Notification title
body Required
string
Notification body
priority Optional
string
Notification priority
Request

          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"}'

        
GET /api/push/devices

List user's registered devices

Query Parameters

email Required
string
User's email address
Request

          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.

Live Activities are started via POST /api/push/send with workflow_state in the data payload. See the Quick Start guide for complete examples.
POST /api/push/live-activity/update

Update a Live Activity

Body Parameters

notification_id Required
string
ID of the Live Activity notification
content_state Required
object
Live Activity content (itemTitle, status, progressPercent, etc.)
event Optional
string
"update" (default) or "end" to dismiss
priority Optional
string
critical, high, normal, low (low = silent update)
dismissal_date Optional
integer
Unix timestamp for dismissal (only for end event)

Content State Fields

itemTitle Required
string
Main title displayed
itemSubtitle Optional
string
Subtitle text
status Required
string
Current status text
progressPercent Required
integer
Progress percentage (0-100)
currentStep Optional
integer
Current step number
totalSteps Optional
integer
Total steps
lastUpdate Optional
integer
Unix timestamp (auto-dismiss after 2 min without updates)
Update Request

          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}}'

        
200 Success

          {
  "success": true,
  "tokens_updated": 1,
  "notification_id": "notif-123"
}

        
End Request

          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}}'

        
Use 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.

200 Success
201 Created
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
409 Conflict
422 Validation
429 Rate Limited
500 Server Error

Error Response Format

Error Response
{
  "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.

+
Business Impact
-
Sweet Spot
High Maintenance
Commodity
Time Sink
- Support Required +
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.

Calculator