LeanPBX CRM tool
The LeanPBX CRM tool gives an agent full read/write access to your LeanPBX CRM — contacts, companies, deals, tasks, notes, and reference data — behind a single action the agent picks per call. One configuration holds an API key.
create_contact.phone and list_contacts.search default to the caller's number (so "look me up" just works), and create_note.call_uniqueid defaults to the conversation id (notes auto-link to the call). An explicitly supplied value always wins. No configuration required — it's automatic.
Connect your CRM
The single credential is a LeanPBX API key (a Bearer token) with CRM read/write access. Generate one in your LeanPBX workspace's API settings and paste it into the API Key field. It's stored encrypted and never shown again; on edit, leave it blank to keep the stored key. One key = one CRM workspace.
Capabilities
The agent picks one action per call, grouped by entity:
Contacts
list_contacts— search/list (filters:search,type,limit,page).get_contact/update_contact/delete_contact— byid.create_contact— needsfirst_name,phone.list_contact_notes/_tasks/_deals/_calls/_sms— a contact's sub-records (byid).attach_tags(id,tag_idsarray) /detach_tag(id,tag_id).
Companies
list_companies/get_company/create_company(needsname) /update_company/delete_company(byid).list_company_contacts/list_company_deals— sub-records (byid).
Deals
list_deals— filters:status,pipeline_id,stage_id,assigned_to,contact_id,company_id…get_deal/update_deal/delete_deal— byid.create_deal— needsname,pipeline_id,stage_id.list_deal_notes/list_deal_tasks— sub-records (byid).
Tasks
list_tasks(filters),get_task/update_task/delete_task(byid),create_task(needstitle).
Notes
list_notes(filterscontact_id/deal_id),get_note/update_note/delete_note(byid),create_note(needscontact_id,content).
Lookups (reference data)
list_pipelines/get_pipeline(byid),list_tags/create_tag(needsname) /delete_tag(byid),list_dispositions.
pipeline_id + stage_id — the agent should call list_pipelines first (stages are returned inline) to get valid ids. Notes need a contact_id — call list_contacts first. Disposition ids come from list_dispositions.
Field reference
- Contact type —
lead/prospect/customer/vendor(defaultcustomer). - Deal status —
open/won/lost(won/lost auto-stamp the close date). - Task status —
pending/in_progress/completed/cancelled(completed auto-stamps completion time). - Task priority —
low/medium/high(defaultmedium). - Tag color —
gray/primary/success/warning/danger/info(defaultgray). - Formats — dates
YYYY-MM-DD;due_timeisHH:MM(24-hour); country is ISO-2; currency is ISO-4217.
Common recipes
- Look up the caller —
list_contactswith nosearch(it defaults to the caller's number on a live call). - Log a call note —
create_notewith the contact and content;call_uniqueidauto-links to the call. - Create a follow-up task —
create_taskwith atitle(adddue_date/priorityas needed). - Open a deal in a pipeline —
list_pipelinesto get apipeline_id+stage_id, thencreate_deal.
Errors & troubleshooting
- 401 / 403 — invalid or under-privileged API key → re-enter the key on the config card.
- 409 (duplicate) — on
create_contact/create_company; the record already exists. - 422 (validation) — e.g. invalid phone, or a bad pipeline/stage/contact id; the field message says what's wrong.
- 404 — bad id on a get/update/delete.
- Misconfigured — a missing API key is caught before any network call.
Classification & lifecycle
This is a read and write tool, and it can delete records (delete_*). If you run it on an autonomous bot, consider its safety classification — marking it destructive makes the platform's destructive-action gate apply (requiring "Allow destructive actions in autonomous runs" on the bot). It's post-call-hook eligible (runs outside the LLM turn), so it can power post-call automations like logging a note or creating a follow-up task.
api.leanpbx_* API-Call presets, which remain available (not retired) — bots using them keep working. New configurations should use this dedicated tool.