AiSensy MCP by usefulapi

v1.21.1
io.usefulapi/aisensy Checked 2 days ago Published 1 day ago

Read AiSensy contacts, templates and campaigns; add contacts, send WhatsApp messages on approval.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

aisensy_get_project Get project

The AiSensy project (WhatsApp account) this key belongs to: name, status, plan and renewal date, monthly active user quota and usage, credit balance (raw units as AiSensy reports them), WhatsApp number, display name status, quality rating and messaging tier. GET /project/{project_id}.

aisensy_list_templates List WhatsApp templates

List the WhatsApp template messages of the project with name, language, status (PENDING, APPROVED, REJECTED), category, text and parameter count. Only APPROVED templates can be sent. Pages by record id: pass next_after from the previous reply as `after`. GET /project/{project_id}/wa_template/.

ParameterTypeDescription
afterstringReturn records after this template id (exclusive); use the previous reply's next_after.
beforestringReturn records before this template id (exclusive).
limitintegerTemplates per page, 1-100 (default 10).

aisensy_get_template Get WhatsApp template

One WhatsApp template by id, with status, rejection reason, buttons and text. GET /project/{project_id}/wa_template/{id}.

ParameterTypeDescription
template_id *stringAiSensy record id (as returned by the list tools).

aisensy_list_campaigns List campaigns

List campaigns (API campaigns, broadcasts or both) with name, type, status, audience size, submitted count, template and creation time. Pages with skip + limit. POST /project/{project_id}/campaigns (a read: it only queries).

ParameterTypeDescription
campaign_typestringWhich campaigns (default ALL).
limitintegerCampaigns per page, 1-100 (default 10; campaign records are large).
skipintegerCampaigns to skip (default 0).

aisensy_list_api_campaigns List API campaigns

List the project's API campaigns (the campaigns messages can be sent through) with status and template. A campaign must be LIVE to send. GET /project/{project_id}/campaign/api.

aisensy_get_api_campaign Get API campaign

One API campaign by id: status, template, parameters and counts. GET /project/{project_id}/campaign/api/{campaign_id}.

ParameterTypeDescription
campaign_id *stringAiSensy record id (as returned by the list tools).

aisensy_get_campaign_analytics Get campaign analytics

Daily delivery and credit-usage statistics of one campaign (sent, delivered, read, failed counts and message credit usage), optionally within a date range. POST /project/{project_id}/campaign/analytics/{campaign_id} (a read: it only queries).

ParameterTypeDescription
campaign_id *stringAiSensy record id (as returned by the list tools).
end_datestringLast day, yyyy-mm-dd.
start_datestringFirst day, yyyy-mm-dd.

aisensy_list_campaign_audience List campaign audience

Who a campaign was sent to, with name, number and sent/delivered/read times, optionally filtered by outcome (SENT, DELIVERED, READ, FAILED, REPLIED, CLICKED) and date range. Pages by cursor: pass next_after from the previous reply as `after`. GET /project/{project_id}/campaign/audience/{campaign_id}.

ParameterTypeDescription
campaign_id *stringAiSensy record id (as returned by the list tools).
afterstringCursor from the previous reply's next_after.
categorystringOnly recipients with this outcome.
end_datestringLatest day, yyyy-mm-dd.
limitintegerRecipients per page, 1-1000 (default 20).
sortstring
start_datestringEarliest day, yyyy-mm-dd.

aisensy_create_api_campaign Create API campaign

WRITE: create an API campaign that binds a name to an APPROVED WhatsApp template. It sends nothing; messages go out only when aisensy_send_campaign_message is called for it. Not idempotent: calling twice with the same name may create two campaigns or fail. POST /project/{project_id}/campaign/api.

ParameterTypeDescription
campaign_name *stringName of the new campaign.
template_name *stringExact name of an APPROVED template (see aisensy_list_templates).

aisensy_find_contact Find contact by phone number

Look up a contact by phone number: id, name, tags, attributes, opt-in/chat state and last activity. 404 means no such contact. GET /project/{project_id}/contact?action=FetchContact&mobile_number=.

ParameterTypeDescription
phone_number *stringPhone number with country code, e.g. 919876543210 (digits; a leading + is dropped).

aisensy_get_contact Get contact

One contact by id: name, phone number, tags, attributes, chat state and last activity. GET /project/{project_id}/contact/{contact_id}.

ParameterTypeDescription
contact_id *stringAiSensy record id (as returned by the list tools).

aisensy_create_contact Create contact

WRITE: add a contact (name and phone number with country code). AiSensy opts new contacts in to WhatsApp notifications automatically, so only add people who agreed to be messaged. A number that already exists returns a 409 conflict. POST /project/{project_id}/contact.

ParameterTypeDescription
name *string
phone_number *stringPhone number with country code, e.g. 919876543210 (digits; a leading + is dropped).

aisensy_update_contact Update contact

WRITE: change a contact's name, custom attributes, WhatsApp opt-in status or blocked status. Setting opted_in=false stops campaign messages to that person; blocked=true blocks them. Only the fields you pass change. PATCH /project/{project_id}/contact/{contact_id}.

ParameterTypeDescription
contact_id *stringAiSensy record id (as returned by the list tools).
attributesobjectContact attributes as name → text value. AiSensy ignores attribute names that do not exist in the project.
blockedbooleanWhether the contact is blocked.
namestring
opted_inbooleanWhether the contact accepts WhatsApp notifications.

aisensy_upsert_contacts Create or update contacts in bulk

WRITE (bulk): create or update up to 50 contacts by phone number in one call. Each row: phone_number, and optionally name (needed to create a new contact), attributes and opted_in. Without confirm=true it only PREVIEWS: it looks up every number and returns what would be created, updated (with the exact changes) or left unchanged. With confirm=true it looks each number up again and applies the rows one by one; a failed row does not stop the others, and every row reports its outcome (created, updated, unchanged, partial or failed). AiSensy ignores attribute names the project does not have: such…

ParameterTypeDescription
contacts *array1-50 contacts, one row per phone number.
confirmbooleanLeave out (or false) to preview. Set true only after the user has seen the preview and approved the changes.

aisensy_get_message Get message

One WhatsApp message by id: status (SENT, DELIVERED, READ), sent/delivered/read times, sender, campaign, content and price. GET /project/{project_id}/messages/{message_id}.

ParameterTypeDescription
message_id *stringAiSensy record id (as returned by the list tools).

aisensy_send_campaign_message Send campaign message

WRITE, SENDS A WHATSAPP MESSAGE TO A CUSTOMER AND SPENDS AISENSY CREDIT: send the template of a LIVE API campaign to one phone number (a new contact is created if the number is unknown). Not idempotent: every call sends again. template_params must match the template's parameter count. Show the user the recipient and the template first and set confirm=true only after they approve. POST /project/{project_id}/campaign/api/send.

ParameterTypeDescription
campaign_name *stringName of a LIVE API campaign (see aisensy_list_api_campaigns).
confirm *booleanMust be true. Set it only after the user has seen and approved the recipient and the message in this conversation.
name *stringRecipient's name.
phone_number *stringPhone number with country code, e.g. 919876543210 (digits; a leading + is dropped).
attributesobjectContact attributes as name → text value. AiSensy ignores attribute names that do not exist in the project.
default_country_codestringCountry code to assume when phone_number has none, e.g. 91.
media_filenamestringFile name shown for the media.
media_urlstringPublic https URL of the image/video/document for a media template.
sourcestringLead source label.
tagsarrayExisting tags to put on the contact (unknown tags are ignored).
template_paramsarrayValues for the template's {{1}}, {{2}}... in order; the count must match the template.

aisensy_send_message Send WhatsApp message

WRITE, SENDS A WHATSAPP MESSAGE TO A CUSTOMER AND MAY SPEND AISENSY CREDIT: send either a free-text message (type=text; WhatsApp only delivers it inside the 24-hour window after the customer last wrote) or an approved template (type=template with template_name, language_code and body_params). Not idempotent. Show the user the recipient and the text first and set confirm=true only after they approve. POST /project/{project_id}/messages.

ParameterTypeDescription
confirm *booleanMust be true. Set it only after the user has seen and approved the recipient and the message in this conversation.
phone_number *stringPhone number with country code, e.g. 919876543210 (digits; a leading + is dropped).
type *stringtext = free-form reply; template = an approved template.
body_paramsarrayValues for the template's body {{1}}, {{2}}... in order (type=template).
language_codestringTemplate language code such as en, en_US, hi (type=template; default en).
template_namestringApproved template name (type=template).
textstringMessage text (type=text).