Custom API Reference
Use this page for custom REST integrations with Elaris. Replace BASE_URL with the
production app URL for the deployment, and keep every token in server-side
configuration or an automation secret store.
BASE_URL=https://elarissolutionsllc.com
Authentication
| API area | Token source | Header |
|---|---|---|
| Bookings | AGENTS_API_TOKEN | Authorization: Bearer YOUR_AGENTS_API_TOKEN |
| Agent schedules | AGENTS_API_TOKEN | Authorization: Bearer YOUR_AGENTS_API_TOKEN |
| Lead webhooks | LEADS_WEBHOOK_TOKEN | Authorization: Bearer YOUR_LEADS_WEBHOOK_TOKEN |
| Email automation replies | Per-email callback token | X-Callback-Token: CALLBACK_TOKEN |
| Outbound call batch status | Per-batch callback token | X-Callback-Token: CALLBACK_TOKEN |
[!NOTE] Do not publish real bearer tokens in examples, docs, screenshots, or client-side code.
Endpoint Summary
| Endpoint | Method | Purpose |
|---|---|---|
/api/users/{user_id}/bookings | GET | Retrieve calendar bookings for a user |
/api/users/{user_id}/bookings | POST | Add a booking to a user’s connected calendar |
/api/email-automation/logs/{email_log_id}/reply | POST | Send an email reply from an automation callback |
/api/webhooks/leads | POST | Create a lead from an external webhook |
/api/webhook/patch-lead-column | PATCH | Update the visible lead table columns for a user |
/api/agents/{agent_id}/schedule/details | GET | Read an agent schedule and current local routing context |
/api/outbound-call-batches/{batch_id}/status | POST | Mark an outbound call batch as completed or failed |
Bookings
Get Bookings
GET /api/users/{user_id}/bookings
Retrieves bookings from the target user’s connected Google Calendar. If date is
provided, the response is limited to that date. Without date, the endpoint
returns bookings for the next five days.
| Parameter | Location | Required | Description |
|---|---|---|---|
user_id | Path | Yes | Target Elaris user ID |
date | Query | No | Date to fetch in YYYY-MM-DD format |
curl -X GET "$BASE_URL/api/users/3/bookings?date=2026-06-25" \
-H "Authorization: Bearer YOUR_AGENTS_API_TOKEN" \
-H "Accept: application/json"
Add Booking
POST /api/users/{user_id}/bookings
Adds a new booking session to the target user’s connected Google Calendar.
| Parameter | Location | Required | Description |
|---|---|---|---|
user_id | Path | Yes | Target Elaris user ID |
name | Body | Yes | Full name of the booking customer |
date | Body | Yes | Booking date in YYYY-MM-DD format |
time | Body | Yes | Time range, for example 10:00 AM - 11:00 AM |
phone | Body | No | Customer phone number, preferably E.164 format |
email | Body | No | Customer email address |
service | Body | No | Requested service or appointment type |
location | Body | No | Meeting location or medium |
timezone | Body | No | IANA timezone, for example Asia/Dhaka |
curl -X POST "$BASE_URL/api/users/3/bookings" \
-H "Authorization: Bearer YOUR_AGENTS_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "John Doe",
"phone": "+8801700000000",
"email": "johndoe@example.com",
"service": "Consultation",
"location": "Online",
"date": "2026-06-25",
"time": "10:00 AM - 11:00 AM",
"timezone": "Asia/Dhaka"
}'
Email Automation
Send Email Automation Reply
POST /api/email-automation/logs/{email_log_id}/reply
Sends a reply for an existing email automation log. The callback token is unique
to the email log and can be sent in X-Callback-Token, X-Reply-Token,
callback_token, or reply_callback_token.
| Parameter | Location | Required | Description |
|---|---|---|---|
email_log_id | Path | Yes | Original email log ID |
reply_body | Body | Yes | Reply message body |
callback_token | Body | No | Callback token if a token header is not used |
reply_callback_token | Body | No | Alternate callback token field |
curl -X POST "$BASE_URL/api/email-automation/logs/456/reply" \
-H "Accept: application/json" \
-H "X-Callback-Token: CALLBACK_TOKEN" \
--data-urlencode "reply_body=Thank you for your email."
Webhooks
Add Lead Webhook
POST /api/webhooks/leads
Creates a new lead from an external system such as n8n, a form provider, or a
marketing automation workflow. Provide user_id or owner_email when the lead
must be assigned to a specific non-admin user.
| Parameter | Location | Required | Description |
|---|---|---|---|
user_id | Body | No | Owner user ID |
owner_email | Body | No | Owner email used to resolve the user |
name | Body | No | Lead prospect name |
email | Body | No | Lead email address |
phone_number | Body | No | Lead phone number |
address | Body | No | Lead address or location |
source | Body | No | Source system or campaign |
notes | Body | No | Qualification notes or message text |
At least one lead detail field must be provided. The endpoint also accepts
common aliases such as full_name, phone, mobile, lead_source, and
message.
curl -X POST "$BASE_URL/api/webhooks/leads" \
-H "Authorization: Bearer YOUR_LEADS_WEBHOOK_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"owner_email": "owner@example.com",
"name": "John Doe",
"email": "john@example.com",
"phone_number": "+15551234567",
"address": "123 Main Street, Dallas, TX",
"source": "n8n-test",
"notes": "Testing lead webhook from n8n"
}'
Change Lead Column Config
PATCH /api/webhook/patch-lead-column
Updates the visible lead table columns for a user.
| Parameter | Location | Required | Description |
|---|---|---|---|
user_id | Body | Yes | Owner user ID |
column | Body | Yes | Array or comma-separated list of lead column names |
Allowed columns are name, email, phone_number, address, disposition,
source, notes, and created_at. Common aliases such as phone,
full_name, status, and received_at are normalized.
curl -X PATCH "$BASE_URL/api/webhook/patch-lead-column" \
-H "Authorization: Bearer YOUR_LEADS_WEBHOOK_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"user_id": 14,
"column": ["email", "name", "phone"]
}'
Agents
Agent Schedule Checker
GET /api/agents/{agent_id}/schedule/details
Returns an agent’s schedule and the current time in the schedule timezone. This can be used by call routing workflows to decide whether to route a call to a human number or an AI agent.
| Parameter | Location | Required | Description |
|---|---|---|---|
agent_id | Path | Yes | Target agent ID |
curl -X GET "$BASE_URL/api/agents/12/schedule/details" \
-H "Authorization: Bearer YOUR_AGENTS_API_TOKEN" \
-H "Accept: application/json"
Outbound Calls
Call Batch Status Update
POST /api/outbound-call-batches/{batch_id}/status
Updates an outbound call batch after an external workflow finishes processing the batch.
| Parameter | Location | Required | Description |
|---|---|---|---|
batch_id | Path | Yes | Outbound call batch ID |
status | Body | Yes | completed or failed |
message | Body | No | Diagnostic summary |
n8n_execution_id | Body | No | External workflow execution ID |
result | Body | No | Structured result object |
callback_token | Body | No | Callback token if X-Callback-Token is not used |
curl -X POST "$BASE_URL/api/outbound-call-batches/25/status" \
-H "X-Callback-Token: CALLBACK_TOKEN" \
-H "Accept: application/json" \
--data-urlencode "status=completed" \
--data-urlencode "message=Done"