Stop Typing

Remove the 'typing...' or 'recording audio...' status from a chat.

POST
https://api.wawp.net/v2/send/stop-typing?access_token=YOUR_ACCESS_TOKEN&chatId=201234567890%40c.us&instance_id=123456789

Authentication Required

Login to swap the placeholders with your real Instance ID and Access Token.

Log In
Test /v2/send/stop-typing endpoint
POST
POST

No query parameters required

This endpoint doesn't expect data in the URL.

Best practices

  • Consult the official documentation for detailed parameter descriptions.

  • Test endpoints in a sandbox environment before production.

  • Keep your API client library up to date.

State Cleanup: Mastering the Stop Typing Engine

The /v2/send/stop-typing endpoint is the essential "Cleanup Crew" of the Wawp presence system. While simple in its objective—to remove the "typing..." or "recording audio..." indicators—it plays a critical role in maintaining the professional polish of your WhatsApp integration. In a high-stakes customer support or sales environment, a "typing..." indicator that lingers indefinitely without a resulting message is a significant UX failure that signals system malfunction or agent indecision.


🏗️ The Presence Termination Pipeline

When you explicitly call /stop-typing, Wawp executes a coordinated cleanup across the WhatsApp stack:

  1. The PAUSE Signal: The engine transmits a specialized PAUSE packet to the target chatId. This packet instructs the recipient's WhatsApp client to immediately hide all presence indicators.
  2. Override of Implicit Timeouts: While WhatsApp has a native timeout (usually 10–20 seconds), explicit calls to /stop-typing provide instant feedback. This is crucial for fast-paced, multi-step conversational flows where states change rapidly.
  3. Internal Buffer Clearance: Wawp clears the local session's presence-tracking buffer to ensure that subsequent typing requests are treated as fresh starts, preventing "Presence Stuttering" on the recipient's UI.

🛡️ Strategic Best Practices for Presence Hygiene

1. The "Message-Sent" Auto-Stop

It is a common misconception that you must call /stop-typing immediately before sending a message.

  • Fact: Sending any message (Text, Image, PDF, etc.) to a chat automatically triggers the "Stop Typing" behavior on the WhatsApp network.
  • Optimization: To save API calls and reduce latency, do not call /v2/send/stop-typing before or after sending your final message. The message delivery itself is the most efficient way to clear the status.

2. Handling Workflow Cancellations

This is the most critical use case for the explicit stop endpoint.

  • Scenario: An agent starts a response in your CRM but then decides the inquiry belongs to a different department. They close the chat tab or transfer the ticket.
  • Best Practice: Your CRM should automatically trigger /v2/send/stop-typing whenever an agent's focus leaves a chat that was previously in a "Typing" state. This prevents the "Phantom Agent" effect where a customer sees someone typing for minutes with no result.

3. Graceful AI Failure Recovery

If your AI backend (e.g., GPT-4 or Claude) times out or returns an error while a "typing..." indicator is active, your system must handle the cleanup.

  • Implementation: Wrap your AI generation logic in a try...catch...finally block. In the finally section, if no message was successfully sent, trigger /v2/send/stop-typing. This ensures that even in the event of a crash, the customer isn't left staring at a perpetual typing status.

🧩 Advanced Use Cases

The "Search Transition" UX

In complex bot flows where a user requests a search (e.g., "Find my order"), you can use /v2/send/start-typing to show work is in progress. If the search returns 0 results, trigger /v2/send/stop-typing before sending the "No results found" text. This momentary clearing of the status creates a distinct visual "Beat" in the conversation, signaling that one phase of logic has ended and another (the error message) has begun.

Agent Transfer Synchronization

When transferring a chat between human agents, the secondary agent may want to "Pick up" the thread quietly. Triggering stop-typing during the handoff ensures the transition is visually seamless for the customer, with no overlapping or conflicting indicators from two different sessions.


🛠️ Common Pitfalls and Solutions

  • Double-Counting Latency: If your network is slow, calling /stop-typing followed immediately by a message might cause the message to arrive before the stop signal is processed, leading to a brief flicker. Solution: Rely on the "Auto-Stop" property of messages whenever possible.
  • Rate Limit Caution: While presence signals are lightweight, WhatsApp still tracks the frequency of these specialized packets. Avoid sending more than 3 stop-typing calls per second to the same chat to ensure your instance maintains a high trust score.
  • Group Environment Noise: In group chats with 200+ participants, presence indicators can be noisy. Use /stop-typing only when an agent was definitely "Active" and now definitely is "Not."

Summary of Capabilities:

  • Explicitly terminate the "typing..." or "recording audio..." presence indicators.
  • Native integration with WhatsApp PAUSE signaling for instant recipient feedback.
  • Essential for cleaning up states after agent transfers or workflow cancellations.
  • Zero-latency override of standard 20-second network-level timeouts.
  • Foundation for reliable "Try/Finally" error handling in automated AI bot systems.
  • Ensures a polished, professional conversational aesthetic by preventing "Phantom Typing."

Request Parameters

Configure the parameters required to interact with this endpoint. All query and body arguments are listed below with their details.

Request Body

Sent as a JSON object
string

Your unique WhatsApp Instance ID

Example:
string

Your API Access Token

Example:
string

Target phone number or group ID

Example:

Request Samples

Use these ready-to-go code snippets to integrate our API into your project quickly and efficiently. Choose your preferred language and library.

1const baseUrl = "https://api.wawp.net";
2const endpoint = "/v2/send/stop-typing";
3const params = new URLSearchParams({
4 "instance_id": "123456789",
5 "access_token": "YOUR_ACCESS_TOKEN"
6}).toString();
7const body = {
8 "chatId": "201234567890@c.us"
9};
10
11fetch(`${baseUrl}${endpoint}${params ? '?' + params : ''}`, {
12 method: "POST",
13 headers: { "Content-Type": "application/json" },
14 body: JSON.stringify(body)
15})
16 .then(async (response) => {
17 if (response.ok) {
18 const data = await response.json();
19 console.log("Success:", data);
20 return data;
21 }
22
23 // Error Handling
24 if (response.status === 400) {
25 console.error("Error 400: Bad Request - Missing Required Parameter(s)");
26 }
27 if (response.status === 400) {
28 console.error("Error 400: Bad Request - Invalid Number (Egypt)");
29 }
30 if (response.status === 400) {
31 console.error("Error 400: Bad Request - Invalid Number (Saudi Arabia)");
32 }
33 if (response.status === 400) {
34 console.error("Error 400: Bad Request - Invalid Number (Unknown)");
35 }
36 if (response.status === 400) {
37 console.error("Error 400: Bad Request (XML Format)");
38 }
39 if (response.status === 400) {
40 console.error("Error 400: Bad Request (Plain Text)");
41 }
42 if (response.status === 401) {
43 console.error("Error 401: Unauthorized - Invalid or Missing Access Token");
44 }
45 if (response.status === 401) {
46 console.error("Error 401: Unauthorized (XML Format)");
47 }
48 if (response.status === 404) {
49 console.error("Error 404: Not Found - Session Does Not Exist");
50 }
51 if (response.status === 404) {
52 console.error("Error 404: Not Found (XML Format)");
53 }
54 if (response.status === 429) {
55 console.error("Error 429: Too Many Requests - Rate Limit Exceeded");
56 }
57 if (response.status === 500) {
58 console.error("Error 500: Internal Server Error - Unexpected Failure");
59 }
60 if (response.status === 500) {
61 console.error("Error 500: Internal Server Error (HTML)");
62 }
63 if (response.status === 502) {
64 console.error("Error 502: Bad Gateway - Connection Failed to Upstream");
65 }
66 if (response.status === 502) {
67 console.error("Error 502: Bad Gateway (XML Format)");
68 }
69
70 const errorText = await response.text();
71 console.error(`Error ${response.status}: ${errorText}`);
72 })
73 .catch((error) => console.error("Network Error:", error));
Interactive Samples
Ln 73, Col 1javascript

Expected Responses

Explore all possible responses and outcomes from the server. We have documented each status code with data examples to make success and error handling easier.

Message Sent Successfully
Type:
application/json
object *
string *
object *
number *
boolean *
string *
string *
number *
string *
string *
string *
boolean *
number *
boolean *
boolean *
boolean *
boolean *
boolean *
array *
array *
array *
boolean *
array *

Example

{
"_data": {
  "id": {
    "fromMe": true,
    "remote": "000000000000@c.us",
    "id": "MSG_ID_123456",
    "_serialized": "true_000000000000@c.us_MSG_ID_123456"
    },
  "viewed": false,
  "body": "BASE64_IMAGE_DATA",
  "type": "image",
  "t": 1759108866,
  "from": {
    "server": "c.us",
    "user": "111111111111",
    "_serialized": "111111111111@c.us"
    },
  "to": {
    "server": "c.us",
    "user": "000000000000",
    "_serialized": "000000000000@c.us"
    },
  "ack": 0,
  "isNewMsg": true,
  "star": false,
  "kicNotified": false,
  "caption": "Here's your requested image.",
  "deprecatedMms3Url": "https://example.com/media-url",
  "directPath": "/media/direct/path/example",
  "mimetype": "image/jpeg",
  "filehash": "FILE_HASH_PLACEHOLDER",
  "encFilehash": "ENC_FILE_HASH_PLACEHOLDER",
  "size": 192487,
  "mediaKey": "MEDIA_KEY_PLACEHOLDER",
  "mediaKeyTimestamp": 1759108865,
  "streamable": false,
  "mediaHandle": null,
  "isFromTemplate": false,
  "pollInvalidated": false,
  "isSentCagPollCreation": false,
  "latestEditMsgKey": null,
  "latestEditSenderTimestampMs": null,
  "mentionedJidList": {
    },
  "groupMentions": {
    },
  "isEventCanceled": false,
  "eventInvalidated": false,
  "isVcardOverMmsDocument": false,
  "isForwarded": false,
  "isQuestion": false,
  "questionReplyQuotedMessage": null,
  "questionResponsesCount": 0,
  "readQuestionResponsesCount": 0,
  "labels": {
    },
  "hasReaction": false,
  "disappearingModeInitiator": "chat",
  "disappearingModeTrigger": "chat_settings",
  "productHeaderImageRejected": false,
  "lastPlaybackProgress": 0,
  "isDynamicReplyButtonsMsg": false,
  "isCarouselCard": false,
  "parentMsgId": null,
  "callSilenceReason": null,
  "isVideoCall": false,
  "callDuration": null,
  "callCreator": null,
  "callParticipants": null,
  "isCallLink": null,
  "callLinkToken": null,
  "isMdHistoryMsg": false,
  "stickerSentTs": 0,
  "lastUpdateFromServerTs": 0,
  "invokedBotWid": null,
  "bizBotType": null,
  "botResponseTargetId": null,
  "botPluginType": null,
  "botPluginReferenceIndex": null,
  "botPluginSearchProvider": null,
  "botPluginSearchUrl": null,
  "botPluginSearchQuery": null,
  "botPluginMaybeParent": false,
  "botReelPluginThumbnailCdnUrl": null,
  "botMessageDisclaimerText": null,
  "botMsgBodyType": null,
  "requiresDirectConnection": false,
  "bizContentPlaceholderType": null,
  "hostedBizEncStateMismatch": false,
  "senderOrRecipientAccountTypeHosted": false,
  "placeholderCreatedWhenAccountIsHosted": false,
  "galaxyFlowDisabled": false,
  "links": {
    }
  },
"mediaKey": "MEDIA_KEY_PLACEHOLDER",
"id": {
  "fromMe": true,
  "remote": "000000000000@c.us",
  "id": "MSG_ID_123456",
  "_serialized": "true_000000000000@c.us_MSG_ID_123456"
  },
"ack": 0,
"hasMedia": true,
"body": "Here's your requested image.",
"type": "image",
"timestamp": 1759108866,
"from": "111111111111@c.us",
"to": "000000000000@c.us",
"deviceType": "android",
"isForwarded": false,
"forwardingScore": 0,
"isStatus": false,
"isStarred": false,
"fromMe": true,
"hasQuotedMsg": false,
"hasReaction": false,
"vCards": {
  },
"mentionedIds": {
  },
"groupMentions": {
  },
"isGif": false,
"links": {
  }
}
Bad Request - Missing Required Parameter(s)
Unauthorized - Invalid or Missing Access Token
Not Found - Session Does Not Exist
Too Many Requests - Rate Limit Exceeded
Internal Server Error - Unexpected Failure
Bad Gateway - Connection Failed to Upstream
Previous TopicStart Typing
Next TopicReaction

Command Palette

Search for a command to run...