# 07 · API, webhooks and AI assistants

**Purpose:** connect your shop, CRM or automation tool to Wsapme, and let an AI assistant such as Claude or ChatGPT work with your workspace.

## Before you start

- You are signed in to the workspace.
- For the API and webhooks you (or your developer) need a server or tool that can make or receive web requests. The no-code **Incoming hooks** need none.

> Screenshots use a demo workspace with Demo mode on. **No API key, webhook, incoming hook or connector link was created for this guide**, because a key or link is shown only once and works like a password. The forms are shown empty.

## The Developers page

**Watch first (4:24, Malay narration):** [API, webhooks and AI assistants (MCP): tour of the Developers page](https://v3.wsapme.com/guide-media/video/07-api-webhooks-mcp-malay.mp4). Parts 1 to 5 in the order of this guide: the API key form and Quick start, a webhook endpoint, an incoming hook, the Request log and API reference, and a connector link for an AI assistant. No key, webhook, hook or connector link is created in the video.

1. In the sidebar, under **Settings**, click **Developers**.
2. The tabs across the top are **API keys**, **Webhooks**, **Incoming hooks**, **Delivery log**, **Request log**, **AI assistants**, **Your apps** and **API reference**.
3. Building an app that many Wsapme customers connect (a POS, CRM or shop)? Use **Your apps** and a **Connect with Wsapme** button instead of asking each customer for an API key: see [45 · Build an app with Connect with Wsapme](https://v3.wsapme.com/guides/build-an-app-with-connect-with-wsapme.md). Apps your workspace connected are under **Settings → Connected apps** ([44 · Connected apps](https://v3.wsapme.com/guides/connected-apps.md)).

## Part 1 · API keys

An API key lets your own system send messages and read data. Give each integration its own key.

1. On **API keys**, click **Create API key**.
2. Type a **Name** (for example `Online shop`).
3. Tick only the **Permissions** it needs, for example `messages:send` (send messages and check numbers) or `contacts:read` (read contacts and companies). Other permissions cover messages, leads, broadcasts and follow-ups, devices, conversations, webhooks, tasks, workflows, orders, products, sales pages and the AI agent's knowledge.
4. Choose the **Mode**: **Live** sends real WhatsApp messages, **Test** reads real data but only simulates sends. You can also set when the key **Expires** (never, 30 days, 90 days or 1 year), limit it to some **WhatsApp numbers** (shown when you have more than one) and to **Allowed IP addresses**.
5. Click **Create key** and copy it somewhere safe. It is shown once. Never paste it in a chat, a screenshot or a public place.

   ![The empty API keys tab](https://v3.wsapme.com/guide-media/img/api-webhooks-mcp/01-api-keys.webp)

   ![The Create API key dialog with its permissions](https://v3.wsapme.com/guide-media/img/api-webhooks-mcp/02-create-key-dialog.webp)

6. The **Quick start** box on the same page shows how to send a first message with a key that has the `messages:send` permission (a `curl` command to `/api/v1/messages`). The base address is shown under it.

> **Not executed:** creating a key and sending a request.

## Part 2 · Webhooks

A webhook sends your server a signed web request whenever something happens in Wsapme.

1. Click **Webhooks**, then **Add endpoint**.

   ![The Webhooks tab](https://v3.wsapme.com/guide-media/img/api-webhooks-mcp/04-webhooks.webp)

2. Type the **Endpoint URL**. It must be a public HTTPS address. Add a **Description** if you like (for example `n8n order workflow`).
3. Choose the **Events**. Use the quick picks **Messages only**, **Contacts & leads** or **Everything**, or tick events one by one, such as `message.received` (a new message arrives), `message.sent`, `message.status` (delivered, read or played) or `device.status` (a number connects or disconnects).
4. Click **Add endpoint**.

   ![The Add webhook endpoint page](https://v3.wsapme.com/guide-media/img/api-webhooks-mcp/05-add-endpoint.webp)

5. Use **Delivery log** to see what was sent to your endpoints (kept for 30 days), and filter by endpoint, event and status.

   ![The Delivery log](https://v3.wsapme.com/guide-media/img/api-webhooks-mcp/08-delivery-log.webp)

> **Not executed:** adding an endpoint.

## Part 3 · Incoming hooks (no code)

An incoming hook gives you a Wsapme address. When a shop, form or automation tool calls it, Wsapme sends a WhatsApp message you choose. It suits a paid WooCommerce or Shopify order, a WordPress form, or a step in Zapier, Make, n8n or GoHighLevel.

1. Click **Incoming hooks**, then **New incoming hook**.

   ![The Incoming hooks tab](https://v3.wsapme.com/guide-media/img/api-webhooks-mcp/06-incoming-hooks.webp)

2. Pick the **Source**: **WooCommerce: order paid**, **Shopify: order paid**, **WordPress form**, **Zapier**, **Make (Integromat)**, **n8n**, **GoHighLevel** or **Something else (any JSON or form)**. The fields and a first message are filled in for you.
3. Type a **Name** (for example `Shop orders`) and click **Create**.

   ![The New incoming hook dialog](https://v3.wsapme.com/guide-media/img/api-webhooks-mcp/07-new-hook-dialog.webp)

> **Not executed:** creating a hook.

## Part 4 · The request log and the API reference

- **Request log** shows the requests made with your API keys for 30 days, with filters for key, result and live or test. Request and response bodies are never stored. You can **Export CSV** (turned off while Demo mode is on).

  ![The Request log](https://v3.wsapme.com/guide-media/img/api-webhooks-mcp/09-request-log.webp)

- **API reference** lists every endpoint with examples, plus the permissions (scopes), error format and a downloadable OpenAPI file.

  ![The API reference](https://v3.wsapme.com/guide-media/img/api-webhooks-mcp/12-api-reference.webp)

## Part 5 · Connect an AI assistant (MCP)

You can connect Claude, ChatGPT or any assistant that supports MCP connectors. By default it can read your conversations, contacts, deals and broadcasts. You choose what else it may do.

### The simplest way: paste the address, sign in, Allow

1. Click **Copy address** on the **AI assistants** tab.
2. In **Claude**: Customize → Connectors → **+ Add** → **Add custom connector**. Name it "Wsapme", paste `https://v3.wsapme.com/mcp` as the URL, click **Add**, then **Connect**.
3. In **ChatGPT** Plus or Pro: Settings → Apps & Connectors → Advanced → turn on Developer mode, then create a connector. On Business, Enterprise or Edu an admin or owner adds it under Plugins → **+** → **Add custom MCP server**. Name it "Wsapme", paste `https://v3.wsapme.com/mcp` as the URL and choose **OAuth** as the authentication.
4. A Wsapme page opens. Sign in as a workspace owner or admin, choose the **Workspace** and tick what the assistant may do: **Read** is always on (it includes orders); **Update records**, **Edit the AI agent** and **Send messages** are your choice. Check that the app name and the address it sends you back to are the ones you expect, then click **Allow**.
5. In a chat, turn on Wsapme. The connection is listed on the **API keys** tab as **Connected app (sign-in)**. Click **Revoke** there to disconnect it at once.

### Which plan can use what

Claude and ChatGPT decide which of their plans may add a custom connector, not Wsapme. They can change this; checked on 25 Nov 2026.

| Assistant | Plan | Wsapme tools | Good to know |
|---|---|---|---|
| Claude | Free | Read and actions | One custom connector only. |
| Claude | Pro, Max | Read and actions | Add it yourself under Customize → Connectors. |
| Claude | Team, Enterprise | Read and actions | An Owner adds it once in Organization settings → Connectors; each member then clicks **Connect**. |
| ChatGPT | Free, Go | Not available | No Developer mode, so no custom connector. |
| ChatGPT | Plus, Pro | Read and actions | Turn on Developer mode first (Settings → Apps & Connectors → Advanced). ChatGPT asks before each action. |
| ChatGPT | Business, Enterprise, Edu | Read and actions | Only an admin or owner adds it (Plugins → + → Add custom MCP server); the admin may need to allow actions for members. |

"Actions" are tools that send messages or change data, such as starting a workflow or editing a follow-up sequence.

### Or with a connector link (no sign-in page)

1. Click **AI assistants** to read the steps.

   ![The AI assistants (MCP) tab](https://v3.wsapme.com/guide-media/img/api-webhooks-mcp/10-ai-assistants-mcp.webp)

2. On **API keys**, click **Create connector link**.
3. Type a **Name** and tick what it may do: **Update records**, **Send messages** (one WhatsApp text or reply at a time, a workflow or follow-up for one contact, orders marked shipped or delivered, block and chatbot off/reset/on for one chat, and making and publishing sales pages; always after you confirm it in the chat, never in bulk) and **Edit the AI agent** (off unless you tick it). Under **WhatsApp numbers**, tick the numbers it may use (none ticked means every number).
4. Click **Create link** and copy the link. It is shown once. Revoke the connector on the API keys tab to disconnect it.

   ![The connector dialog](https://v3.wsapme.com/guide-media/img/api-webhooks-mcp/11-connector-dialog.webp)

5. In **Claude**: Customize → Connectors → **+ Add** → **Add custom connector**. Use **one** of these two ways:
   - **Connector link (simplest):** name it "Wsapme" and paste the **whole** connector link as the URL. It ends in `/api/mcp/wsk_live_…`. Under **Authentication** choose **No sign-in**. Leave **OAuth client** as it is and add no headers.
   - **Key in a header (the key never shows in the URL):** paste only the URL shown under **For developers** on the AI assistants tab (it ends in `/api/mcp`) and choose **No sign-in**. Under **Request headers**, click **Add header**: name `Authorization`, value `Bearer wsk_live_…` (the part of your connector link after `/api/mcp/`). Claude stores the value and never shows it again.

   Then, in a chat, turn on Wsapme in the tools menu.
6. In **ChatGPT** Plus or Pro: Settings → Apps & Connectors → Advanced → turn on Developer mode, then create a connector (on Business, Enterprise or Edu an admin uses Plugins → **+** → **Add custom MCP server**). Name it "Wsapme", paste the link as the URL with authentication "No authentication". In a chat, turn on Developer mode (Plus, Pro) and enable Wsapme.

Whatever the assistant changes shows in the contact's timeline as done by the AI assistant.

### Make sales pages with your assistant

With **Send messages** ticked, the assistant can also make and change your sales pages: create a page from a template or from scratch, set the headline, text, products and prices, pictures (from a public link), FAQ and the WhatsApp button, publish or unpublish it, duplicate it, and go back to an earlier version. It gives you the page link. Without **Send messages** it can only read your pages.

Try this prompt:

> Make a Wsapme sales page for Herbal Tea X at RM89 with this picture: https://example.com/tea.jpg. The button opens WhatsApp. Use only what I told you, no made-up reviews. Send me the link and don't publish until I say so.

Then, for example: "Add a 3-box pack at RM239 with free postage", "Remove the sample reviews", "Publish it". See guide 20, Part 13.

### Follow-up sequences

With **Send messages** ticked, your assistant can also create, change and delete your follow-up sequences: the steps, their waits and messages, the stop rules, the number and on or off. It shows you the change and asks before it saves. Contacts already in a sequence keep their place (guide 03, Part 7). A sequence can only be deleted when nobody is going through it; switching it off is gentler.

Try this prompt:

> Show me my follow-up sequence "New leads". Change step 2 to wait 2 days and add a last step after 7 days: "Hi {{first_name|there}}, any questions? Just reply here." Show me the change before you save.

### Ask about your ad spend

With Meta or TikTok ad spend connected (guide 37, Parts 6 and 7), your assistant can tell you what your ads cost and what they brought: spend, impressions, clicks, CTR, CPC, chats, leads, orders, cost per chat, cost per order and ROAS, per campaign, ad set, ad or day, for up to 92 days. It only reads; it never changes your ads. It is part of **Read** (permission `reports:read`) and needs a plan with Ads.

Try these prompts:

> Berapa saya belanja iklan Meta minggu ni, dan berapa kos setiap chat?

> Kempen mana paling banyak bawa order bulan ni? Tunjuk belanja, chat, order dan ROAS setiap kempen.

You can also paste a link from Facebook Ads Manager, for example `https://adsmanager.facebook.com/adsmanager/manage/ads?act=1234567890&selected_campaign_ids=120210000000001`. The assistant does not open the link: it reads the campaign, ad set or ad ids (and the dates) from it and asks Wsapme for those. If the `act=` number is not the ad account connected in Wsapme, it tells you.

Good to know:

- Spend is in your ad account's currency, exactly as Meta or TikTok reported it at the last sync. Meta can still change the last 1 to 3 days.
- **Orders** are the orders recorded in Wsapme (AI agent orders and sales page forms) within 30 days of the chat. Orders closed by phone and not recorded are not counted, so your real sales may be higher.
- Spend cannot be split by WhatsApp number. A connector limited to some numbers sees only those numbers' chats and orders, so it does not show cost per chat or ROAS.
- If spend is not connected or the connection expired, the assistant says so and never guesses a number.

The same numbers are in the API: `GET /v1/reports/ads` and `GET /v1/reports/ads/campaigns` (see the API reference).

### Change many contacts at once

Your assistant can add custom contact fields (for example **Received at**, a date, or **Product set**, a list of choices), find contacts by tags, field values or ranges and last message dates, and then change many of them in one go: add or remove tags, set fields, or put them in a follow-up sequence (or stop it for them). It always does a dry run first and tells you how many contacts match, how many will change, who is skipped and why, with a few example names. Nothing changes until you say yes; then it runs in the background in batches of 250 and the assistant can tell you the progress. Opted-out, archived and phoneless contacts are never put in a sequence. Deleting a field also clears it on every contact, so the assistant tells you how many contacts have a value and asks you first.

This needs **Update records** (and **Send messages** for follow-up sequences) when you connect.

For care and repeat-order flows the assistant can also build follow-up sequences whose steps go out on each contact's own date (for example 3, 14 and 30 days after **Received at**), start a sequence by itself on a date (5 days before **Expected stock out**), and let an answer such as "dah sampai" set **Received at** to today. See [32 · Follow-up sequences in depth](https://v3.wsapme.com/guides/follow-up-sequences-in-depth.md), Part 3b.

### Ask what will go out

Ask "What will go out next week?" or "How many follow-ups go out on Friday?". The assistant reads **Planned sends** (tool `list_planned_sends`, API `GET /v1/planned-sends`): per day and kind (broadcasts, follow-up steps, drips, scheduled messages, AI follow-ups, sales tasks, workflow waits), the exact sends and the estimates, and who gets what. It only reads; it never sends or moves anything.

### Build workflows with your assistant

The assistant can create a workflow, or change one, for example "when the customer replies *dah sampai*, set **Received at** to today, stop the delivery chaser and start the care flow", with branches on a reply or a button, tags and contact fields, follow-ups, **Pause AI agent** and **Hand to team**. It is always saved as a **draft, switched off**: open it in Wsapme, check it with **Test**, and switch it on yourself. When the workflow is already on, the assistant's change is saved as a draft and the published steps keep running until you publish the draft. It needs **Send messages** when you connect (the workflows permission).

### Send an approved template

On an Official or Hybrid number the assistant can send one approved WhatsApp template to one contact, with its values filled in (for example the customer's name and product). This is how a customer is reached more than 24 hours after their last message. It shows you the template, the filled-in text and the contact and asks before it sends. For many contacts, use a broadcast or a follow-up sequence instead.

### What your assistant can change in your AI agent

Only when you tick **Edit the AI agent** (on the sign-in page, or when you create a connector link). Then you can ask it, in plain words, to:

- switch an agent on or off, choose which WhatsApp numbers it answers, and change its instructions, model, tone, working hours, hand-over words and message, language, forms, follow-ups and chat commands (everything on **AI Agent → Settings**);
- add another agent or remove one (the main agent stays);
- rewrite the business description, or put an earlier one back (the last 10 are kept);
- teach it (knowledge entries), change products and their stock and delivery charges;
- add or change the **photo** of a product, a testimonial or a knowledge entry, from a picture link or a picture you attach in the chat. Wsapme keeps its own copy (JPG, PNG or WebP up to 5 MB), so the photo keeps working even if the link stops working later;
- add, rename or delete **testimonial topics** and testimonials. Before it deletes a topic, it shows you which testimonials lose it; a testimonial left with no topic is not sent until you tag it again;
- add, test and change **AI tools**. Secret values (API keys) are never shown back; type them yourself;
- add test questions and run the tests (a run uses AI credits, the assistant tells you the estimate first), and mark replies on **Review** good or wrong;
- stop the AI in one chat so you can take over, hand it back, and change what the AI remembers about that customer;
- mark an order shipped (the customer gets the tracking number on WhatsApp) or delivered.

It asks you before it changes or deletes anything. It can never touch your own AI keys, AI providers, credits, payment settings or billing, and it does not change the industry preset. Every change is written to **Settings → Audit log**.

**Only the help guides, no account needed:** add `https://v3.wsapme.com/mcp/help` as an MCP server with no sign-in (in Claude: **No sign-in**; in ChatGPT: "No authentication"). The assistant gets three tools: **search** and **fetch** (search and read these guides) and **ask_wsapme_help** (a short answer written from the guides, with a limit on questions per hour). It cannot see any workspace. AI tools and crawlers can also read `https://v3.wsapme.com/llms.txt`, a plain-text summary of Wsapme with every guide, and each guide as Markdown by adding `.md` to its address.

> **Not executed:** creating a connector link and connecting Claude or ChatGPT, with sign-in or with a link (the Claude and ChatGPT steps are taken from their on-screen instructions and need your own accounts).

### Files and pictures from the assistant

Wherever you can upload a file in Wsapme, the assistant can add one too: a picture, video, audio or document from a link, or a file you attach in the chat. That covers broadcasts, follow-up sequence steps, workflow message steps, quick replies, sales page pictures, and (with **Edit the AI agent**) product, testimonial and knowledge pictures. Wsapme keeps its own copy, so the message still works if the link stops working. The limits are the same as in the app: pictures JPG, PNG or WebP up to 5 MB; videos, audio and documents up to 16 MB. A file the assistant uploaded but did not use is deleted after 7 days.

If the assistant cannot take a file you attached in the chat, it gives you an **upload link**: open it on your phone or computer, add the file, then tell the assistant you are done. The link works for about 30 minutes.

Developers: `POST /v1/media` (url or base64 `data`) returns a `media_id`; send it as `media_id` in a broadcast, sequence step, workflow message step or quick reply, or as a picture of a sales page. See **Developers → API reference**, section **Messages** (Upload a file).

## Common problems

| Problem | What to do |
|---|---|
| AI chat says it cannot upload a picture | Ask it for an upload link. Open the link, add the file, then tell the chat you are done. Link ended? Ask for a new one. |
| File link refused when the AI assistant adds a file | The link must open the file itself (not a web page, a Google Drive or WhatsApp page), be public **https**, and be an allowed file: **pictures JPG, PNG or WebP up to 5 MB**; **videos MP4 or 3GP, audio and documents (PDF, Word, Excel, PowerPoint, TXT, CSV, ZIP) up to 16 MB**. Open the link in a private browser window: the file should open or download at once. Otherwise ask the assistant for an upload link and add the file there. An uploaded file must be used within 7 days. |
| Photo link refused when the AI assistant adds a photo | The link must open the picture itself (not a web page or a shop page), be public **https**, and be a **JPG, PNG or WebP up to 5 MB**. Open the link in a private browser window: you should see only the picture. Otherwise ask the assistant for an upload link and add the picture there. |
| ChatGPT has no place to add a custom connector | On Plus or Pro, turn on Developer mode first (Settings → Apps & Connectors → Advanced). ChatGPT Free and Go cannot add one. On Business, Enterprise or Edu only an admin or owner can (Plugins → + → Add custom MCP server). |
| Assistant says spend is not connected | The assistant reads spend from your Meta or TikTok connection in Wsapme, not from Ads Manager. An owner or admin opens **Ads → Meta** (or **Ads → TikTok**), clicks **Connect with Facebook** and chooses the ad account; if it says **Reconnect needed**, click **Reconnect**. Spend for the last 30 days is read right after. Chats and orders are reported even without it. |
| Spend differs from Ads Manager | Meta keeps adjusting the last 1 to 3 days, and Wsapme reads spend every morning (the last 28 days once a week), so the newest days can differ a little: click **Sync now** on **Ads → Meta**. Meta's days follow the ad account's time zone. Only the ad account chosen in Wsapme is counted, in its own currency. |
| A key was lost | Keys are shown once. Create a new key and update your system to use it. |
| The assistant says it can't change many contacts at once, or the bulk tools are missing | Connect again with **Update records** ticked (and **Send messages** to put contacts in a follow-up sequence). A connector limited to some WhatsApp numbers cannot use bulk changes or change contact fields: use a connection for the whole workspace. |
| A bulk change says the dry run is too old | A dry run can be confirmed for 60 minutes. Ask the assistant to run the dry run again, check the numbers, then confirm. |
| The assistant can't send a template ("needs a value for …") | Every variable of the template needs a value, and a template with a picture, video or document header needs its file link. Give the assistant the missing values, or pick another template from the approved list. |
| My AI assistant says it can't create or change follow-up sequences | Tick **Send messages** when you connect it (or create a new connector link with it ticked). An API key needs the permission `sequences:write` (or `broadcasts:write`). |
| A document arrives without its ending (for example `INV-000123` instead of `INV-000123.pdf`) | Send `file_name` with the ending. When the name or link has none, Wsapme adds it from the file type (PDF, Word, Excel, PowerPoint, CSV, text, ZIP). |
| A link in my message arrives with a preview card I don't want (or without one) | Text messages sent with the API or the MCP connector get a WhatsApp-style preview card of their first link by default. Send `"link_preview": false` to send the link as plain text. No card means the page has no title or share picture, or could not be reached; the message is sent anyway. |
| My webhook shows nothing in the Delivery log | Check that the endpoint exists, is HTTPS and public, and that you ticked events. The log shows deliveries from the last 30 days only. |
| Claude says "Couldn't register with Wsapme's sign-in service" | Use one way, not a mix: the Wsapme address ending in `/mcp` (step 1 above) with sign-in, or the whole connector link (or the header) with **No sign-in**. Remove the connector and add it again. |
| The assistant only has search, fetch and ask_wsapme_help, nothing from my workspace | You added the help address (`/mcp/help`). Remove the connector and add the Wsapme address ending in `/mcp` (no `/help`) with sign-in, or a connector link. |
| The sign-in page says "No workspace you can connect" | Only a workspace owner or admin can allow an app, and the workspace's plan must include the developer API. Ask the owner, or upgrade in Billing. |
| The assistant asks me to sign in again | The connection was revoked on the API keys tab, or it was not used for 30 days. Connect again: sign in and click **Allow**. |
| A connector link was shared, pasted in a chat or shown in a screenshot | Treat it like a leaked password: revoke it on the API keys tab, create a new link and add the connector again. |
| The assistant cannot send a message | Create a connector link with **Send messages** ticked, and confirm each message in the chat. |
| The assistant cannot mark an order shipped or delivered, block a number or turn the chatbot off | These come with **Send messages**. Connect again and tick **Send messages**, or create a connector link with it ticked. Links and connections that already had **Send messages** got them automatically. |
| The assistant says it has no permission to change the AI agent (or the tools for it are missing) | The connection was made without **Edit the AI agent**, or before Wsapme added these tools (it lacks the `ai_agent:write` permission). Connect again and tick **Edit the AI agent**, or create a new connector link with it ticked. |

## Related

- [44 · Connected apps](https://v3.wsapme.com/guides/connected-apps.md)
- [45 · Build an app with Connect with Wsapme](https://v3.wsapme.com/guides/build-an-app-with-connect-with-wsapme.md)
- [04 · Chatbot and workflows](https://v3.wsapme.com/guides/chatbot-workflows.md)
- [05 · AI agent and knowledge](https://v3.wsapme.com/guides/ai-agent-and-knowledge.md)
- [10 · Testing chatbots and Clear chat](https://v3.wsapme.com/guides/testing-chatbots.md)
