Skip to main content

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
panelRequired

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

Responsedata 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

FieldDefaultNotes
name
subject
body
categoryContact 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.

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

Responsedata 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
idRequired

Responsedata 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
idRequired

Request body

FieldDefaultNotes
name
subject
body
categoryContact category id.
attachments
variables

Responsedata is one EmailTemplate object.

Errors EmailTemplateNotFound_404 · TemplateNameAlreadyExists_400

POST /template/email/generate-ai

Generate AI email template.

Auth apikey · Success 201

Request body

FieldDefaultNotes
promptThe outreach goal, in plain language.
name
categoryContact category id.
contactIds
leadIds
toneFree text, e.g. friendly or formal.
language
aiTypeAI 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.

Responsedata 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

FieldDefaultNotes
appID
name
appCategory
language
categoryContact category id.
bodyText
expiry
variables
buttons[]
headerType
headerText
headerFile
footerText
ttl
addSecurity
copyCodeText
refIds[]
defaults{}

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

Responsedata 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
idRequired

Responsedata 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

FieldDefaultNotes
promptThe outreach goal, in plain language.
name
appID
appCategory
metaCategory
language
toneFree text, e.g. friendly or formal.
contactIds
leadIds
aiTypeAI provider. Defaults to Gemini.
components
headerFile

Responsedata is one MetaTemplate object.

POST /template/whatsapp/status-reconcile

Reconcile whatsapp template.

Auth apikey · Success 200

Request body

FieldDefault
tids
syncAll

Errors WhatsAppTemplateNotFound_404