Integrations (apps)
Everything under /apps configures a connected service — an email sender, a messaging channel, an AI provider, storage, or a calendar. It is the largest area of the API at 145 endpoints, but it is almost entirely one repeated shape.
The standard shape
Most integrations expose exactly five endpoints:
| Method | Endpoint | Purpose |
|---|---|---|
GET | /apps/{provider} | List configurations. |
POST | /apps/{provider} | Create one. |
DELETE | /apps/{provider} | Bulk delete — { "ids": [...] }. |
GET | /apps/{provider}/:id | Read one. |
PUT | /apps/{provider}/:id | Update one. |
That covers smtp, ses, sendgrid, postmark, brevo, sparkpost, elasticemail, mailchimp, telegram, s3bucket, ocr, gemini, claude, offline-meeting, zoom, google-calendar.
Learn it once and only the credential fields in the POST body change per provider.
curl -X POST https://api.leadx.in/api/key/protected/apps/smtp \
-H "apikey: $KEY" -H "Content-Type: application/json" \
-d '{ "name": "Transactional", "host": "smtp.example.com", "port": 587,
"username": "postbox@example.com", "password": "...", "fromEmail": "hello@example.com" }'
Company-wide app settings — including which S3 bucket and which sender are the defaults — live at GET / PUT /apps.
Email senders
smtp · ses · sendgrid · postmark · brevo · sparkpost · elasticemail · mailchimp
All eight follow the standard shape. A configuration id from any of them is what you pass as smtp: { id } when creating a campaign.
Delivery events per provider are readable under /logs.
Gmail
Adds an OAuth dance to the standard shape:
| Method | Endpoint | Purpose |
|---|---|---|
GET | /apps/gmail/redirect | Get the consent URL to send the user to. |
POST | /apps/gmail | Complete the callback with the returned code. |
GET | /apps/gmail/refresh | Refresh the stored token. |
GET / PUT | /apps/gmail/:id | Read / update. |
GET / DELETE | /apps/gmail | List / delete. |
WhatsApp Business
| Method | Endpoint | Purpose |
|---|---|---|
GET / POST | /apps/whatsapp | List / create. |
GET / PUT | /apps/whatsapp/:id | Read / update. |
GET | /apps/whatsapp/verify/:id | Register the number and subscribe the webhook. |
POST | /apps/whatsapp/oauth/init | Start embedded signup. |
POST | /apps/whatsapp/oauth/callback | Finish embedded signup. |
The verify step is not optional — without it Meta will not deliver inbound messages, and the unified inbox stays empty.
There is no bulk DELETE for WhatsApp apps; the route is commented out in source.
Instagram
19 endpoints covering OAuth and account management:
| Method | Endpoint | Purpose |
|---|---|---|
GET / POST | /apps/instagram | List / create. |
GET / PUT | /apps/instagram/:id | Read / update. |
POST | /apps/instagram/oauth/init | Start OAuth. |
POST | /apps/instagram/oauth/callback | Complete OAuth. |
POST | /apps/instagram/:id/oauth/refresh | Refresh the long-lived token. |
Instagram tokens expire. Refresh on a schedule or inbound DMs stop arriving.
Facebook lead ads
The richest integration — 22 endpoints, because it both configures the connection and syncs lead forms.
Setup
| Method | Endpoint |
|---|---|
POST | /apps/facebook/apps |
GET / PUT | /apps/facebook/apps/:id |
POST | /apps/facebook/validate-token |
GET | /apps/facebook/pages |
Forms and leads
| Method | Endpoint | Purpose |
|---|---|---|
GET | /apps/facebook/page/forms | Forms on a page. |
GET | /apps/facebook/form/details | One form's definition. |
GET | /apps/facebook/form/leads | Leads on a form. |
GET | /apps/facebook/lead | One lead. |
PUT | /apps/facebook/lead/status | Update lead status. |
PUT | /apps/facebook/forms/:id | Update form mapping. |
Sync
| Method | Endpoint | Scope |
|---|---|---|
GET | /apps/facebook/sync/form-leads/:id | One form's leads. |
GET | /apps/facebook/sync/page-forms/:id | One page's forms. |
GET | /apps/facebook/sync/page-forms-leads/:id | One page: forms and leads. |
GET | /apps/facebook/sync/pages-forms | All pages' forms. |
GET | /apps/facebook/sync/pages-forms-leads | Everything. |
GET | /apps/facebook/sync/manual-job | Queue a manual sync. |
GET | /apps/facebook/sync/process-job | Process the queue. |
GET | /apps/facebook/sync/job-status/:jobId | Job status. |
GET | /apps/facebook/sync/schedule | Set up periodic sync. |
GET | /apps/facebook/sync/webhook-failures | Replay leads whose webhook failed. |
webhook-failures is the recovery path when Meta's webhook did not reach you — check it if lead counts look short.
Leads arriving this way carry formId, pageId, and ad attribution (ad_id, ad_name, adset_id, adset_name, campaignId, campaignName).
AI providers
| Provider | Endpoints |
|---|---|
| Gemini | standard five, plus GET /apps/gemini/models |
| Claude | standard five, plus GET /apps/claude/models |
Use the models endpoints to discover what the configured credentials can actually call rather than hard-coding model names. AI Genie and AI CRM chat both require Gemini to be configured and present in your plan.
Meetings and calendars
Company-level (shared configuration): /apps/zoom, /apps/google-calendar, /apps/offline-meeting — each with the standard five plus a POST .../redirect for OAuth.
Member-level (the calling member's own account):
| Method | Endpoint |
|---|---|
GET / POST | /my-zoom, /my-google-calendar |
POST | /my-zoom/redirect, /my-google-calendar/redirect |
GET / PUT | /my-zoom/default, /my-google-calendar/default |
GET | /my-zoom/:id, /my-google-calendar/:id |
Since an API key is a member, the /my-* endpoints act on the account of the member who created the key.
Meetings themselves: GET / POST /meeting, GET /meeting/:id. Update and cancel routes exist in source but are commented out.
Storage and OCR
/apps/s3bucket— standard five, plusPUT /apps/s3bucketfor a bulk update. Setting a default bucket changes where uploads land./apps/ocr— standard five, plusPOST /apps/ocr/imageto run OCR on an image (business-card capture).