Lelemon
  • Get started
  • Use cases
  • Guides
  • API basics
  • Webhooks
  • SDK, CLI and MCP
  • API reference
  • Changelog
  • v1 (legacy)
Information
Me
    Retrieve the current keyget
API keys
    List scopesget
Agents
    List agentsgetCreate an agentpostRetrieve an agentgetDelete an agentdeleteUpdate an agentpatchActivate an agentpostPause an agentpostList versionsgetRetrieve a versiongetRestore a versionpostList the fixed facts of an agentgetSave a fixed fact of an agentputForget a fixed fact of an agentdelete
Models and templates
    List agent templatesgetList modelsget
Subaccounts
    List subaccountsgetCreate a subaccountpostRetrieve a subaccountgetDelete a subaccountdeleteUpdate a subaccountpatchGive a subaccount its own keypost
WhatsApp
    List WhatsApp connectionsgetCreate a WhatsApp connection linkpostRetrieve a WhatsApp connectiongetRevoke a pending WhatsApp connectiondeleteList WhatsApp phone numbersgetRetrieve a WhatsApp phone numbergetDisconnect a WhatsApp phone numberdeleteChange the agent, label or state of a numberpatchRead the cart and catalog settings of a numbergetTurn the cart button or the catalog icon of a number on or offpatch
Actions
    List actionsgetCreate an actionpostRead the current authorization textgetRotate the signing secret of your actionspostRetrieve the signing secret of an actiongetRetrieve an actiongetDelete an actiondeleteUpdate an actionpatchTest an actionpostRead the approval floor of a shared actiongetSet the approval floor of a shared actionput
MCP servers
    List MCP serversgetConnect an MCP serverpostRetrieve an MCP servergetDisconnect an MCP serverdeleteUpdate an MCP serverpatchList the tools of an MCP servergetDiscover toolspostRead the run identity of an MCP servergetTurn on or rotate the run identity of an MCP serverpostTurn off the run identity of an MCP serverdelete
Data connectors
    Get the lelemon-connector/v1 formatgetValidate a connector documentpostList data connectorsgetRegister a data connectorpostRetrieve a data connectorgetDelete a data connectordeleteUpdate a data connectorpatchRetrieve the signing secret of a data connectorgetRotate the signing secret of a data connectorpostCheck a data connectorpostRetrieve the manifest of a data connectorgetSearch accounts by emailgetRead the card of an account livegetReveal one masked value of an accountpostGet the link of an account actionpostRead a view livegetList who looked at what through a connectorget
Skills
    List skillsgetCreate a skillpostRetrieve a skillgetDelete a skilldeleteUpdate a skillpatch
Agent tools
    List an agent's toolsgetGrant a toolputRemove a tooldelete
Approvals
    List approvalsgetRetrieve an approvalgetApprove an actionpostReject an actionpostAsk for a human review of a decisionpost
Automated decisions
    List automated decisionsgetRetrieve an automated decisiongetAsk for a human review of an automated decisionpost
Team questions
    List team questionsgetRetrieve a team questiongetRead a team question with its contextgetAnswer a team questionpost
Runs
    Give an agent a jobpostList runsgetRetrieve a rungetCancel a runpostAnswer a run that asked somethingpost
Schedules
    Schedule a job for an agentpostList scheduled tasksgetRetrieve a scheduled taskgetDelete a scheduled taskdeleteChange a scheduled taskpatchFire a scheduled task nowpost
Pipelines
    List pipelinesgetCreate a pipelinepostRetrieve a pipelinegetDelete a pipelinedeleteUpdate a pipelinepatchClone a pipelinepostReorder the stages of a pipelinepost
Stages
    List the stages of a pipelinegetCreate a stagepostRetrieve a stagegetDelete a stagedeleteUpdate a stagepatchMake a stage the entry stagepost
Fields
    List the fields of a pipelinegetCreate a fieldpostRetrieve a fieldgetDelete a fielddeleteUpdate a fieldpatch
Routing rules
    List the routing rules of a pipelinegetCreate a routing rulepostRetrieve a routing rulegetDelete a routing ruledeleteUpdate a routing rulepatch
Knowledge
    List collectionsgetCreate a collectionpostSearch the knowledgepostRetrieve a collectiongetDelete a collectiondeleteUpdate a collectionpatchList documentsgetAdd a documentpostRetrieve a documentgetDelete a documentdeleteUpdate a documentpatchLet an agent search a collectionputStop an agent from searching a collectiondelete
Contacts
    List contactsgetCreate a contactpostCreate or update a contact by your own idputRetrieve a contactgetErase a contactdeleteUpdate a contactpatch
Contact fields
    List the contact fieldsgetCreate a contact fieldpostRetrieve a contact fieldgetDelete a contact fielddeleteUpdate a contact fieldpatch
Companies
    List companiesgetCreate a companypostRetrieve a companygetDelete a companydeleteUpdate a companypatch
Lead forms
    List lead formsgetCreate a lead formpostRetrieve a lead formgetDelete a lead formdeleteUpdate a lead formpatch
Suppressions
    Retrieve a suppressionget
Cases
    List casesgetOpen a casepostRetrieve a casegetDelete a casedeleteUpdate a casepatchMove a case to a stagepostAssign a case to a memberpostClose a casepostReopen a casepostTake control of a casepostHand a case back to the agentpostMark a case as readpostMove several cases to a stagepostArchive a casepostBring an archived case backpostMute the contact of a casepostUnmute the contact of a casepostHand a case to a personpostReveal a sensitive field of a casepostEscalate a case to the technical teampostList the escalations of a caseget
Case queue
    Read the attention queue of a memberget
Contact events
    List the events of a contactgetReport a contact eventpostRetrieve a contact eventget
Case reminders
    List the reminders of a casegetAdd a reminder to a casepost
Reminders
    Retrieve a remindergetDelete a reminderdeleteEdit a reminderpatchComplete a reminderpostDismiss a reminderpost
Presence
    Report who is online in your apppostRead the presence settinggetTurn presence on or offput
Organization
    Get the organizationgetRename the organizationpatchGet the organization settingsgetChange the organization settingspatchGet the company profilegetChange the company profilepatch
Case notes
    List the notes of a casegetAdd a note to a casepostRetrieve a notegetDelete a notedeleteEdit a notepatch
Case attachments
    List the files of a casegetUpload a file to a casepostRetrieve a file of a casegetDelete a file of a casedeleteGet the download link of a fileget
Files
    List filesgetUpload a filepostRetrieve a filegetDelete a filedelete
Case messages
    List the messages of a casegetAdd a message to a casepostRedact a messagepost
Case turns
    List the turns the agent took in a caseget
Usage
    Get the usage of your agentsget
Case metrics
    List the times of the cases that changed in a rangeget
Budgets
    List the budgetsgetCreate a monthly budgetpostGet a budgetgetDelete a budgetdeleteChange a budgetpatch
Members
    List the active members of the organizationgetList who invited, changed the role of or removed membersgetRead whether a team member is availablegetMark a team member available or awayputChange the role of a memberpatchChange which cases a member seespatchRemove a member from the organizationdelete
Invitations
    List the invitations of the organizationgetInvite a person to the organizationpostResend an invitationpostCancel an invitationpost
Scheduling
    List the agendasgetCreate an agendapostRetrieve an agendagetUpdate an agendapatchList the team of an agendagetAdd a person to the team of an agendapostRemove a person from the team of an agendadeleteUpdate a person in the team of an agendapatchRead the free slots of an agendagetList meetingsgetBook a meetingpostRetrieve a meetinggetCancel a meetingpostMove a meeting to another slotpost
Webhook endpoints
    List webhook endpointsgetCreate a webhook endpointpostRetrieve a webhook endpointgetDelete a webhook endpointdeleteUpdate a webhook endpointpatchRotate the signing secretpostSend a test eventpostList the deliveries of an endpointget
Events
    Resend an eventpostList the event typesget
Recipient allowlist
    Get the recipient allowlistgetReplace the recipient allowlistput
WhatsApp templates
    List templatesgetCreate a templatepostSync template statusespostRetrieve a templategetDelete a templatedeleteUpdate a templatepatchRender a templatepostSend a test messagepost
WhatsApp messages
    Send a templatepostRetrieve a template messagegetCancel a scheduled messagepost
Triggers
    List triggersgetCreate a triggerpostRetrieve a triggergetDelete a triggerdeleteUpdate a triggerpatchList the runs of a triggerget
Opt-outs
    List opt-outsgetOpt a contact outputClear an opt-outdelete
Campaigns
    List campaignsgetCreate a campaignpostRetrieve a campaigngetDelete a campaigndeleteUpdate a campaignpatchPreview a campaignpostLaunch a campaignpostPause a campaignpostResume a campaignpostCancel a campaignpostList recipientsget
Email domains
    List the sender domainsgetAdd a sender domainpostGet a sender domain with its status and DNS recordsgetRemove a sender domaindeleteChange the default sender or the inbound agent of a domainpatchCheck the DNS records nowpost
Email messages
    Write first by emailpostRetrieve an email messageget
Teams
    List the teamsgetCreate a teampostRetrieve a teamgetDelete a teamdeleteUpdate a teampatchMerge another team into this onepostMove a pipeline into a teamputAdd a member to a team or change their role in itputRemove a member from a teamdelete
Linear
    Get the Linear connectiongetConnect LinearputDisconnect LineardeleteUpdate the Linear connectionpatch
Schemas
powered by Zudoku
Lelemon API
Lelemon API

WhatsApp templates


List templates

GET
https://api.lelemon.cl
/v2/whatsapp/templates
Bearer (API key)

Newest first. Filter by status.

Required scope: whatsapp:read.

List templates › query Parameters

limit
​integer · min: 1 · max: 100
Default: 20
cursor
​string · maxLength: 512

The nextCursor of the previous page, with the same filters.

status
​string · enum
Enum values:
in_review
approved
rejected
paused

List templates › Headers

Lelemon-Subaccount
​string · pattern: ^sub_[0-9A-Za-z]{22}…

The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.

List templates › Responses

TemplateList
object
​string · enum · required
Enum values:
list
hasMore
​boolean · required
nextCursor
​string | null · required
​Template[] · required
GET/v2/whatsapp/templates
curl https://api.lelemon.cl/v2/whatsapp/templates \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "list", "hasMore": true, "nextCursor": "nextCursor", "data": [ { "object": "template", "id": "tpl_02y0e5MANqacVbmtn1YyeJ", "name": "name", "language": "language", "category": "marketing", "status": "in_review", "rejectionReason": "rejectionReason", "body": "body", "footer": "footer", "header": { "type": "document" }, "buttons": [ "string" ], "buttonActions": [ { "type": "quick_reply", "text": "text", "payload": "payload", "url": "url", "flowId": "flowId", "flowAction": "navigate", "screen": "screen" } ], "carousel": { "type": "media", "cards": [ { "header": { "type": "image", "exampleFileId": "fil_4Zq0x8bVw1TqS9mYp3RkLd", "exampleUrl": "https://files.example.com/chair.jpg" }, "body": "body", "buttons": [ { "type": "quick_reply", "text": "Buy", "payload": "payload", "url": "url" } ] } ], "buttonText": "View" }, "variables": [ "string" ], "examples": { "key": "string" }, "phoneNumberIds": "all", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" } ] }
json
application/json

Create a template

POST
https://api.lelemon.cl
/v2/whatsapp/templates
Bearer (API key)

Sends it to WhatsApp review (in_review). You get template.status_changed when WhatsApp decides. Marketing templates always get an opt-out button, written in the language of the template ("No recibir más" in Spanish, "Stop messages" by default). To word it yourself, send a quick_reply with payload lelemon_stop_messages and your text. A template can have a document header: send header.exampleUrl, and the document itself when you send the message. Use buttons for quick replies (the tap comes back as a message with reply {id, title}, so a reminder can offer Confirm and Cancel) and for fixed links (type url, https, no variables yet). It is not idempotent: repeating it with the same name and language is a 409.

Required scope: whatsapp:write.

Create a template › Headers

Lelemon-Subaccount
​string · pattern: ^sub_[0-9A-Za-z]{22}…

The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.

Idempotency-Key
​string · minLength: 1 · maxLength: 255

Makes the request safe to retry. Once it starts running, its final response (2xx, 4xx or 5xx) is kept for 24 hours and the same key gets it back, without repeating the effect. A request rejected before it runs leaves the key free. A replayed create omits the secret. The same key with a different request is rejected with 409 idempotency_key_reused.

Create a template › Request Body

CreateTemplate
name
​string · pattern: ^[a-z][a-z0-9_]{0,51… · required

lowercase_with_underscores.

language
​string · minLength: 2 · maxLength: 20 · required
category
​string · enum · required
Enum values:
marketing
utility
authentication
body
​string · minLength: 1 · maxLength: 1024 · required

With named variables: {{name}}.

​object · required

A sample value for each variable.

​required
footer
​string · maxLength: 60
​TemplateHeaderInput
​TemplateButtonInput[]

Up to 10 buttons, at most 2 of type url. Marketing templates also get the opt-out button, which counts toward the 10: in the language of the template, or your own text if you send a quick_reply with payload lelemon_stop_messages. Quick replies are kept together before the links.

​object

Swipeable cards under the body, with media or with catalog products. WhatsApp checks the combination with the other parts when it reviews the template.

Create a template › Responses

Template
object
​string · enum · required
Enum values:
template
id
​string · required
name
​string · required
language
​string · required
category
​string · enum · required
Enum values:
marketing
utility
authentication
status
​string · enum · required
Enum values:
in_review
approved
rejected
paused
rejectionReason
​string | null · required
body
​string · required
footer
​string | null · required
​required
buttons
​string[] · required

Texts of the buttons.

​TemplateButton[] · required

The buttons with their type, payload or link.

​required
variables
​string[] · required

The variables of the body and of the links of the buttons.

​object · required
​required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
POST/v2/whatsapp/templates
curl https://api.lelemon.cl/v2/whatsapp/templates \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "name": "we_miss_you", "language": "es", "category": "marketing", "body": "Hola {{name}}, usa el código {{coupon}}.", "footer": "Responde STOP para no recibir más.", "buttons": [ { "type": "quick_reply", "text": "Quiero mi cupón" } ], "examples": { "name": "Ana", "coupon": "VUELVE10" }, "phoneNumberIds": "all" }'
Example Request Body
{ "name": "we_miss_you", "language": "es", "category": "marketing", "body": "Hola {{name}}, usa el código {{coupon}}.", "footer": "Responde STOP para no recibir más.", "buttons": [ { "type": "quick_reply", "text": "Quiero mi cupón" } ], "examples": { "name": "Ana", "coupon": "VUELVE10" }, "phoneNumberIds": "all" }
json
application/json
Example Responses
{ "object": "template", "id": "tpl_02y0e5MANqacVbmtn1YyeJ", "name": "name", "language": "language", "category": "marketing", "status": "in_review", "rejectionReason": "rejectionReason", "body": "body", "footer": "footer", "header": { "type": "document" }, "buttons": [ "string" ], "buttonActions": [ { "type": "quick_reply", "text": "text", "payload": "payload", "url": "url", "flowId": "flowId", "flowAction": "navigate", "screen": "screen" } ], "carousel": { "type": "media", "cards": [ { "header": { "type": "image", "exampleFileId": "fil_4Zq0x8bVw1TqS9mYp3RkLd", "exampleUrl": "https://files.example.com/chair.jpg" }, "body": "body", "buttons": [ { "type": "quick_reply", "text": "Buy", "payload": "payload", "url": "url" } ] } ], "buttonText": "View" }, "variables": [ "string" ], "examples": { "key": "string" }, "phoneNumberIds": "all", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" }
json
application/json

Sync template statuses

POST
https://api.lelemon.cl
/v2/whatsapp/templates/sync
Bearer (API key)

Asks WhatsApp for the current status of your templates and updates them. WhatsApp does not notify changes, so this also runs by itself while a template is in review.

Required scope: whatsapp:write.

Sync template statuses › Headers

Lelemon-Subaccount
​string · pattern: ^sub_[0-9A-Za-z]{22}…

The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.

Idempotency-Key
​string · minLength: 1 · maxLength: 255

Makes the request safe to retry. Once it starts running, its final response (2xx, 4xx or 5xx) is kept for 24 hours and the same key gets it back, without repeating the effect. A request rejected before it runs leaves the key free. A replayed create omits the secret. The same key with a different request is rejected with 409 idempotency_key_reused.

Sync template statuses › Responses

TemplateSync
object
​string · enum · required
Enum values:
template_sync
checked
​number · required

Templates checked against WhatsApp.

updated
​number · required

Templates whose status changed.

imported
​number · required

Templates found on WhatsApp that were not here.

POST/v2/whatsapp/templates/sync
curl https://api.lelemon.cl/v2/whatsapp/templates/sync \ --request POST \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "template_sync", "checked": 0, "updated": 0, "imported": 0 }
json
application/json

Retrieve a template

GET
https://api.lelemon.cl
/v2/whatsapp/templates/{id}
Bearer (API key)

Returns one WhatsApp template by id. Use it to refresh a single record you already know; to find records, use the list route. It includes its review status. Read only. 404 not_found when the id does not exist or belongs to another organization. You can repeat it safely: it has no side effects.

Required scope: whatsapp:read.

Retrieve a template › path Parameters

id
​string · pattern: ^tpl_[0-9A-Za-z]{22}… · required

The id of the template (tpl_…).

Retrieve a template › Headers

Lelemon-Subaccount
​string · pattern: ^sub_[0-9A-Za-z]{22}…

The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.

Retrieve a template › Responses

Template
object
​string · enum · required
Enum values:
template
id
​string · required
name
​string · required
language
​string · required
category
​string · enum · required
Enum values:
marketing
utility
authentication
status
​string · enum · required
Enum values:
in_review
approved
rejected
paused
rejectionReason
​string | null · required
body
​string · required
footer
​string | null · required
​required
buttons
​string[] · required

Texts of the buttons.

​TemplateButton[] · required

The buttons with their type, payload or link.

​required
variables
​string[] · required

The variables of the body and of the links of the buttons.

​object · required
​required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
GET/v2/whatsapp/templates/{id}
curl https://api.lelemon.cl/v2/whatsapp/templates/:id \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "template", "id": "tpl_02y0e5MANqacVbmtn1YyeJ", "name": "name", "language": "language", "category": "marketing", "status": "in_review", "rejectionReason": "rejectionReason", "body": "body", "footer": "footer", "header": { "type": "document" }, "buttons": [ "string" ], "buttonActions": [ { "type": "quick_reply", "text": "text", "payload": "payload", "url": "url", "flowId": "flowId", "flowAction": "navigate", "screen": "screen" } ], "carousel": { "type": "media", "cards": [ { "header": { "type": "image", "exampleFileId": "fil_4Zq0x8bVw1TqS9mYp3RkLd", "exampleUrl": "https://files.example.com/chair.jpg" }, "body": "body", "buttons": [ { "type": "quick_reply", "text": "Buy", "payload": "payload", "url": "url" } ] } ], "buttonText": "View" }, "variables": [ "string" ], "examples": { "key": "string" }, "phoneNumberIds": "all", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" }
json
application/json

Delete a template

DELETE
https://api.lelemon.cl
/v2/whatsapp/templates/{id}
Bearer (API key)

Also deletes it on WhatsApp. Answers 409 resource_in_use while a trigger or an active campaign uses it.

Required scope: whatsapp:write.

Delete a template › path Parameters

id
​string · pattern: ^tpl_[0-9A-Za-z]{22}… · required

The id of the template (tpl_…).

Delete a template › Headers

Lelemon-Subaccount
​string · pattern: ^sub_[0-9A-Za-z]{22}…

The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.

Delete a template › Responses

No data returned
DELETE/v2/whatsapp/templates/{id}
curl https://api.lelemon.cl/v2/whatsapp/templates/:id \ --request DELETE \ --header 'Authorization: Bearer <token>'
Example Responses
No example specified for this content type

Update a template

PATCH
https://api.lelemon.cl
/v2/whatsapp/templates/{id}
Bearer (API key)

WhatsApp does not allow changing the text of an approved template. Here you can only change which numbers can send it.

Required scope: whatsapp:write.

Update a template › path Parameters

id
​string · pattern: ^tpl_[0-9A-Za-z]{22}… · required

The id of the template (tpl_…).

Update a template › Headers

Lelemon-Subaccount
​string · pattern: ^sub_[0-9A-Za-z]{22}…

The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.

Update a template › Request Body optional

UpdateTemplate
​

Update a template › Responses

Template
object
​string · enum · required
Enum values:
template
id
​string · required
name
​string · required
language
​string · required
category
​string · enum · required
Enum values:
marketing
utility
authentication
status
​string · enum · required
Enum values:
in_review
approved
rejected
paused
rejectionReason
​string | null · required
body
​string · required
footer
​string | null · required
​required
buttons
​string[] · required

Texts of the buttons.

​TemplateButton[] · required

The buttons with their type, payload or link.

​required
variables
​string[] · required

The variables of the body and of the links of the buttons.

​object · required
​required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
PATCH/v2/whatsapp/templates/{id}
curl https://api.lelemon.cl/v2/whatsapp/templates/:id \ --request PATCH \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "phoneNumberIds": "all" }'
Example Request Body
{ "phoneNumberIds": "all" }
json
application/json
Example Responses
{ "object": "template", "id": "tpl_02y0e5MANqacVbmtn1YyeJ", "name": "name", "language": "language", "category": "marketing", "status": "in_review", "rejectionReason": "rejectionReason", "body": "body", "footer": "footer", "header": { "type": "document" }, "buttons": [ "string" ], "buttonActions": [ { "type": "quick_reply", "text": "text", "payload": "payload", "url": "url", "flowId": "flowId", "flowAction": "navigate", "screen": "screen" } ], "carousel": { "type": "media", "cards": [ { "header": { "type": "image", "exampleFileId": "fil_4Zq0x8bVw1TqS9mYp3RkLd", "exampleUrl": "https://files.example.com/chair.jpg" }, "body": "body", "buttons": [ { "type": "quick_reply", "text": "Buy", "payload": "payload", "url": "url" } ] } ], "buttonText": "View" }, "variables": [ "string" ], "examples": { "key": "string" }, "phoneNumberIds": "all", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" }
json
application/json

Render a template

POST
https://api.lelemon.cl
/v2/whatsapp/templates/{id}/render
Bearer (API key)

The final text with your variables, without sending.

Required scope: whatsapp:read.

Render a template › path Parameters

id
​string · pattern: ^tpl_[0-9A-Za-z]{22}… · required

The id of the template (tpl_…).

Render a template › Headers

Lelemon-Subaccount
​string · pattern: ^sub_[0-9A-Za-z]{22}…

The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.

Idempotency-Key
​string · minLength: 1 · maxLength: 255

Makes the request safe to retry. Once it starts running, its final response (2xx, 4xx or 5xx) is kept for 24 hours and the same key gets it back, without repeating the effect. A request rejected before it runs leaves the key free. A replayed create omits the secret. The same key with a different request is rejected with 409 idempotency_key_reused.

Render a template › Request Body

RenderTemplate
​object · required

Render a template › Responses

TemplateRender
object
​string · enum · required
Enum values:
template_render
text
​string · required
buttons
​string[] · required
POST/v2/whatsapp/templates/{id}/render
curl https://api.lelemon.cl/v2/whatsapp/templates/:id/render \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "variables": { "name": "Ana", "coupon": "VUELVE10" } }'
Example Request Body
{ "variables": { "name": "Ana", "coupon": "VUELVE10" } }
json
application/json
Example Responses
{ "object": "template_render", "text": "text", "buttons": [ "string" ] }
json
application/json

Send a test message

POST
https://api.lelemon.cl
/v2/whatsapp/templates/{id}/test
Bearer (API key)

Sends the template to one phone with the sample values it was created with, or yours. It opens no case. A phone that belongs to a contact who opted out of WhatsApp answers 422 contact_opted_out and nothing is sent. It sends a real message: use dryRun=true first, which runs the same checks (template approved, recipient allowlist, opt-out, variables, document, WhatsApp number) and answers 200 with the message as it would be created, sending nothing; its id is not saved.

Required scope: whatsapp:write.

Send a test message › path Parameters

id
​string · pattern: ^tpl_[0-9A-Za-z]{22}… · required

The id of the template (tpl_…).

Send a test message › query Parameters

dryRun
​boolean

When true, the request goes through the same validation as the real one and is answered with what would happen (always 200), and nothing is saved, sent or charged. The answer has the same shape as the real one plus dryRun: true; an id in it is not saved. It does not use the Idempotency-Key.

Send a test message › Headers

Lelemon-Subaccount
​string · pattern: ^sub_[0-9A-Za-z]{22}…

The subaccount (sub_…) this request acts on. Only for the keys of a platform account; without it the request acts on the account itself.

Idempotency-Key
​string · minLength: 1 · maxLength: 255

Makes the request safe to retry. Once it starts running, its final response (2xx, 4xx or 5xx) is kept for 24 hours and the same key gets it back, without repeating the effect. A request rejected before it runs leaves the key free. A replayed create omits the secret. The same key with a different request is rejected with 409 idempotency_key_reused.

Send a test message › Request Body

TestTemplate
to
​string · maxLength: 50 · required
​object

By default, the sample values the template was created with.

​HeaderDocument
​object

What the template needs besides its variables: image or video header, products, Flow data, cards.

Send a test message › Responses

dryRun=true: the message as it would be created; nothing is sent.

What a dryRun answer adds to the normal one: nothing was saved, sent or charged, and an id in it is not saved.
object
​string · enum · required
Enum values:
whatsapp_message
id
​string · required
status
​string · enum · required
Enum values:
queued
scheduled
sent
delivered
read
failed
skipped
canceled
templateId
​string | null · required
contactId
​string | null · required
caseId
​string | null · required
sendAt
​string | null · date-time · required
skipReason
​string | null · required

Why it was skipped: opted_out, no_phone, template_not_approved, human_in_control, cooldown, not_allowed or canceled.

​required
createdAt
​string · date-time · required
dryRun
​boolean · const

Present and true when the request had dryRun=true.

Const value:
POST/v2/whatsapp/templates/{id}/test
curl https://api.lelemon.cl/v2/whatsapp/templates/:id/test \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "to": "+56987654321", "variables": { "name": "Ana", "coupon": "VUELVE10" } }'
Example Request Body
{ "to": "+56987654321", "variables": { "name": "Ana", "coupon": "VUELVE10" } }
json
application/json
Example Responses
{ "object": "whatsapp_message", "id": "wam_3Dk0x8bVw1TqS9mYp3RkLd", "status": "queued", "templateId": "templateId", "contactId": "contactId", "caseId": "caseId", "sendAt": "2024-08-25T15:00:00Z", "skipReason": "skipReason", "failure": { "code": "131047", "message": "message" }, "createdAt": "2024-08-25T15:00:00Z", "dryRun": true }
json
application/json

Recipient allowlistWhatsApp messages