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

MCP servers


List MCP servers

GET
https://api.lelemon.cl
/v2/mcp-servers
Bearer (API key)

Newest first, without their tools.

Required scope: actions:read.

List MCP servers › 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 MCP servers › 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 MCP servers › Responses

McpServerList
object
​string · enum · required
Enum values:
list
hasMore
​boolean · required
nextCursor
​string | null · required
​McpServer[] · required
GET/v2/mcp-servers
curl https://api.lelemon.cl/v2/mcp-servers \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "list", "hasMore": true, "nextCursor": "nextCursor", "data": [ { "object": "mcp_server", "id": "mcp_02y0e5MANqacVbmtn1YyeJ", "name": "name", "origin": "https://mcp.mesa.cl", "status": "connected", "authType": "none", "toolCount": 0, "noPersist": true, "sharedWithSubaccounts": true, "sharedByPlatform": true, "lastError": "lastError", "lastDiscoveryAt": "2024-08-25T15:00:00Z", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" } ] }
json
application/json

Connect an MCP server

POST
https://api.lelemon.cl
/v2/mcp-servers
Bearer (API key)

Connects a Streamable HTTP MCP server and asks it for its tools right away. The URL must be public and its site must be allowed for this key, the same list actions use. The connection is made to the address that was checked and redirects are not followed, so a server that redirects to an internal address is rejected. If the server does not answer, nothing is saved and the answer is 422 mcp_server_unreachable. Grant its tools to agents with PUT /v2/agents/{id}/tools/{toolId}.

Required scope: actions:write.

Connect an MCP server › 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.

Connect an MCP server › Request Body

ConnectMcpServer
name
​string · minLength: 1 · maxLength: 128 · required

How you see it. Its lowercase form prefixes every tool name the agent sees, so it cannot repeat or start like another server.

url
​string · minLength: 1 · maxLength: 2048 · required

A public http or https URL of a Streamable HTTP MCP server. It never comes back in a response, only its origin. Redirects are not followed.

​object

Defaults to none. OAuth servers are connected from the dashboard.

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, your subaccounts can grant the tools of this server to their agents but cannot change it. Turning it off, or deleting the server, removes the tools from their agents.

Default: false

Connect an MCP server › Responses

McpServerWithTools
object
​string · enum · required
Enum values:
mcp_server
id
​string · required
name
​string · required
origin
​string · required

Only the origin. The path and query may hold a secret.

status
​string · enum · required

connected: the last discovery worked, the last tool call was answered and its tools can be granted. error: the last discovery or the last tool call failed; lastError says which. inactive: not connected.

Enum values:
connected
error
inactive
authType
​string · enum · required
Enum values:
none
bearer
api_key
oauth2
toolCount
​integer · required
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, your subaccounts can grant the tools of this server to their agents but cannot change it. Turning it off, or deleting the server, removes the tools from their agents.

lastError
​string | null · required
lastDiscoveryAt
​string | null · date-time · required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
​McpTool[] · required

What the last discovery found.

sharedByPlatform
​boolean

True when your platform shares this server with you: you can grant its tools, not change it. Absent on your own servers.

POST/v2/mcp-servers
curl https://api.lelemon.cl/v2/mcp-servers \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "name": "Mesa menu", "url": "https://mcp.mesa.cl", "auth": { "type": "bearer", "token": "your-secret" } }'
Example Request Body
{ "name": "Mesa menu", "url": "https://mcp.mesa.cl", "auth": { "type": "bearer", "token": "your-secret" } }
json
application/json
Example Responses
{ "object": "mcp_server", "id": "mcp_02y0e5MANqacVbmtn1YyeJ", "name": "name", "origin": "https://mcp.mesa.cl", "status": "connected", "authType": "none", "toolCount": 0, "noPersist": true, "sharedWithSubaccounts": true, "sharedByPlatform": true, "lastError": "lastError", "lastDiscoveryAt": "2024-08-25T15:00:00Z", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z", "tools": [ { "object": "mcp_tool", "id": "mtl_6Tn3XqLmN3tYbZc01aKq9R", "name": "get_menu", "description": "description", "inputSchema": {}, "readOnly": true } ] }
json
application/json

Retrieve an MCP server

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

Includes the tools found by the last discovery.

Required scope: actions:read.

Retrieve an MCP server › path Parameters

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

The id of the mcp server (mcp_…).

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

McpServerWithTools
object
​string · enum · required
Enum values:
mcp_server
id
​string · required
name
​string · required
origin
​string · required

Only the origin. The path and query may hold a secret.

status
​string · enum · required

connected: the last discovery worked, the last tool call was answered and its tools can be granted. error: the last discovery or the last tool call failed; lastError says which. inactive: not connected.

Enum values:
connected
error
inactive
authType
​string · enum · required
Enum values:
none
bearer
api_key
oauth2
toolCount
​integer · required
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, your subaccounts can grant the tools of this server to their agents but cannot change it. Turning it off, or deleting the server, removes the tools from their agents.

lastError
​string | null · required
lastDiscoveryAt
​string | null · date-time · required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
​McpTool[] · required

What the last discovery found.

sharedByPlatform
​boolean

True when your platform shares this server with you: you can grant its tools, not change it. Absent on your own servers.

GET/v2/mcp-servers/{id}
curl https://api.lelemon.cl/v2/mcp-servers/:id \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "mcp_server", "id": "mcp_02y0e5MANqacVbmtn1YyeJ", "name": "name", "origin": "https://mcp.mesa.cl", "status": "connected", "authType": "none", "toolCount": 0, "noPersist": true, "sharedWithSubaccounts": true, "sharedByPlatform": true, "lastError": "lastError", "lastDiscoveryAt": "2024-08-25T15:00:00Z", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z", "tools": [ { "object": "mcp_tool", "id": "mtl_6Tn3XqLmN3tYbZc01aKq9R", "name": "get_menu", "description": "description", "inputSchema": {}, "readOnly": true } ] }
json
application/json

Disconnect an MCP server

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

Removes its tools from every agent that had them, then disconnects the server.

Required scope: actions:write.

Disconnect an MCP server › path Parameters

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

The id of the mcp server (mcp_…).

Disconnect an MCP server › 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 an MCP server › Responses

Disconnected.

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

Update an MCP server

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

Changes only what you send. A new url or auth discovers the tools again; if that fails the server stays with status error. Servers connected by OAuth are reconnected from the dashboard.

Required scope: actions:write.

Update an MCP server › path Parameters

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

The id of the mcp server (mcp_…).

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

UpdateMcpServer
name
​string · minLength: 1 · maxLength: 128
url
​string · minLength: 1 · maxLength: 2048

Changing it discovers the tools again.

​object

Replaces the credentials and discovers the tools again.

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, your subaccounts can grant the tools of this server to their agents but cannot change it. Turning it off, or deleting the server, removes the tools from their agents.

Update an MCP server › Responses

McpServerWithTools
object
​string · enum · required
Enum values:
mcp_server
id
​string · required
name
​string · required
origin
​string · required

Only the origin. The path and query may hold a secret.

status
​string · enum · required

connected: the last discovery worked, the last tool call was answered and its tools can be granted. error: the last discovery or the last tool call failed; lastError says which. inactive: not connected.

Enum values:
connected
error
inactive
authType
​string · enum · required
Enum values:
none
bearer
api_key
oauth2
toolCount
​integer · required
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, your subaccounts can grant the tools of this server to their agents but cannot change it. Turning it off, or deleting the server, removes the tools from their agents.

lastError
​string | null · required
lastDiscoveryAt
​string | null · date-time · required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
​McpTool[] · required

What the last discovery found.

sharedByPlatform
​boolean

True when your platform shares this server with you: you can grant its tools, not change it. Absent on your own servers.

PATCH/v2/mcp-servers/{id}
curl https://api.lelemon.cl/v2/mcp-servers/:id \ --request PATCH \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "name": "Mesa menu and stock" }'
Example Request Body
{ "name": "Mesa menu and stock" }
json
application/json
Example Responses
{ "object": "mcp_server", "id": "mcp_02y0e5MANqacVbmtn1YyeJ", "name": "name", "origin": "https://mcp.mesa.cl", "status": "connected", "authType": "none", "toolCount": 0, "noPersist": true, "sharedWithSubaccounts": true, "sharedByPlatform": true, "lastError": "lastError", "lastDiscoveryAt": "2024-08-25T15:00:00Z", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z", "tools": [ { "object": "mcp_tool", "id": "mtl_6Tn3XqLmN3tYbZc01aKq9R", "name": "get_menu", "description": "description", "inputSchema": {}, "readOnly": true } ] }
json
application/json

List the tools of an MCP server

GET
https://api.lelemon.cl
/v2/mcp-servers/{id}/tools
Bearer (API key)

The tools found by the last discovery, as a list. Use it to get the id that PUT /v2/agents/{id}/tools/{toolId} takes. It reads what is stored and does not call the server: to refresh it, call POST /v2/mcp-servers/{id}/discover.

Required scope: actions:read.

List the tools of an MCP server › path Parameters

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

The id of the mcp server (mcp_…).

List the tools of an MCP server › 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 the tools of an MCP server › 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 the tools of an MCP server › Responses

McpToolList
object
​string · enum · required
Enum values:
list
hasMore
​boolean · required
nextCursor
​string | null · required
​McpTool[] · required
GET/v2/mcp-servers/{id}/tools
curl https://api.lelemon.cl/v2/mcp-servers/:id/tools \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "list", "hasMore": true, "nextCursor": "nextCursor", "data": [ { "object": "mcp_tool", "id": "mtl_6Tn3XqLmN3tYbZc01aKq9R", "name": "get_menu", "description": "description", "inputSchema": {}, "readOnly": true } ] }
json
application/json

Discover tools

POST
https://api.lelemon.cl
/v2/mcp-servers/{id}/discover
Bearer (API key)

Asks the server for its tools now and returns the server (not a list) with its tools in the tools field; use GET /v2/mcp-servers/{id}/tools for a paginated list. It calls the server, so it is not free to repeat: an organization can discover at most 20 times per minute, and the next call answers 429 rate_limited with Retry-After. It is safe to retry. Answers 422 mcp_server_unreachable when the server does not answer (the server is marked error until a discovery works).

Required scope: actions:write.

Discover tools › path Parameters

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

The id of the mcp server (mcp_…).

Discover tools › 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.

Discover tools › Responses

McpServerWithTools
object
​string · enum · required
Enum values:
mcp_server
id
​string · required
name
​string · required
origin
​string · required

Only the origin. The path and query may hold a secret.

status
​string · enum · required

connected: the last discovery worked, the last tool call was answered and its tools can be granted. error: the last discovery or the last tool call failed; lastError says which. inactive: not connected.

Enum values:
connected
error
inactive
authType
​string · enum · required
Enum values:
none
bearer
api_key
oauth2
toolCount
​integer · required
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, your subaccounts can grant the tools of this server to their agents but cannot change it. Turning it off, or deleting the server, removes the tools from their agents.

lastError
​string | null · required
lastDiscoveryAt
​string | null · date-time · required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
​McpTool[] · required

What the last discovery found.

sharedByPlatform
​boolean

True when your platform shares this server with you: you can grant its tools, not change it. Absent on your own servers.

POST/v2/mcp-servers/{id}/discover
curl https://api.lelemon.cl/v2/mcp-servers/:id/discover \ --request POST \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "mcp_server", "id": "mcp_02y0e5MANqacVbmtn1YyeJ", "name": "name", "origin": "https://mcp.mesa.cl", "status": "connected", "authType": "none", "toolCount": 0, "noPersist": true, "sharedWithSubaccounts": true, "sharedByPlatform": true, "lastError": "lastError", "lastDiscoveryAt": "2024-08-25T15:00:00Z", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z", "tools": [ { "object": "mcp_tool", "id": "mtl_6Tn3XqLmN3tYbZc01aKq9R", "name": "get_menu", "description": "description", "inputSchema": {}, "readOnly": true } ] }
json
application/json

Read the run identity of an MCP server

GET
https://api.lelemon.cl
/v2/mcp-servers/{id}/run-identity
Bearer (API key)

Use it to know whether Lelemon signs its calls to this server and with which header, audience and secret id (kid). It never returns the secret. When enabled is false the calls go unsigned and your server gets no verified user or case context.

Required scope: actions:read.

Read the run identity of an MCP server › path Parameters

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

The id of the mcp server (mcp_…).

Read the run identity of an MCP server › 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 run identity of an MCP server › Responses

McpRunIdentity
object
​string · enum · required
Enum values:
mcp_run_identity
serverId
​string · required
enabled
​boolean · required

True when Lelemon signs every call it makes to this server. False means calls go unsigned and the server gets no verified context.

header
​string · required
audience
​string · required
kid
​string | null · required

The kid of the secret that signs now. The JWT header carries it, so your server picks the right secret during a rotation.

secretCreatedAt
​string | null · date-time · required
GET/v2/mcp-servers/{id}/run-identity
curl https://api.lelemon.cl/v2/mcp-servers/:id/run-identity \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "mcp_run_identity", "serverId": "mcp_02y0e5MANqacVbmtn1YyeJ", "enabled": true, "header": "x-agente-corrida", "audience": "https://mcp.mesa.cl/mcp", "kid": "kid", "secretCreatedAt": "2024-08-25T15:00:00Z" }
json
application/json

Turn on or rotate the run identity of an MCP server

POST
https://api.lelemon.cl
/v2/mcp-servers/{id}/run-identity
Bearer (API key)

Use it so your MCP server can trust who is asking: from now on every tools/call carries a JWT (HS256, 60 seconds) in the header, with the user, case, contact and tool in its claims; verify it with the SDK (verifyMcpAssertion). If the identity is already on, it issues a new secret and the previous one keeps verifying until the next rotation, so accept both by kid. The secret is shown once, in this answer. It changes how the server is called, so it is not idempotent and ignores Idempotency-Key. Use dryRun=true to check the header and audience and see whether it would rotate; nothing is saved.

Required scope: actions:write.

Turn on or rotate the run identity of an MCP server › path Parameters

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

The id of the mcp server (mcp_…).

Turn on or rotate the run identity of an MCP server › 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.

Turn on or rotate the run identity of an MCP server › 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 on or rotate the run identity of an MCP server › Request Body optional

ActivateMcpRunIdentity
header
​string · pattern: ^[a-z][a-z0-9-]{2,63…

Header that carries the signed JWT. Lowercase letters, digits and hyphens, 3 to 64 characters, not one the server already uses for its own auth. Default x-agente-corrida.

audience
​string · maxLength: 200 · pattern: ^\S+$

The aud claim: an https URL or an identifier without spaces, up to 200 characters. Default the URL of the server without query or fragment.

Turn on or rotate the run identity of an MCP server › 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:
mcp_run_identity
serverId
​string · required
enabled
​boolean · required

True when Lelemon signs every call it makes to this server. False means calls go unsigned and the server gets no verified context.

header
​string · required
audience
​string · required
kid
​string | null · required

The kid of the secret that signs now. The JWT header carries it, so your server picks the right secret during a rotation.

secretCreatedAt
​string | null · date-time · required
secret
​string

HS256 secret. Shown only in the answer that creates it, never again, and absent in a dryRun. Store it now.

rotated
​boolean

Only in the answer to POST: true when the identity was already on and this call replaced the signing secret. The previous secret keeps verifying until the next rotation, so your server accepts both for a while.

dryRun
​boolean · const

Present and true when the request had dryRun=true.

Const value:
POST/v2/mcp-servers/{id}/run-identity
curl https://api.lelemon.cl/v2/mcp-servers/:id/run-identity \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "header": "x-agente-corrida", "audience": "https://mcp.mesa.cl/mcp" }'
Example Request Body
{ "header": "x-agente-corrida", "audience": "https://mcp.mesa.cl/mcp" }
json
application/json
Example Responses
{ "object": "mcp_run_identity", "serverId": "mcp_02y0e5MANqacVbmtn1YyeJ", "enabled": true, "header": "x-agente-corrida", "audience": "https://mcp.mesa.cl/mcp", "kid": "kid", "secretCreatedAt": "2024-08-25T15:00:00Z", "secret": "secret", "rotated": true, "dryRun": true }
json
application/json

Turn off the run identity of an MCP server

DELETE
https://api.lelemon.cl
/v2/mcp-servers/{id}/run-identity
Bearer (API key)

Lelemon stops signing its calls and forgets the secrets. Do it only after your server stops requiring the JWT, or its calls will be rejected. Safe to repeat.

Required scope: actions:write.

Turn off the run identity of an MCP server › path Parameters

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

The id of the mcp server (mcp_…).

Turn off the run identity of an MCP server › 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 off the run identity of an MCP server › Responses

Turned off.

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

ActionsData connectors