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

Data connectors


Get the lelemon-connector/v1 format

GET
https://api.lelemon.cl
/v2/data-connectors/format
Bearer (API key)

Returns the JSON Schemas of the four documents your connector serves (manifest, account card, account search and view page) and their limits. Use it to build or validate your connector before registering it. It reads nothing of your data and is safe to repeat.

Required scope: connectors:read.

Get the lelemon-connector/v1 format › 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.

Get the lelemon-connector/v1 format › Responses

DataConnectorFormat
object
​string · enum · required
Enum values:
data_connector_format
format
​string · enum · required
Enum values:
lelemon-connector/v1
​object · required
​object · required

JSON Schemas of the manifest, the account card, the account search and the view page.

GET/v2/data-connectors/format
curl https://api.lelemon.cl/v2/data-connectors/format \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "data_connector_format", "format": "lelemon-connector/v1", "limits": { "key": 0 }, "schemas": {} }
json
application/json

Validate a connector document

POST
https://api.lelemon.cl
/v2/data-connectors/format/validate
Bearer (API key)

Use it while you build your connector, before you register it: send the manifest, an account card, an account search answer or a view page exactly as you serve them, and get every place that does not follow lelemon-connector/v1 with its path (such as $.sections[0].components[1].value) and the reason, never the value. It runs the same validator that checks the real answers of your system, so a document that passes here passes there. Nothing is stored and nothing is sent to your system, so it is safe to repeat. For an account card send baseUrl or allowedOrigins, or its action links are rejected. To check the manifest your registered system serves, use POST /v2/data-connectors/{id}/check.

Required scope: connectors:read.

Validate a connector document › 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.

Validate a connector document › Request Body

ValidateConnectorDocument
type
​string · enum · required

Which document you are checking: manifest, account (the card), accounts_search (the answer to GET {base}/accounts?email=) or view_page (a page of a view).

Enum values:
manifest
account
accounts_search
view_page
​object · required

The JSON document exactly as your connector serves it. It is checked and thrown away: nothing is stored and nothing is sent to your system.

baseUrl
​string · maxLength: 2048

For account: the base URL of your connector. The hosts of an action link must be this host or one of allowedOrigins.

allowedOrigins
​string[] · maxItems: 10

For account: more https origins an action link may use.

Validate a connector document › Responses

DataConnectorFormatValidation
object
​string · enum · required
Enum values:
data_connector_format_validation
type
​string · enum · required
Enum values:
manifest
account
accounts_search
view_page
ok
​boolean · required

True when the document follows the format.

​FormatProblem[] · required

Every place that does not follow the format, up to 50, with its path. Values are never repeated.

POST/v2/data-connectors/format/validate
curl https://api.lelemon.cl/v2/data-connectors/format/validate \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "type": "account", "baseUrl": "https://admin.example.com/lelemon", "document": { "object": "account", "id": "acc_1", "title": "Acme", "sections": [] } }'
Example Request Body
{ "type": "account", "baseUrl": "https://admin.example.com/lelemon", "document": { "object": "account", "id": "acc_1", "title": "Acme", "sections": [] } }
json
application/json
Example Responses
{ "object": "data_connector_format_validation", "type": "manifest", "ok": true, "problems": [ { "path": "$.sections[0].components[1].value", "message": "must be a finite number for money" } ] }
json
application/json

List data connectors

GET
https://api.lelemon.cl
/v2/data-connectors
Bearer (API key)

Newest first. It does not call your systems.

Required scope: connectors:read.

List data connectors › 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 data connectors › 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 data connectors › Responses

DataConnectorList
object
​string · enum · required
Enum values:
list
hasMore
​boolean · required
nextCursor
​string | null · required
​DataConnector[] · required
GET/v2/data-connectors
curl https://api.lelemon.cl/v2/data-connectors \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "list", "hasMore": true, "nextCursor": "nextCursor", "data": [ { "object": "data_connector", "id": "dcn_4Zq0x8bVw1TqS9mYp3RkLd", "name": "name", "slug": "slug", "origin": "origin", "allowedOrigins": [ "string" ], "format": "lelemon-connector/v1", "status": "pending", "lastError": "unavailable", "viewCount": 0, "manifestFetchedAt": "2024-08-25T15:00:00Z", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" } ] }
json
application/json

Register a data connector

POST
https://api.lelemon.cl
/v2/data-connectors
Bearer (API key)

Registers the API of your system that serves lelemon-connector/v1: account cards and views that Lelemon reads live and never stores. The base URL must be https, public, and its site must be allowed for this key: an http URL, one with a user or password, or a private address answers 422 action_destination_blocked. It does not call your system: read the signing secret with GET /v2/data-connectors/{id}/signing-secret, serve the format, then call POST /v2/data-connectors/{id}/check. Until the check passes the connector is pending and gives no tools to the copilot.

Required scope: connectors:write.

Register a data connector › 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.

Register a data connector › Request Body

CreateDataConnector
name
​string · minLength: 1 · maxLength: 100 · required

How you see it. Its lowercase form (up to 16 characters) prefixes the tools the copilot gets from this connector, so it cannot repeat another connector.

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

The https base URL of your connector. Lelemon calls {baseUrl}/manifest, {baseUrl}/accounts and {baseUrl}/views/{viewId}. It must be public and its site must be allowed for this key, the same list actions use. Redirects are not followed.

allowedOrigins
​string[] · maxItems: 5

Extra sites that an action link of your account cards may point to, besides the host of baseUrl. Each one must be allowed for this key.

Register a data connector › Responses

DataConnector
object
​string · enum · required
Enum values:
data_connector
id
​string · required
name
​string · required
slug
​string · required

The prefix of the copilot tools of this connector, for example backoffice_account.

origin
​string · required

Only the origin of the base URL. The full URL never comes back.

allowedOrigins
​string[] · required
format
​string · enum · required
Enum values:
lelemon-connector/v1
status
​string · enum · required

pending: created, never checked. active: the last check passed. error: the last check or the manifest failed, see lastError.

Enum values:
pending
active
error
lastError
​string | null · enum · required
Enum values:
unavailable
invalid_response
not_found
bad_request
viewCount
​integer · required

Views in the stored manifest.

manifestFetchedAt
​string | null · date-time · required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
POST/v2/data-connectors
curl https://api.lelemon.cl/v2/data-connectors \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "name": "Backoffice", "baseUrl": "https://admin.example.com/lelemon", "allowedOrigins": [ "https://admin.example.com" ] }'
Example Request Body
{ "name": "Backoffice", "baseUrl": "https://admin.example.com/lelemon", "allowedOrigins": [ "https://admin.example.com" ] }
json
application/json
Example Responses
{ "object": "data_connector", "id": "dcn_4Zq0x8bVw1TqS9mYp3RkLd", "name": "name", "slug": "slug", "origin": "origin", "allowedOrigins": [ "string" ], "format": "lelemon-connector/v1", "status": "pending", "lastError": "unavailable", "viewCount": 0, "manifestFetchedAt": "2024-08-25T15:00:00Z", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" }
json
application/json

Retrieve a data connector

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

Its status and the origin of its base URL. It does not call your system.

Required scope: connectors:read.

Retrieve a data connector › path Parameters

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

The id of the data connector (dcn_…).

Retrieve a data connector › 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 data connector › Responses

DataConnector
object
​string · enum · required
Enum values:
data_connector
id
​string · required
name
​string · required
slug
​string · required

The prefix of the copilot tools of this connector, for example backoffice_account.

origin
​string · required

Only the origin of the base URL. The full URL never comes back.

allowedOrigins
​string[] · required
format
​string · enum · required
Enum values:
lelemon-connector/v1
status
​string · enum · required

pending: created, never checked. active: the last check passed. error: the last check or the manifest failed, see lastError.

Enum values:
pending
active
error
lastError
​string | null · enum · required
Enum values:
unavailable
invalid_response
not_found
bad_request
viewCount
​integer · required

Views in the stored manifest.

manifestFetchedAt
​string | null · date-time · required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
GET/v2/data-connectors/{id}
curl https://api.lelemon.cl/v2/data-connectors/:id \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "data_connector", "id": "dcn_4Zq0x8bVw1TqS9mYp3RkLd", "name": "name", "slug": "slug", "origin": "origin", "allowedOrigins": [ "string" ], "format": "lelemon-connector/v1", "status": "pending", "lastError": "unavailable", "viewCount": 0, "manifestFetchedAt": "2024-08-25T15:00:00Z", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" }
json
application/json

Delete a data connector

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

Stops every read through it and removes its tools from the copilot. The audit of past reads is kept for two years.

Required scope: connectors:write.

Delete a data connector › path Parameters

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

The id of the data connector (dcn_…).

Delete a data connector › Headers

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

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

Delete a data connector › Responses

Deleted.

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

Update a data connector

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

Changes only what you send. A new baseUrl or new allowedOrigins put the connector back to pending and drop its stored manifest until you call the check endpoint again. The sites must be allowed for this key.

Required scope: connectors:write.

Update a data connector › path Parameters

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

The id of the data connector (dcn_…).

Update a data connector › Headers

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

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

Update a data connector › Request Body optional

UpdateDataConnector
name
​string · minLength: 1 · maxLength: 100
baseUrl
​string · minLength: 1 · maxLength: 2048

Changing it puts the connector back to pending until you call the check endpoint.

allowedOrigins
​string[] · maxItems: 5

Update a data connector › Responses

DataConnector
object
​string · enum · required
Enum values:
data_connector
id
​string · required
name
​string · required
slug
​string · required

The prefix of the copilot tools of this connector, for example backoffice_account.

origin
​string · required

Only the origin of the base URL. The full URL never comes back.

allowedOrigins
​string[] · required
format
​string · enum · required
Enum values:
lelemon-connector/v1
status
​string · enum · required

pending: created, never checked. active: the last check passed. error: the last check or the manifest failed, see lastError.

Enum values:
pending
active
error
lastError
​string | null · enum · required
Enum values:
unavailable
invalid_response
not_found
bad_request
viewCount
​integer · required

Views in the stored manifest.

manifestFetchedAt
​string | null · date-time · required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
PATCH/v2/data-connectors/{id}
curl https://api.lelemon.cl/v2/data-connectors/:id \ --request PATCH \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "name": "Backoffice Chile" }'
Example Request Body
{ "name": "Backoffice Chile" }
json
application/json
Example Responses
{ "object": "data_connector", "id": "dcn_4Zq0x8bVw1TqS9mYp3RkLd", "name": "name", "slug": "slug", "origin": "origin", "allowedOrigins": [ "string" ], "format": "lelemon-connector/v1", "status": "pending", "lastError": "unavailable", "viewCount": 0, "manifestFetchedAt": "2024-08-25T15:00:00Z", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" }
json
application/json

Retrieve the signing secret of a data connector

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

Every call of Lelemon to your connector carries a Lelemon-Signature header. Pass the whole secrets list, the method, the full URL and the raw body (empty) to verifyRequest of the SDK with domain connector. The signature covers the path and query, so it is worthless for any other route, and it expires in 60 seconds. It needs connectors:write because it is a secret. Read only: it returns the same secrets until you rotate.

Required scope: connectors:write.

Retrieve the signing secret of a data connector › path Parameters

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

The id of the data connector (dcn_…).

Retrieve the signing secret of a data connector › 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 a data connector › Responses

DataConnectorSigningSecret
object
​string · enum · required
Enum values:
data_connector_signing_secret
connectorId
​string · required
secrets
​string[] · required

The secrets that sign the calls to this connector, newest first. After a rotation the previous one is listed for 24 hours. Pass the whole list to verifyRequest of the SDK with domain connector.

previousValidUntil
​string · date-time
GET/v2/data-connectors/{id}/signing-secret
curl https://api.lelemon.cl/v2/data-connectors/:id/signing-secret \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "data_connector_signing_secret", "connectorId": "dcn_4Zq0x8bVw1TqS9mYp3RkLd", "secrets": [ "string" ], "previousValidUntil": "2024-08-25T15:00:00Z" }
json
application/json

Rotate the signing secret of a data connector

POST
https://api.lelemon.cl
/v2/data-connectors/{id}/signing-secret/rotate
Bearer (API key)

Creates a new secret. The previous one keeps signing alongside the new one for 24 hours, so you can change it in your system 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 carries no secret: read it with GET /v2/data-connectors/{id}/signing-secret. Use dryRun=true to see when the previous secret would stop working; nothing rotates.

Required scope: connectors:write.

Rotate the signing secret of a data connector › path Parameters

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

The id of the data connector (dcn_…).

Rotate the signing secret of a data connector › 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 a data connector › 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 a data connector › 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:
data_connector_signing_secret_rotation
rotatedAt
​string · date-time · required
previousValidUntil
​string · date-time · required
dryRun
​boolean · const

Present and true when the request had dryRun=true.

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

Check a data connector

POST
https://api.lelemon.cl
/v2/data-connectors/{id}/check
Bearer (API key)

Calls GET {baseUrl}/manifest signed, validates it against lelemon-connector/v1 and stores the manifest. If it passes, the connector becomes active and its views become tools for the copilot. If the response does not follow the format, it answers 200 with ok false and the failing paths (never the values). It reads the manifest only: account cards, searches and views are validated when they are read, and a read that fails answers 422 data_connector_invalid_response with its failing paths; test them before with POST /v2/data-connectors/format/validate. If the connector does not answer, it answers 422 data_connector_unavailable and the connector goes to error. It calls your system and is safe to repeat, up to 20 checks per minute for an organization: the next one answers 429 rate_limited with Retry-After.

Required scope: connectors:write.

Check a data connector › path Parameters

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

The id of the data connector (dcn_…).

Check a data connector › 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.

Check a data connector › Responses

DataConnectorCheck
object
​string · enum · required
Enum values:
data_connector_check
ok
​boolean · required
​FormatProblem[] · required
​DataConnector · required
POST/v2/data-connectors/{id}/check
curl https://api.lelemon.cl/v2/data-connectors/:id/check \ --request POST \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "data_connector_check", "ok": true, "problems": [ { "path": "$.sections[0].components[1].value", "message": "must be a finite number for money" } ], "connector": { "object": "data_connector", "id": "dcn_4Zq0x8bVw1TqS9mYp3RkLd", "name": "name", "slug": "slug", "origin": "origin", "allowedOrigins": [ "string" ], "format": "lelemon-connector/v1", "status": "pending", "lastError": "unavailable", "viewCount": 0, "manifestFetchedAt": "2024-08-25T15:00:00Z", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" } }
json
application/json

Retrieve the manifest of a data connector

GET
https://api.lelemon.cl
/v2/data-connectors/{id}/manifest
Bearer (API key)

The manifest stored by the last check: its views and how accounts are looked up. It does not call your system; use it to know which views and filters exist before reading one.

Required scope: connectors:read.

Retrieve the manifest of a data connector › path Parameters

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

The id of the data connector (dcn_…).

Retrieve the manifest of a data connector › 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 manifest of a data connector › Responses

DataConnectorManifest
object
​string · enum · required
Enum values:
data_connector_manifest
format
​string · enum · required
Enum values:
lelemon-connector/v1
name
​string · required
​object · required
​DataConnectorView[] · required
GET/v2/data-connectors/{id}/manifest
curl https://api.lelemon.cl/v2/data-connectors/:id/manifest \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "data_connector_manifest", "format": "lelemon-connector/v1", "name": "name", "lookup": { "key": true }, "views": [ { "id": "trials", "name": "name", "description": "description", "inputSchema": {} } ] }
json
application/json

Search accounts by email

GET
https://api.lelemon.cl
/v2/data-connectors/{id}/accounts
Bearer (API key)

Asks your connector live for the accounts whose email matches. Use it to get the stable account id; the email is only for searching, store the id as the externalRef of the contact. Titles come back masked when they look like a RUT, email or phone. Nothing is stored, only the audit of who looked. Use GET /v2/data-connectors/{id}/accounts/{account} when you already have the id.

Required scope: connectors:read.

Search accounts by email › path Parameters

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

The id of the data connector (dcn_…).

Search accounts by email › query Parameters

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

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

Search accounts by email › 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.

Search accounts by email › Responses

AccountSummaryList
object
​string · enum · required
Enum values:
list
hasMore
​boolean · required
nextCursor
​string | null · required
​AccountSummary[] · required
GET/v2/data-connectors/{id}/accounts
curl 'https://api.lelemon.cl/v2/data-connectors/:id/accounts?email=<string>' \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "list", "hasMore": true, "nextCursor": "nextCursor", "data": [ { "object": "account_summary", "id": "id", "title": "title", "subtitle": "subtitle" } ] }
json
application/json

Read the card of an account live

GET
https://api.lelemon.cl
/v2/data-connectors/{id}/accounts/{account}
Bearer (API key)

Asks your connector for the card of one account and returns it masked: fields marked sensitive and any value shaped like a RUT, email or phone come back with value null and masked true. Nothing is stored; the read is audited. To see one masked value use POST /v2/data-connectors/{id}/accounts/{account}/reveal. Answers 404 when your connector does not know the account.

Required scope: connectors:read.

Read the card of an account live › path Parameters

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

The id of the data connector (dcn_…).

account
​string · required

The id of the account in your system, exactly as the connector returns it from the search.

Read the card of an account live › 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 card of an account live › Responses

AccountCard
object
​string · enum · required
Enum values:
account
id
​string · required

The stable id your connector gives the account.

title
​string · required
​AccountSection[] · required
subtitle
​string
GET/v2/data-connectors/{id}/accounts/{account}
curl https://api.lelemon.cl/v2/data-connectors/:id/accounts/:account \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "account", "id": "id", "title": "title", "subtitle": "subtitle", "sections": [ { "title": "title", "components": [ {} ] } ] }
json
application/json

Reveal one masked value of an account

POST
https://api.lelemon.cl
/v2/data-connectors/{id}/accounts/{account}/reveal
Bearer (API key)

Reads the card live again and returns the real value of one field. The audit records the key, the account (as a keyed hash) and the field, never the value, and it is written before the value is returned. Fields marked specialCategory cannot be revealed (403). The response is never stored for idempotent replay. Use it only when the person must see the value.

Required scope: connectors:reveal.

Reveal one masked value of an account › path Parameters

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

The id of the data connector (dcn_…).

account
​string · required

The id of the account in your system, exactly as the connector returns it from the search.

Reveal one masked value of an account › 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.

Reveal one masked value of an account › Request Body

RevealField
fieldKey
​string · pattern: ^[a-z][a-z0-9_]{0,39… · required

The key of a field of the account card.

Reveal one masked value of an account › Responses

RevealedField
object
​string · enum · required
Enum values:
revealed_field
key
​string · required
valueType
​string · required
​required
currency
​string
POST/v2/data-connectors/{id}/accounts/{account}/reveal
curl https://api.lelemon.cl/v2/data-connectors/:id/accounts/:account/reveal \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "fieldKey": "tax_id" }'
Example Request Body
{ "fieldKey": "tax_id" }
json
application/json
Example Responses
{ "object": "revealed_field", "key": "key", "valueType": "valueType", "value": "string", "currency": "currency" }
json
application/json

Get the link of an account action

POST
https://api.lelemon.cl
/v2/data-connectors/{id}/accounts/{account}/actions/{action}/open
Bearer (API key)

Reads the card live and returns the https link of one action, only if its host is inside the sites of the connector. Lelemon never calls the link: the person opens it in a new tab with rel=noopener noreferrer. The click is audited. The link may carry a one-time token, so the response is never stored for idempotent replay.

Required scope: connectors:read.

Get the link of an account action › path Parameters

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

The id of the data connector (dcn_…).

account
​string · required

The id of the account in your system, exactly as the connector returns it from the search.

action
​string · required

The name of the action, as listed by the manifest of the connector.

Get the link of an account 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.

Get the link of an account action › Responses

ActionLink
object
​string · enum · required
Enum values:
action_link
url
​string · required

An https link inside the sites of the connector. Open it in a new tab with rel=noopener noreferrer. Lelemon never calls it.

POST/v2/data-connectors/{id}/accounts/{account}/actions/{action}/open
curl https://api.lelemon.cl/v2/data-connectors/:id/accounts/:account/actions/:action/open \ --request POST \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "action_link", "url": "url" }
json
application/json

Read a view live

GET
https://api.lelemon.cl
/v2/data-connectors/{id}/views/{view}
Bearer (API key)

Asks your connector for one page of a view declared in its manifest, for example the accounts in trial. Filters go as filter[name]=value and only the names the manifest declares are accepted (422 otherwise). The page keeps the connector order and cursor; sensitive columns and values shaped like a RUT, email or phone come back masked. Nothing is stored; the read is audited.

Required scope: connectors:read.

Read a view live › path Parameters

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

The id of the data connector (dcn_…).

view
​string · required

The name of the view, as listed by the manifest of the connector.

Read a view live › query Parameters

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

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

​object · style: deepObject · explode: true

Read a view live › 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 a view live › Responses

ViewPage
object
​string · enum · required
Enum values:
list
hasMore
​boolean · required
nextCursor
​string | null · required
​object[] · required

Columns of the view: key, label, valueType and sensitive.

​object[] · required

Rows with id, optional accountId and cells. Each cell is { value, masked, maskReason? }.

GET/v2/data-connectors/{id}/views/{view}
curl https://api.lelemon.cl/v2/data-connectors/:id/views/:view \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "list", "hasMore": true, "nextCursor": "nextCursor", "columns": [ {} ], "data": [ {} ] }
json
application/json

List who looked at what through a connector

GET
https://api.lelemon.cl
/v2/data-connectors/{id}/accesses
Bearer (API key)

Newest first. Each access has the key or member, the kind (read_account, read_view, reveal, open_action...), the view, the field and an account hash; it never has a value. integrity is tampered when a row no longer matches its signature. Kept for two years. Filter by accountId to answer a data subject request.

Required scope: connectors:audit-read.

List who looked at what through a connector › path Parameters

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

The id of the data connector (dcn_…).

List who looked at what through a connector › query Parameters

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

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

accountId
​string

Only the accesses to this account id.

kind
​string · enum
Enum values:
read_manifest
read_account
search_accounts
read_view
reveal
open_action

List who looked at what through a connector › 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 who looked at what through a connector › Responses

DataConnectorAccessList
object
​string · enum · required
Enum values:
list
hasMore
​boolean · required
nextCursor
​string | null · required
​DataConnectorAccess[] · required
GET/v2/data-connectors/{id}/accesses
curl https://api.lelemon.cl/v2/data-connectors/:id/accesses \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "list", "hasMore": true, "nextCursor": "nextCursor", "data": [ { "object": "data_connector_access", "id": "id", "connectorId": "dcn_4Zq0x8bVw1TqS9mYp3RkLd", "kind": "kind", "actorType": "api_key", "actorId": "actorId", "onBehalfOf": "onBehalfOf", "accountHmac": "accountHmac", "viewId": "viewId", "fieldKey": "fieldKey", "integrity": "intact", "createdAt": "2024-08-25T15:00:00Z" } ] }
json
application/json

MCP serversSkills