Templates
Base URL https://api.leadx.in/api/key/protected. Every request needs an apikey header — see Authentication.
13 endpoints.
GET /template/category/:panel
Get email categories.
Auth apikey
:::note Used by the web app
components/GenerateEmailTemplateModal.jsx, components/GenerateWhatsappTemplateModal.jsx, pages/AddEmailTemplate.jsx and 1 more
:::
Path parameters
| Name | |
|---|---|
panel | Required |
Response — data is one Category object.
Errors InvalidPanel_400
GET /template/email
Get all email template.
Auth apikey
:::note Used by the web app
components/EmailMessageSend.jsx, components/EmailTemplateModal.jsx, pages/AddEmailTemplate.jsx and 9 more
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of EmailTemplate objects, alongside the pagination fields described in Response format. updatedBy, createdBy are populated, so they arrive as nested objects rather than ids.
POST /template/email
Create email template.
Auth apikey · Success 201
:::note Used by the web app
components/EmailMessageSend.jsx, components/EmailTemplateModal.jsx, pages/AddEmailTemplate.jsx and 9 more
:::
Request body
| Field | Default | Notes |
|---|---|---|
name | — | |
subject | — | |
body | — | |
category | — | Contact category id. |
attachments | [] | |
variables | [] |
Required: templateName, subject, body. Of these, templateName is nested inside another field (commonly formData), or checked under a different internal name.
Response — data is one EmailTemplate object.
Errors TemplateNameAlreadyExists_400
DELETE /template/email
Delete email template.
Auth apikey · Success 200
:::note Used by the web app
components/EmailMessageSend.jsx, components/EmailTemplateModal.jsx, pages/AddEmailTemplate.jsx and 9 more
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
GET /template/email/:id
Get email template.
Auth apikey
:::note Used by the web app
components/GenerateEmailTemplateModal.jsx, pages/AddEmailTemplate.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one EmailTemplate object.
Errors EmailTemplateNotFound_404
PUT /template/email/:id
Update email template.
Auth apikey · Success 200
:::note Used by the web app
components/GenerateEmailTemplateModal.jsx, pages/AddEmailTemplate.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Request body
| Field | Default | Notes |
|---|---|---|
name | — | |
subject | — | |
body | — | |
category | — | Contact category id. |
attachments | — | |
variables | — |
Response — data is one EmailTemplate object.
Errors EmailTemplateNotFound_404 · TemplateNameAlreadyExists_400
POST /template/email/generate-ai
Generate AI email template.
Auth apikey · Success 201
Request body
| Field | Default | Notes |
|---|---|---|
prompt | — | The outreach goal, in plain language. |
name | — | |
category | — | Contact category id. |
contactIds | — | |
leadIds | — | |
tone | — | Free text, e.g. friendly or formal. |
language | — | |
aiType | — | AI provider. Defaults to Gemini. |
GET /template/whatsapp
Get all WhatsApp template.
Auth apikey
:::note Used by the web app
components/WhatsappMessageSend.jsx, components/WhatsappTemplateModal.jsx, pages/AddLead.jsx and 8 more
:::
Query parameters — the standard list contract: p, n, sortBy, sortOrder, searchBy, searchValue, filters, advancedFilters, ids, nids. See Pagination and Filtering.
Response — data is an array of MetaTemplate objects, alongside the pagination fields described in Response format. app is populated, so it arrives as nested objects rather than ids.
POST /template/whatsapp
Create WhatsApp template.
Auth apikey · Success 201
:::note Used by the web app
components/WhatsappMessageSend.jsx, components/WhatsappTemplateModal.jsx, pages/AddLead.jsx and 8 more
:::
Request body
| Field | Default | Notes |
|---|---|---|
appID | — | |
name | — | |
appCategory | — | |
language | — | |
category | — | Contact category id. |
bodyText | — | |
expiry | — | |
variables | — | |
buttons | [] | |
headerType | — | |
headerText | — | |
headerFile | — | |
footerText | — | |
ttl | — | |
addSecurity | — | |
copyCodeText | — | |
refIds | [] | |
defaults | {} |
Response — data is one Category object. (Resource deduced from the collections this handler reads, not read off an explicit return.)
DELETE /template/whatsapp
Delete WhatsApp template.
Auth apikey · Success 200
:::note Used by the web app
components/WhatsappMessageSend.jsx, components/WhatsappTemplateModal.jsx, pages/AddLead.jsx and 8 more
:::
Request body — the standard bulk selection: ids, nids, selectAll. Query-string filters apply when selectAll is set.
Response — data is null; the outcome is the status code and message.
GET /template/whatsapp/:id
Get WhatsApp template.
Auth apikey
:::note Used by the web app
components/GenerateWhatsappTemplateModal.jsx, pages/AddWhatsappTemplate.jsx, pages/TemplateWhatsapp.jsx
:::
Path parameters
| Name | |
|---|---|
id | Required |
Response — data is one MetaTemplate object. app is populated, so it arrives as nested objects rather than ids.
Errors WhatsAppTemplateNotFound_404
POST /template/whatsapp/generate-ai
Generate AI WhatsApp template.
Auth apikey · Success 201
Request body
| Field | Default | Notes |
|---|---|---|
prompt | — | The outreach goal, in plain language. |
name | — | |
appID | — | |
appCategory | — | |
metaCategory | — | |
language | — | |
tone | — | Free text, e.g. friendly or formal. |
contactIds | — | |
leadIds | — | |
aiType | — | AI provider. Defaults to Gemini. |
components | — | |
headerFile | — |
Response — data is one MetaTemplate object.
POST /template/whatsapp/status-reconcile
Reconcile whatsapp template.
Auth apikey · Success 200
Request body
| Field | Default |
|---|---|
tids | — |
syncAll | — |
Errors WhatsAppTemplateNotFound_404