Elaris Docs / Custom API Reference

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 areaToken sourceHeader
BookingsAGENTS_API_TOKENAuthorization: Bearer YOUR_AGENTS_API_TOKEN
Agent schedulesAGENTS_API_TOKENAuthorization: Bearer YOUR_AGENTS_API_TOKEN
Lead webhooksLEADS_WEBHOOK_TOKENAuthorization: Bearer YOUR_LEADS_WEBHOOK_TOKEN
Email automation repliesPer-email callback tokenX-Callback-Token: CALLBACK_TOKEN
Outbound call batch statusPer-batch callback tokenX-Callback-Token: CALLBACK_TOKEN

[!NOTE] Do not publish real bearer tokens in examples, docs, screenshots, or client-side code.

Endpoint Summary

EndpointMethodPurpose
/api/users/{user_id}/bookingsGETRetrieve calendar bookings for a user
/api/users/{user_id}/bookingsPOSTAdd a booking to a user’s connected calendar
/api/email-automation/logs/{email_log_id}/replyPOSTSend an email reply from an automation callback
/api/webhooks/leadsPOSTCreate a lead from an external webhook
/api/webhook/patch-lead-columnPATCHUpdate the visible lead table columns for a user
/api/agents/{agent_id}/schedule/detailsGETRead an agent schedule and current local routing context
/api/outbound-call-batches/{batch_id}/statusPOSTMark 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.

ParameterLocationRequiredDescription
user_idPathYesTarget Elaris user ID
dateQueryNoDate 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.

ParameterLocationRequiredDescription
user_idPathYesTarget Elaris user ID
nameBodyYesFull name of the booking customer
dateBodyYesBooking date in YYYY-MM-DD format
timeBodyYesTime range, for example 10:00 AM - 11:00 AM
phoneBodyNoCustomer phone number, preferably E.164 format
emailBodyNoCustomer email address
serviceBodyNoRequested service or appointment type
locationBodyNoMeeting location or medium
timezoneBodyNoIANA 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.

ParameterLocationRequiredDescription
email_log_idPathYesOriginal email log ID
reply_bodyBodyYesReply message body
callback_tokenBodyNoCallback token if a token header is not used
reply_callback_tokenBodyNoAlternate 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.

ParameterLocationRequiredDescription
user_idBodyNoOwner user ID
owner_emailBodyNoOwner email used to resolve the user
nameBodyNoLead prospect name
emailBodyNoLead email address
phone_numberBodyNoLead phone number
addressBodyNoLead address or location
sourceBodyNoSource system or campaign
notesBodyNoQualification 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.

ParameterLocationRequiredDescription
user_idBodyYesOwner user ID
columnBodyYesArray 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.

ParameterLocationRequiredDescription
agent_idPathYesTarget 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.

ParameterLocationRequiredDescription
batch_idPathYesOutbound call batch ID
statusBodyYescompleted or failed
messageBodyNoDiagnostic summary
n8n_execution_idBodyNoExternal workflow execution ID
resultBodyNoStructured result object
callback_tokenBodyNoCallback 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"