{"info":{"_postman_id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","name":"🚀 Programmable WhatsApp API by 2Chat","description":"<html><head></head><body><img src=\"https://content.pstmn.io/72ddfcb7-9875-49be-b527-08cb93c539a6/czNhMjBhYjZiNTA4MGU3N2IxYjMzZTJiNDI2NmNiNDBkMTU5MWUwNWVjMjFmY2M3YWRlYjMxODhhODZiMmFhZTIgKDEpLnBuZw==\" alt=\"2chat.co\" width=\"166\" height=\"176\">\n\n<p><a href=\"https://2chat.co?ref=postman\">2Chat</a> is an automation layer built on top of WhatsApp and other text channels. This API powers that service and is available to developers like you to build upon.</p>\n<h2 id=\"📌-before-you-begin\">📌 Before you begin</h2>\n<p>Clone this collection into Postman's desktop application to run it as doing it from a browser may cause CORS errors.</p>\n<h2 id=\"👶-create-an-account\">👶 Create an account</h2>\n<p>You will need a 2Chat account and a <a href=\"https://help.2chat.io/en/articles/7243195-how-to-create-a-whatsapp-channel\">connected number</a> to be able to use this API. You can do so <a href=\"https://app.2chat.io/signup\">here</a>.</p>\n<h2 id=\"🔒-authentication\">🔒 Authentication</h2>\n<p>We enforce HTTP-header-based API-key authentication on the endpoints that provide functionality, like for sending and receiving messages.</p>\n<p>Your API Key can be obtained after signing up for the service and renewed/changed at any time.</p>\n<p>For more information about how to get your API key, <a href=\"https://help.2chat.io/en/articles/7830948-where-you-can-find-the-api-code-in-2chat\">check this article</a> from our help center.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Header</th>\n<th>Value</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>X-User-API-Key</code></td>\n<td><code>my_api_key_value</code></td>\n<td>Your API Key</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"environment-configuration\">Environment configuration</h3>\n<p>Configure the API key you got in the previous step inside the 2Chat environment. If it doesn't exist you, can create it.</p>\n<img src=\"https://content.pstmn.io/4dd3213e-a127-400e-a3bd-aa03b9a0391a/aW1hZ2UucG5n\" alt=\"Configuring%20the%20API%20key\" width=\"1962\" height=\"544\">\n\n<h3 id=\"extra-environment-variables\">Extra environment variables</h3>\n<p>You will also need to configure the phone number (<code>CONNECTED_NUMBER</code> variable) you have connected to 2Chat.</p>\n<img src=\"https://content.pstmn.io/496a606e-01cc-448f-97f3-916b20e7d57f/aW1hZ2UucG5n\" alt=\"Configuring%20the%20collection%20variables\" width=\"2176\" height=\"548\">\n\n<p>You can leave the <code>WHATSAPP_GROUP_UUID</code> unassigned until you want to test the WhatsApp group-related endpoints.</p>\n<h2 id=\"⚠️-authentication-error-response\">⚠️ Authentication error response</h2>\n<p>If an API key is missing, malformed, or invalid, you will receive an <strong>HTTP 401</strong> Unauthorized response code.</p>\n<p>Likewise, if your account expires, <strong>HTTP 402 Payment required</strong> will arrive as an answer.</p>\n<h2 id=\"💨-rate-and-usage-limits\">💨 Rate and usage limits</h2>\n<p>API access rate limits apply on a per-API key basis per unit of time. Also, depending on your plan, you may have usage limits. If you exceed either limit, your request will return an HTTP 429 Too Many Requests status code.</p>\n<p>To prevent abuse, trial accounts are <strong>limited to 10 requests per minute which is 1 request every 6 seconds</strong>. To remove this restriction, <a href=\"https://app.2chat.io/billing\">please consider upgrading your account</a>.</p>\n<h2 id=\"❌-503-response\">❌ 503 response</h2>\n<p>An HTTP <code>503</code> response from our servers indicates there is an unexpected spike in API access traffic. The server is usually operational within the next few minutes. If the outage persists or you receive any other form of an HTTP <code>5XX</code> error, <a href=\"https://mailto:support@2chat.co\">contact support</a>.</p>\n<h2 id=\"📙-need-some-help\">📙 <strong>Need some help?</strong></h2>\n<p>Please check out our <a href=\"https://developers.2chat.co/\">Developers Portal</a> and <a href=\"https://help.2chat.io/en/\">Help Center</a>.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"20444184","collectionId":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","publishedId":"2s946h9YKd","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2023-07-18T15:35:23.000Z"},"item":[{"name":"✅ Check if your API key works","item":[{"name":"Get account information","event":[{"listen":"test","script":{"id":"655ee05e-0c82-4add-a380-b9cfaa091e4b","exec":[""],"type":"text/javascript"}}],"id":"2fd0e781-263c-403a-9eba-17d2ea867eac","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://api.p.2chat.io/open/info/","description":"<p>Gets information about the authenticated user.</p>\n","auth":{"type":"apikey","apikey":{"value":"{{API_KEY_VALUE}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","name":"🚀 Programmable WhatsApp API by 2Chat","type":"collection"}},"urlObject":{"protocol":"https","path":["open","info",""],"host":["api","p","2chat","io"],"query":[],"variable":[]}},"response":[{"id":"a18bc9a3-2ab8-4dcb-a3f0-9ee2e2194af3","name":"Successful Response","originalRequest":{"method":"GET","header":[],"url":"https://api.p.2chat.io/open/info/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","name":"Content-Type","description":{"content":"","type":"text/plain"}}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"account\": {\n        \"name\": \"My Test Account\",\n        \"uuid\": \"ACC91be87af-5a29-4034-b599-342f2aeb5d52\",\n        \"on_trial\": true,\n        \"blocked\": false,\n        \"block_reason\": null,\n        \"created_at\": \"2022-04-21T21:55:37Z\",\n        \"expires_at\": \"2023-08-14T15:32:21Z\"\n    },\n    \"limits\": {\n        \"requests_per_minute\": 10\n    }\n}"}],"_postman_id":"2fd0e781-263c-403a-9eba-17d2ea867eac"}],"id":"dee3f61b-2b3f-4c52-9699-e9dff8440a4d","description":"<p>The <code>/info</code> endpoint will return your account's status together with its limits.</p>\n","_postman_id":"dee3f61b-2b3f-4c52-9699-e9dff8440a4d","auth":{"type":"apikey","apikey":{"value":"{{API_KEY_VALUE}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","name":"🚀 Programmable WhatsApp API by 2Chat","type":"collection"}}},{"name":"💬 WhatsApp Messenger & WhatsApp Business","item":[{"name":"Webhooks","item":[{"name":"List all webhooks","event":[{"listen":"test","script":{"id":"d699c28f-b4d0-45ec-8902-0cc1b1129fd1","exec":[""],"type":"text/javascript"}}],"id":"afd2791f-4cfc-456b-a476-d13e576686a1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"}],"url":"https://api.p.2chat.io/open/webhooks","description":"<p>This endpoint will return all configured and enabled webhooks you have in your 2Chat account.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Description</th>\n<th>Example values</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>uuid</code></td>\n<td>The unique identifier of the webhook that you will need to make changes to it</td>\n<td><code>WHKdc78c87e-5b18-47c7-9183-5bf527fd6c69</code></td>\n</tr>\n<tr>\n<td><code>event_name</code></td>\n<td>The name of the event this webhook is subscribed to</td>\n<td><code>whatsapp.call.received</code>.</td>\n</tr>\n<tr>\n<td><code>channel_uuid</code></td>\n<td>The unique UUID of the channel this webhook is subscribed to</td>\n<td><code>WPN95841312-b54d-46e3-b0bc-6414f4a5296b</code></td>\n</tr>\n<tr>\n<td><code>hook_url</code></td>\n<td>The URL 2Chat will call when a event is triggered</td>\n<td><code>https://my-dev-server</code></td>\n</tr>\n<tr>\n<td><code>hook_params</code></td>\n<td>Custom parameters 2Chat sets to make the webhook functional</td>\n<td><code>{}</code></td>\n</tr>\n<tr>\n<td><code>created_at</code></td>\n<td>UTC timestamp for when the webhook was created</td>\n<td><code>2023-04-17T18:50:45Z</code></td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"apikey","apikey":{"value":"{{API_KEY_VALUE}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","name":"🚀 Programmable WhatsApp API by 2Chat","type":"collection"}},"urlObject":{"protocol":"https","path":["open","webhooks"],"host":["api","p","2chat","io"],"query":[],"variable":[]}},"response":[{"id":"4b0ee860-17e5-4155-a367-597143fdc652","name":"Successful Response","originalRequest":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"}],"url":"https://api.p.2chat.io/open/webhooks"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","name":"Content-Type","description":{"content":"","type":"text/plain"}}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"webhooks\": [\n        {\n            \"uuid\": \"WHKdc78c87e-5b18-47c7-9183-5bf527fd6c69\",\n            \"event_name\": \"whatsapp.message.received\",\n            \"channel_uuid\": \"WPN95841312-b54d-46e3-b0bc-6414f4a5296b\",\n            \"hook_url\": \"https://www.toptal.com/developers/postbin/1681755466939-3421728690154\",\n            \"hook_params\": {\n                \"waweb_uuid\": \"WPN95841312-b54d-46e3-b0bc-6414f4a5296b\"\n            },\n            \"created_at\": \"2023-04-17T18:50:50Z\"\n        },\n        {\n            \"uuid\": \"WHKe768c62c-d41f-49a9-82ff-8982a0683902\",\n            \"event_name\": \"whatsapp.message.sent\",\n            \"channel_uuid\": \"WPN95841312-b54d-46e3-b0bc-6414f4a5296b\",\n            \"hook_url\": \"https://www.toptal.com/developers/postbin/1681755466939-3421728690154\",\n            \"hook_params\": {\n                \"waweb_uuid\": \"WPN95841312-b54d-46e3-b0bc-6414f4a5296b\"\n            },\n            \"created_at\": \"2023-04-17T18:50:45Z\"\n        }\n    ]\n}"}],"_postman_id":"afd2791f-4cfc-456b-a476-d13e576686a1"},{"name":"Subscribe to webhook","event":[{"listen":"test","script":{"id":"d699c28f-b4d0-45ec-8902-0cc1b1129fd1","exec":[""],"type":"text/javascript"}}],"id":"7b669a2f-c3ec-4582-9e35-8ccac34007f6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"hook_url\": \"https://www.toptal.com/developers/postbin/1681755466939-3421728690154\",\n    \"on_number\": \"+595981048477\"\n}"},"url":"https://api.p.2chat.io/open/webhooks/subscribe/{{WEBHOOK_NAME}}","description":"<p>Posting a request to this endpoint will create a new webhook subscription to the specified event.</p>\n<h4 id=\"list-of-accepted-events\">List of accepted events</h4>\n<p>Any of these events can be specified as a query parameter in the invocation URL.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Event</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>whatsapp.call.received</code></td>\n<td>Triggers when a new WhatsApp call is received and <strong>missed</strong></td>\n</tr>\n<tr>\n<td><code>whatsapp.message.new</code></td>\n<td>Triggers when a new WhatsApp message is either <strong>sent</strong> or <strong>received</strong></td>\n</tr>\n<tr>\n<td><code>whatsapp.message.received</code></td>\n<td>Triggers when a new WhatsApp message is <strong>received</strong></td>\n</tr>\n<tr>\n<td><code>whatsapp.message.sent</code></td>\n<td>Triggers when a new WhatsApp message is <strong>sent</strong></td>\n</tr>\n<tr>\n<td><code>whatsapp.conversation.new</code></td>\n<td>Triggers when a new WhatsApp conversation <strong>is started</strong></td>\n</tr>\n<tr>\n<td><code>whatsapp.audio.transcribed</code></td>\n<td>Triggers when a new WhatsApp audio message is <strong>transcribed to text</strong></td>\n</tr>\n</tbody>\n</table>\n</div><h5 id=\"whatsapp-group-related-events\">WhatsApp group related events:</h5>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Event</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>whatsapp.group.message.received</code></td>\n<td>Triggers when a message is received on a WhatsApp group your number is part of</td>\n</tr>\n<tr>\n<td><code>whatsapp.group.join</code></td>\n<td>Triggers when someone joins a group</td>\n</tr>\n<tr>\n<td><code>whatsapp.group.leave</code></td>\n<td>Triggers when some leaves a group</td>\n</tr>\n<tr>\n<td><code>whatsapp.group.remove</code></td>\n<td>Triggers when someone is kicked/removed from a group</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"parameters\">Parameters</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>hook_url</code></td>\n<td>A valid and publicly reachable URL that 2Chat will invoke when the event is triggered</td>\n</tr>\n<tr>\n<td><code>on_number</code></td>\n<td>The phone number that you have configured and connected to 2Chat. Always make sure it is connected</td>\n</tr>\n<tr>\n<td><code>time_period</code></td>\n<td>Required only if you are subscribing to <code>whatsapp.conversation.new</code>.</td>\n</tr>\n</tbody>\n</table>\n</div><p>For the <code>whatsapp.conversation.new</code> event, you can specify also the time period of your preference to consider a conversation new.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Time Period Value</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>all-time</code></td>\n<td>Will trigger the new conversation event when the user messages you for the first time ever. This is the default value when no time period is specified</td>\n</tr>\n<tr>\n<td><code>hour</code></td>\n<td>Will trigger the new conversation event after 1 hour of no messages</td>\n</tr>\n<tr>\n<td><code>day</code></td>\n<td>Will trigger the new conversation event after 1 day of no messages</td>\n</tr>\n<tr>\n<td><code>week</code></td>\n<td>Will trigger the new conversation event after 1 week of no messages</td>\n</tr>\n<tr>\n<td><code>month</code></td>\n<td>Will trigger the new conversation event after 1 month of no messages</td>\n</tr>\n<tr>\n<td><code>year</code></td>\n<td>Will trigger the new conversation event after 1 year of no messages</td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"apikey","apikey":{"value":"{{API_KEY_VALUE}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","name":"🚀 Programmable WhatsApp API by 2Chat","type":"collection"}},"urlObject":{"protocol":"https","path":["open","webhooks","subscribe","{{WEBHOOK_NAME}}"],"host":["api","p","2chat","io"],"query":[],"variable":[]}},"response":[{"id":"20be28f1-9201-4d36-8fa2-5840d3d3c363","name":"Successful Response","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"hook_url\": \"https://www.toptal.com/developers/postbin/1681755466939-3421728690154\",\n    \"on_number\": \"+595981048477\"\n}","options":{"raw":{"language":"json"}}},"url":"https://api.p.2chat.io/open/webhooks/subscribe/{{WEBHOOK_NAME}}"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","name":"Content-Type","description":{"content":"","type":"text/plain"}}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"uuid\": \"WHK530c9d58-2259-4ce2-82a8-1941f3a60665\",\n        \"event_name\": \"whatsapp.message.sent\",\n        \"channel_uuid\": \"WPN95841312-b54d-46e3-b0bc-6414f4a5296b\",\n        \"hook_url\": \"https://www.toptal.com/developers/postbin/1681755466939-3421728690154\",\n        \"hook_params\": {\n            \"waweb_uuid\": \"WPN95841312-b54d-46e3-b0bc-6414f4a5296b\"\n        },\n        \"created_at\": \"2023-04-18T01:58:02Z\"\n    }\n}"}],"_postman_id":"7b669a2f-c3ec-4582-9e35-8ccac34007f6"},{"name":"Delete webhook subscription","event":[{"listen":"test","script":{"id":"d699c28f-b4d0-45ec-8902-0cc1b1129fd1","exec":[""],"type":"text/javascript"}}],"id":"a6c176a7-90fa-4790-9117-0b961b99a5e9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Content-Type","value":"application/json"}],"url":"https://api.p.2chat.io/open/webhooks/{{WEBHOOK_UUID}}","description":"<p>With this endpoint, you will be able to delete webhooks you have previously created using this API.</p>\n<h3 id=\"requirements\">Requirements</h3>\n<p>The query path in the invocation URL must have the ID of the webhook you want to delete. This ID always starts with <code>WHK</code> followed by 36 characters. For example: <code>WHK530c9d58-2259-4ce2-82a8-1941f3a60665</code>.</p>\n<p>If you want to obtain the ID required to delete a webhook, you can do so using the <a href=\"https://developers.2chat.co/docs/API/WhatsApp/webhooks/list-all-webhooks\">List All Webhooks</a> endpoint.</p>\n","auth":{"type":"apikey","apikey":{"value":"{{API_KEY_VALUE}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","name":"🚀 Programmable WhatsApp API by 2Chat","type":"collection"}},"urlObject":{"protocol":"https","path":["open","webhooks","{{WEBHOOK_UUID}}"],"host":["api","p","2chat","io"],"query":[],"variable":[]}},"response":[{"id":"160bf791-693c-4893-a9c4-a9eaab237c41","name":"Successful Response","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"collection\": {\n        \"info\": {\n            \"name\": \"Test Collection\",\n            \"description\": \"This collection makes a request to the Postman Echo service to get a list of request headers sent by an HTTP client.\",\n            \"schema\": \"https://schema.getpostman.com/json/collection/v2.1.0/collection.json\"\n        },\n        \"item\": [\n            {\n                \"name\": \"Test GET Response\",\n                \"event\": [\n                    {\n                        \"listen\": \"test\",\n                        \"script\": {\n                            \"id\": \"7d2334fc-a84a-4c3d-b26c-7529afa4c0ae\",\n                            \"exec\": [\n                                \"pm.test(\\\"Status code is 200\\\", function () {\",\n                                \"    pm.response.to.have.status(200);\",\n                                \"});\"\n                                ],\n                            \"type\": \"text/javascript\"\n                            }\n                        }\n                    ],\n                \"request\": {\n                    \"url\": \"https://echo.getpostman.com/headers\",\n                    \"method\": \"GET\",\n                    \"header\": [\n                        {\n                            \"key\": \"Content-Type\",\n                            \"value\": \"application/json\"\n                        }\n                    ]\n                }\n            }\n        ]\n    }\n}","options":{"raw":{"language":"json"}}},"url":"https://api.p.2chat.io/open/webhooks/{{WEBHOOK_UUID}}"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","name":"Content-Type","description":{"content":"","type":"text/plain"}}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true\n}"}],"_postman_id":"a6c176a7-90fa-4790-9117-0b961b99a5e9"}],"id":"6b1b6e71-32b2-4079-b745-fe38e88557c3","description":"<p>This endpoint will help you create and manage webhooks to be able to know in real time when WhatsApp messages are sent or received.</p>\n","_postman_id":"6b1b6e71-32b2-4079-b745-fe38e88557c3","auth":{"type":"apikey","apikey":{"value":"{{API_KEY_VALUE}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","name":"🚀 Programmable WhatsApp API by 2Chat","type":"collection"}}},{"name":"List numbers","event":[{"listen":"test","script":{"id":"d699c28f-b4d0-45ec-8902-0cc1b1129fd1","exec":[""],"type":"text/javascript"}}],"id":"5b858aba-2e28-4723-8bd0-93f126eb8917","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"}],"url":"https://api.p.2chat.io/open/whatsapp/get-numbers","description":"<p>This endpoint will help you list the numbers you have connected to 2Chat.</p>\n<h3 id=\"response\">Response</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Description</th>\n<th>Example values</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>uuid</code></td>\n<td>The unique identifier of the number</td>\n<td><code>WPN95841312-b54d-46e3-b0bc-6414f4a5296b</code></td>\n</tr>\n<tr>\n<td><code>friendly_name</code></td>\n<td>the friendly name you chose for your number</td>\n<td><code>my number</code>.</td>\n</tr>\n<tr>\n<td><code>phone_number</code></td>\n<td>the phone number in international format</td>\n<td><code>+595981048477</code></td>\n</tr>\n<tr>\n<td><code>iso_country_code</code></td>\n<td>the two-letter country code of the number</td>\n<td><code>US</code></td>\n</tr>\n<tr>\n<td><code>pushname</code></td>\n<td>the nickname you chose on WhatsApp</td>\n<td><code>My business</code></td>\n</tr>\n<tr>\n<td><code>server</code></td>\n<td>WhatsApp-specific value</td>\n<td><code>595981048477@c.us</code></td>\n</tr>\n<tr>\n<td><code>platform</code></td>\n<td>The mobile device your WhatsApp app is running on</td>\n<td><code>android</code></td>\n</tr>\n<tr>\n<td><code>connection_status</code></td>\n<td>2Chat value indicating the connection status to WhatsApp</td>\n<td><code>C</code> = <code>connected</code>, <code>D</code> = <code>disconnected</code>, <code>F</code> = <code>failure</code></td>\n</tr>\n<tr>\n<td><code>enabled</code></td>\n<td>Whether the number is enabled or not on 2Chat</td>\n<td><code>true</code></td>\n</tr>\n<tr>\n<td><code>is_business_profile</code></td>\n<td>Whether the number is on Regular WhatsApp or WhatsApp for Business</td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td><code>channel_type</code></td>\n<td>The type of channel</td>\n<td><code>WW</code> = <code>WhatsApp Web</code>, <code>IG</code> = <code>Instagram</code>, <code>SMS</code> = <code>Phone Text Messages</code>.</td>\n</tr>\n<tr>\n<td><code>sync_contacts</code></td>\n<td>Whether you have enabled importing your phone directory to 2Chat</td>\n<td><code>true</code></td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"apikey","apikey":{"value":"{{API_KEY_VALUE}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","name":"🚀 Programmable WhatsApp API by 2Chat","type":"collection"}},"urlObject":{"protocol":"https","path":["open","whatsapp","get-numbers"],"host":["api","p","2chat","io"],"query":[],"variable":[]}},"response":[{"id":"6fd319df-7f19-486c-a94a-b3ab8695a0ab","name":"Successful Response","originalRequest":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"}],"url":"https://api.p.2chat.io/open/whatsapp/get-numbers"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","name":"Content-Type","description":{"content":"","type":"text/plain"}}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"numbers\": [\n        {\n            \"uuid\": \"WPN95841312-b54d-46e3-b0bc-6414f4a5296b\",\n            \"friendly_name\": \"my testing number\",\n            \"phone_number\": \"+595981048477\",\n            \"iso_country_code\": \"PY\",\n            \"pushname\": \"✌️\",\n            \"server\": \"595981048477@c.us\",\n            \"platform\": \"iphone\",\n            \"connection_status\": \"C\",\n            \"enabled\": true,\n            \"is_business_profile\": false,\n            \"channel_type\": \"WW\",\n            \"sync_contacts\": true,\n            \"created_at\": \"2022-10-31 22:05:44\",\n            \"updated_at\": \"2022-12-01 21:40:04\"\n        }\n    ]\n}"}],"_postman_id":"5b858aba-2e28-4723-8bd0-93f126eb8917"},{"name":"List groups","event":[{"listen":"test","script":{"id":"d699c28f-b4d0-45ec-8902-0cc1b1129fd1","exec":[""],"type":"text/javascript"}}],"id":"250000a1-7043-4f12-b80a-f41304c7321e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"}],"url":"https://api.p.2chat.io/open/whatsapp/groups/","description":"<p>Using a 2Chat-connected number as the source, this endpoint will get you a list of all groups such number is a participant of.</p>\n<h3 id=\"response\">Response</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Description</th>\n<th>Example value</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>uuid</code></td>\n<td>The unique identifier of the group</td>\n<td><code>WAG768beeef-2b96-4bc7-9b7f-045078568723</code></td>\n</tr>\n<tr>\n<td><code>channel_uuid</code></td>\n<td>The unique identifier of the channel</td>\n<td><code>WPN95841312-b54d-46e3-b0bc-6414f4a5296b</code></td>\n</tr>\n<tr>\n<td><code>wa_group_id</code></td>\n<td>WhatsApp's internal identifier for the group</td>\n<td><code>...@g.us</code></td>\n</tr>\n<tr>\n<td><code>profile_pic_url</code></td>\n<td>URL to the profile picture of the group</td>\n<td><code>https://...</code></td>\n</tr>\n<tr>\n<td><code>wa_owner_id</code></td>\n<td>WhatsApp's internal identifier for the owner of the group</td>\n<td><code>17137157533@c.us</code></td>\n</tr>\n<tr>\n<td><code>wa_group_name</code></td>\n<td>Name of the group</td>\n<td><code>2chat test group 👌</code></td>\n</tr>\n<tr>\n<td><code>wa_created_at</code></td>\n<td>The date the group was created at</td>\n<td><code>2022-10-23T17:11:41Z</code></td>\n</tr>\n<tr>\n<td><code>wa_subject</code></td>\n<td>Subject of the group</td>\n<td><code>daily motivational quotes 💪</code></td>\n</tr>\n<tr>\n<td><code>size</code></td>\n<td>The number of participants in this group</td>\n<td><code>4</code></td>\n</tr>\n<tr>\n<td><code>is_muted</code></td>\n<td>Whether the group is muted on your phone</td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td><code>is_read_only</code></td>\n<td>Whether the group is read-only or not</td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td><code>channel_is_owner</code></td>\n<td>Whether you own the group or not</td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td><code>created_at</code></td>\n<td>Timestamp of when the group was registered on 2Chat</td>\n<td><code>2023-06-22T20:02:56Z</code></td>\n</tr>\n<tr>\n<td><code>updated_at</code></td>\n<td>The last time 2Chat pulled information about the group</td>\n<td><code>2023-07-12T19:18:41Z</code></td>\n</tr>\n<tr>\n<td><code>owner_contact</code></td>\n<td>The contact information of the owner of the group, if present</td>\n<td><code>true</code></td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"apikey","apikey":{"value":"{{API_KEY_VALUE}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","name":"🚀 Programmable WhatsApp API by 2Chat","type":"collection"}},"urlObject":{"protocol":"https","path":["open","whatsapp","groups",""],"host":["api","p","2chat","io"],"query":[],"variable":[]}},"response":[{"id":"4a0f38c9-2136-4ff2-b5e7-6684fbc56e3c","name":"Successful Response","originalRequest":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"https://api.p.2chat.io/open/whatsapp/groups/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","name":"Content-Type","description":{"content":"","type":"text/plain"}}],"cookie":[],"responseTime":null,"body":"{\n    {\n    \"success\": true,\n    \"data\": [\n        {\n            \"uuid\": \"WAG768beeef-2b96-4bc7-9b7f-045078568723\",\n            \"channel_uuid\": \"WPN95841312-b54d-46e3-b0bc-6414f4a5296b\",\n            \"wa_group_id\": \"....@g.us\",\n            \"profile_pic_url\": \"...\",\n            \"wa_owner_id\": \"17137157533@c.us\",\n            \"wa_group_name\": \"2chat test group 👌\",\n            \"wa_created_at\": \"2022-10-23T17:11:41Z\",\n            \"wa_subject\": \"daily motivational quotes 💪\",\n            \"size\": 4,\n            \"is_muted\": false,\n            \"is_read_only\": false,\n            \"channel_is_owner\": false,\n            \"created_at\": \"2023-06-22T20:02:56Z\",\n            \"updated_at\": \"2023-07-12T19:18:41Z\",\n            \"owner_contact\": {\n                \"uuid\": \"CON1653490d-194b-4992-8353-e4b46a64e321\",\n                \"first_name\": \"Mikey\",\n                \"last_name\": \"Mike\",\n                \"channel_uuid\": \"WPNc568c832-606c-4d50-8092-fc51b5149d16\",\n                \"profile_pic_url\": \"...\"\n            }\n        }\n    ]\n  }\n}"}],"_postman_id":"250000a1-7043-4f12-b80a-f41304c7321e"},{"name":"List group participants","event":[{"listen":"test","script":{"id":"d699c28f-b4d0-45ec-8902-0cc1b1129fd1","exec":[""],"type":"text/javascript"}}],"id":"1eee134e-84fb-4e45-b93b-cc207fae71c5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"}],"url":"https://api.p.2chat.io/open/whatsapp/group/","description":"<p>Get all participants of a WhatsApp group.</p>\n<p>You need the <code>UUID</code> of the group to pull this information. You can get it from the <a href=\"https://developers.2chat.co/docs/API/WhatsApp/list-whatsapp-groups\">List WhatsApp Groups endpoint</a>.</p>\n<h3 id=\"response\">Response</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Description</th>\n<th>Example value</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>owner_data</code></td>\n<td>Information about the owner of the group, including their phone number</td>\n<td></td>\n</tr>\n<tr>\n<td><code>participant.wa_participant_id</code></td>\n<td>WhatsApp's internal identifier for the participant</td>\n<td><code>595981048477@c.us</code></td>\n</tr>\n<tr>\n<td><code>participant.wa_pushname</code></td>\n<td>Push name or Notify name of the participant</td>\n<td><code>Mikey</code></td>\n</tr>\n<tr>\n<td><code>participant.profile_pic_url</code></td>\n<td>URL to the profile picture of the partcipant</td>\n<td><code>https://</code></td>\n</tr>\n<tr>\n<td><code>participant.wa_is_super_admin</code></td>\n<td>Whether the participant owns the group or not</td>\n<td><code>true</code></td>\n</tr>\n<tr>\n<td><code>participant.wa_is_admin</code></td>\n<td>Whether the participant is an administrator in group or not</td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td><code>participant.device</code></td>\n<td>The participant last known device</td>\n<td>Any of <code>android</code>, <code>ios</code>, or <code>web</code></td>\n</tr>\n<tr>\n<td><code>participant.phone_number</code></td>\n<td>The phone number of the participant</td>\n<td><code>+595981048477</code></td>\n</tr>\n<tr>\n<td><code>participant.iso_country_code</code></td>\n<td>The country code the phone number belongs to</td>\n<td><code>PY</code></td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"apikey","apikey":{"value":"{{API_KEY_VALUE}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","name":"🚀 Programmable WhatsApp API by 2Chat","type":"collection"}},"urlObject":{"protocol":"https","path":["open","whatsapp","group",""],"host":["api","p","2chat","io"],"query":[],"variable":[]}},"response":[{"id":"156a5b51-d933-44a2-b44e-5883baac3158","name":"Successful Response","originalRequest":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"}],"url":"https://api.p.2chat.io/open/whatsapp/group/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","name":"Content-Type","description":{"content":"","type":"text/plain"}}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"uuid\": \"WGP768beeef-2b96-4bc7-9b7f-045078568723\",\n        \"channel_uuid\": \"WPN95841312-b54d-46e3-b0bc-6414f4a5296b\",\n        \"wa_group_id\": \"...@g.us\",\n        \"profile_pic_url\": \"...\",\n        \"wa_owner_id\": \"5215530483303@c.us\",\n        \"wa_group_name\": \"2chat test group 👌\",\n        \"wa_created_at\": \"2022-10-23T17:11:41Z\",\n        \"wa_subject\": \"daily motivational quotes 💪\",\n        \"size\": 3,\n        \"is_muted\": false,\n        \"is_read_only\": false,\n        \"channel_is_owner\": false,\n        \"created_at\": \"2023-06-22T20:02:56Z\",\n        \"updated_at\": \"2023-07-12T19:18:41Z\",\n        \"owner_contact\": {\n            \"uuid\": \"CON1653490d-194b-4992-8353-e4b46a64e321\",\n            \"first_name\": \"Mikey\",\n            \"last_name\": \"Mike\",\n            \"channel_uuid\": \"WPNc568c832-606c-4d50-8092-fc51b5149d16\",\n            \"profile_pic_url\": \"...\"\n        },\n        \"owner_data\": {\n            \"phone_number\": \"...\",\n            \"formatted_phone_number\": \"...\",\n            \"iso_country_code\": \"MX\"\n        },\n        \"participants\": [\n            {\n                \"wa_participant_id\": \"447700176576@c.us\",\n                \"wa_pushname\": \"Carlos @ 2Chat\",\n                \"profile_pic_url\": \"...\",\n                \"wa_is_super_admin\": false,\n                \"wa_is_admin\": false,\n                \"device\": \"ios\",\n                \"created_at\": \"2023-07-11T19:21:45Z\",\n                \"updated_at\": \"2023-07-12T19:18:41Z\",\n                \"contact\": {\n                    \"uuid\": \"CON767f3ab9-e2c1-48e0-9234-092e835fa089\",\n                    \"first_name\": \"2Chat\",\n                    \"last_name\": \"UK\",\n                    \"channel_uuid\": null,\n                    \"profile_pic_url\": null\n                },\n                \"phone_number\": \"+447700176576\",\n                \"formatted_phone_number\": \"+44 7700 176576\",\n                \"iso_country_code\": \"GB\"\n            },\n            {\n                \"wa_participant_id\": \"5215617554529@c.us\",\n                \"wa_pushname\": \"Mikey\",\n                \"profile_pic_url\": \"...\",\n                \"wa_is_super_admin\": false,\n                \"wa_is_admin\": false,\n                \"device\": null,\n                \"created_at\": \"2023-07-11T19:30:03Z\",\n                \"updated_at\": \"2023-07-12T19:18:41Z\",\n                \"phone_number\": \"+525617554529\",\n                \"formatted_phone_number\": \"+52 56 1755 4529\",\n                \"iso_country_code\": \"MX\"\n            },\n            {\n                \"wa_participant_id\": \"595981048477@c.us\",\n                \"wa_pushname\": null,\n                \"profile_pic_url\": null,\n                \"wa_is_super_admin\": false,\n                \"wa_is_admin\": true,\n                \"device\": null,\n                \"created_at\": \"2023-06-23T19:43:31Z\",\n                \"updated_at\": \"2023-07-12T19:18:40Z\",\n                \"contact\": {\n                    \"uuid\": \"CON36b2bc38-c21a-4712-8015-99bf2f8001f6\",\n                    \"first_name\": \"2Chat\",\n                    \"last_name\": \"PAR\",\n                    \"channel_uuid\": \"WPNc568c832-606c-4d50-8092-fc51b5149d16\",\n                    \"profile_pic_url\": null\n                },\n                \"phone_number\": \"+595981048477\",\n                \"formatted_phone_number\": \"+595 981 048477\",\n                \"iso_country_code\": \"PY\"\n            }\n        ]\n    }\n}"}],"_postman_id":"1eee134e-84fb-4e45-b93b-cc207fae71c5"},{"name":"Check number","event":[{"listen":"test","script":{"id":"d699c28f-b4d0-45ec-8902-0cc1b1129fd1","exec":[""],"type":"text/javascript"}}],"id":"d7b913d9-550b-45d5-b5e2-3f2d937ac01c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"}],"url":"https://api.p.2chat.io/open/whatsapp/check-number//+17137157533","description":"<p>Using this endpoint you can check if a given number is registered on WhatsApp or not. This can be useful to know if you can use WhatsApp to send messages to a contact number.</p>\n<p><em>For a working client of this endpoint, check out our example script <a href=\"https://github.com/2ChatCo/whatsapp-number-checker\">on GitHub</a>.</em></p>\n<h3 id=\"parameters\">Parameters</h3>\n<p>These are query-string parameters that should go on the URL you use to invoke the endpoint.<br />Considering <code>https://api.p.2chat.io/open/whatsapp/check-number//</code>:</p>\n<ul>\n<li>must be replaced with the actual WhatsApp number that you <strong>connected to 2Chat</strong>, and...</li>\n<li>with the number you want to know if WhatsApp is enabled or not.<br />  Example: <code>https://api.p.2chat.io/open/whatsapp/check-number/+595981048477/+17137157533</code>.</li>\n</ul>\n<h3 id=\"response\">Response</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>is_valid</code></td>\n<td>Whether the number is syntactically valid or not</td>\n</tr>\n<tr>\n<td><code>number.iso_country_code</code></td>\n<td>Two-letter country code of the number</td>\n</tr>\n<tr>\n<td><code>number.region</code></td>\n<td>The approximate region the number belongs to</td>\n</tr>\n<tr>\n<td><code>number.carrier</code></td>\n<td>The first carrier (phone provider) that issued this number</td>\n</tr>\n<tr>\n<td><code>number.timezone</code></td>\n<td>The timezone this number is likely on based on its region</td>\n</tr>\n<tr>\n<td><code>on_whatsapp</code></td>\n<td><code>true</code> when the number is using WhatsApp</td>\n</tr>\n<tr>\n<td><code>whatsapp_info.is_business</code></td>\n<td><code>true</code> when the number is a Business Account and has its profile public</td>\n</tr>\n<tr>\n<td><code>whatsapp_info.is_enterprise</code></td>\n<td><code>true</code> when the number has an Enterprise Account</td>\n</tr>\n<tr>\n<td><code>whatsapp_info.profile_pic</code></td>\n<td>URL of the public (not hidden from people who aren't contacts) profile picture if it has any</td>\n</tr>\n<tr>\n<td><code>whatsapp_info.verified_level</code></td>\n<td><code>0</code> to <code>2</code>. Where <code>0</code> is not verified and <code>2</code> is verified with the green badge</td>\n</tr>\n<tr>\n<td><code>whatsapp_info.verified_name</code></td>\n<td>The business name of a verified account</td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"apikey","apikey":{"value":"{{API_KEY_VALUE}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","name":"🚀 Programmable WhatsApp API by 2Chat","type":"collection"}},"urlObject":{"protocol":"https","path":["open","whatsapp","check-number","","+17137157533"],"host":["api","p","2chat","io"],"query":[],"variable":[]}},"response":[{"id":"217d7898-d2da-4422-8105-31be38ab829a","name":"Successful Response","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"url":"https://api.p.2chat.io/open/whatsapp/check-number//+17137157533"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","name":"Content-Type","description":{"content":"","type":"text/plain"}}],"cookie":[],"responseTime":null,"body":"{\n    \"is_valid\": true,\n    \"number\": {\n        \"iso_country_code\": \"US\",\n        \"region\": \"Texas\",\n        \"carrier\": \"\",\n        \"timezone\": [\n            \"America/Chicago\"\n        ]\n    },\n    \"on_whatsapp\": true,\n    \"whatsapp_info\": {\n                      \"is_business\": true,\n                      \"is_enterprise\": true,\n                      \"profile_pic\": \"https://2chat-user-data-...\",\n                      \"verified_level\": 2,\n                      \"verified_name\": \"...\"}\n                    }\n}"}],"_postman_id":"d7b913d9-550b-45d5-b5e2-3f2d937ac01c"},{"name":"Get messages","event":[{"listen":"test","script":{"id":"d699c28f-b4d0-45ec-8902-0cc1b1129fd1","exec":[""],"type":"text/javascript"}}],"id":"4b47e9d8-7083-4a2e-a101-cf4bdd497786","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"}],"url":"https://api.p.2chat.io/open/whatsapp/messages/","description":"<p>This endpoint will let you get messages that you received on your 2Chat-connected WhatsApp number. Only messages that you received <em>after</em> you made the connection to 2Chat will appear here.</p>\n<h3 id=\"parameters\">Parameters</h3>\n<p>These are query-string parameters that should go on the URL you use to invoke the endpoint.</p>\n<p>Considering <code>https://api.p.2chat.io/open/whatsapp/messages//</code>, must be replaced with your actual WhatsApp number connected to 2Chat.</p>\n<p>Example: <code>https://api.p.2chat.io/open/whatsapp/messages/+595981048477/</code>.</p>\n<h3 id=\"response\">Response</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>uuid</code></td>\n<td>The unique identifier of the message</td>\n</tr>\n<tr>\n<td><code>timestamp</code></td>\n<td>Timestamp of the message in UTC</td>\n</tr>\n<tr>\n<td><code>session_key</code></td>\n<td>The chat session key that corresponds to this message</td>\n</tr>\n<tr>\n<td><code>message</code></td>\n<td>The payload of the message</td>\n</tr>\n<tr>\n<td><code>message.text</code></td>\n<td>The text content of the message, if present</td>\n</tr>\n<tr>\n<td><code>message.media.url</code></td>\n<td>The 2Chat-hosted media file URL sent or received</td>\n</tr>\n<tr>\n<td><code>message.media.type</code></td>\n<td>The type of media message</td>\n</tr>\n<tr>\n<td><code>message.media.mime_type</code></td>\n<td>The MIME type of the message</td>\n</tr>\n<tr>\n<td><code>remote_phone_number</code></td>\n<td>The WhatsApp phone number of the other end of the conversation</td>\n</tr>\n<tr>\n<td><code>sent_by</code></td>\n<td>Who sent the message. E.g.: <code>api</code>, <code>agent</code>, <code>user</code></td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"apikey","apikey":{"value":"{{API_KEY_VALUE}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","name":"🚀 Programmable WhatsApp API by 2Chat","type":"collection"}},"urlObject":{"protocol":"https","path":["open","whatsapp","messages",""],"host":["api","p","2chat","io"],"query":[],"variable":[]}},"response":[{"id":"af1ba5f8-79da-4cd5-8f00-3fc539bdf66b","name":"Successful Response","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"url":"https://api.p.2chat.io/open/whatsapp/messages/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","name":"Content-Type","description":{"content":"","type":"text/plain"}}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"messages\": [\n        {\n            \"uuid\": \"MSGaf1fa3a1-0d8d-4aa5-b117-f9425b651485\",\n            \"timestamp\": 1670454681.0,\n            \"session_key\": \"WW-WPN95841312-b54d-46e3-b0bc-6414f4a5296b-5215512345432@c.us\",\n            \"message\": {\n                \"media\": {\n                    \"url\": \"https://2chat-user-data-dev.s3.amazonaws.com/ACC91be87af-5a29-4034-b599-342f2aeb5d52/accm/sfe4d7e29cd9dfad63b535dec54c5992055498dcd13cfc319f723c4b962b8803a.svg\",\n                    \"type\": \"image\",\n                    \"mime_type\": \"image/svg+xml\"\n                }\n            },\n            \"remote_phone_number\": \"+5215512345432\",\n            \"sent_by\": \"api\"\n        },\n        {\n            \"uuid\": \"MSG8c39a0a9-01cf-46c9-ab46-3c0fb0477e99\",\n            \"timestamp\": 1670378997.0,\n            \"session_key\": \"WW-WPN95841312-b54d-46e3-b0bc-6414f4a5296b-5215512345432@c.us\",\n            \"message\": {\n                \"text\": \"you can see my replies here\"\n            },\n            \"remote_phone_number\": \"+5215512345432\",\n            \"sent_by\": \"agent\"\n        }\n    ]\n\n}"}],"_postman_id":"4b47e9d8-7083-4a2e-a101-cf4bdd497786"},{"name":"Send message","event":[{"listen":"test","script":{"id":"9aa3fa6a-e2dc-4afe-97b4-906528cbb829","exec":[""],"type":"text/javascript"}}],"id":"4f14eb65-912f-4e2d-b964-b0e50a8de869","request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"to_number\": \"+17137157133\",\n    \"from_number\": \"\",\n    \"text\": \"Test from 2Chat API using _Postman_\",\n    \"url\": \"https://uploads-ssl.webflow.com/6281a9c52303343ff7c3b269/62a1648ee0273340bf38e3a9_logo-2C.svg\"\n}","options":{"raw":{"language":"json"}}},"url":"https://api.p.2chat.io/open/whatsapp/send-message","description":"<p>This endpoint will let you send messages to any WhatsApp-enabled phone number using your own number connected to 2Chat.</p>\n<p>You can send text and multimedia messages, including audio, video, PDFs, images, etc., both to a single person or to a WhatsApp group.</p>\n<blockquote>\n<p>💡 <em>Trial accounts are rate-limited to 10 requests per minute (1 request every 6 seconds). If you would like a faster throughput,</em> <a href=\"https://app.2chat.io/billing?\">&lt;em&gt;please upgrade your account&lt;/em&gt;</a><em>.</em> </p>\n</blockquote>\n<blockquote>\n<p>💡 <em>If you are sending attachments using the</em> <code>_url_</code> <em>field, make sure the attachment is publicly accessible and is not larger than</em> <em><strong>16 MB</strong>__.</em><br /><em>If you are using Google Drive or you are not sure if the URL is publicly accessible, download it and reupload it to 2Chat to make sure it is.</em> <a href=\"https://help.2chat.io/en/articles/8317785-getting-a-public-url-of-a-media-file\">&lt;em&gt;Learn how here&lt;/em&gt;</a><em>.</em> </p>\n</blockquote>\n<h3 id=\"parameters\">Parameters</h3>\n<p>These parameters should be sent as JSON payload in the request body.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Description</th>\n<th>Example values</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>from_number</code></td>\n<td>The number you have connected to 2Chat</td>\n<td><code>+595981048477</code></td>\n</tr>\n<tr>\n<td><code>to_number</code></td>\n<td>The destination number you want to receive your message</td>\n<td><code>+5215512345432</code></td>\n</tr>\n<tr>\n<td><code>to_group_uuid</code></td>\n<td>The WhatsApp group UUID if you intend to send it to a group</td>\n<td><code>WGP768beeef-2b96-4bc7-9b7f-045078568723</code></td>\n</tr>\n<tr>\n<td><code>text</code></td>\n<td>The content of the message you want to send</td>\n<td><code>Test from 2Chat API</code></td>\n</tr>\n<tr>\n<td><code>url</code></td>\n<td>The URL of the media file you want to attach to the message. This value is optional</td>\n<td></td>\n</tr>\n</tbody>\n</table>\n</div><p>You can't use <code>to_number</code> and <code>to_group_uuid</code> in the same request. Learn more about where <a href=\"https://developers.2chat.co/docs/API/WhatsApp/list-whatsapp-groups\">to get the group's UUID here</a>.</p>\n","auth":{"type":"apikey","apikey":{"value":"{{API_KEY_VALUE}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","name":"🚀 Programmable WhatsApp API by 2Chat","type":"collection"}},"urlObject":{"protocol":"https","path":["open","whatsapp","send-message"],"host":["api","p","2chat","io"],"query":[],"variable":[]}},"response":[{"id":"ac514724-b4da-4647-9838-68762e714f5e","name":"Successful Response","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"to_number\": \"+17137157133\",\n    \"from_number\": \"\",\n    \"text\": \"Test from 2Chat API using _Postman_\",\n    \"url\": \"https://uploads-ssl.webflow.com/6281a9c52303343ff7c3b269/62a1648ee0273340bf38e3a9_logo-2C.svg\"\n}","options":{"raw":{"language":"json"}}},"url":"https://api.p.2chat.io/open/whatsapp/send-message"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","name":"Content-Type","description":{"content":"","type":"text/plain"}}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"batched\": true\n}"}],"_postman_id":"4f14eb65-912f-4e2d-b964-b0e50a8de869"}],"id":"f0c9331f-176a-4098-a4e8-cd4fe5eaa55b","description":"<p>This set of endpoints can be used to automate WhatsApp interactions programmatically.</p>\n<p><strong>You will need:</strong></p>\n<ol>\n<li>A regular WhatsApp or a WhatsApp Business account. WhatsApp Business API is not required.</li>\n<li>A working 2Chat account where you have connected your WhatsApp account.</li>\n</ol>\n","_postman_id":"f0c9331f-176a-4098-a4e8-cd4fe5eaa55b","auth":{"type":"apikey","apikey":{"value":"{{API_KEY_VALUE}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","id":"dd0d0d67-ce3b-42ae-8073-68e7393a0422","name":"🚀 Programmable WhatsApp API by 2Chat","type":"collection"}}}],"auth":{"type":"apikey","apikey":{"value":"{{API_KEY_VALUE}}","key":"<key>"}},"event":[{"listen":"prerequest","script":{"id":"374b555d-34b9-4aaa-b62f-01f91620042e","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"6a8b4234-2710-4bfa-8971-4e2f3446e9c1","type":"text/javascript","exec":[""]}}],"variable":[{"key":"CONNECTED_NUMBER","value":"","type":"string"},{"key":"WHATSAPP_GROUP_UUID","value":"","type":"string"}]}