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


List WhatsApp connections

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

Newest first.

Required scope: whatsapp:read.

List WhatsApp connections › 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:
pending
connected
failed
revoked
expired
disconnected

List WhatsApp connections › 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 WhatsApp connections › Responses

WhatsappConnectionList
object
​string · enum · required
Enum values:
list
hasMore
​boolean · required
nextCursor
​string | null · required
​WhatsappConnection[] · required
GET/v2/whatsapp/connections
curl https://api.lelemon.cl/v2/whatsapp/connections \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "list", "hasMore": true, "nextCursor": "nextCursor", "data": [ { "object": "whatsapp_connection", "id": "wcn_4Zq0x8bVw1TqS9mYp3RkLd", "phone": "+56912345678", "agentId": "agt_4Zq0x8bVw1TqS9mYp3RkLd", "connectionType": "coexistence", "status": "pending", "setupUrl": "setupUrl", "expiresAt": "2024-08-25T15:00:00Z", "phoneNumberId": "pn_4Zq0x8bVw1TqS9mYp3RkLd", "failure": { "code": "phone_number_mismatch", "message": "The number linked is not the one requested." }, "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" } ] }
json
application/json

Create a WhatsApp connection link

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

Returns a setupUrl for the account owner to link their WhatsApp number. Only the number in phone can be linked: any other one ends the connection as failed and is not attached. When the number is linked, it answers with agentId and the phone_number.connected event is sent. One pending link per account.

Required scope: whatsapp:write.

Create a WhatsApp connection link › 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 WhatsApp connection link › Request Body

CreateWhatsappConnection
phone
​string · pattern: ^\+[1-9]\d{6,14}$ · required

The number the subaccount will link, in E.164. If they link another one, the connection fails and nothing is attached.

agentId
​string · minLength: 1 · maxLength: 64 · required

The agent that will answer on this number.

connectionType
​string · enum · required

coexistence keeps the WhatsApp Business app working next to the API; dedicated is API only.

Enum values:
coexistence
dedicated
​ConnectionRedirects
language
​string · enum
Enum values:
es
en
pt
Default: es

Create a WhatsApp connection link › Responses

WhatsappConnection
object
​string · enum · required
Enum values:
whatsapp_connection
id
​string · required
phone
​string · required
agentId
​string | null · required
connectionType
​string · enum · required
Enum values:
coexistence
dedicated
status
​string · enum · required
Enum values:
pending
connected
failed
revoked
expired
disconnected
setupUrl
​string | null · required

Send the subaccount here. Only while status is pending.

expiresAt
​string | null · date-time · required
phoneNumberId
​string | null · required

The phone number it created, once connected.

​required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
POST/v2/whatsapp/connections
curl https://api.lelemon.cl/v2/whatsapp/connections \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "phone": "+56912345678", "agentId": "agt_02y0e5MANqacVbmtn1YyeJ", "connectionType": "coexistence", "redirects": { "success": "https://app.example.com/whatsapp/connected", "failure": "https://app.example.com/whatsapp/failed" }, "language": "es" }'
Example Request Body
{ "phone": "+56912345678", "agentId": "agt_02y0e5MANqacVbmtn1YyeJ", "connectionType": "coexistence", "redirects": { "success": "https://app.example.com/whatsapp/connected", "failure": "https://app.example.com/whatsapp/failed" }, "language": "es" }
json
application/json
Example Responses
{ "object": "whatsapp_connection", "id": "wcn_4Zq0x8bVw1TqS9mYp3RkLd", "phone": "+56912345678", "agentId": "agt_4Zq0x8bVw1TqS9mYp3RkLd", "connectionType": "coexistence", "status": "pending", "setupUrl": "setupUrl", "expiresAt": "2024-08-25T15:00:00Z", "phoneNumberId": "pn_4Zq0x8bVw1TqS9mYp3RkLd", "failure": { "code": "phone_number_mismatch", "message": "The number linked is not the one requested." }, "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" }
json
application/json

Retrieve a WhatsApp connection

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

Returns one WhatsApp connection by id. Use it to refresh a single record you already know; to find records, use the list route. 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 WhatsApp connection › path Parameters

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

The id of the whatsapp connection (wcn_…).

Retrieve a WhatsApp connection › 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 WhatsApp connection › Responses

WhatsappConnection
object
​string · enum · required
Enum values:
whatsapp_connection
id
​string · required
phone
​string · required
agentId
​string | null · required
connectionType
​string · enum · required
Enum values:
coexistence
dedicated
status
​string · enum · required
Enum values:
pending
connected
failed
revoked
expired
disconnected
setupUrl
​string | null · required

Send the subaccount here. Only while status is pending.

expiresAt
​string | null · date-time · required
phoneNumberId
​string | null · required

The phone number it created, once connected.

​required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
GET/v2/whatsapp/connections/{id}
curl https://api.lelemon.cl/v2/whatsapp/connections/:id \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "whatsapp_connection", "id": "wcn_4Zq0x8bVw1TqS9mYp3RkLd", "phone": "+56912345678", "agentId": "agt_4Zq0x8bVw1TqS9mYp3RkLd", "connectionType": "coexistence", "status": "pending", "setupUrl": "setupUrl", "expiresAt": "2024-08-25T15:00:00Z", "phoneNumberId": "pn_4Zq0x8bVw1TqS9mYp3RkLd", "failure": { "code": "phone_number_mismatch", "message": "The number linked is not the one requested." }, "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" }
json
application/json

Revoke a pending WhatsApp connection

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

Kills the setupUrl. Only a pending connection can be revoked; to remove a linked number use DELETE /v2/whatsapp/phone-numbers/{id}.

Required scope: whatsapp:write.

Revoke a pending WhatsApp connection › path Parameters

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

The id of the whatsapp connection (wcn_…).

Revoke a pending WhatsApp connection › 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.

Revoke a pending WhatsApp connection › Responses

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

List WhatsApp phone numbers

GET
https://api.lelemon.cl
/v2/whatsapp/phone-numbers
Bearer (API key)

Newest first.

Required scope: whatsapp:read.

List WhatsApp phone numbers › query Parameters

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

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

List WhatsApp phone numbers › 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 WhatsApp phone numbers › Responses

PhoneNumberList
object
​string · enum · required
Enum values:
list
hasMore
​boolean · required
nextCursor
​string | null · required
​PhoneNumber[] · required
GET/v2/whatsapp/phone-numbers
curl https://api.lelemon.cl/v2/whatsapp/phone-numbers \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "list", "hasMore": true, "nextCursor": "nextCursor", "data": [ { "object": "phone_number", "id": "pn_4Zq0x8bVw1TqS9mYp3RkLd", "phone": "+56 9 1234 5678", "verifiedName": "Cafe Central", "label": "Sucursal Centro", "catalogId": "1234567890", "agentId": "agt_4Zq0x8bVw1TqS9mYp3RkLd", "active": true, "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" } ] }
json
application/json

Retrieve a WhatsApp phone number

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

Returns one WhatsApp phone number by id. Use it to refresh a single record you already know; to find records, use the list route. 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 WhatsApp phone number › path Parameters

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

The id of the phone number (pn_…).

Retrieve a WhatsApp phone number › 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 WhatsApp phone number › Responses

PhoneNumber
object
​string · enum · required
Enum values:
phone_number
id
​string · required
phone
​string | null · required
verifiedName
​string | null · required
label
​string | null · required

Your own name for the number, such as the branch it serves.

catalogId
​string | null · required

The id of the Meta catalog connected to this number. The product, product_list and catalog messages and the catalog templates only send with this catalog. null when none is set.

agentId
​string | null · required
active
​boolean · required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
GET/v2/whatsapp/phone-numbers/{id}
curl https://api.lelemon.cl/v2/whatsapp/phone-numbers/:id \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "phone_number", "id": "pn_4Zq0x8bVw1TqS9mYp3RkLd", "phone": "+56 9 1234 5678", "verifiedName": "Cafe Central", "label": "Sucursal Centro", "catalogId": "1234567890", "agentId": "agt_4Zq0x8bVw1TqS9mYp3RkLd", "active": true, "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" }
json
application/json

Disconnect a WhatsApp phone number

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

Detaches the number from the provider and stops its agent. The phone_number.disconnected event is sent.

Required scope: whatsapp:write.

Disconnect a WhatsApp phone number › path Parameters

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

The id of the phone number (pn_…).

Disconnect a WhatsApp phone number › 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.

Disconnect a WhatsApp phone number › Responses

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

Change the agent, label or state of a number

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

Use it to switch the agent that answers (agentId), stop answering without disconnecting (active: false) or name the number, for example by branch (label, null clears it). Only the fields you send change, and the call is idempotent. It does not set business hours or a time zone: those belong to the organization, not to a number, and a field this route does not know is not applied.

Required scope: whatsapp:write.

Change the agent, label or state of a number › path Parameters

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

The id of the phone number (pn_…).

Change the agent, label or state of a number › 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.

Change the agent, label or state of a number › Request Body optional

UpdatePhoneNumber
agentId
​string · minLength: 1 · maxLength: 64

The agent that answers on this number from now on.

active
​boolean

false stops the agent from answering; true turns it back on.

label
​string | null · minLength: 1 · maxLength: 100

Your own name for the number, such as the branch it serves. Send null to clear it.

catalogId
​string | null · maxLength: 100 · pattern: ^[0-9]{5,100}$

The id of the catalog you connected to this number in Meta Commerce Manager and WhatsApp Manager. Send null to clear it. The platform cannot ask Meta whether it exists: a wrong id shows up as a failed message with its error.

Change the agent, label or state of a number › Responses

PhoneNumber
object
​string · enum · required
Enum values:
phone_number
id
​string · required
phone
​string | null · required
verifiedName
​string | null · required
label
​string | null · required

Your own name for the number, such as the branch it serves.

catalogId
​string | null · required

The id of the Meta catalog connected to this number. The product, product_list and catalog messages and the catalog templates only send with this catalog. null when none is set.

agentId
​string | null · required
active
​boolean · required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
PATCH/v2/whatsapp/phone-numbers/{id}
curl https://api.lelemon.cl/v2/whatsapp/phone-numbers/:id \ --request PATCH \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "agentId": "agt_02y0e5MANqacVbmtn1YyeJ", "active": true, "label": "Sucursal Centro", "catalogId": "1234567890" }'
Example Request Body
{ "agentId": "agt_02y0e5MANqacVbmtn1YyeJ", "active": true, "label": "Sucursal Centro", "catalogId": "1234567890" }
json
application/json
Example Responses
{ "object": "phone_number", "id": "pn_4Zq0x8bVw1TqS9mYp3RkLd", "phone": "+56 9 1234 5678", "verifiedName": "Cafe Central", "label": "Sucursal Centro", "catalogId": "1234567890", "agentId": "agt_4Zq0x8bVw1TqS9mYp3RkLd", "active": true, "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" }
json
application/json

Read the cart and catalog settings of a number

GET
https://api.lelemon.cl
/v2/whatsapp/phone-numbers/{id}/commerce-settings
Bearer (API key)

Use it before sending product, product_list or catalog messages to know whether the cart button (isCartEnabled) and the catalog icon (isCatalogVisible) are on, and which catalog the number has (catalogId). Read only and safe to repeat. It asks WhatsApp through the provider, so it answers 503 service_unavailable when the provider does not answer. 404 not_found when the id does not exist or belongs to another organization.

Required scope: whatsapp:read.

Read the cart and catalog settings of a number › path Parameters

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

The id of the phone number (pn_…).

Read the cart and catalog settings of a number › 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.

Read the cart and catalog settings of a number › Responses

CommerceSettings
object
​string · enum · required
Enum values:
commerce_settings
phoneNumberId
​string · required
isCartEnabled
​boolean · required

Whether the cart button shows on the product and catalog messages. WhatsApp turns it on by default.

isCatalogVisible
​boolean · required

Whether the catalog icon shows in the chat with the number. WhatsApp turns it off by default.

catalogId
​string | null · required

The catalog set on the number, if any.

GET/v2/whatsapp/phone-numbers/{id}/commerce-settings
curl https://api.lelemon.cl/v2/whatsapp/phone-numbers/:id/commerce-settings \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "commerce_settings", "phoneNumberId": "pn_4Zq0x8bVw1TqS9mYp3RkLd", "isCartEnabled": true, "isCatalogVisible": true, "catalogId": "1234567890" }
json
application/json

Turn the cart button or the catalog icon of a number on or off

PATCH
https://api.lelemon.cl
/v2/whatsapp/phone-numbers/{id}/commerce-settings
Bearer (API key)

Use it to show or hide the cart button (isCartEnabled) and the catalog icon in the chat (isCatalogVisible) of one number. Only the fields you send change, and the call is idempotent. It does not connect a catalog: the catalog is created in Meta Commerce Manager and connected in WhatsApp Manager, then you save its id with PATCH /v2/whatsapp/phone-numbers/{id} (catalogId). It writes to WhatsApp through the provider, so it answers 503 service_unavailable when the provider does not accept it.

Required scope: whatsapp:write.

Turn the cart button or the catalog icon of a number on or off › path Parameters

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

The id of the phone number (pn_…).

Turn the cart button or the catalog icon of a number on or off › 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.

Turn the cart button or the catalog icon of a number on or off › Request Body optional

UpdateCommerceSettings
isCartEnabled
​boolean

true shows the cart button; false hides it.

isCatalogVisible
​boolean

true shows the catalog icon in the chat; false hides it.

Turn the cart button or the catalog icon of a number on or off › Responses

CommerceSettings
object
​string · enum · required
Enum values:
commerce_settings
phoneNumberId
​string · required
isCartEnabled
​boolean · required

Whether the cart button shows on the product and catalog messages. WhatsApp turns it on by default.

isCatalogVisible
​boolean · required

Whether the catalog icon shows in the chat with the number. WhatsApp turns it off by default.

catalogId
​string | null · required

The catalog set on the number, if any.

PATCH/v2/whatsapp/phone-numbers/{id}/commerce-settings
curl https://api.lelemon.cl/v2/whatsapp/phone-numbers/:id/commerce-settings \ --request PATCH \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "isCartEnabled": true, "isCatalogVisible": true }'
Example Request Body
{ "isCartEnabled": true, "isCatalogVisible": true }
json
application/json
Example Responses
{ "object": "commerce_settings", "phoneNumberId": "pn_4Zq0x8bVw1TqS9mYp3RkLd", "isCartEnabled": true, "isCatalogVisible": true, "catalogId": "1234567890" }
json
application/json

SubaccountsActions