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

Actions


List actions

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

The actions you registered, newest first. It does not include Lelemon tools or MCP tools: see GET /v2/agents/{id}/tools for what an agent can use.

Required scope: actions:read.

List actions › 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 actions › 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 actions › Responses

ActionList
object
​string · enum · required
Enum values:
list
hasMore
​boolean · required
nextCursor
​string | null · required
​Action[] · required
GET/v2/actions
curl https://api.lelemon.cl/v2/actions \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "list", "hasMore": true, "nextCursor": "nextCursor", "data": [ { "object": "action", "id": "act_5RvP2aKq9XwLmN3tYbZc01", "name": "create_order", "description": "description", "request": { "method": "GET", "origin": "https://api.mesa.cl", "headerNames": [ "string" ], "timeoutMs": 0 }, "input": {}, "audience": "all", "noPersist": true, "sharedWithSubaccounts": true, "variables": [ { "name": "session_id", "source": "lelemon", "variable": "case.id", "field": "rut_comprador", "optional": true } ], "authorization": { "purpose": "purpose", "destinationCountry": "chile", "version": "2026-09-1", "acceptedAt": "2024-08-25T15:00:00Z", "confirmedTransferOutsideChile": true, "dataSent": [ "string" ] }, "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" } ] }
json
application/json

Create an action

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

Registers an HTTP endpoint of yours that agents can call. The URL must be public and its site must be allowed for this key (an administrator adds sites to the key). Credentials go in request.headers: they are stored encrypted and never returned. Nothing can use the action until you grant it to an agent with PUT /v2/agents/{id}/tools/{toolId}. The URL is called exactly as written: a placeholder such as {id} is rejected with 400 (param request.url); what the agent must fill goes in input (query for GET, body otherwise). Optional authorization block records the purpose and where the system is hosted (Law 21.719): read the text with GET /v2/actions/authorization. Use dryRun=true to run the same checks (name, site allowed for the key, destination, input, authorization) and get 200 with the action as it would be saved, without saving it; its id is not saved.

Required scope: actions:write.

Create an action › 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.

Create an action › 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 an action › Request Body

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

What the agent calls it: lowercase letters, digits and underscores, starting with a letter. It cannot change later.

description
​string · minLength: 1 · maxLength: 2000 · required

When to use it. The agent reads this to decide.

​ActionRequestInput · required
​object · required

JSON Schema of what the agent must send: type "object" with properties. The agent fills it in; for GET it goes in the query, otherwise in the body.

audience
​string · enum

Which agents may be granted it: all, or customers (only agents that talk to the public).

Enum values:
all
customers
Default: all
noPersist
​boolean

When true, what this action returns lives only in the turn that called it. It is not kept in the tool memory between turns, in the execution trace, in approval requests or in run steps. The agent still uses it to answer. Consequences: the action cannot be replayed from a stored result, and a run interrupted in the middle of a round that called it fails instead of resuming. The provider (Bedrock) still receives the content as part of the prompt of that turn.

Default: false
sharedWithSubaccounts
​boolean

Platforms only. When true, every subaccount of yours can grant this action to its own agents. The action keeps living in your organization: calls to it are signed with your signing secret and carry the Lelemon-Subaccount-Id of the subaccount that made the call. Subaccounts cannot read, change or delete it. Turning it off, or deleting the action, removes it from the agents of your subaccounts. Its name cannot match an action that one of your subaccounts already has.

Default: false
​ActionVariableInput[] · maxItems: 20

Fields Lelemon fills when it makes the call, not the agent: the agent does not see them and cannot invent them. They go in the query for GET and in the body otherwise. If Lelemon does not have the value, the field is left out.

​object

The authorization to send personal data to your system (article 15 bis of Law 21.719): purpose, where it is hosted and the accepted text version. Optional as a block, but if you send it, send all of it. Without it the action is saved anyway, and it can be added later with PATCH.

Create an action › Responses

dryRun=true: the action as it would be saved.

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:
action
id
​string · required
name
​string · required
description
​string · required
​ActionRequest · required
​object · required
audience
​string · enum · required
Enum values:
all
customers
internal
noPersist
​boolean · required

When true, what this action returns lives only in the turn that called it. It is not kept in the tool memory between turns, in the execution trace, in approval requests or in run steps. The agent still uses it to answer. Consequences: the action cannot be replayed from a stored result, and a run interrupted in the middle of a round that called it fails instead of resuming. The provider (Bedrock) still receives the content as part of the prompt of that turn.

sharedWithSubaccounts
​boolean · required

Platforms only. When true, every subaccount of yours can grant this action to its own agents. The action keeps living in your organization: calls to it are signed with your signing secret and carry the Lelemon-Subaccount-Id of the subaccount that made the call. Subaccounts cannot read, change or delete it. Turning it off, or deleting the action, removes it from the agents of your subaccounts. Its name cannot match an action that one of your subaccounts already has.

​ActionVariable[] · required

The fields Lelemon fills on every call. Empty when there are none.

​required

The authorization in force for the destination of this action: what you accepted when you created it or last changed its destination. null when there is none, for example after the destination changed and was not authorized again, and always null on an action shared by your platform.

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

Present and true when the request had dryRun=true.

Const value:
POST/v2/actions
curl https://api.lelemon.cl/v2/actions \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "name": "create_order", "description": "Create an order when the customer confirms what they want to buy.", "request": { "method": "POST", "url": "https://api.mesa.cl/lelemon/orders", "headers": { "Authorization": "Bearer your-secret" }, "timeoutMs": 10000 }, "input": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "string" } } } }, "audience": "customers" }'
Example Request Body
{ "name": "create_order", "description": "Create an order when the customer confirms what they want to buy.", "request": { "method": "POST", "url": "https://api.mesa.cl/lelemon/orders", "headers": { "Authorization": "Bearer your-secret" }, "timeoutMs": 10000 }, "input": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "items": { "type": "string" } } } }, "audience": "customers" }
json
application/json
Example Responses
{ "object": "action", "id": "act_5RvP2aKq9XwLmN3tYbZc01", "name": "create_order", "description": "description", "request": { "method": "GET", "origin": "https://api.mesa.cl", "headerNames": [ "string" ], "timeoutMs": 0 }, "input": {}, "audience": "all", "noPersist": true, "sharedWithSubaccounts": true, "variables": [ { "name": "session_id", "source": "lelemon", "variable": "case.id", "field": "rut_comprador", "optional": true } ], "authorization": { "purpose": "purpose", "destinationCountry": "chile", "version": "2026-09-1", "acceptedAt": "2024-08-25T15:00:00Z", "confirmedTransferOutsideChile": true, "dataSent": [ "string" ] }, "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z", "dryRun": true }
json
application/json

Read the current authorization text

GET
https://api.lelemon.cl
/v2/actions/authorization
Bearer (API key)

The text you accept when an action sends personal data to your system (article 15 bis of Law 21.719), its version and the extra confirmation for a system outside Chile. Read it before sending authorization in POST /v2/actions or PATCH /v2/actions/{id}; when the text changes, the version changes and old versions are refused. Read only.

Required scope: actions:read.

Read the current authorization text › 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 current authorization text › Responses

ActionAuthorization
object
​string · enum · required
Enum values:
action_authorization
version
​string · required

The version to send as authorization.version.

text
​string · required

The authorization to deliver data to your system (article 15 bis of Law 21.719), which you accept every time.

detail
​string · required

What the text means in practice.

​object · required

The extra confirmation for a system outside Chile. Accept it with authorization.confirmsTransferOutsideChile.

countries
​string[] · required
Enum values:
chile
outside_chile
unknown
GET/v2/actions/authorization
curl https://api.lelemon.cl/v2/actions/authorization \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "action_authorization", "version": "2026-09-1", "text": "text", "detail": "detail", "outsideChile": { "version": "2026-09-1", "text": "text" }, "countries": [ "chile" ] }
json
application/json

Rotate the signing secret of your actions

POST
https://api.lelemon.cl
/v2/actions/signing-secret/rotate
Bearer (API key)

Every call of an action to your system carries a Lelemon-Signature header and the turn context (case, contact, subaccount, actor). The secret behind it belongs to your organization and each action gets its own, derived from it. This creates a new one: the previous keeps signing alongside the new one for 24 hours, so you can change the secrets in your systems without a cut. Every call rotates again, and the secret of the earlier rotation stops being listed: send an Idempotency-Key so a retry does not rotate twice. The response does not carry any secret: read each one with GET /v2/actions/{id}/signing-secret. Use dryRun=true to see when the previous secret would stop working; nothing rotates.

Required scope: actions:write.

Rotate the signing secret of your actions › 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.

Rotate the signing secret of your actions › 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.

Rotate the signing secret of your actions › Responses

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:
action_signing_secret_rotation
rotatedAt
​string · date-time · required
previousValidUntil
​string · date-time · required

Until when calls signed with the previous secret still verify. Read the new secret of each action with GET /v2/actions/{id}/signing-secret.

dryRun
​boolean · const

Present and true when the request had dryRun=true.

Const value:
POST/v2/actions/signing-secret/rotate
curl https://api.lelemon.cl/v2/actions/signing-secret/rotate \ --request POST \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "action_signing_secret_rotation", "rotatedAt": "2024-08-25T15:00:00Z", "previousValidUntil": "2024-08-25T15:00:00Z", "dryRun": true }
json
application/json

Retrieve the signing secret of an action

GET
https://api.lelemon.cl
/v2/actions/{id}/signing-secret
Bearer (API key)

Use it to verify that a call to your system comes from Lelemon: pass the whole secrets list, the raw body and the full URL to verifyRequest of the SDK. It needs actions:write because it is a secret. Read only; calling it again returns the same secrets until you rotate. The Test an action endpoint does not sign: only calls made in a turn do.

Required scope: actions:write.

Retrieve the signing secret of an action › path Parameters

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

The id of the action (act_…).

Retrieve the signing secret of an action › 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 the signing secret of an action › Responses

ActionSigningSecret
object
​string · enum · required
Enum values:
action_signing_secret
actionId
​string · required
secrets
​string[] · required

The secrets that sign the calls of this action, newest first. After a rotation the previous one is still listed for 24 hours: pass the whole list to verifyRequest. Each action has its own secret, derived from the one of your organization, so share it only with the system that serves that action.

previousValidUntil
​string · date-time

When the previous secret stops being listed. Absent when there is no previous secret.

GET/v2/actions/{id}/signing-secret
curl https://api.lelemon.cl/v2/actions/:id/signing-secret \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "action_signing_secret", "actionId": "act_4Zq0x8bVw1TqS9mYp3RkLd", "secrets": [ "lelsig_bX3k..." ], "previousValidUntil": "2024-08-25T15:00:00Z" }
json
application/json

Retrieve an action

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

Returns one action 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: actions:read.

Retrieve an action › path Parameters

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

The id of the action (act_…).

Retrieve an action › 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 an action › Responses

Action
object
​string · enum · required
Enum values:
action
id
​string · required
name
​string · required
description
​string · required
​ActionRequest · required
​object · required
audience
​string · enum · required
Enum values:
all
customers
internal
noPersist
​boolean · required

When true, what this action returns lives only in the turn that called it. It is not kept in the tool memory between turns, in the execution trace, in approval requests or in run steps. The agent still uses it to answer. Consequences: the action cannot be replayed from a stored result, and a run interrupted in the middle of a round that called it fails instead of resuming. The provider (Bedrock) still receives the content as part of the prompt of that turn.

sharedWithSubaccounts
​boolean · required

Platforms only. When true, every subaccount of yours can grant this action to its own agents. The action keeps living in your organization: calls to it are signed with your signing secret and carry the Lelemon-Subaccount-Id of the subaccount that made the call. Subaccounts cannot read, change or delete it. Turning it off, or deleting the action, removes it from the agents of your subaccounts. Its name cannot match an action that one of your subaccounts already has.

​ActionVariable[] · required

The fields Lelemon fills on every call. Empty when there are none.

​required

The authorization in force for the destination of this action: what you accepted when you created it or last changed its destination. null when there is none, for example after the destination changed and was not authorized again, and always null on an action shared by your platform.

createdAt
​string · date-time · required
updatedAt
​string · date-time · required
GET/v2/actions/{id}
curl https://api.lelemon.cl/v2/actions/:id \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "action", "id": "act_5RvP2aKq9XwLmN3tYbZc01", "name": "create_order", "description": "description", "request": { "method": "GET", "origin": "https://api.mesa.cl", "headerNames": [ "string" ], "timeoutMs": 0 }, "input": {}, "audience": "all", "noPersist": true, "sharedWithSubaccounts": true, "variables": [ { "name": "session_id", "source": "lelemon", "variable": "case.id", "field": "rut_comprador", "optional": true } ], "authorization": { "purpose": "purpose", "destinationCountry": "chile", "version": "2026-09-1", "acceptedAt": "2024-08-25T15:00:00Z", "confirmedTransferOutsideChile": true, "dataSent": [ "string" ] }, "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" }
json
application/json

Delete an action

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

Also removes it from every agent that had it. The name stays reserved: creating an action with the same name again brings this one back with what you send.

Required scope: actions:write.

Delete an action › path Parameters

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

The id of the action (act_…).

Delete an action › 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 an action › Responses

Deleted.

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

Update an action

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

Changes only what you send. request is merged field by field; input replaces the whole schema. The name cannot change. Use dryRun=true to run the same checks and get the action as it would be saved, without saving it.

Required scope: actions:write.

Update an action › path Parameters

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

The id of the action (act_…).

Update an action › 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.

Update an action › 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 an action › Request Body optional

UpdateAction
description
​string · minLength: 1 · maxLength: 2000
​object

Merged into the current request, field by field.

​object

Replaces the whole input schema.

noPersist
​boolean

When true, what this action returns lives only in the turn that called it. It is not kept in the tool memory between turns, in the execution trace, in approval requests or in run steps. The agent still uses it to answer. Consequences: the action cannot be replayed from a stored result, and a run interrupted in the middle of a round that called it fails instead of resuming. The provider (Bedrock) still receives the content as part of the prompt of that turn.

sharedWithSubaccounts
​boolean

Platforms only. When true, every subaccount of yours can grant this action to its own agents. The action keeps living in your organization: calls to it are signed with your signing secret and carry the Lelemon-Subaccount-Id of the subaccount that made the call. Subaccounts cannot read, change or delete it. Turning it off, or deleting the action, removes it from the agents of your subaccounts. Its name cannot match an action that one of your subaccounts already has.

​ActionVariableInput[] · maxItems: 20

Replaces the whole list; omit it to keep the current one and send [] to remove them. Fields Lelemon fills when it makes the call, not the agent: the agent does not see them and cannot invent them. They go in the query for GET and in the body otherwise. If Lelemon does not have the value, the field is left out.

​object

Registers or renews the authorization to send data to your system. Needed again when you change the destination site or where it is hosted.

Update an action › Responses

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:
action
id
​string · required
name
​string · required
description
​string · required
​ActionRequest · required
​object · required
audience
​string · enum · required
Enum values:
all
customers
internal
noPersist
​boolean · required

When true, what this action returns lives only in the turn that called it. It is not kept in the tool memory between turns, in the execution trace, in approval requests or in run steps. The agent still uses it to answer. Consequences: the action cannot be replayed from a stored result, and a run interrupted in the middle of a round that called it fails instead of resuming. The provider (Bedrock) still receives the content as part of the prompt of that turn.

sharedWithSubaccounts
​boolean · required

Platforms only. When true, every subaccount of yours can grant this action to its own agents. The action keeps living in your organization: calls to it are signed with your signing secret and carry the Lelemon-Subaccount-Id of the subaccount that made the call. Subaccounts cannot read, change or delete it. Turning it off, or deleting the action, removes it from the agents of your subaccounts. Its name cannot match an action that one of your subaccounts already has.

​ActionVariable[] · required

The fields Lelemon fills on every call. Empty when there are none.

​required

The authorization in force for the destination of this action: what you accepted when you created it or last changed its destination. null when there is none, for example after the destination changed and was not authorized again, and always null on an action shared by your platform.

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

Present and true when the request had dryRun=true.

Const value:
PATCH/v2/actions/{id}
curl https://api.lelemon.cl/v2/actions/:id \ --request PATCH \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "description": "Create an order once the customer confirms the items.", "request": { "timeoutMs": 15000 } }'
Example Request Body
{ "description": "Create an order once the customer confirms the items.", "request": { "timeoutMs": 15000 } }
json
application/json
Example Responses
{ "object": "action", "id": "act_5RvP2aKq9XwLmN3tYbZc01", "name": "create_order", "description": "description", "request": { "method": "GET", "origin": "https://api.mesa.cl", "headerNames": [ "string" ], "timeoutMs": 0 }, "input": {}, "audience": "all", "noPersist": true, "sharedWithSubaccounts": true, "variables": [ { "name": "session_id", "source": "lelemon", "variable": "case.id", "field": "rut_comprador", "optional": true } ], "authorization": { "purpose": "purpose", "destinationCountry": "chile", "version": "2026-09-1", "acceptedAt": "2024-08-25T15:00:00Z", "confirmedTransferOutsideChile": true, "dataSent": [ "string" ] }, "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z", "dryRun": true }
json
application/json

Test an action

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

Calls your endpoint once with the sample input, the way an agent would, but without an agent. The answer is the status and the body your endpoint returned, cut at 4000 characters and with your credential hidden. A refused destination is a 400; an endpoint that does not answer is a 200 with ok false. At most 10 tests per minute per organization. Note that it really calls your endpoint: use sample data when the action writes.

Required scope: actions:write.

Test an action › path Parameters

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

The id of the action (act_…).

Test an action › 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.

Test an action › Request Body optional

TestAction
​object

Sample input, as the agent would send it. For GET it goes in the query, otherwise in the body.

Test an action › Responses

ActionTest
object
​string · enum · required
Enum values:
action_test
ok
​boolean · required

True when your endpoint answered with a 2xx status.

durationMs
​integer · required
body
​string · required

What your endpoint answered, cut at 4000 characters, with your credential hidden.

truncated
​boolean · required
status
​integer

Absent when your endpoint did not answer.

failure
​string · enum
Enum values:
timeout
unreachable
POST/v2/actions/{id}/test
curl https://api.lelemon.cl/v2/actions/:id/test \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "input": { "items": [ "2 coffees" ] } }'
Example Request Body
{ "input": { "items": [ "2 coffees" ] } }
json
application/json
Example Responses
{ "object": "action_test", "ok": true, "status": 0, "durationMs": 0, "body": "body", "truncated": true, "failure": "timeout" }
json
application/json

Read the approval floor of a shared action

GET
https://api.lelemon.cl
/v2/actions/{id}/approval-floor
Bearer (API key)

The minimum approval your platform set for a shared action, or mode never when there is none. Subaccounts that use the action cannot go below it. Read only and safe to repeat.

Required scope: actions:read.

Read the approval floor of a shared action › path Parameters

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

The id of the action (act_…).

Read the approval floor of a shared action › 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 approval floor of a shared action › Responses

ApprovalPolicy
mode
​string · enum · required

never: the agent runs the action without approval. always: every call waits for a person. when: only the calls that meet condition, or that pass accumulated, wait. rules: the ordered list in rules decides each call; the first rule that applies wins.

Enum values:
never
always
when
rules
​ApprovalCondition

Only for mode when. A comparison {param, op, value} with op eq, ne, gt, gte, lt, lte, in (value is a list) or exists (no value), or a group {all: [...]} or {any: [...]}. Up to 3 levels and 10 comparisons. If the argument is missing or has another type the call needs approval. param is a path into the arguments of the action, like amount or order.total.

​ApprovalRule[] · maxItems: 20

Only for mode rules. Evaluated in order for every call: the first rule whose when applies decides, and the rest are not read. A rule without when applies to every call and has to be last. If no rule applies the call runs, so end with a rule that has no when to choose the default. Use it for a hard cap ("above X, reject"), or for steps by amount ("up to X a supervisor decides, above X the management"). A platform floor and accumulated still apply on top: a rule can never run an action the floor sends to a person.

​AccumulatedLimit
​Approver[] · maxItems: 20

Who may decide. Without it: owners and admins. A role includes the roles above it: admin also lets owners decide. An API key decides only if it is named here.

expiresInMinutes
​integer · min: 1 · max: 43200

Minutes to decide. Past it the request expires, the action never runs and the agent tells the person.

Default: 1440
escalateAfterMinutes
​integer · min: 1 · max: 43200

Minutes after which a pending request escalates: approval.escalated fires once. Less than expiresInMinutes.

customerMessage
​string · maxLength: 500

What the agent tells the person while it waits. Without it a neutral Spanish text is used.

automatedDecision
​boolean

True when the action makes an automated decision about a person (Ley 21.719, art. 8 bis). It works with any mode. Every call leaves a record with the data it used and a reasonCode: an approval when a person decides, an automated decision (GET /v2/automated-decisions) when no one was asked or a rule rejected it. The person can ask for a human review of either.

GET/v2/actions/{id}/approval-floor
curl https://api.lelemon.cl/v2/actions/:id/approval-floor \ --header 'Authorization: Bearer <token>'
Example Responses
{ "mode": "never", "condition": { "param": "amount", "op": "eq", "value": {} }, "rules": [ { "when": { "param": "amount", "op": "eq", "value": {} }, "effect": "allow", "approvers": [ { "type": "role", "value": "admin" } ], "expiresInMinutes": 1, "escalateAfterMinutes": 1, "customerMessage": "customerMessage" } ], "accumulated": { "param": "amount", "period": "day", "limit": 50000 }, "approvers": [ { "type": "role", "value": "admin" } ], "expiresInMinutes": 1440, "escalateAfterMinutes": 1, "customerMessage": "customerMessage", "automatedDecision": true }
json
application/json

Set the approval floor of a shared action

PUT
https://api.lelemon.cl
/v2/actions/{id}/approval-floor
Bearer (API key)

Only a platform, and only on an action shared with its subaccounts. The floor is the least approval any subaccount can run the action with: a call that meets it waits for the approvers you name here, whatever the policy of the subaccount says, and a subaccount cannot grant the action with mode never. The policy of the subaccount still applies on top, and the stricter one wins. Replaces the whole floor; mode never removes it. Idempotent.

Required scope: actions:write.

Set the approval floor of a shared action › path Parameters

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

The id of the action (act_…).

Set the approval floor of a shared action › 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.

Set the approval floor of a shared action › Request Body

ApprovalPolicy
mode
​string · enum · required

never: the agent runs the action without approval. always: every call waits for a person. when: only the calls that meet condition, or that pass accumulated, wait. rules: the ordered list in rules decides each call; the first rule that applies wins.

Enum values:
never
always
when
rules
​ApprovalCondition

Only for mode when. A comparison {param, op, value} with op eq, ne, gt, gte, lt, lte, in (value is a list) or exists (no value), or a group {all: [...]} or {any: [...]}. Up to 3 levels and 10 comparisons. If the argument is missing or has another type the call needs approval. param is a path into the arguments of the action, like amount or order.total.

​ApprovalRule[] · maxItems: 20

Only for mode rules. Evaluated in order for every call: the first rule whose when applies decides, and the rest are not read. A rule without when applies to every call and has to be last. If no rule applies the call runs, so end with a rule that has no when to choose the default. Use it for a hard cap ("above X, reject"), or for steps by amount ("up to X a supervisor decides, above X the management"). A platform floor and accumulated still apply on top: a rule can never run an action the floor sends to a person.

​AccumulatedLimit
​Approver[] · maxItems: 20

Who may decide. Without it: owners and admins. A role includes the roles above it: admin also lets owners decide. An API key decides only if it is named here.

expiresInMinutes
​integer · min: 1 · max: 43200

Minutes to decide. Past it the request expires, the action never runs and the agent tells the person.

Default: 1440
escalateAfterMinutes
​integer · min: 1 · max: 43200

Minutes after which a pending request escalates: approval.escalated fires once. Less than expiresInMinutes.

customerMessage
​string · maxLength: 500

What the agent tells the person while it waits. Without it a neutral Spanish text is used.

automatedDecision
​boolean

True when the action makes an automated decision about a person (Ley 21.719, art. 8 bis). It works with any mode. Every call leaves a record with the data it used and a reasonCode: an approval when a person decides, an automated decision (GET /v2/automated-decisions) when no one was asked or a rule rejected it. The person can ask for a human review of either.

Set the approval floor of a shared action › Responses

ApprovalPolicy
mode
​string · enum · required

never: the agent runs the action without approval. always: every call waits for a person. when: only the calls that meet condition, or that pass accumulated, wait. rules: the ordered list in rules decides each call; the first rule that applies wins.

Enum values:
never
always
when
rules
​ApprovalCondition

Only for mode when. A comparison {param, op, value} with op eq, ne, gt, gte, lt, lte, in (value is a list) or exists (no value), or a group {all: [...]} or {any: [...]}. Up to 3 levels and 10 comparisons. If the argument is missing or has another type the call needs approval. param is a path into the arguments of the action, like amount or order.total.

​ApprovalRule[] · maxItems: 20

Only for mode rules. Evaluated in order for every call: the first rule whose when applies decides, and the rest are not read. A rule without when applies to every call and has to be last. If no rule applies the call runs, so end with a rule that has no when to choose the default. Use it for a hard cap ("above X, reject"), or for steps by amount ("up to X a supervisor decides, above X the management"). A platform floor and accumulated still apply on top: a rule can never run an action the floor sends to a person.

​AccumulatedLimit
​Approver[] · maxItems: 20

Who may decide. Without it: owners and admins. A role includes the roles above it: admin also lets owners decide. An API key decides only if it is named here.

expiresInMinutes
​integer · min: 1 · max: 43200

Minutes to decide. Past it the request expires, the action never runs and the agent tells the person.

Default: 1440
escalateAfterMinutes
​integer · min: 1 · max: 43200

Minutes after which a pending request escalates: approval.escalated fires once. Less than expiresInMinutes.

customerMessage
​string · maxLength: 500

What the agent tells the person while it waits. Without it a neutral Spanish text is used.

automatedDecision
​boolean

True when the action makes an automated decision about a person (Ley 21.719, art. 8 bis). It works with any mode. Every call leaves a record with the data it used and a reasonCode: an approval when a person decides, an automated decision (GET /v2/automated-decisions) when no one was asked or a rule rejected it. The person can ask for a human review of either.

PUT/v2/actions/{id}/approval-floor
curl https://api.lelemon.cl/v2/actions/:id/approval-floor \ --request PUT \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "mode": "when", "condition": { "param": "amount", "op": "gt", "value": 20000 }, "approvers": [ { "type": "role", "value": "admin" } ], "expiresInMinutes": 60 }'
Example Request Body
{ "mode": "when", "condition": { "param": "amount", "op": "gt", "value": 20000 }, "approvers": [ { "type": "role", "value": "admin" } ], "expiresInMinutes": 60 }
json
application/json
Example Responses
{ "mode": "never", "condition": { "param": "amount", "op": "eq", "value": {} }, "rules": [ { "when": { "param": "amount", "op": "eq", "value": {} }, "effect": "allow", "approvers": [ { "type": "role", "value": "admin" } ], "expiresInMinutes": 1, "escalateAfterMinutes": 1, "customerMessage": "customerMessage" } ], "accumulated": { "param": "amount", "period": "day", "limit": 50000 }, "approvers": [ { "type": "role", "value": "admin" } ], "expiresInMinutes": 1440, "escalateAfterMinutes": 1, "customerMessage": "customerMessage", "automatedDecision": true }
json
application/json

WhatsAppMCP servers