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

Members


List the active members of the organization

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

Use it to find the mbr_ id that POST /v2/cases/{id}/assign takes as assigneeId, and to see who is available. Read only: it does not invite, change roles, change the case scope or set availability. It returns the case scope of each member. Suspended and invited members are not listed. Newest first.

Required scope: members:read.

List the active members of the organization › 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 active members of the organization › 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 active members of the organization › Responses

MemberList
object
​string · enum · required
Enum values:
list
hasMore
​boolean · required
nextCursor
​string | null · required
​Member[] · required
GET/v2/members
curl https://api.lelemon.cl/v2/members \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "list", "hasMore": true, "nextCursor": "nextCursor", "data": [ { "object": "member", "id": "mbr_4Zq0x8bVw1TqS9mYp3RkLd", "name": "Ana Pérez", "email": "[email protected]", "role": "role", "availability": "available", "caseScope": "all", "effectiveCaseScope": "all", "createdAt": "2024-08-25T15:00:00Z" } ] }
json
application/json

List who invited, changed the role of or removed members

GET
https://api.lelemon.cl
/v2/members/audit-log
Bearer (API key)

The audit log of members, newest first: invitations created, resent and cancelled, role changes and removals, with who did it (the member and the API key, if it came from one), to whom, and the role before and after. Filter with member to see only what was done to one member, their invitation included. Read only. It needs members:audit-read, which only an admin or the owner can give.

Required scope: members:audit-read.

List who invited, changed the role of or removed members › query Parameters

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

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

member
​string

Only what was done to this member, including their invitation. Same id as members.list.

List who invited, changed the role of or removed members › 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 invited, changed the role of or removed members › Responses

MemberAuditList
object
​string · enum · required
Enum values:
list
hasMore
​boolean · required
nextCursor
​string | null · required
​MemberAuditEntry[] · required
GET/v2/members/audit-log
curl https://api.lelemon.cl/v2/members/audit-log \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "list", "hasMore": true, "nextCursor": "nextCursor", "data": [ { "object": "member_audit_entry", "id": "mae_4Zq0x8bVw1TqS9mYp3RkLd", "action": "invitation.created", "actor": { "memberId": "mbr_4Zq0x8bVw1TqS9mYp3RkLd", "apiKeyId": "key_4Zq0x8bVw1TqS9mYp3RkLd" }, "target": { "memberId": "mbr_4Zq0x8bVw1TqS9mYp3RkLd", "invitationId": "inv_4Zq0x8bVw1TqS9mYp3RkLd", "email": "[email protected]" }, "roleBefore": "owner", "roleAfter": "owner", "scopeBefore": "all", "scopeAfter": "all", "createdAt": "2024-08-25T15:00:00Z" } ] }
json
application/json

Read whether a team member is available

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

status is what was marked; availableForAssignment says whether the assignment would give them a new case now, considering the opening hours of the organization. Read only and safe to repeat.

Required scope: members:read.

Read whether a team member is available › path Parameters

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

The id of the member (mbr_…).

Read whether a team member is available › 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 whether a team member is available › Responses

MemberAvailability
object
​string · enum · required
Enum values:
member_availability
memberId
​string · required
email
​string · required
status
​string · enum · required

What was marked, by the person or by the API. It does not consider the opening hours of the organization: that is availableForAssignment.

Enum values:
available
away
availableForAssignment
​boolean · required

Whether the assignment would give this person a new case right now. false if away, and also if available but the organization has opening hours and they are closed: the automatic away by schedule wins, unless the person asked to keep going a while longer (extendedUntil in the future).

changedAt
​string | null · date-time · required

When the status last changed. null if it never did.

extendedUntil
​string | null · date-time · required

Until when the person asked to keep receiving cases after the opening hours. null if there is no extension.

GET/v2/members/{id}/availability
curl https://api.lelemon.cl/v2/members/:id/availability \ --header 'Authorization: Bearer <token>'
Example Responses
{ "object": "member_availability", "memberId": "mbr_4Zq0x8bVw1TqS9mYp3RkLd", "email": "[email protected]", "status": "available", "availableForAssignment": true, "changedAt": "2024-08-25T15:00:00Z", "extendedUntil": "2024-08-25T15:00:00Z" }
json
application/json

Mark a team member available or away

PUT
https://api.lelemon.cl
/v2/members/{id}/availability
Bearer (API key)

Does the same as when the person changes their own status: the assignment of new cases reads it from there. away takes them out of the assignment and drops the extension they asked for. available marks them, but if the organization has opening hours and they are closed, the automatic away by schedule still wins (availableForAssignment stays false) unless the person asked to keep going a while longer. Setting the status they already have writes nothing, so repeating the request is safe. It needs members:write: members:read does not include it.

Required scope: members:write.

Mark a team member available or away › path Parameters

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

The id of the member (mbr_…).

Mark a team member available or away › 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.

Mark a team member available or away › Request Body

SetMemberAvailability
status
​string · enum · required

available: can receive new cases. away: the assignment skips them and any extension they asked for is dropped.

Enum values:
available
away

Mark a team member available or away › Responses

MemberAvailability
object
​string · enum · required
Enum values:
member_availability
memberId
​string · required
email
​string · required
status
​string · enum · required

What was marked, by the person or by the API. It does not consider the opening hours of the organization: that is availableForAssignment.

Enum values:
available
away
availableForAssignment
​boolean · required

Whether the assignment would give this person a new case right now. false if away, and also if available but the organization has opening hours and they are closed: the automatic away by schedule wins, unless the person asked to keep going a while longer (extendedUntil in the future).

changedAt
​string | null · date-time · required

When the status last changed. null if it never did.

extendedUntil
​string | null · date-time · required

Until when the person asked to keep receiving cases after the opening hours. null if there is no extension.

PUT/v2/members/{id}/availability
curl https://api.lelemon.cl/v2/members/:id/availability \ --request PUT \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "status": "away" }'
Example Request Body
{ "status": "away" }
json
application/json
Example Responses
{ "object": "member_availability", "memberId": "mbr_4Zq0x8bVw1TqS9mYp3RkLd", "email": "[email protected]", "status": "available", "availableForAssignment": true, "changedAt": "2024-08-25T15:00:00Z", "extendedUntil": "2024-08-25T15:00:00Z" }
json
application/json

Change the role of a member

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

Same rule as the panel, capped by the current role of whoever issued the key: it never gives a role above that role, never touches someone with a higher role, and the owner is never changed nor named by API. The owner can set admin, member or viewer; an admin only member or viewer, and only on members and viewers. It is recorded in the audit log of members with the key. It needs members:manage.

Required scope: members:manage.

Change the role of a member › path Parameters

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

The id of the member (mbr_…).

Change the role of a member › Headers

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

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

Change the role of a member › Request Body

UpdateMemberRole
role
​string · enum · required

The new role. It cannot be above the current role of whoever issued the key, and nobody is named owner by API.

Enum values:
admin
member
viewer

Change the role of a member › Responses

Member
object
​string · enum · required
Enum values:
member
id
​string · required

The id that POST /v2/cases/{id}/assign takes as assigneeId.

name
​string | null · required
email
​string · required
role
​string · required

The role of the member. A viewer cannot be assigned cases.

availability
​string · enum · required

Whether the member is receiving new cases right now.

Enum values:
available
away
caseScope
​string | null · enum · required

Which cases the member sees, when set for them: all (every case of their pipelines), unassigned_and_own (the unassigned ones and theirs) or assigned (only theirs). null means they follow the default of the organization.

Enum values:
all
unassigned_and_own
assigned
effectiveCaseScope
​string · enum · required

What the member sees now: caseScope, or the default of the organization when that is null. The owner and admins always see all. The MCP connector of Lelemon only works for people who see all.

Enum values:
all
unassigned_and_own
assigned
createdAt
​string · date-time · required
PATCH/v2/members/{id}/role
curl https://api.lelemon.cl/v2/members/:id/role \ --request PATCH \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "role": "viewer" }'
Example Request Body
{ "role": "viewer" }
json
application/json
Example Responses
{ "object": "member", "id": "mbr_4Zq0x8bVw1TqS9mYp3RkLd", "name": "Ana Pérez", "email": "[email protected]", "role": "role", "availability": "available", "caseScope": "all", "effectiveCaseScope": "all", "createdAt": "2024-08-25T15:00:00Z" }
json
application/json

Change which cases a member sees

PATCH
https://api.lelemon.cl
/v2/members/{id}/case-scope
Bearer (API key)

Same rule as the Team screen of the panel, capped by the current role of whoever issued the key: it never touches someone with a higher role (an admin changes members and viewers only), and the owner and admins always see all, so their scope cannot be set. caseScope all lets the person see every case of their pipelines, which is also what the MCP connector of Lelemon requires; null goes back to the default of the organization. Setting the value they already have writes nothing, so repeating the request is safe. It is recorded in the audit log of members with the key. It needs members:manage.

Required scope: members:manage.

Change which cases a member sees › path Parameters

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

The id of the member (mbr_…).

Change which cases a member sees › Headers

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

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

Change which cases a member sees › Request Body

UpdateMemberCaseScope
caseScope
​string | null · enum · required

all: sees every case of their pipelines. unassigned_and_own: the unassigned ones and theirs. assigned: only theirs. null: goes back to the default of the organization.

Enum values:
all
unassigned_and_own
assigned

Change which cases a member sees › Responses

Member
object
​string · enum · required
Enum values:
member
id
​string · required

The id that POST /v2/cases/{id}/assign takes as assigneeId.

name
​string | null · required
email
​string · required
role
​string · required

The role of the member. A viewer cannot be assigned cases.

availability
​string · enum · required

Whether the member is receiving new cases right now.

Enum values:
available
away
caseScope
​string | null · enum · required

Which cases the member sees, when set for them: all (every case of their pipelines), unassigned_and_own (the unassigned ones and theirs) or assigned (only theirs). null means they follow the default of the organization.

Enum values:
all
unassigned_and_own
assigned
effectiveCaseScope
​string · enum · required

What the member sees now: caseScope, or the default of the organization when that is null. The owner and admins always see all. The MCP connector of Lelemon only works for people who see all.

Enum values:
all
unassigned_and_own
assigned
createdAt
​string · date-time · required
PATCH/v2/members/{id}/case-scope
curl https://api.lelemon.cl/v2/members/:id/case-scope \ --request PATCH \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "caseScope": "all" }'
Example Request Body
{ "caseScope": "all" }
json
application/json
Example Responses
{ "object": "member", "id": "mbr_4Zq0x8bVw1TqS9mYp3RkLd", "name": "Ana Pérez", "email": "[email protected]", "role": "role", "availability": "available", "caseScope": "all", "effectiveCaseScope": "all", "createdAt": "2024-08-25T15:00:00Z" }
json
application/json

Remove a member from the organization

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

The person loses access and leaves their teams. The keys they issued lose their power to manage on the next call. Capped by the current role of whoever issued the key: an admin removes members and viewers only, and the owner is never removed by API. It is recorded in the audit log of members with the key. It needs members:manage.

Required scope: members:manage.

Remove a member from the organization › path Parameters

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

The id of the member (mbr_…).

Remove a member from the organization › 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.

Remove a member from the organization › Responses

Removed.

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

BudgetsInvitations