{"info":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","description":"<html><head></head><body><p>Version 1 of the Spoki API is structured around REST, HTTP, and JSON. API endpoint URLs are organized around <em>resources</em>, such as <code>contacts</code> or <code>templates</code>. It uses HTTP methods for indicating the action to take on a resource, and HTTP status codes for expressing error states.</p>\n<h1 id=\"installation\">Installation</h1>\n<p>Use the <code>Run in Postman</code> button at the top right corner of this doc to import this collection into your local Postman app.</p>\n<h1 id=\"base-url\">Base URL</h1>\n<ul>\n<li><p>The API is accessed using the following base URL: <a href=\"https://api.spoki.com/api/1/\"><b>https://api.spoki.com/api/1/</b></a></p>\n</li>\n<li><p>All endpoint paths must begin with <strong>/api/1</strong>, which specifies version 1 of the API.</p>\n</li>\n<li><p>All API requests must be made over <strong>HTTPS</strong>.</p>\n</li>\n</ul>\n<h1 id=\"schema\">Schema</h1>\n<p>All API requests and response bodies adhere to a common JSON format representing individual items, collections of items, links to related items and additional meta data.</p>\n<h4 id=\"single-resources\">Single Resources</h4>\n<p>Individual resources are represented by top level member named after the resource in the singular form.</p>\n<h4 id=\"collections\">Collections</h4>\n<p>Collections of resources are represented by a top level member named after the resource in the plural form.</p>\n<h1 id=\"environment\">Environment</h1>\n<p>This collection includes a pre-configured environment.</p>\n<p>To run requests in the <a href=\"#01e24b28-7896-4aee-946c-210b6945e50b\">Get Started</a> guide, you need to set the variables in the following table to values that make sense for your business:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Name</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Base-URL</td>\n<td><a href=\"https://api.spoki.com\">https://api.spoki.com</a></td>\n</tr>\n<tr>\n<td>Api-Key</td>\n<td>You need an active Spoki account to get this key.</td>\n</tr>\n<tr>\n<td>Service-Api-Key</td>\n<td>You need an active Spoki account to get this key.</td>\n</tr>\n<tr>\n<td>Your-Delivery-URL</td>\n<td>The URL where Spoki will send you the webhook</td>\n</tr>\n</tbody>\n</table>\n</div><h1 id=\"guidance\">Guidance</h1>\n<p>To ensure the best experience with using the ActiveCampaign APIs, please observe the following guidelines.</p>\n<ul>\n<li><p>Use version 1 (v1) APIs.</p>\n</li>\n<li><p>If an error occurs, please pause or “sleep” execution for at least 1,000 milliseconds before resubmitting your API request.</p>\n</li>\n</ul>\n<p>We are actively working on improving our platform experience, adding new features, and improving performance. Following these guidelines will reduce intermittent errors and help us to provide a better experience for all customers.</p>\n<h1 id=\"authentication\">Authentication</h1>\n<p>All requests to the API are authenticated by providing your API key. The API key must be provided as an HTTP header named <code>X-Spoki-Api-Key</code>.</p>\n<p>Each Spoki account has his own unique API key.</p>\n<blockquote>\n<p>Remember to keep your API key secret.</p>\n</blockquote>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Installation","slug":"installation"},{"content":"Base URL","slug":"base-url"},{"content":"Schema","slug":"schema"},{"content":"Environment","slug":"environment"},{"content":"Guidance","slug":"guidance"},{"content":"Authentication","slug":"authentication"}],"owner":"21611004","collectionId":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","publishedId":"UzBqnPvF","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"15D36B"},"publishDate":"2024-03-29T13:36:45.000Z"},"item":[{"name":"Accounts","item":[{"name":"List, search, and filter accounts","id":"e5945eaf-8d26-4d3c-9dbc-5a0b36d5b02e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/accounts/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n<p>This endpoint retrieves a list of accounts.</p>\n<h4 id=\"response\">Response</h4>\n<p>The response will include an array of objects, where each object represents an account with the following properties:</p>\n<ul>\n<li><p><code>id</code> (number): The unique identifier for the account.</p>\n</li>\n<li><p><code>name</code> (string): The name associated with the account.</p>\n</li>\n<li><p><code>current_credit</code> (number): The current credit balance for the account.</p>\n</li>\n<li><p><code>status</code> (string): The status of the account.</p>\n</li>\n<li><p><code>default_language</code> (string): The default language set for the account.</p>\n</li>\n<li><p><code>phone</code> (string): The phone number associated with the account.</p>\n</li>\n<li><p><code>has_official_verification</code> (boolean): Indicates whether the account has official verification.</p>\n</li>\n<li><p><code>daily_limit</code> (number): The daily limit for the account.</p>\n</li>\n<li><p><code>phone_status</code> (string): The status for the phone.</p>\n<ul>\n<li><p>🟢 Connected</p>\n</li>\n<li><p>🟡 Flagged</p>\n</li>\n<li><p>🔴 Restricted</p>\n</li>\n<li><p>🚫 Banned</p>\n</li>\n<li><p>📵 Disconnected</p>\n</li>\n<li><p>Ⓜ️ Migrated</p>\n</li>\n<li><p>⏳ Pending</p>\n</li>\n<li><p>⛔️ Rate limited</p>\n</li>\n<li><p>❗️ Unverified</p>\n</li>\n</ul>\n</li>\n<li><p><code>quality_score</code> (number): The quality score of the account.</p>\n<ul>\n<li><p>1 : 🟢 Green</p>\n</li>\n<li><p>2 : 🟡 Yellow</p>\n</li>\n<li><p>3 : 🔴 Red</p>\n</li>\n</ul>\n</li>\n<li><p><code>quality_reasons</code> (null): Reasons for the quality score (if available).</p>\n</li>\n<li><p><code>is_active</code> (boolean): Indicates whether the account is active.</p>\n</li>\n<li><p><code>country_code</code> (string): The country code associated with the account.</p>\n</li>\n<li><p><code>estimated_available_conversations</code> (number): The estimated available conversations for the account.</p>\n</li>\n<li><p><code>account_type</code> (number): The type of the account.</p>\n<ul>\n<li><p>1 : Sandbox</p>\n</li>\n<li><p>2 : Standard</p>\n</li>\n<li><p>4 : Agency</p>\n</li>\n</ul>\n</li>\n<li><p><code>default_pricing_delta</code> (number): The default pricing delta for the account.</p>\n</li>\n<li><p><code>low_credit_threshold</code> (number): The low credit threshold for the account.</p>\n</li>\n<li><p><code>has_low_credit_alert</code> (boolean): Indicates whether the account has a low credit alert.</p>\n</li>\n<li><p><code>default_prefix</code> (string): The default prefix for the account.</p>\n</li>\n<li><p><code>default_country_code</code> (string): The default country code for the account.</p>\n</li>\n<li><p><code>timezone</code> (string): The timezone set for the account.</p>\n</li>\n<li><p><code>contacted_in_24h</code> (number): Number of contacts made in the last 24 hours for the account.</p>\n</li>\n<li><p><code>contacted_in_7d</code> (number): Number of contacts made in the last 7 days for the account.</p>\n</li>\n<li><p><code>primary_channel_id</code> (number | null): The ID of the primary channel associated with the account. <code>null</code> if no primary channel is set.</p>\n</li>\n<li><p><code>channels</code> (array): List of channels associated with the account. Each channel object follows the <code>AccountChannel</code> shape with the following 10 fields:</p>\n<ul>\n<li><p><code>id</code> (number): The unique identifier for the channel.</p>\n</li>\n<li><p><code>name</code> (string): The display name of the channel.</p>\n</li>\n<li><p><code>phone</code> (string): The phone number associated with the channel.</p>\n</li>\n<li><p><code>phone_status</code> (string): The connection status of the channel's phone number (same values as account-level <code>phone_status</code>).</p>\n</li>\n<li><p><code>quality_score</code> (number): The quality score of the channel (1 = 🟢 Green, 2 = 🟡 Yellow, 3 = 🔴 Red).</p>\n</li>\n<li><p><code>quality_reasons</code> (null | array): Reasons for the quality score, if available.</p>\n</li>\n<li><p><code>has_official_verification</code> (boolean): Whether the channel has official WhatsApp verification.</p>\n</li>\n<li><p><code>daily_limit</code> (number): The daily messaging limit for the channel.</p>\n</li>\n<li><p><code>account_type</code> (number): The type of the channel's account (1 = Sandbox, 2 = Standard, 4 = Agency).</p>\n</li>\n<li><p><code>is_active</code> (boolean): Whether the channel is currently active.</p>\n</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"example-response\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">[\n  {\n    \"id\": 2009,\n    \"name\": \"Spoki_tyntec\",\n    \"current_credit\": 100.0,\n    \"status\": \"active\",\n    \"default_language\": \"it\",\n    \"phone\": \"+391234567890\",\n    \"has_official_verification\": true,\n    \"daily_limit\": 1000,\n    \"phone_status\": \"Connected\",\n    \"quality_score\": 1,\n    \"quality_reasons\": null,\n    \"is_active\": true,\n    \"country_code\": \"IT\",\n    \"estimated_available_conversations\": 500,\n    \"account_type\": 2,\n    \"default_pricing_delta\": 0.0,\n    \"low_credit_threshold\": 10.0,\n    \"has_low_credit_alert\": false,\n    \"default_prefix\": \"+39\",\n    \"default_country_code\": \"IT\",\n    \"timezone\": \"Europe/Rome\",\n    \"contacted_in_24h\": 12,\n    \"contacted_in_7d\": 84,\n    \"primary_channel_id\": 17,\n    \"channels\": [\n      {\n        \"id\": 17,\n        \"name\": \"Main Channel\",\n        \"phone\": \"+391234567890\",\n        \"phone_status\": \"Connected\",\n        \"quality_score\": 1,\n        \"quality_reasons\": null,\n        \"has_official_verification\": true,\n        \"daily_limit\": 1000,\n        \"account_type\": 2,\n        \"is_active\": true\n      }\n    ]\n  }\n]\n\n</code></pre>\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","accounts",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"240978aa-1b6d-4dad-824d-2e11e67e562e","name":"200 OK","originalRequest":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/accounts/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Wed, 21 Jun 2023 13:12:58 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"550"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": 13128334,\n        \"name\": \"MyShop\",\n        \"current_credit\": 8556300,\n        \"status\": \"Active\",\n        \"default_language\": \"it\",\n        \"phone\": \"3933312345678\",\n        \"has_official_verification\": false,\n        \"daily_limit\": 100000,\n        \"phone_status\": \"🟢 Connected\",\n        \"quality_score\": 1,\n        \"quality_reasons\": null,\n        \"is_active\": true,\n        \"country_code\": \"\",\n        \"estimated_available_conversations\": 85563,\n        \"account_type\": 2,\n        \"default_pricing_delta\": 0,\n        \"low_credit_threshold\": 15000,\n        \"has_low_credit_alert\": false,\n        \"default_prefix\": \"+39\",\n        \"default_country_code\": \"IT\",\n        \"timezone\": \"Europe/Rome\",\n        \"contacted_in_24h\": 150,\n        \"contacted_in_7d\": 602\n    }\n]"}],"_postman_id":"e5945eaf-8d26-4d3c-9dbc-5a0b36d5b02e"},{"name":"Retrieve account","id":"2eeedf7e-7318-4867-bd51-c053e5d6e04b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/accounts/{{id}}/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n<p>This endpoint retrieves a single account by its ID.</p>\n<h4 id=\"path-parameters\">Path Parameters</h4>\n<ul>\n<li><code>id</code> (number): The unique identifier of the account to retrieve.</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response is a single object representing the account with the following properties:</p>\n<ul>\n<li><p><code>id</code> (number): The unique identifier for the account.</p>\n</li>\n<li><p><code>name</code> (string): The name associated with the account.</p>\n</li>\n<li><p><code>current_credit</code> (number): The current credit balance for the account.</p>\n</li>\n<li><p><code>status</code> (string): The status of the account.</p>\n</li>\n<li><p><code>default_language</code> (string): The default language set for the account.</p>\n</li>\n<li><p><code>phone</code> (string): The phone number associated with the account.</p>\n</li>\n<li><p><code>has_official_verification</code> (boolean): Indicates whether the account has official verification.</p>\n</li>\n<li><p><code>daily_limit</code> (number): The daily limit for the account.</p>\n</li>\n<li><p><code>phone_status</code> (string): The status for the phone.</p>\n<ul>\n<li><p>🟢 Connected</p>\n</li>\n<li><p>🟡 Flagged</p>\n</li>\n<li><p>🔴 Restricted</p>\n</li>\n<li><p>🚫 Banned</p>\n</li>\n<li><p>📵 Disconnected</p>\n</li>\n<li><p>Ⓜ️ Migrated</p>\n</li>\n<li><p>⏳ Pending</p>\n</li>\n<li><p>⛔️ Rate limited</p>\n</li>\n<li><p>❗️ Unverified</p>\n</li>\n</ul>\n</li>\n<li><p><code>quality_score</code> (number): The quality score of the account.</p>\n<ul>\n<li><p>1 : 🟢 Green</p>\n</li>\n<li><p>2 : 🟡 Yellow</p>\n</li>\n<li><p>3 : 🔴 Red</p>\n</li>\n</ul>\n</li>\n<li><p><code>quality_reasons</code> (null | array): Reasons for the quality score (if available).</p>\n</li>\n<li><p><code>is_active</code> (boolean): Indicates whether the account is active.</p>\n</li>\n<li><p><code>country_code</code> (string): The country code associated with the account.</p>\n</li>\n<li><p><code>estimated_available_conversations</code> (number): The estimated available conversations for the account.</p>\n</li>\n<li><p><code>account_type</code> (number): The type of the account.</p>\n<ul>\n<li><p>1 : Sandbox</p>\n</li>\n<li><p>2 : Standard</p>\n</li>\n<li><p>4 : Agency</p>\n</li>\n</ul>\n</li>\n<li><p><code>default_pricing_delta</code> (number): The default pricing delta for the account.</p>\n</li>\n<li><p><code>low_credit_threshold</code> (number): The low credit threshold for the account.</p>\n</li>\n<li><p><code>has_low_credit_alert</code> (boolean): Indicates whether the account has a low credit alert.</p>\n</li>\n<li><p><code>default_prefix</code> (string): The default prefix for the account.</p>\n</li>\n<li><p><code>default_country_code</code> (string): The default country code for the account.</p>\n</li>\n<li><p><code>timezone</code> (string): The timezone set for the account.</p>\n</li>\n<li><p><code>contacted_in_24h</code> (number): Number of contacts made in the last 24 hours for the account.</p>\n</li>\n<li><p><code>contacted_in_7d</code> (number): Number of contacts made in the last 7 days for the account.</p>\n</li>\n<li><p><code>primary_channel_id</code> (number | null): The ID of the primary channel associated with the account. <code>null</code> if no primary channel is set.</p>\n</li>\n<li><p><code>channels</code> (array): List of channels associated with the account. Each channel object follows the <code>AccountChannelSerializer</code> shape with the following 10 fields:</p>\n<ul>\n<li><p><code>id</code> (number): The unique identifier for the channel.</p>\n</li>\n<li><p><code>name</code> (string): The display name of the channel.</p>\n</li>\n<li><p><code>phone</code> (string): The phone number associated with the channel.</p>\n</li>\n<li><p><code>phone_status</code> (string): The connection status of the channel's phone number (same values as account-level <code>phone_status</code>).</p>\n</li>\n<li><p><code>quality_score</code> (number): The quality score of the channel (1 = 🟢 Green, 2 = 🟡 Yellow, 3 = 🔴 Red).</p>\n</li>\n<li><p><code>quality_reasons</code> (null | array): Reasons for the quality score, if available.</p>\n</li>\n<li><p><code>has_official_verification</code> (boolean): Whether the channel has official WhatsApp verification.</p>\n</li>\n<li><p><code>daily_limit</code> (number): The daily messaging limit for the channel.</p>\n</li>\n<li><p><code>account_type</code> (number): The type of the channel's account (1 = Sandbox, 2 = Standard, 4 = Agency).</p>\n</li>\n<li><p><code>is_active</code> (boolean): Whether the channel is currently active.</p>\n</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"example-response\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"id\": 2009,\n  \"name\": \"Spoki_tyntec\",\n  \"current_credit\": 100.0,\n  \"status\": \"active\",\n  \"default_language\": \"it\",\n  \"phone\": \"+391234567890\",\n  \"has_official_verification\": true,\n  \"daily_limit\": 1000,\n  \"phone_status\": \"Connected\",\n  \"quality_score\": 1,\n  \"quality_reasons\": null,\n  \"is_active\": true,\n  \"country_code\": \"IT\",\n  \"estimated_available_conversations\": 500,\n  \"account_type\": 2,\n  \"default_pricing_delta\": 0.0,\n  \"low_credit_threshold\": 10.0,\n  \"has_low_credit_alert\": false,\n  \"default_prefix\": \"+39\",\n  \"default_country_code\": \"IT\",\n  \"timezone\": \"Europe/Rome\",\n  \"contacted_in_24h\": 12,\n  \"contacted_in_7d\": 84,\n  \"primary_channel_id\": 17,\n  \"channels\": [\n    {\n      \"id\": 17,\n      \"name\": \"Main Channel\",\n      \"phone\": \"+391234567890\",\n      \"phone_status\": \"Connected\",\n      \"quality_score\": 1,\n      \"quality_reasons\": null,\n      \"has_official_verification\": true,\n      \"daily_limit\": 1000,\n      \"account_type\": 2,\n      \"is_active\": true\n    }\n  ]\n}\n</code></pre>\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","accounts","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"05fcf098-dc05-4217-bb06-033ef0c58d05","name":"200 OK","originalRequest":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/accounts/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.27.4"},{"key":"Date","value":"Thu, 27 Feb 2025 08:49:59 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"505"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 13128334,\n    \"name\": \"MyShop\",\n    \"current_credit\": 8556300,\n    \"status\": \"Active\",\n    \"default_language\": \"it\",\n    \"phone\": \"3933312345678\",\n    \"has_official_verification\": false,\n    \"daily_limit\": 100000,\n    \"phone_status\": \"🟢 Connected\",\n    \"quality_score\": 1,\n    \"quality_reasons\": null,\n    \"is_active\": true,\n    \"country_code\": \"\",\n    \"estimated_available_conversations\": 85563,\n    \"account_type\": 2,\n    \"default_pricing_delta\": 0,\n    \"low_credit_threshold\": 15000,\n    \"has_low_credit_alert\": false,\n    \"default_prefix\": \"+39\",\n    \"default_country_code\": \"IT\",\n    \"timezone\": \"Europe/Rome\",\n    \"contacted_in_24h\": 150,\n    \"contacted_in_7d\": 602,\n    \"channels\": [\n        {\n            \"name\": \"Main WhatsApp\",\n            \"identifier\": \"3933312345678\",\n            \"platform\": \"WhatsApp\",\n            \"status\": \"Active\",\n            \"phone_status\": \"🟢 Connected\",\n            \"quality_score\": \"🟢 Green\",\n            \"is_primary\": true\n        },\n        {\n            \"name\": \"SMS Sender\",\n            \"identifier\": \"MyShop\",\n            \"platform\": \"SMS\",\n            \"status\": \"Active\",\n            \"phone_status\": \"❔ Undefined\",\n            \"quality_score\": \"❔ Undefined\",\n            \"is_primary\": true\n        }\n    ]\n}"}],"_postman_id":"2eeedf7e-7318-4867-bd51-c053e5d6e04b"},{"name":"Retrieve account by phone","id":"b58c10fd-10fa-4b73-83e7-9f8b4f11065e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/accounts/phone/{{phone}}/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n<p>Reverse-lookup endpoint: given a phone number, returns the account that owns it along with the matched channel and the full channel list.</p>\n<h4 id=\"path-parameters\">Path Parameters</h4>\n<ul>\n<li><code>phone</code> (string): The phone number to look up (E.164 format recommended, e.g. <code>+391234567890</code>).</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>On success the response is a single object with all standard account fields plus the following additional properties:</p>\n<ul>\n<li><p><code>id</code> (number): The unique identifier for the account.</p>\n</li>\n<li><p><code>name</code> (string): The name associated with the account.</p>\n</li>\n<li><p><code>current_credit</code> (number): The current credit balance for the account.</p>\n</li>\n<li><p><code>status</code> (string): The status of the account.</p>\n</li>\n<li><p><code>default_language</code> (string): The default language set for the account.</p>\n</li>\n<li><p><code>phone</code> (string): The phone number associated with the account.</p>\n</li>\n<li><p><code>has_official_verification</code> (boolean): Indicates whether the account has official verification.</p>\n</li>\n<li><p><code>daily_limit</code> (number): The daily limit for the account.</p>\n</li>\n<li><p><code>phone_status</code> (string): The status for the phone.</p>\n<ul>\n<li><p>🟢 Connected</p>\n</li>\n<li><p>🟡 Flagged</p>\n</li>\n<li><p>🔴 Restricted</p>\n</li>\n<li><p>🚫 Banned</p>\n</li>\n<li><p>📵 Disconnected</p>\n</li>\n<li><p>Ⓜ️ Migrated</p>\n</li>\n<li><p>⏳ Pending</p>\n</li>\n<li><p>⛔️ Rate limited</p>\n</li>\n<li><p>❗️ Unverified</p>\n</li>\n</ul>\n</li>\n<li><p><code>quality_score</code> (number): The quality score of the account.</p>\n<ul>\n<li><p>1 : 🟢 Green</p>\n</li>\n<li><p>2 : 🟡 Yellow</p>\n</li>\n<li><p>3 : 🔴 Red</p>\n</li>\n</ul>\n</li>\n<li><p><code>quality_reasons</code> (null | array): Reasons for the quality score (if available).</p>\n</li>\n<li><p><code>is_active</code> (boolean): Indicates whether the account is active.</p>\n</li>\n<li><p><code>country_code</code> (string): The country code associated with the account.</p>\n</li>\n<li><p><code>estimated_available_conversations</code> (number): The estimated available conversations for the account.</p>\n</li>\n<li><p><code>account_type</code> (number): The type of the account.</p>\n<ul>\n<li><p>1 : Sandbox</p>\n</li>\n<li><p>2 : Standard</p>\n</li>\n<li><p>4 : Agency</p>\n</li>\n</ul>\n</li>\n<li><p><code>default_pricing_delta</code> (number): The default pricing delta for the account.</p>\n</li>\n<li><p><code>low_credit_threshold</code> (number): The low credit threshold for the account.</p>\n</li>\n<li><p><code>has_low_credit_alert</code> (boolean): Indicates whether the account has a low credit alert.</p>\n</li>\n<li><p><code>default_prefix</code> (string): The default prefix for the account.</p>\n</li>\n<li><p><code>default_country_code</code> (string): The default country code for the account.</p>\n</li>\n<li><p><code>timezone</code> (string): The timezone set for the account.</p>\n</li>\n<li><p><code>contacted_in_24h</code> (number): Number of contacts made in the last 24 hours for the account.</p>\n</li>\n<li><p><code>contacted_in_7d</code> (number): Number of contacts made in the last 7 days for the account.</p>\n</li>\n<li><p><code>matched_channel_id</code> (number): The ID of the channel whose phone number matched the lookup.</p>\n</li>\n<li><p><code>channel</code> (object): The matched channel object, following the <code>AccountChannelSerializer</code> shape with the following 10 fields:</p>\n<ul>\n<li><p><code>id</code> (number): The unique identifier for the channel.</p>\n</li>\n<li><p><code>name</code> (string): The display name of the channel.</p>\n</li>\n<li><p><code>phone</code> (string): The phone number associated with the channel.</p>\n</li>\n<li><p><code>phone_status</code> (string): The connection status of the channel's phone number (same values as account-level <code>phone_status</code>).</p>\n</li>\n<li><p><code>quality_score</code> (number): The quality score of the channel (1 = 🟢 Green, 2 = 🟡 Yellow, 3 = 🔴 Red).</p>\n</li>\n<li><p><code>quality_reasons</code> (null | array): Reasons for the quality score, if available.</p>\n</li>\n<li><p><code>has_official_verification</code> (boolean): Whether the channel has official WhatsApp verification.</p>\n</li>\n<li><p><code>daily_limit</code> (number): The daily messaging limit for the channel.</p>\n</li>\n<li><p><code>account_type</code> (number): The type of the channel's account (1 = Sandbox, 2 = Standard, 4 = Agency).</p>\n</li>\n<li><p><code>is_active</code> (boolean): Whether the channel is currently active.</p>\n</li>\n</ul>\n</li>\n<li><p><code>primary_channel_id</code> (number | null): The ID of the primary channel associated with the account. <code>null</code> if no primary channel is set.</p>\n</li>\n<li><p><code>channels</code> (array): Full list of all channels associated with the account. Each object follows the same 10-field <code>AccountChannelSerializer</code> shape as <code>channel</code> above.</p>\n</li>\n</ul>\n<h4 id=\"error-response\">Error Response</h4>\n<p>If no channel matches the given phone number, the API returns:</p>\n<ul>\n<li><strong>Status:</strong> <code>404 Not Found</code></li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"detail\": \"Channel not found\"\n}\n</code></pre>\n<h4 id=\"example-response-200-ok\">Example Response (200 OK)</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"id\": 2009,\n  \"name\": \"Spoki_tyntec\",\n  \"current_credit\": 100.0,\n  \"status\": \"active\",\n  \"default_language\": \"it\",\n  \"phone\": \"+391234567890\",\n  \"has_official_verification\": true,\n  \"daily_limit\": 1000,\n  \"phone_status\": \"Connected\",\n  \"quality_score\": 1,\n  \"quality_reasons\": null,\n  \"is_active\": true,\n  \"country_code\": \"IT\",\n  \"estimated_available_conversations\": 500,\n  \"account_type\": 2,\n  \"default_pricing_delta\": 0.0,\n  \"low_credit_threshold\": 10.0,\n  \"has_low_credit_alert\": false,\n  \"default_prefix\": \"+39\",\n  \"default_country_code\": \"IT\",\n  \"timezone\": \"Europe/Rome\",\n  \"contacted_in_24h\": 12,\n  \"contacted_in_7d\": 84,\n  \"matched_channel_id\": 15,\n  \"channel\": {\n    \"id\": 15,\n    \"name\": \"Secondary Channel\",\n    \"phone\": \"+391234567890\",\n    \"phone_status\": \"Connected\",\n    \"quality_score\": 1,\n    \"quality_reasons\": null,\n    \"has_official_verification\": true,\n    \"daily_limit\": 1000,\n    \"account_type\": 2,\n    \"is_active\": true\n  },\n  \"primary_channel_id\": 17,\n  \"channels\": [\n    {\n      \"id\": 15,\n      \"name\": \"Secondary Channel\",\n      \"phone\": \"+391234567890\",\n      \"phone_status\": \"Connected\",\n      \"quality_score\": 1,\n      \"quality_reasons\": null,\n      \"has_official_verification\": true,\n      \"daily_limit\": 1000,\n      \"account_type\": 2,\n      \"is_active\": true\n    },\n    {\n      \"id\": 17,\n      \"name\": \"Main Channel\",\n      \"phone\": \"+399876543210\",\n      \"phone_status\": \"Connected\",\n      \"quality_score\": 1,\n      \"quality_reasons\": null,\n      \"has_official_verification\": true,\n      \"daily_limit\": 1000,\n      \"account_type\": 2,\n      \"is_active\": true\n    }\n  ]\n}\n</code></pre>\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","accounts","phone","{{phone}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"2c07907a-993a-4854-af9e-53e2fa6ccb38","name":"200 OK","originalRequest":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/accounts/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.27.4"},{"key":"Date","value":"Thu, 27 Feb 2025 08:49:59 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"505"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 13128334,\n    \"name\": \"MyShop\",\n    \"current_credit\": 8556300,\n    \"status\": \"Active\",\n    \"default_language\": \"it\",\n    \"phone\": \"3933312345678\",\n    \"has_official_verification\": false,\n    \"daily_limit\": 100000,\n    \"phone_status\": \"🟢 Connected\",\n    \"quality_score\": 1,\n    \"quality_reasons\": null,\n    \"is_active\": true,\n    \"country_code\": \"\",\n    \"estimated_available_conversations\": 85563,\n    \"account_type\": 2,\n    \"default_pricing_delta\": 0,\n    \"low_credit_threshold\": 15000,\n    \"has_low_credit_alert\": false,\n    \"default_prefix\": \"+39\",\n    \"default_country_code\": \"IT\",\n    \"timezone\": \"Europe/Rome\",\n    \"contacted_in_24h\": 150,\n    \"contacted_in_7d\": 602\n}"}],"_postman_id":"b58c10fd-10fa-4b73-83e7-9f8b4f11065e"},{"name":"Current report","id":"045d7f09-b434-4d6c-be68-7fc65d82471c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/accounts/{{id}}/current_report/","description":"<p><strong>Rate Limit:</strong> 5/min<br /><strong>Caching Policy</strong>: The result will be cached for 30 minutes.</p>\n<p>This endpoint retrieves the current report for a specific account.</p>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request is a JSON object with the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"account\": \"number\",\n  \"period_start\": \"string\",\n  \"contacted_contacts\": \"number\",\n  \"template_message_count\": \"number\",\n  \"free_message_count\": \"number\",\n  \"incoming_message_count\": \"number\",\n  \"exchanged_messages\": \"number\",\n  \"sent_message_count\": \"number\",\n  \"delivered_message_count\": \"number\",\n  \"read_message_count\": \"number\",\n  \"conversation_count\": \"number\"\n}\n\n</code></pre>\n<p>The response includes various metrics related to the current report for the specified account.</p>\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","accounts","{{id}}","current_report",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"5619dfce-5f5d-4125-96fe-cf8c9f139366","name":"200 OK","originalRequest":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/accounts/{{id}}/current_report/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Wed, 21 Jun 2023 13:15:54 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"291"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"account\": 1384211,\n    \"period_start\": \"2023-06-01\",\n    \"contacted_contacts\": 1101,\n    \"template_message_count\": 2580,\n    \"free_message_count\": 2588,\n    \"incoming_message_count\": 3880,\n    \"exchanged_messages\": 9048,\n    \"sent_message_count\": 5168,\n    \"delivered_message_count\": 5168,\n    \"read_message_count\": 4036,\n    \"conversation_count\": 2223\n}"}],"_postman_id":"045d7f09-b434-4d6c-be68-7fc65d82471c"},{"name":"Create Onboarding Link","id":"299e7cd5-d8f6-40a7-ad48-32c267980ee6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/accounts/{{id}}/onboarding/","description":"<blockquote>\n<p>⚠️ <strong>Deprecated</strong> — This endpoint has been removed and always returns <code>404 Not Found</code> on the current branch. Use <strong>POST /channel/</strong> with <code>platform=1</code> instead, which returns the same response shape.</p>\n</blockquote>\n<hr />\n<p>Creates an onboarding link for the specified account.</p>\n<p><strong>This endpoint is no longer active.</strong> The action body has been deleted server-side. Any call to <code>POST /accounts/{id}/onboarding/</code> will receive:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"detail\": \"Not found.\"\n}\n</code></pre>\n<h4 id=\"migration\">Migration</h4>\n<p>Replace calls to this endpoint with <strong>POST /channel/</strong> passing <code>platform=1</code>. The response shape is identical:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>redirect_url</code></td>\n<td>string</td>\n<td>The URL to redirect the user to for onboarding.</td>\n</tr>\n<tr>\n<td><code>auth_token</code></td>\n<td>string</td>\n<td>The authentication token for the onboarding session.</td>\n</tr>\n<tr>\n<td><code>lang</code></td>\n<td>string</td>\n<td>The language code for the onboarding flow.</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"example-response-from-post-channel-with-platform1\">Example Response (from POST /channel/ with platform=1)</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"redirect_url\": \"https://onboarding.spoki.it/start?token=abc123\",\n  \"auth_token\": \"abc123\",\n  \"lang\": \"it\"\n}\n</code></pre>\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","accounts","{{id}}","onboarding",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"ece6c07f-f46f-4b38-95fd-4112cf2c6fce","name":"Create Onboarding Link","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/accounts/{{id}}/onboarding/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"redirect_url\": \"<onboarding_link>\"\n}"}],"_postman_id":"299e7cd5-d8f6-40a7-ad48-32c267980ee6"}],"id":"d469f025-b578-4a44-bdf4-e3a5b686e337","_postman_id":"d469f025-b578-4a44-bdf4-e3a5b686e337","description":"","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}}},{"name":"Agencies","item":[{"name":"List agencies","id":"cf1f817b-724c-4f58-828e-041085dbd3bf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/agencies/","description":"<p><strong>Rate Limit:</strong> 5/min  </p>\n<p>This endpoint retrieves a list of agencies.</p>\n<h4 id=\"response\">Response</h4>\n<p>The response for this request will be a JSON array containing objects with the following properties:</p>\n<ul>\n<li><p><code>id</code> (number): The ID of the agency.</p>\n</li>\n<li><p><code>account</code> (number): The account associated with the agency.</p>\n</li>\n</ul>\n<p>Example response body:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">[\n    {\n        \"id\": 0,\n        \"account\": 0\n    }\n]\n\n</code></pre>\n<h4 id=\"request-body\">Request Body</h4>\n<p>This request does not require a request body.</p>\n","urlObject":{"path":["api","1","agencies",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"dabdda50-2024-4e4d-88e4-036948496c82","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/agencies/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Mon, 19 Sep 2022 07:24:39 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"25"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": 12344,\n        \"account\": 987654\n    }\n]"}],"_postman_id":"cf1f817b-724c-4f58-828e-041085dbd3bf"},{"name":"Retrieve agency","id":"93c360ca-7f9a-46d8-a517-8d1b551fa9ce","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/agencies/{{id}}/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n<h3 id=\"response\">Response</h3>\n<p>The response will include the details of the agency, such as its ID, account information, and a list of clients associated with the agency. Each client object contains details such as ID, name, current credit, status, default language, phone number, verification status, daily limit, and more.</p>\n<p>The <code>estimated_available_conversations</code> field is the number of start-up conversations estimated based on the <code>country_code</code> associated with the customer's account.<br />It estimates the number of conversations that can be initiated to users with the same country_code.<br />It can change in reality.</p>\n","urlObject":{"path":["api","1","agencies","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"23635f8e-c6f2-4471-a2d2-caf8d373140a","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/agencies/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Mon, 19 Sep 2022 07:29:54 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"2812"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 12344,\n    \"account\": 987654,\n    \"clients\": [\n        {\n            \"id\": 1273716,\n            \"name\": \"MyClient\",\n            \"current_credit\": 523640,\n            \"status\": \"Active\",\n            \"default_language\": null,\n            \"phone\": \"+447782358717\",\n            \"has_official_verification\": false,\n            \"daily_limit\": 1000,\n            \"phone_status\": \"🟢 Connected\",\n            \"quality_score\": 0,\n            \"quality_reasons\": \"\",\n            \"is_active\": true,\n            \"country_code\": \"IT\",\n            \"estimated_available_conversations\": 120,\n            \"account_type\": 2,\n            \"default_pricing_delta\": 0,\n            \"low_credit_threshold\": 15000,\n            \"has_low_credit_alert\": true,\n            \"default_prefix\": \"+39\",\n            \"default_country_code\": \"IT\",\n            \"timezone\": \"Europe/Rome\",\n            \"contacted_in_24h\": 30,\n            \"contacted_in_7d\": 120\n        }\n    ]\n}"}],"_postman_id":"93c360ca-7f9a-46d8-a517-8d1b551fa9ce"}],"id":"c74314a9-87d3-49e7-838e-be8b6f1101c0","_postman_id":"c74314a9-87d3-49e7-838e-be8b6f1101c0","description":"","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}}},{"name":"Automations","item":[{"name":"Start Automation","id":"083a9c63-d691-4ace-9c65-2cdc2d9a6ce0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"secret\": \"{{secret}}\",\n    \"phone\": \"{{phone}}\",\n    \"first_name\": \"John\",\n    \"last_name\": \"Doe\",\n    \"email\": \"john.doe@domain.com\",\n    \"language\": \"en\",\n    \"custom_fields\": {\n        \"ORDER_ID\": \"1234\"\n    },\n    \"metadata\": {\n        \"your_str_meta\": \"lorem ipsum\",\n        \"your_int_meta\": 3,\n        \"your_float_meta\": 42.5,\n        \"your_bool_meta\": true\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/wh/ap/{{uuid}}/","description":"<p>This endpoint allows you to start an automation created on Spoki Platform.</p>\n<p><strong>Important</strong>: You don’t need the <code>API_KEY</code> to use this API. Just get the <code>WEBHOOK_SECRET</code> from the Automation Detail as shown below.</p>\n<img src=\"https://spoki.it/wp-content/uploads/2022/03/Schermata-2022-03-09-alle-09.44.56-768x530.png\" />","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"d4c9e9e1-781d-4cf8-a037-b2f92bd7f2fa","id":"d4c9e9e1-781d-4cf8-a037-b2f92bd7f2fa","name":"Automations","type":"folder"}},"urlObject":{"path":["wh","ap","{{uuid}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"a5b0a585-3de0-460a-a82c-e2a9f6d63856","name":"200 OK","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"secret\": \"{{secret}}\",\n    \"phone\": \"{{phone}}\",\n    \"first_name\": \"John\",\n    \"last_name\": \"Doe\",\n    \"email\": \"john.doe@domain.com\",\n    \"language\": \"en\",\n    \"custom_fields\": {\n        \"ORDER_ID\": \"1234\"\n    },\n    \"metadata\": {\n        \"your_str_meta\": \"lorem ipsum\",\n        \"your_int_meta\": 3,\n        \"your_float_meta\": 42.5,\n        \"your_bool_meta\": true\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/wh/ap/{{uuid}}/"},"status":"OK","code":200,"_postman_previewlanguage":"html","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Thu, 15 Sep 2022 13:11:30 GMT"},{"key":"Content-Type","value":"text/html; charset=utf-8"},{"key":"Content-Length","value":"0"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Origin"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"083a9c63-d691-4ace-9c65-2cdc2d9a6ce0"},{"name":"Start Automation for many contacts","id":"b3ad8aa9-dd95-4681-879c-3a4bf3aff158","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"secret\": \"{{secret}}\",\n    \"contacts\": [\n        {\n            \"phone\": \"{{phone}}\",\n            \"first_name\": \"John\",\n            \"last_name\": \"Doe\",\n            \"email\": \"john.doe@domain.com\",\n            \"language\": \"en\",\n            \"custom_fields\": {\n                \"ORDER_ID\": \"1234\"\n            }\n        },\n        {\n            \"phone\": \"+39333123461234\",\n            \"first_name\": \"Giovanni\",\n            \"last_name\": \"Bianchi\",\n            \"email\": \"giovanni.bianchi@domain.com\",\n            \"custom_fields\": {\n                \"ORDER_ID\": \"4222\"\n            },\n            \"metadata\": {\n                \"your_str_meta\": \"lorem ipsum\",\n                \"your_int_meta\": 3,\n                \"your_float_meta\": 42.5,\n                \"your_bool_meta\": true\n            }\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/wh/ap/{{uuid}}/bulk/","description":"<p>This endpoint allows you to start an automation created on Spoki Platform.</p>\n<p><strong>Important</strong>: You don’t need the <code>API_KEY</code> to use this API. Just get the <code>WEBHOOK_SECRET</code> from the Automation Detail as shown below.  </p>\n<p>Max contacts allowed: 500.</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"d4c9e9e1-781d-4cf8-a037-b2f92bd7f2fa","id":"d4c9e9e1-781d-4cf8-a037-b2f92bd7f2fa","name":"Automations","type":"folder"}},"urlObject":{"path":["wh","ap","{{uuid}}","bulk",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"0c0dc71d-faab-402b-8436-3bf8e17b65aa","name":"200 OK","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"secret\": \"{{secret}}\",\n    \"contacts\": [\n        {\n            \"phone\": \"{{phone}}\",\n            \"first_name\": \"John\",\n            \"last_name\": \"Doe\",\n            \"email\": \"john.doe@domain.com\",\n            \"language\": \"en\",\n            \"custom_fields\": {\n                \"ORDER_ID\": \"1234\"\n            }\n        },\n        {\n            \"phone\": \"+39333123461234\",\n            \"first_name\": \"Giovanni\",\n            \"last_name\": \"Bianchi\",\n            \"email\": \"giovanni.bianchi@domain.com\",\n            \"custom_fields\": {\n                \"ORDER_ID\": \"4222\"\n            },\n            \"metadata\": {\n                \"your_str_meta\": \"lorem ipsum\",\n                \"your_int_meta\": 3,\n                \"your_float_meta\": 42.5,\n                \"your_bool_meta\": true\n            }\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/wh/ap/{{uuid}}/bulk/"},"status":"OK","code":200,"_postman_previewlanguage":"html","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Thu, 15 Sep 2022 13:18:19 GMT"},{"key":"Content-Type","value":"text/html; charset=utf-8"},{"key":"Content-Length","value":"0"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Origin"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"b3ad8aa9-dd95-4681-879c-3a4bf3aff158"},{"name":"List, search, and filter automations","id":"84e7037e-efee-419f-bc77-7180d397a50f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/automations/","description":"<p><strong>Rate Limit:</strong> 60/min</p>\n","urlObject":{"path":["api","1","automations",""],"host":["{{Base-URL}}"],"query":[{"disabled":true,"description":{"content":"<p>You can search by: name, webhook link</p>\n","type":"text/plain"},"key":"search","value":""},{"disabled":true,"description":{"content":"<p>Api, Active Campaign, Woocommerce, Magento, Prestashop, Shopify, Zapier, Qapla', BrainLead, HubSpot, Klaviyo, Zoho, Sendinblue, WPNotif, Connectif, IFTTT, Pipedrive, Meta, Zendesk</p>\n","type":"text/plain"},"key":"webhook_platform","value":""},{"disabled":true,"description":{"content":"<p>true, false</p>\n","type":"text/plain"},"key":"is_active","value":""}],"variable":[]}},"response":[{"id":"e3632a47-3921-43f2-ab7b-8c19d1cdf98e","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/automations/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Thu, 22 Dec 2022 13:57:24 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"2720"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 7,\n    \"next\": null,\n    \"previous\": null,\n    \"results\": [\n        {\n            \"id\": 345016,\n            \"name\": \"test_automation\",\n            \"first_message_text\": \"Ciao %%SENTENCE%%\\nA presto\",\n            \"webhook_set\": [\n                {\n                    \"uuid\": \"e9ed4c53-2c33-4137-bfdb-e23f9d679c53\",\n                    \"link\": \"https://app.spoki.it/wh/ap/e9ed4c53-2c33-4137-bfdb-e23f9d679c53/\",\n                    \"secret\": \"2dced9e911c247dcbeca6bbbaa26e0a4\",\n                    \"is_active\": true\n                }\n            ],\n            \"created_datetime\": \"2022-09-16T10:21:56.564216+02:00\",\n            \"updated_datetime\": \"2022-12-22T14:55:54.431910+01:00\",\n            \"is_active\": true\n        },\n        {\n            \"id\": 345015,\n            \"name\": \"supporto\",\n            \"first_message_text\": \"Ciao, ti do il benvenuto nella nostra area dedicata al supporto! \\r\\n\\r\\nCome posso aiutarti?\",\n            \"webhook_set\": [],\n            \"created_datetime\": \"2022-09-16T10:21:56.544937+02:00\",\n            \"updated_datetime\": \"2022-09-16T10:21:56.563198+02:00\",\n            \"is_active\": true\n        },\n        {\n            \"id\": 345014,\n            \"name\": \"supporto_3\",\n            \"first_message_text\": \"Perfetto! 👍👍👍\\r\\nIn basso il link per prenotare una consulenza con il nostro esperto. Le consulenze hanno una durata di 45' e si terranno su Google Meet. \\r\\nGrazie ai consigli dei nostri esperti potrai rendere più performanti le tue attività!\\r\\nTroverai tutto nel tuo calendario!\",\n            \"webhook_set\": [],\n            \"created_datetime\": \"2022-09-16T10:21:56.526027+02:00\",\n            \"updated_datetime\": \"2022-09-16T10:21:56.544066+02:00\",\n            \"is_active\": true\n        },\n        {\n            \"id\": 345013,\n            \"name\": \"supporto_2\",\n            \"first_message_text\": \"Descrivi brevemente la tua necessità, un nostro operatore sta prendendo in carico la tua richiesta.\\n\\nTi invito nel frattempo a visualizzare la sezione \\\"video tutorial\\\" del nostro sito, troverai tantissimi video su come utilizzare al meglio il prodotto!\",\n            \"webhook_set\": [],\n            \"created_datetime\": \"2022-09-16T10:21:56.502145+02:00\",\n            \"updated_datetime\": \"2022-09-16T10:21:56.525112+02:00\",\n            \"is_active\": true\n        },\n        {\n            \"id\": 345012,\n            \"name\": \"promo_2\",\n            \"first_message_text\": null,\n            \"webhook_set\": [],\n            \"created_datetime\": \"2022-09-16T10:21:56.484521+02:00\",\n            \"updated_datetime\": \"2022-09-16T10:21:56.501283+02:00\",\n            \"is_active\": true\n        },\n        {\n            \"id\": 345011,\n            \"name\": \"promo\",\n            \"first_message_text\": \"Ciao, abbiamo una bellissima notizia per te! 😍\\r\\n\\r\\nDa oggi *fino a fine mese* avrai la possibilità di acquistare *i tuoi costumi preferiti* a *metà prezzo* 🛍!\\r\\n\\r\\nSfoglia il catalogo e scegli il tuo modello preferito 👇\",\n            \"webhook_set\": [],\n            \"created_datetime\": \"2022-09-16T10:21:56.467132+02:00\",\n            \"updated_datetime\": \"2022-09-16T10:21:56.483663+02:00\",\n            \"is_active\": true\n        },\n        {\n            \"id\": 345010,\n            \"name\": \"carrello_abbandonato\",\n            \"first_message_text\": \"Ciao %%FIRST_NAME%%, hai lasciato i tuoi articoli preferiti nel carrello! 🛒\\r\\n\\r\\nCompleta ora il tuo ordine 👉 %%CHECKOUT_LINK%%\\r\\n\\r\\nHai bisogno di supporto? Contattaci 👇\",\n            \"webhook_set\": [],\n            \"created_datetime\": \"2022-09-16T10:21:56.430977+02:00\",\n            \"updated_datetime\": \"2022-09-16T10:21:56.466249+02:00\",\n            \"is_active\": true\n        }\n    ]\n}"}],"_postman_id":"84e7037e-efee-419f-bc77-7180d397a50f"},{"name":"Retrieve automation","id":"9711abeb-0666-494c-a553-611ec8b35dc2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/automations/{{id}}/","description":"<p><strong>Rate Limit:</strong> 60/min</p>\n","urlObject":{"path":["api","1","automations","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"b9e5104e-88c6-4603-90db-21b4217e6500","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/automations/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Thu, 22 Dec 2022 13:59:22 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"412"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 345016,\n    \"name\": \"test_automation\",\n    \"first_message_text\": \"Ciao %%SENTENCE%%\\nA presto\",\n    \"webhook_set\": [\n        {\n            \"uuid\": \"e9ed4c53-2c33-4137-bfdb-e23f9d679c53\",\n            \"link\": \"https://app.spoki.it/wh/ap/e9ed4c53-2c33-4137-bfdb-e23f9d679c53/\",\n            \"secret\": \"2dced9e911c247dcbeca6bbbaa26e0a4\",\n            \"is_active\": true\n        }\n    ],\n    \"created_datetime\": \"2022-09-16T10:21:56.564216+02:00\",\n    \"updated_datetime\": \"2022-12-22T14:55:54.431910+01:00\",\n    \"is_active\": true\n}"}],"_postman_id":"9711abeb-0666-494c-a553-611ec8b35dc2"},{"name":"Create Automation","id":"e3731a3d-af6d-457b-a498-dfa27c293787","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"{{Base-URL}}/api/1/automations/","description":"<h1 id=\"create-automation\">Create Automation</h1>\n<h2 id=\"post-create-automation\">POST Create automation</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>https://api.spoki.com/api/1/automations/\n\n</code></pre><p><strong>Rate Limit:</strong> 60/min</p>\n<h3 id=\"overview\">Overview</h3>\n<p>Create a new automation with support for steps, triggers, and automation groups in a single request. Steps are created in the order provided and can include delays, messages, webhooks, tags, operators, and more. Triggers define when the automation starts (e.g., on first message, on webhook, on field condition).</p>\n<h3 id=\"headers\">HEADERS</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Header</th>\n<th>Value</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>X-Spoki-Api-Key</td>\n<td>{{Api-Key}}</td>\n</tr>\n<tr>\n<td>Content-Type</td>\n<td>application/json</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"request-body-structure\">Request Body Structure</h3>\n<h4 id=\"root-level-fields\">Root Level Fields</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>name</td>\n<td>string</td>\n<td>Yes</td>\n<td>Name of the automation</td>\n</tr>\n<tr>\n<td>description</td>\n<td>string</td>\n<td>No</td>\n<td>Description of the automation</td>\n</tr>\n<tr>\n<td>category</td>\n<td>string</td>\n<td>No</td>\n<td>Category of the automation</td>\n</tr>\n<tr>\n<td>is_active</td>\n<td>boolean</td>\n<td>No</td>\n<td>Whether the automation is active. Default: <code>true</code></td>\n</tr>\n<tr>\n<td>is_favorite</td>\n<td>boolean</td>\n<td>No</td>\n<td>Whether the automation is marked as favorite. Default: <code>false</code></td>\n</tr>\n<tr>\n<td>automation_groups</td>\n<td>array[integer]</td>\n<td>No</td>\n<td>List of automation group IDs to assign</td>\n</tr>\n<tr>\n<td>steps</td>\n<td>array[object]</td>\n<td>No</td>\n<td>List of step objects to create (see Step Types below)</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"trigger-fields-all-optional\">Trigger Fields (all optional)</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>webhook_set</td>\n<td>array[object]</td>\n<td>Webhook triggers</td>\n</tr>\n<tr>\n<td>onfirstmessagestarter_set</td>\n<td>array[object]</td>\n<td>First message triggers</td>\n</tr>\n<tr>\n<td>fieldconditionstarter_set</td>\n<td>array[object]</td>\n<td>Field condition triggers</td>\n</tr>\n<tr>\n<td>onopeninghoursstarter_set</td>\n<td>array[object]</td>\n<td>Opening hours triggers</td>\n</tr>\n<tr>\n<td>onclosinghoursstarter_set</td>\n<td>array[object]</td>\n<td>Closing hours triggers</td>\n</tr>\n<tr>\n<td>onholidayhoursstarter_set</td>\n<td>array[object]</td>\n<td>Holiday hours triggers</td>\n</tr>\n<tr>\n<td>metaadsconditionstarter_set</td>\n<td>array[object]</td>\n<td>Meta Ads condition triggers</td>\n</tr>\n<tr>\n<td>onticketcreatestarter_set</td>\n<td>array[object]</td>\n<td>Ticket creation triggers</td>\n</tr>\n<tr>\n<td>onticketstatuschangestarter_set</td>\n<td>array[object]</td>\n<td>Ticket status change triggers</td>\n</tr>\n<tr>\n<td>accountpaymentrequeststarter_set</td>\n<td>array[object]</td>\n<td>Payment request triggers</td>\n</tr>\n<tr>\n<td>oninboundmessageorderstarter_set</td>\n<td>array[object]</td>\n<td>Inbound message order triggers</td>\n</tr>\n<tr>\n<td>oninboundmessageproductstarter_set</td>\n<td>array[object]</td>\n<td>Inbound message product triggers</td>\n</tr>\n<tr>\n<td>onmarketingacceptancestatuschangestarter_set</td>\n<td>array[object]</td>\n<td>Marketing acceptance status triggers</td>\n</tr>\n<tr>\n<td>googlesheetstrigger_set</td>\n<td>array[object]</td>\n<td>Google Sheets triggers</td>\n</tr>\n<tr>\n<td>ondealcreatestarter_set</td>\n<td>array[object]</td>\n<td>Deal creation triggers</td>\n</tr>\n<tr>\n<td>ondealupdatestarter_set</td>\n<td>array[object]</td>\n<td>Deal update triggers</td>\n</tr>\n<tr>\n<td>ondealcontactupdatedstarter_set</td>\n<td>array[object]</td>\n<td>Deal contact updated triggers</td>\n</tr>\n<tr>\n<td>ondealstagechangestarter_set</td>\n<td>array[object]</td>\n<td>Deal stage change triggers</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"trigger-details\">Trigger Details</h4>\n<p>Each trigger type has its own required and optional fields. See the <a href=\"#trigger-types-reference\">Trigger Types Reference</a> section for full field definitions and examples for each trigger.</p>\n<hr />\n<h2 id=\"step-types-reference\">Step Types Reference</h2>\n<p>Each step object in the <code>steps</code> array must include a <code>step_type</code> field as a <strong>string label</strong> (case-insensitive).</p>\n<h4 id=\"common-fields-all-steps\">Common Fields (all steps)</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>step_type</td>\n<td>string</td>\n<td>Yes</td>\n<td>Step type label (see table below)</td>\n</tr>\n<tr>\n<td>position</td>\n<td>integer</td>\n<td>No</td>\n<td>Step position in the automation. Automatically assigned based on array index (0, 1, 2, ...) unless explicitly provided</td>\n</tr>\n<tr>\n<td>note</td>\n<td>string</td>\n<td>No</td>\n<td>Internal note for this step (not visible to contacts)</td>\n</tr>\n<tr>\n<td>reference</td>\n<td>string</td>\n<td>No</td>\n<td>Reference identifier. Used to link child steps to button flows in InteractiveMessage/ListMessage</td>\n</tr>\n<tr>\n<td>key</td>\n<td>string</td>\n<td>No</td>\n<td>Step key identifier. Used by GoToStep to reference this step as a jump target</td>\n</tr>\n<tr>\n<td>step_set</td>\n<td>array[object]</td>\n<td>No</td>\n<td>Array of child step objects. Used for: button sub-flows in InteractiveMessage/ListMessage (requires <code>reference</code>), and the <strong>false branch</strong> in IfElse (no <code>reference</code> needed)</td>\n</tr>\n</tbody>\n</table>\n</div><div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Label</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>Delay</code></td>\n<td>Pause automation</td>\n</tr>\n<tr>\n<td><code>TemplateMessage</code></td>\n<td>Send WhatsApp template</td>\n</tr>\n<tr>\n<td><code>FreeMessage</code></td>\n<td>Send free-form text</td>\n</tr>\n<tr>\n<td><code>ReadMessage</code></td>\n<td>Wait for reply</td>\n</tr>\n<tr>\n<td><code>Webhook</code></td>\n<td>Send HTTP request</td>\n</tr>\n<tr>\n<td><code>AddTag</code></td>\n<td>Add tag to contact</td>\n</tr>\n<tr>\n<td><code>RemoveTag</code></td>\n<td>Remove tag</td>\n</tr>\n<tr>\n<td><code>AddToList</code></td>\n<td>Add to list</td>\n</tr>\n<tr>\n<td><code>RemoveFromList</code></td>\n<td>Remove from list</td>\n</tr>\n<tr>\n<td><code>CustomField</code></td>\n<td>Set custom field</td>\n</tr>\n<tr>\n<td><code>BlockContact</code></td>\n<td>Block contact</td>\n</tr>\n<tr>\n<td><code>InteractiveMessage</code></td>\n<td>Message with buttons</td>\n</tr>\n<tr>\n<td><code>AddOperator</code></td>\n<td>Assign operator</td>\n</tr>\n<tr>\n<td><code>RemoveOperator</code></td>\n<td>Remove operator</td>\n</tr>\n<tr>\n<td><code>ListMessage</code></td>\n<td>Message with menu list</td>\n</tr>\n<tr>\n<td><code>OpenTicket</code></td>\n<td>Open ticket</td>\n</tr>\n<tr>\n<td><code>UpdateTicket</code></td>\n<td>Update ticket</td>\n</tr>\n<tr>\n<td><code>TerminateAutomations</code></td>\n<td>Stop all automations</td>\n</tr>\n<tr>\n<td><code>RestoreContact</code></td>\n<td>Unblock contact</td>\n</tr>\n<tr>\n<td><code>IfElse</code></td>\n<td>Conditional branching</td>\n</tr>\n<tr>\n<td><code>ZapierWebhook</code></td>\n<td>Zapier webhook</td>\n</tr>\n<tr>\n<td><code>ActiveCampaign</code></td>\n<td>Active Campaign</td>\n</tr>\n<tr>\n<td><code>PayPal</code></td>\n<td>PayPal payment</td>\n</tr>\n<tr>\n<td><code>SubAutomation</code></td>\n<td>Trigger sub-automation</td>\n</tr>\n<tr>\n<td><code>GoToStep</code></td>\n<td>Jump to step</td>\n</tr>\n<tr>\n<td><code>SwitchCase</code></td>\n<td>Multi-branch routing</td>\n</tr>\n<tr>\n<td><code>AddNote</code></td>\n<td>Add chat note</td>\n</tr>\n<tr>\n<td><code>SetChatUnread</code></td>\n<td>Mark chat unread</td>\n</tr>\n<tr>\n<td><code>MarketingAcceptanceStatus</code></td>\n<td>Set marketing status</td>\n</tr>\n<tr>\n<td><code>MakeWebhook</code></td>\n<td>Make (Integromat) webhook</td>\n</tr>\n<tr>\n<td><code>SMS</code></td>\n<td>Send SMS</td>\n</tr>\n<tr>\n<td><code>AIOperator</code></td>\n<td>AI operator</td>\n</tr>\n<tr>\n<td><code>Emailchef</code></td>\n<td>Emailchef integration</td>\n</tr>\n<tr>\n<td><code>GoogleSheets</code></td>\n<td>Google Sheets</td>\n</tr>\n<tr>\n<td><code>SetChatRead</code></td>\n<td>Mark chat read</td>\n</tr>\n<tr>\n<td><code>GoogleCalendar</code></td>\n<td>Google Calendar</td>\n</tr>\n<tr>\n<td><code>N8nWebhook</code></td>\n<td>n8n webhook</td>\n</tr>\n<tr>\n<td><code>TransformContactField</code></td>\n<td>Transform field value</td>\n</tr>\n<tr>\n<td><code>HubSpotWebhook</code></td>\n<td>HubSpot webhook</td>\n</tr>\n<tr>\n<td><code>GoHighLevelWebhook</code></td>\n<td>GoHighLevel webhook</td>\n</tr>\n<tr>\n<td><code>GoogleGmail</code></td>\n<td>Google Gmail</td>\n</tr>\n<tr>\n<td><code>UpdateDeal</code></td>\n<td>Update deal</td>\n</tr>\n<tr>\n<td><code>CreateDeal</code></td>\n<td>Create deal</td>\n</tr>\n<tr>\n<td><code>Voice</code></td>\n<td>Spoki Voice call</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"delay\">Delay</h3>\n<p>Pauses the automation for a given number of seconds.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>delay_seconds</td>\n<td>integer</td>\n<td>No</td>\n<td>Delay in seconds. Default: <code>1000</code></td>\n</tr>\n<tr>\n<td>conditions</td>\n<td>object</td>\n<td>No</td>\n<td>Optional conditions for conditional delay</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"Delay\",\n    \"delay_seconds\": 3600\n}\n\n</code></pre>\n<p>Delay with condition (e.g., wait until specific day):</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"Delay\",\n    \"delay_seconds\": 3600,\n    \"conditions\": {\n        \"and_conditions\": [\n            {\n                \"condition\": \"equal_to\",\n                \"key\": \"day_of_week\",\n                \"metadata\": \"day_of_week\",\n                \"value\": \"1\"\n            }\n        ]\n    }\n}\n\n</code></pre>\n<hr />\n<h3 id=\"templatemessage\">TemplateMessage</h3>\n<p>Sends a WhatsApp template message.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>template</td>\n<td>integer</td>\n<td>Yes</td>\n<td>Template ID (must belong to your account)</td>\n</tr>\n<tr>\n<td>header_media</td>\n<td>object</td>\n<td>No</td>\n<td>Media header configuration. Use when the template has a media header (image, video, document)</td>\n</tr>\n<tr>\n<td>custom_field_values</td>\n<td>object</td>\n<td>No</td>\n<td>Dynamic field values for template variables. Keys are the variable position numbers (as strings), values are the dynamic field codes (e.g., <code>\"dynamic_field_first_name\"</code>, <code>\"dynamic_field_\"</code>)</td>\n</tr>\n<tr>\n<td>carousel_headers_media</td>\n<td>array</td>\n<td>No</td>\n<td>Carousel header media items. Used only for carousel-type templates — one media object per carousel card</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Simple example — send a template with no variables:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"TemplateMessage\",\n    \"template\": 456\n}\n\n</code></pre>\n<p><strong>With custom field values</strong> — map template variable positions to contact dynamic fields:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"TemplateMessage\",\n    \"template\": 456,\n    \"custom_field_values\": {\n        \"1\": \"dynamic_field_first_name\",\n        \"2\": \"dynamic_field_55\"\n    }\n}\n\n</code></pre>\n<hr />\n<h3 id=\"freemessage\">FreeMessage</h3>\n<p>Sends a free-form text message.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>text</td>\n<td>string</td>\n<td>No</td>\n<td>Message text (can be blank)</td>\n</tr>\n<tr>\n<td>header_media</td>\n<td>object</td>\n<td>No</td>\n<td>Media attachment</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"FreeMessage\",\n    \"text\": \"Hello! Welcome to our service.\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"readmessage\">ReadMessage</h3>\n<p>Waits for an inbound message from the contact.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>delay_seconds</td>\n<td>integer</td>\n<td>No</td>\n<td>Timeout in seconds. If set, the automation will continue after this timeout even if no reply is received</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"ReadMessage\"\n}\n\n</code></pre>\n<p>With timeout:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"ReadMessage\",\n    \"delay_seconds\": 86400\n}\n\n</code></pre>\n<hr />\n<h3 id=\"webhook\">Webhook</h3>\n<p>Sends an HTTP request to an external URL.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>url</td>\n<td>string (URL)</td>\n<td>Yes</td>\n<td>Webhook URL</td>\n</tr>\n<tr>\n<td>method</td>\n<td>string</td>\n<td>No</td>\n<td>HTTP method: <code>GET</code>, <code>POST</code>, <code>PUT</code>, <code>PATCH</code>, <code>DELETE</code>. Default: <code>POST</code></td>\n</tr>\n<tr>\n<td>headers</td>\n<td>object</td>\n<td>No</td>\n<td>Custom headers</td>\n</tr>\n<tr>\n<td>payload</td>\n<td>string</td>\n<td>No</td>\n<td>Request body (max 4096 chars). Must be valid JSON. Max 5 nested objects.</td>\n</tr>\n<tr>\n<td>response_data</td>\n<td>object</td>\n<td>No</td>\n<td>Response mapping configuration</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"Webhook\",\n    \"url\": \"https://example.com/webhook\",\n    \"method\": \"POST\",\n    \"headers\": {\"Authorization\": \"Bearer token123\"},\n    \"payload\": \"{\\\"contact\\\": \\\"{{phone}}\\\"}\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"addtag\">AddTag</h3>\n<p>Adds one or more tags to the contact.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>tags</td>\n<td>array[integer]</td>\n<td>No</td>\n<td>Tag IDs to add (must belong to your account)</td>\n</tr>\n<tr>\n<td>is_all</td>\n<td>boolean</td>\n<td>No</td>\n<td>Apply all tags. Default: <code>false</code></td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"AddTag\",\n    \"tags\": [123, 456, 789]\n}\n\n</code></pre>\n<hr />\n<h3 id=\"removetag\">RemoveTag</h3>\n<p>Removes one or more tags from the contact.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>tags</td>\n<td>array[integer]</td>\n<td>No</td>\n<td>Tag IDs to remove (must belong to your account)</td>\n</tr>\n<tr>\n<td>is_all</td>\n<td>boolean</td>\n<td>No</td>\n<td>Remove all tags. Default: <code>false</code></td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"RemoveTag\",\n    \"tags\": [123, 456]\n}\n\n</code></pre>\n<p>Remove all tags:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"RemoveTag\",\n    \"is_all\": true\n}\n\n</code></pre>\n<hr />\n<h3 id=\"addtolist\">AddToList</h3>\n<p>Adds the contact to one or more lists.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>lists</td>\n<td>array[integer]</td>\n<td>No</td>\n<td>List IDs to add the contact to (must belong to your account)</td>\n</tr>\n<tr>\n<td>is_all</td>\n<td>boolean</td>\n<td>No</td>\n<td>Add to all lists. Default: <code>false</code></td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"AddToList\",\n    \"lists\": [42, 43]\n}\n\n</code></pre>\n<hr />\n<h3 id=\"removefromlist\">RemoveFromList</h3>\n<p>Removes the contact from one or more lists.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>lists</td>\n<td>array[integer]</td>\n<td>No</td>\n<td>List IDs to remove the contact from (must belong to your account)</td>\n</tr>\n<tr>\n<td>is_all</td>\n<td>boolean</td>\n<td>No</td>\n<td>Remove from all lists. Default: <code>false</code></td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"RemoveFromList\",\n    \"lists\": [42]\n}\n\n</code></pre>\n<hr />\n<h3 id=\"customfield\">CustomField</h3>\n<p>Sets a custom field value on the contact.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>custom_field</td>\n<td>integer</td>\n<td>Yes</td>\n<td>Custom field ID (must belong to your account)</td>\n</tr>\n<tr>\n<td>value</td>\n<td>string</td>\n<td>No</td>\n<td>Value to set on the contact's custom field</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"CustomField\",\n    \"custom_field\": 99,\n    \"value\": \"VIP\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"blockcontact\">BlockContact</h3>\n<p>Blocks the contact (sets <code>is_blocked = true</code>). No additional fields required.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"BlockContact\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"interactivemessage\">InteractiveMessage</h3>\n<p>Sends an interactive message with buttons.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>interactive_message</td>\n<td>object</td>\n<td>Yes</td>\n<td>Nested interactive message object (see structure below)</td>\n</tr>\n<tr>\n<td>header_media</td>\n<td>object</td>\n<td>No</td>\n<td>Header media configuration</td>\n</tr>\n<tr>\n<td>step_set</td>\n<td>array[object]</td>\n<td>No</td>\n<td>Child steps (button flows). Each child must have a <code>reference</code> matching a button's <code>text</code></td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"interactive_message-object\">interactive_message object</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>language</td>\n<td>string</td>\n<td>No</td>\n<td>Language code (e.g., <code>\"en\"</code>, <code>\"it\"</code>)</td>\n</tr>\n<tr>\n<td>header_component</td>\n<td>object or null</td>\n<td>No</td>\n<td>Header component. Pass <code>null</code> to omit</td>\n</tr>\n<tr>\n<td>body_component</td>\n<td>object</td>\n<td>Yes</td>\n<td>Body component with the message text</td>\n</tr>\n<tr>\n<td>footer_component</td>\n<td>object or null</td>\n<td>No</td>\n<td>Footer component. Pass <code>null</code> to omit</td>\n</tr>\n<tr>\n<td>interactivemessagebuttoncomponent_set</td>\n<td>array[object]</td>\n<td>Yes</td>\n<td>Array of button objects</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"component-object-header_component-body_component-footer_component\">Component object (header_component, body_component, footer_component)</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>component_type</td>\n<td>string</td>\n<td>Yes</td>\n<td>One of: <code>\"header\"</code>, <code>\"body\"</code>, <code>\"footer\"</code></td>\n</tr>\n<tr>\n<td>format</td>\n<td>string</td>\n<td>No</td>\n<td>For header: <code>\"text\"</code>, <code>\"image\"</code>, <code>\"video\"</code>, <code>\"document\"</code></td>\n</tr>\n<tr>\n<td>text</td>\n<td>string</td>\n<td>Yes</td>\n<td>Component text content</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"button-object-interactivemessagebuttoncomponent_set\">Button object (interactivemessagebuttoncomponent_set)</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>text</td>\n<td>string</td>\n<td>Yes</td>\n<td>Button label text (max 20 chars)</td>\n</tr>\n<tr>\n<td>button_type</td>\n<td>string</td>\n<td>Yes</td>\n<td>One of: <code>\"quick_reply\"</code>, <code>\"url\"</code>, <code>\"phone_number\"</code></td>\n</tr>\n<tr>\n<td>order</td>\n<td>integer</td>\n<td>Yes</td>\n<td>Button display order (0, 1, 2)</td>\n</tr>\n<tr>\n<td>url</td>\n<td>string</td>\n<td>No</td>\n<td>Required for <code>url</code> button type</td>\n</tr>\n<tr>\n<td>phone_number</td>\n<td>string</td>\n<td>No</td>\n<td>Required for <code>phone_number</code> button type</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Button types:</strong></p>\n<ul>\n<li><p><code>quick_reply</code> — Quick reply button (default). Can have child flow steps via <code>step_set</code></p>\n</li>\n<li><p><code>url</code> — URL link button (requires <code>url</code> field)</p>\n</li>\n<li><p><code>phone_number</code> — Phone number button (requires <code>phone_number</code> field)</p>\n</li>\n</ul>\n<p><strong>Child steps (step_set):</strong> To attach a flow to a button, add a <code>step_set</code> array. Each child step must include <code>reference</code> matching the button's exact <code>text</code> value. Multiple steps with the same <code>reference</code> are chained in the same button flow.</p>\n<p><strong>Simple example — one step per button:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"InteractiveMessage\",\n    \"interactive_message\": {\n        \"language\": \"en\",\n        \"header_component\": null,\n        \"body_component\": {\n            \"component_type\": \"body\",\n            \"text\": \"How can we help you?\"\n        },\n        \"footer_component\": null,\n        \"interactivemessagebuttoncomponent_set\": [\n            {\"text\": \"Sales\", \"button_type\": \"quick_reply\", \"order\": 0},\n            {\"text\": \"Support\", \"button_type\": \"quick_reply\", \"order\": 1}\n        ]\n    },\n    \"step_set\": [\n        {\"step_type\": \"Delay\", \"delay_seconds\": 5, \"reference\": \"Sales\"},\n        {\"step_type\": \"Delay\", \"delay_seconds\": 10, \"reference\": \"Support\"}\n    ]\n}\n\n</code></pre>\n<p><strong>Multi-step subflow — multiple steps per button:</strong></p>\n<p>Use the same <code>reference</code> for all steps in the same button flow. The order within each flow follows the array order.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"InteractiveMessage\",\n    \"interactive_message\": {\n        \"language\": \"en\",\n        \"header_component\": null,\n        \"body_component\": {\n            \"component_type\": \"body\",\n            \"text\": \"Choose a department:\"\n        },\n        \"footer_component\": null,\n        \"interactivemessagebuttoncomponent_set\": [\n            {\"text\": \"Sales\", \"button_type\": \"quick_reply\", \"order\": 0},\n            {\"text\": \"Support\", \"button_type\": \"quick_reply\", \"order\": 1}\n        ]\n    },\n    \"step_set\": [\n        {\"step_type\": \"Delay\", \"delay_seconds\": 5, \"reference\": \"Sales\"},\n        {\"step_type\": \"FreeMessage\", \"text\": \"A sales agent will contact you shortly!\", \"reference\": \"Sales\"},\n        {\"step_type\": \"AddTag\", \"tag\": 100, \"reference\": \"Sales\"},\n        {\"step_type\": \"Delay\", \"delay_seconds\": 10, \"reference\": \"Support\"},\n        {\"step_type\": \"FreeMessage\", \"text\": \"Opening a support ticket...\", \"reference\": \"Support\"}\n    ]\n}\n\n</code></pre>\n<p>In this example, the <strong>Sales</strong> button flow has 3 steps (Delay → FreeMessage → AddTag) and the <strong>Support</strong> button flow has 2 steps (Delay → FreeMessage).</p>\n<hr />\n<h3 id=\"addoperator\">AddOperator</h3>\n<p>Assigns one or more operators to the contact's chat.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>roles</td>\n<td>array[integer]</td>\n<td>No</td>\n<td>Role IDs to assign (must belong to your account)</td>\n</tr>\n<tr>\n<td>is_all</td>\n<td>boolean</td>\n<td>No</td>\n<td>Assign all operators. Default: <code>false</code></td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"AddOperator\",\n    \"roles\": [5, 10]\n}\n\n</code></pre>\n<hr />\n<h3 id=\"removeoperator\">RemoveOperator</h3>\n<p>Removes one or more operators from the contact's chat.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>roles</td>\n<td>array[integer]</td>\n<td>No</td>\n<td>Role IDs to remove (must belong to your account)</td>\n</tr>\n<tr>\n<td>is_all</td>\n<td>boolean</td>\n<td>No</td>\n<td>Remove all operators. Default: <code>false</code></td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"RemoveOperator\",\n    \"roles\": [5]\n}\n\n</code></pre>\n<hr />\n<h3 id=\"listmessage\">ListMessage</h3>\n<p>Sends a list message (menu with selectable items).</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>list_message</td>\n<td>object</td>\n<td>Yes</td>\n<td>Nested list message object (see structure below)</td>\n</tr>\n<tr>\n<td>step_set</td>\n<td>array[object]</td>\n<td>No</td>\n<td>Child steps (row flows). Each child must have a <code>reference</code> matching a row's <code>title</code></td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"list_message-object\">list_message object</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>header_component</td>\n<td>object or null</td>\n<td>No</td>\n<td>Header component (see <a href=\"#component-object-header_component-body_component-footer_component\">Component object</a>)</td>\n</tr>\n<tr>\n<td>body_component</td>\n<td>object</td>\n<td>Yes</td>\n<td>Body component with the message text</td>\n</tr>\n<tr>\n<td>footer_component</td>\n<td>object or null</td>\n<td>No</td>\n<td>Footer component</td>\n</tr>\n<tr>\n<td>button_text</td>\n<td>string</td>\n<td>Yes</td>\n<td>Text displayed on the list open button (max 20 chars)</td>\n</tr>\n<tr>\n<td>listmessagesection_set</td>\n<td>array[object]</td>\n<td>Yes</td>\n<td>Array of section objects</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"section-object-listmessagesection_set\">Section object (listmessagesection_set)</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>title</td>\n<td>string</td>\n<td>Yes</td>\n<td>Section title</td>\n</tr>\n<tr>\n<td>listmessagesectionrow_set</td>\n<td>array[object]</td>\n<td>Yes</td>\n<td>Array of row items</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"row-object-listmessagesectionrow_set\">Row object (listmessagesectionrow_set)</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>title</td>\n<td>string</td>\n<td>Yes</td>\n<td>Row title (max 24 chars)</td>\n</tr>\n<tr>\n<td>description</td>\n<td>string</td>\n<td>No</td>\n<td>Row description (max 72 chars)</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"ListMessage\",\n    \"list_message\": {\n        \"header_component\": {\n            \"component_type\": \"header\",\n            \"format\": \"text\",\n            \"text\": \"Our Menu\"\n        },\n        \"body_component\": {\n            \"component_type\": \"body\",\n            \"text\": \"Choose from the list below\"\n        },\n        \"footer_component\": {\n            \"component_type\": \"footer\",\n            \"text\": \"Select an option\"\n        },\n        \"button_text\": \"View Options\",\n        \"listmessagesection_set\": [\n            {\n                \"title\": \"Products\",\n                \"listmessagesectionrow_set\": [\n                    {\n                        \"title\": \"Product A\",\n                        \"description\": \"Description of product A\"\n                    },\n                    {\n                        \"title\": \"Product B\",\n                        \"description\": \"Description of product B\"\n                    }\n                ]\n            }\n        ]\n    }\n}\n\n</code></pre>\n<hr />\n<h3 id=\"openticket\">OpenTicket</h3>\n<p>Opens a support ticket for the contact.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>ticket</td>\n<td>object</td>\n<td>No</td>\n<td>Ticket configuration</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"ticket-object\">ticket object</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>ticket_category</td>\n<td>integer</td>\n<td>No</td>\n<td>Ticket category ID</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"OpenTicket\",\n    \"ticket\": {\n        \"ticket_category\": 1\n    }\n}\n\n</code></pre>\n<hr />\n<h3 id=\"updateticket\">UpdateTicket</h3>\n<p>Updates an existing ticket. Same fields as <a href=\"#openticket\">OpenTicket</a>.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"UpdateTicket\",\n    \"ticket\": {\n        \"ticket_category\": 2\n    }\n}\n\n</code></pre>\n<hr />\n<h3 id=\"terminateautomations\">TerminateAutomations</h3>\n<p>Terminates all running automations for the contact. No additional type-specific fields required.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"TerminateAutomations\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"restorecontact\">RestoreContact</h3>\n<p>Unblocks a previously blocked contact (sets <code>is_blocked = false</code>). This is the reverse operation of <a href=\"#blockcontact\">BlockContact</a>. No additional type-specific fields required.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"RestoreContact\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"ifelse\">IfElse</h3>\n<p>Conditional branching based on contact fields or conditions.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>conditions</td>\n<td>object</td>\n<td>No</td>\n<td>Conditions object (see structure below)</td>\n</tr>\n<tr>\n<td>step_set</td>\n<td>array[object]</td>\n<td>No</td>\n<td>Child steps for the <strong>Else (false) branch</strong> — executed when the condition is NOT met. Do not include <code>reference</code> on these child steps</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"branching-behavior\">Branching behavior</h4>\n<p>The IfElse step splits the flow into two branches:</p>\n<ul>\n<li><p><strong>True branch (condition met):</strong> The automation continues with the next step in the main <code>steps</code> array (the step immediately after the IfElse).</p>\n</li>\n<li><p><strong>False branch (condition NOT met):</strong> The automation executes the child steps defined in <code>step_set</code>.</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>steps: [\n    { \"step_type\": \"IfElse\", \"conditions\": {...}, \"step_set\": [\n        ← These run when condition is FALSE\n    ]},\n    { \"step_type\": \"AddTag\", ... }     ← This runs when condition is TRUE\n]\n\n</code></pre><p><strong>IMPORTANT:</strong> The conditions must use a <strong>nested structure</strong> with two levels:</p>\n<ol>\n<li><p><strong>Outer level</strong>: An object with <code>and_conditions</code> or <code>or_conditions</code> — this is an array of <strong>groups</strong></p>\n</li>\n<li><p><strong>Inner level</strong>: Each group is an object with <code>and_conditions</code> or <code>or_conditions</code> — this is an array of <strong>condition items</strong></p>\n</li>\n</ol>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>conditions: {\n    and_conditions: [          ← Groups joined by AND\n        {\n            and_conditions: [  ← Items within group joined by AND\n                { key, condition, value, metadata }\n            ]\n        }\n    ]\n}\n\n</code></pre><p>Use <code>or_conditions</code> at the outer level to join groups with OR logic. Use <code>and_conditions</code> at the inner level to join items within a group with AND logic.</p>\n<h4 id=\"condition-item-fields\">Condition item fields</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>key</td>\n<td>string</td>\n<td>Field to evaluate (see keys below)</td>\n</tr>\n<tr>\n<td>condition</td>\n<td>string</td>\n<td>Comparison operator (see operators below)</td>\n</tr>\n<tr>\n<td>value</td>\n<td>string</td>\n<td>Value to compare against</td>\n</tr>\n<tr>\n<td>metadata</td>\n<td>string</td>\n<td>Must match the <code>key</code> value (e.g., <code>\"first_name\"</code>, <code>\"email\"</code>). For custom fields use the field name (e.g., <code>\"Order Total\"</code>)</td>\n</tr>\n<tr>\n<td>date_component</td>\n<td>string</td>\n<td>For date conditions: <code>year</code>, <code>month</code>, <code>day_of_month</code>, <code>day_of_week</code>, <code>hour</code>, <code>minute</code>, <code>time</code></td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"available-keys\">Available keys</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Key</th>\n<th>Description</th>\n<th>Supported Conditions</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>first_name</code></td>\n<td>Contact first name</td>\n<td>equal_to, not_equal_to, contains, not_contains, starts_with, not_starts_with, ends_with, not_ends_with, empty, not_empty</td>\n</tr>\n<tr>\n<td><code>last_name</code></td>\n<td>Contact last name</td>\n<td>(same as first_name)</td>\n</tr>\n<tr>\n<td><code>phone</code></td>\n<td>Contact phone</td>\n<td>(same as first_name)</td>\n</tr>\n<tr>\n<td><code>email</code></td>\n<td>Contact email</td>\n<td>(same as first_name)</td>\n</tr>\n<tr>\n<td><code>tag</code></td>\n<td>Has tag</td>\n<td>exists, not_exists</td>\n</tr>\n<tr>\n<td><code>tagcat</code></td>\n<td>Has tag category</td>\n<td>exists, not_exists</td>\n</tr>\n<tr>\n<td><code>list</code></td>\n<td>In list</td>\n<td>exists, not_exists</td>\n</tr>\n<tr>\n<td><code>operator</code></td>\n<td>Has operator</td>\n<td>exists, not_exists</td>\n</tr>\n<tr>\n<td><code>dynamic_field_</code></td>\n<td>Custom field by ID</td>\n<td>equal_to, not_equal_to, contains, not_contains, starts_with, not_starts_with, ends_with, not_ends_with, less_than, less_than_or_equal, greater_than, greater_than_or_equal, empty, not_empty</td>\n</tr>\n<tr>\n<td><code>ticket_status</code></td>\n<td>Ticket status</td>\n<td>equal_to, not_equal_to</td>\n</tr>\n<tr>\n<td><code>ticket_priority</code></td>\n<td>Ticket priority</td>\n<td>equal_to, not_equal_to</td>\n</tr>\n<tr>\n<td><code>conversation_any</code></td>\n<td>Any active conversation</td>\n<td>active, not_active</td>\n</tr>\n<tr>\n<td><code>whatsapp_sent_message_24h</code></td>\n<td>WhatsApp message sent in last 24h</td>\n<td>is_true, is_false</td>\n</tr>\n<tr>\n<td><code>whatsapp_received_message_24h</code></td>\n<td>WhatsApp message received in last 24h</td>\n<td>is_true, is_false</td>\n</tr>\n<tr>\n<td><code>sms_sent_message_24h</code></td>\n<td>SMS sent in last 24h</td>\n<td>is_true, is_false</td>\n</tr>\n<tr>\n<td><code>sms_received_message_24h</code></td>\n<td>SMS received in last 24h</td>\n<td>is_true, is_false</td>\n</tr>\n<tr>\n<td><code>current_date</code></td>\n<td>Current date</td>\n<td>day_of_week, day_of_month, year, month, equal_to, not_equal_to, less_than, less_than_or_equal, greater_than, greater_than_or_equal</td>\n</tr>\n<tr>\n<td><code>current_datetime</code></td>\n<td>Current datetime</td>\n<td>day_of_week, day_of_month, year, month, hour, minute, greater_than, less_than</td>\n</tr>\n<tr>\n<td><code>current_time</code></td>\n<td>Current time</td>\n<td>greater_than, less_than</td>\n</tr>\n<tr>\n<td><code>has_invalid_phone</code></td>\n<td>Invalid phone</td>\n<td>is_true, is_false</td>\n</tr>\n<tr>\n<td><code>is_blocked</code></td>\n<td>Contact blocked</td>\n<td>is_true, is_false</td>\n</tr>\n<tr>\n<td><code>language</code></td>\n<td>Contact language</td>\n<td>equal_to, not_equal_to</td>\n</tr>\n<tr>\n<td><code>marketing_acceptance</code></td>\n<td>Marketing acceptance status. Values: <code>\"0\"</code> (not declared), <code>\"1\"</code> (subscribed), <code>\"2\"</code> (unsubscribed)</td>\n<td>equal_to, not_equal_to</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"available-conditions-operators\">Available conditions (operators)</h4>\n<p><code>equal_to</code>, <code>not_equal_to</code>, <code>contains</code>, <code>not_contains</code>, <code>greater_than</code>, <code>greater_than_or_equal</code>, <code>less_than</code>, <code>less_than_or_equal</code>, <code>empty</code>, <code>not_empty</code>, <code>starts_with</code>, <code>not_starts_with</code>, <code>ends_with</code>, <code>not_ends_with</code>, <code>is_true</code>, <code>is_false</code>, <code>exists</code>, <code>not_exists</code>, <code>one_of</code>, <code>not_one_of</code>, <code>active</code>, <code>not_active</code></p>\n<h4 id=\"example--single-and-condition\">Example — Single AND condition</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"IfElse\",\n    \"conditions\": {\n        \"and_conditions\": [\n            {\n                \"and_conditions\": [\n                    {\n                        \"key\": \"first_name\",\n                        \"condition\": \"contains\",\n                        \"value\": \"Alessandro\",\n                        \"metadata\": \"first_name\"\n                    }\n                ]\n            }\n        ]\n    }\n}\n\n</code></pre>\n<h4 id=\"example--multiple-and-conditions\">Example — Multiple AND conditions</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"IfElse\",\n    \"conditions\": {\n        \"and_conditions\": [\n            {\n                \"and_conditions\": [\n                    {\n                        \"key\": \"first_name\",\n                        \"condition\": \"not_empty\",\n                        \"value\": \"\",\n                        \"metadata\": \"first_name\"\n                    },\n                    {\n                        \"key\": \"email\",\n                        \"condition\": \"contains\",\n                        \"value\": \"@gmail.com\",\n                        \"metadata\": \"email\"\n                    }\n                ]\n            }\n        ]\n    }\n}\n\n</code></pre>\n<h4 id=\"example--or-between-groups\">Example — OR between groups</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"IfElse\",\n    \"conditions\": {\n        \"or_conditions\": [\n            {\n                \"and_conditions\": [\n                    {\n                        \"key\": \"tag\",\n                        \"condition\": \"exists\",\n                        \"value\": \"123\",\n                        \"metadata\": \"tag\"\n                    }\n                ]\n            },\n            {\n                \"and_conditions\": [\n                    {\n                        \"key\": \"list\",\n                        \"condition\": \"exists\",\n                        \"value\": \"42\",\n                        \"metadata\": \"list\"\n                    }\n                ]\n            }\n        ]\n    }\n}\n\n</code></pre>\n<h4 id=\"example--custom-field-condition\">Example — Custom field condition</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"IfElse\",\n    \"conditions\": {\n        \"and_conditions\": [\n            {\n                \"and_conditions\": [\n                    {\n                        \"key\": \"dynamic_field_55\",\n                        \"condition\": \"greater_than\",\n                        \"value\": \"100\",\n                        \"metadata\": \"dynamic_field_55\"\n                    }\n                ]\n            }\n        ]\n    }\n}\n\n</code></pre>\n<h4 id=\"example--no-reply-condition\">Example — No reply condition</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"IfElse\",\n    \"conditions\": {\n        \"and_conditions\": [\n            {\n                \"and_conditions\": [\n                    {\n                        \"key\": \"no_reply\",\n                        \"condition\": \"equal_to\",\n                        \"value\": \"3600\",\n                        \"metadata\": \"no_reply\"\n                    }\n                ]\n            }\n        ]\n    }\n}\n\n</code></pre>\n<h4 id=\"example--ifelse-with-truefalse-branch-steps\">Example — IfElse with true/false branch steps</h4>\n<p>In this example, if the contact has a first name → tag them as \"Known\" (true branch, main flow). If not → tag them as \"Anonymous\" (false branch, step_set).</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"steps\": [\n        {\n            \"step_type\": \"IfElse\",\n            \"position\": 0,\n            \"conditions\": {\n                \"and_conditions\": [\n                    {\n                        \"and_conditions\": [\n                            {\n                                \"key\": \"first_name\",\n                                \"condition\": \"not_empty\",\n                                \"value\": \"\",\n                                \"metadata\": \"first_name\"\n                            }\n                        ]\n                    }\n                ]\n            },\n            \"step_set\": [\n                {\"step_type\": \"AddTag\", \"position\": 0, \"tag\": 200}\n            ]\n        },\n        {\n            \"step_type\": \"AddTag\",\n            \"position\": 1,\n            \"tag\": 100\n        }\n    ]\n}\n\n</code></pre>\n<p>In the flow above:</p>\n<ul>\n<li><p><strong>Condition TRUE</strong> (first_name is not empty) → executes AddTag with tag 100 (position 1, main flow)</p>\n</li>\n<li><p><strong>Condition FALSE</strong> (first_name is empty) → executes AddTag with tag 200 (step_set, false branch)</p>\n</li>\n</ul>\n<hr />\n<h3 id=\"zapierwebhook\">ZapierWebhook</h3>\n<p>Sends a webhook to Zapier.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>url</td>\n<td>string (URL)</td>\n<td>Yes</td>\n<td>Zapier webhook URL</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"ZapierWebhook\",\n    \"url\": \"https://hooks.zapier.com/hooks/catch/123456/abcdef/\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"activecampaign\">ActiveCampaign</h3>\n<p>Triggers an Active Campaign integration. No specific additional fields.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"ActiveCampaign\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"paypal\">PayPal</h3>\n<p>Sends a PayPal payment request using a template.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>template</td>\n<td>integer</td>\n<td>Yes</td>\n<td>Template ID for PayPal message</td>\n</tr>\n<tr>\n<td>custom_field_values</td>\n<td>object</td>\n<td>No</td>\n<td>Dynamic field values</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"PayPal\",\n    \"template\": 789\n}\n\n</code></pre>\n<hr />\n<h3 id=\"subautomation\">SubAutomation</h3>\n<p>Triggers another automation.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>automation_to_start</td>\n<td>integer</td>\n<td>Yes</td>\n<td>Automation ID to trigger</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"SubAutomation\",\n    \"automation_to_start\": 5678\n}\n\n</code></pre>\n<hr />\n<h3 id=\"gotostep\">GoToStep</h3>\n<p>Jumps to another step within the same automation.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>step_key</td>\n<td>string</td>\n<td>No</td>\n<td>Target step key identifier</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"GoToStep\",\n    \"step_key\": \"step_abc_123\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"switchcase\">SwitchCase</h3>\n<p>Routes the automation into multiple branches based on a contact field value (like a multi-branch If/Else).</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>handled_conditions</td>\n<td>array</td>\n<td>Yes</td>\n<td>List of condition values for routing. Must include <code>\"DEFAULT_CASE_KEY\"</code> as the last item for the default/fallback branch</td>\n</tr>\n<tr>\n<td>step_key</td>\n<td>string</td>\n<td>No</td>\n<td>Step key identifier</td>\n</tr>\n<tr>\n<td>key_metadata</td>\n<td>string</td>\n<td>Yes</td>\n<td>JSON-stringified object (see structure below)</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"key_metadata-structure\">key_metadata structure</h4>\n<p>The <code>key_metadata</code> field must be a <strong>JSON string</strong> containing:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Property</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>casesName</td>\n<td>array[string]</td>\n<td>Yes</td>\n<td>Display labels for each case, in the same order as <code>handled_conditions</code>. Must include <code>\"DEFAULT_CASE_KEY\"</code> as the last item</td>\n</tr>\n<tr>\n<td>key</td>\n<td>string</td>\n<td>Yes</td>\n<td>The contact field to evaluate (e.g., <code>\"language\"</code>, <code>\"priority_level\"</code>, or a custom field name)</td>\n</tr>\n<tr>\n<td>customField</td>\n<td>object</td>\n<td>No</td>\n<td>Custom field reference (when routing by custom field)</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>IMPORTANT:</strong></p>\n<ul>\n<li><p><code>handled_conditions</code> contains the <strong>values</strong> to match against (e.g., <code>\"IT\"</code>, <code>\"EN\"</code>)</p>\n</li>\n<li><p><code>casesName</code> contains the <strong>display labels</strong> shown in the UI for each case (e.g., <code>\"Italiano\"</code>, <code>\"English\"</code>)</p>\n</li>\n<li><p>Both arrays must have the same length and order</p>\n</li>\n<li><p>Always include <code>\"DEFAULT_CASE_KEY\"</code> as the last element in <strong>both</strong> <code>handled_conditions</code> and <code>casesName</code> — this is the fallback branch for unmatched values</p>\n</li>\n</ul>\n<h4 id=\"example--route-by-language\">Example — Route by language</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"SwitchCase\",\n    \"handled_conditions\": [\"IT\", \"EN\", \"ES\", \"DEFAULT_CASE_KEY\"],\n    \"key_metadata\": \"{\\\"casesName\\\":[\\\"Italiano\\\",\\\"English\\\",\\\"Español\\\",\\\"DEFAULT_CASE_KEY\\\"],\\\"key\\\":\\\"language\\\"}\"\n}\n\n</code></pre>\n<h4 id=\"example--route-by-custom-field\">Example — Route by custom field</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"SwitchCase\",\n    \"step_key\": \"dynamic_field_55\",\n    \"handled_conditions\": [\"HIGH\", \"MEDIUM\", \"LOW\", \"DEFAULT_CASE_KEY\"],\n    \"key_metadata\": \"{\\\"casesName\\\":[\\\"High Priority\\\",\\\"Medium Priority\\\",\\\"Low Priority\\\",\\\"DEFAULT_CASE_KEY\\\"],\\\"key\\\":\\\"priority_level\\\"}\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"addnote\">AddNote</h3>\n<p>Adds a note to the contact's chat.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>text</td>\n<td>string</td>\n<td>No</td>\n<td>Note text</td>\n</tr>\n<tr>\n<td>header_media</td>\n<td>object</td>\n<td>No</td>\n<td>Media attachment</td>\n</tr>\n<tr>\n<td>ticket_reference</td>\n<td>string</td>\n<td>No</td>\n<td>Reference to ticket</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"AddNote\",\n    \"text\": \"Contact requested a callback.\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"setchatunread\">SetChatUnread</h3>\n<p>Marks the chat as unread. No additional fields required.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"SetChatUnread\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"marketingacceptancestatus\">MarketingAcceptanceStatus</h3>\n<p>Changes the marketing acceptance status of the contact.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>status</td>\n<td>integer</td>\n<td>No</td>\n<td>Marketing acceptance status value</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"MarketingAcceptanceStatus\",\n    \"status\": 1\n}\n\n</code></pre>\n<hr />\n<h3 id=\"makewebhook\">MakeWebhook</h3>\n<p>Sends a webhook to Make (Integromat).</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>url</td>\n<td>string (URL)</td>\n<td>Yes</td>\n<td>Make webhook URL</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"MakeWebhook\",\n    \"url\": \"https://hook.eu1.make.com/abcdef123456\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"sms\">SMS</h3>\n<p>Sends an SMS message.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>text</td>\n<td>string</td>\n<td>No</td>\n<td>SMS text</td>\n</tr>\n<tr>\n<td>is_oneway</td>\n<td>boolean</td>\n<td>No</td>\n<td>One-way SMS. Default: <code>false</code></td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"SMS\",\n    \"text\": \"Your order has been shipped!\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"aioperator\">AIOperator</h3>\n<p>Enables or disables the AI operator for the chat.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>enable</td>\n<td>boolean</td>\n<td>No</td>\n<td>Enable AI operator. Default: <code>false</code></td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"AIOperator\",\n    \"enable\": true\n}\n\n</code></pre>\n<hr />\n<h3 id=\"emailchef\">Emailchef</h3>\n<p>Triggers an Emailchef integration.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>url</td>\n<td>string</td>\n<td>No</td>\n<td>Emailchef endpoint URL</td>\n</tr>\n<tr>\n<td>custom_fields</td>\n<td>object</td>\n<td>No</td>\n<td>Custom field mapping</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"Emailchef\",\n    \"url\": \"https://app.emailchef.com/api/...\",\n    \"custom_fields\": {\n        \"email\": \"dynamic_field_email\",\n        \"name\": \"dynamic_field_first_name\"\n    }\n}\n\n</code></pre>\n<hr />\n<h3 id=\"googlesheets\">GoogleSheets</h3>\n<p>Performs operations on Google Sheets.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>sheet_id</td>\n<td>string</td>\n<td>Depends</td>\n<td>Google Sheet ID (required for <code>append</code>, <code>update</code>, <code>create_tab</code>; optional for <code>create_sheet</code>)</td>\n</tr>\n<tr>\n<td>sheet_name</td>\n<td>string</td>\n<td>No</td>\n<td>Display name of the sheet</td>\n</tr>\n<tr>\n<td>configuration</td>\n<td>object</td>\n<td>No</td>\n<td>Operation configuration (see below)</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"configuration-object\"><code>configuration</code> object</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>operation</td>\n<td>string</td>\n<td>No</td>\n<td><code>\"append\"</code> (default), <code>\"update\"</code>, <code>\"create_sheet\"</code>, or <code>\"create_tab\"</code></td>\n</tr>\n<tr>\n<td>sheet_tab</td>\n<td>string</td>\n<td>No</td>\n<td>Tab name within the sheet (for <code>append</code>/<code>update</code>, e.g. <code>\"Sheet1\"</code>, <code>\"Leads\"</code>)</td>\n</tr>\n<tr>\n<td>columns</td>\n<td>object</td>\n<td>Yes (append/update)</td>\n<td>Column-to-field mapping. Keys are column letters, values are contact field codes or <code>{{placeholder}}</code> templates</td>\n</tr>\n<tr>\n<td>row_number</td>\n<td>integer</td>\n<td>Yes (update)</td>\n<td>Row number to update</td>\n</tr>\n<tr>\n<td>sheet_name</td>\n<td>string</td>\n<td>No (create_sheet)</td>\n<td>Name for the new sheet (defaults to the step's <code>sheet_name</code> field or <code>\"Spoki Data\"</code>)</td>\n</tr>\n<tr>\n<td>tab_name</td>\n<td>string</td>\n<td>No (create_tab)</td>\n<td>Name for the new tab (defaults to <code>\"New Sheet\"</code>)</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Append row</strong> — adds a new row to an existing sheet tab:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"GoogleSheets\",\n    \"sheet_id\": \"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms\",\n    \"sheet_name\": \"Customer Data\",\n    \"configuration\": {\n        \"operation\": \"append\",\n        \"sheet_tab\": \"Leads\",\n        \"columns\": {\n            \"A\": \"phone\",\n            \"B\": \"first_name\",\n            \"C\": \"last_name\",\n            \"D\": \"email\"\n        }\n    }\n}\n\n</code></pre>\n<p><strong>Update row</strong> — updates a specific row:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"GoogleSheets\",\n    \"sheet_id\": \"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms\",\n    \"configuration\": {\n        \"operation\": \"update\",\n        \"sheet_tab\": \"Leads\",\n        \"row_number\": 2,\n        \"columns\": {\n            \"A\": \"phone\",\n            \"B\": \"first_name\"\n        }\n    }\n}\n\n</code></pre>\n<p><strong>Create new sheet</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"GoogleSheets\",\n    \"configuration\": {\n        \"operation\": \"create_sheet\",\n        \"sheet_name\": \"My New Sheet\"\n    }\n}\n\n</code></pre>\n<p><strong>Create new tab</strong> — adds a tab to an existing sheet:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"GoogleSheets\",\n    \"sheet_id\": \"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms\",\n    \"configuration\": {\n        \"operation\": \"create_tab\",\n        \"tab_name\": \"New Tab\"\n    }\n}\n\n</code></pre>\n<hr />\n<h3 id=\"setchatread\">SetChatRead</h3>\n<p>Marks chat messages as read, optionally up to a certain date.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>fixed_date_value</td>\n<td>string (datetime)</td>\n<td>No</td>\n<td>Read messages up to this date</td>\n</tr>\n<tr>\n<td>fixed_date_custom_field</td>\n<td>integer</td>\n<td>No</td>\n<td>Custom field ID containing the date</td>\n</tr>\n<tr>\n<td>period_ago_amount</td>\n<td>integer</td>\n<td>No</td>\n<td>Read messages older than this amount</td>\n</tr>\n<tr>\n<td>period_ago_unit</td>\n<td>string</td>\n<td>No</td>\n<td>Time unit for period_ago_amount</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"SetChatRead\"\n}\n\n</code></pre>\n<p>With date filter:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"SetChatRead\",\n    \"period_ago_amount\": 7,\n    \"period_ago_unit\": \"days\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"googlecalendar\">GoogleCalendar</h3>\n<p>Performs operations on Google Calendar.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>calendar_id</td>\n<td>string</td>\n<td>Yes</td>\n<td>Google Calendar ID (e.g. <code>\"primary\"</code>)</td>\n</tr>\n<tr>\n<td>calendar_name</td>\n<td>string</td>\n<td>No</td>\n<td>Display name of the calendar</td>\n</tr>\n<tr>\n<td>configuration</td>\n<td>object</td>\n<td>Yes</td>\n<td>Event configuration (see below)</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"configuration-object-1\"><code>configuration</code> object</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>operation</td>\n<td>string</td>\n<td>No</td>\n<td><code>\"create\"</code> (default), <code>\"update\"</code>, or <code>\"delete\"</code></td>\n</tr>\n<tr>\n<td>event_id</td>\n<td>string</td>\n<td>Yes (update/delete)</td>\n<td>Calendar event ID. Supports <code>%%VARIABLE%%</code> placeholders</td>\n</tr>\n<tr>\n<td>event_title</td>\n<td>string</td>\n<td>No</td>\n<td>Event title. Supports <code>%%first_name%%</code> etc.</td>\n</tr>\n<tr>\n<td>event_description</td>\n<td>string</td>\n<td>No</td>\n<td>Event description</td>\n</tr>\n<tr>\n<td>event_location</td>\n<td>string</td>\n<td>No</td>\n<td>Event location</td>\n</tr>\n<tr>\n<td>start_datetime</td>\n<td>string</td>\n<td>No</td>\n<td>ISO datetime or <code>%%VARIABLE%%</code>. Used for create/update</td>\n</tr>\n<tr>\n<td>end_datetime</td>\n<td>string</td>\n<td>No</td>\n<td>ISO datetime or <code>%%VARIABLE%%</code></td>\n</tr>\n<tr>\n<td>duration_minutes</td>\n<td>integer</td>\n<td>No</td>\n<td>Duration in minutes (if <code>end_datetime</code> not provided, create only)</td>\n</tr>\n<tr>\n<td>time_zone</td>\n<td>string</td>\n<td>No</td>\n<td>IANA timezone (e.g. <code>\"Europe/Rome\"</code>). Use <code>\"accountTimezone\"</code> for the account's configured timezone</td>\n</tr>\n<tr>\n<td>attendees</td>\n<td>array[string]</td>\n<td>No</td>\n<td>List of attendee emails. Supports <code>%%email%%</code></td>\n</tr>\n<tr>\n<td>google_email</td>\n<td>string</td>\n<td>No</td>\n<td>Specific Google account to use</td>\n</tr>\n<tr>\n<td>reminders</td>\n<td>array[object]</td>\n<td>No</td>\n<td>Reminders. Each: `{\"method\": \"email\"</td>\n</tr>\n<tr>\n<td>visibility</td>\n<td>string</td>\n<td>No</td>\n<td><code>\"default\"</code>, <code>\"public\"</code>, or <code>\"private\"</code></td>\n</tr>\n<tr>\n<td>recurrence</td>\n<td>object</td>\n<td>No</td>\n<td>Recurrence settings (create only). See below</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Recurrence object</strong> (optional, create only):</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>enabled</td>\n<td>boolean</td>\n<td>Enable recurrence</td>\n</tr>\n<tr>\n<td>frequency</td>\n<td>string</td>\n<td><code>\"DAILY\"</code>, <code>\"WEEKLY\"</code>, <code>\"MONTHLY\"</code>, or <code>\"YEARLY\"</code></td>\n</tr>\n<tr>\n<td>count</td>\n<td>integer</td>\n<td>Number of occurrences</td>\n</tr>\n<tr>\n<td>interval</td>\n<td>integer</td>\n<td>Every N days/weeks/months</td>\n</tr>\n<tr>\n<td>by_day</td>\n<td>array[string]</td>\n<td>Day codes for weekly events: <code>\"MO\"</code>, <code>\"TU\"</code>, <code>\"WE\"</code>, <code>\"TH\"</code>, <code>\"FR\"</code>, <code>\"SA\"</code>, <code>\"SU\"</code></td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Create event:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"GoogleCalendar\",\n    \"calendar_id\": \"primary\",\n    \"calendar_name\": \"Work Calendar\",\n    \"configuration\": {\n        \"operation\": \"create\",\n        \"event_title\": \"Call with %%first_name%%\",\n        \"event_description\": \"Auto-scheduled follow-up\",\n        \"start_datetime\": \"2026-03-01T10:00:00Z\",\n        \"end_datetime\": \"2026-03-01T11:00:00Z\",\n        \"time_zone\": \"Europe/Rome\",\n        \"attendees\": [\"%%email%%\"],\n        \"reminders\": [\n            {\"method\": \"popup\", \"minutes\": 30}\n        ]\n    }\n}\n\n</code></pre>\n<p><strong>Update event:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"GoogleCalendar\",\n    \"calendar_id\": \"primary\",\n    \"configuration\": {\n        \"operation\": \"update\",\n        \"event_id\": \"%%EVENT_ID%%\",\n        \"event_title\": \"Updated: Call with %%first_name%%\"\n    }\n}\n\n</code></pre>\n<p><strong>Delete event:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"GoogleCalendar\",\n    \"calendar_id\": \"primary\",\n    \"configuration\": {\n        \"operation\": \"delete\",\n        \"event_id\": \"%%EVENT_ID%%\"\n    }\n}\n\n</code></pre>\n<hr />\n<h3 id=\"n8nwebhook\">N8nWebhook</h3>\n<p>Sends a webhook to n8n.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>url</td>\n<td>string (URL)</td>\n<td>Yes</td>\n<td>n8n webhook URL</td>\n</tr>\n<tr>\n<td>method</td>\n<td>string</td>\n<td>No</td>\n<td>HTTP method. Default: <code>POST</code></td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"N8nWebhook\",\n    \"url\": \"https://n8n.example.com/webhook/abc-123\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"transformcontactfield\">TransformContactField</h3>\n<p>Transforms a contact field value (e.g., date formatting, JSON parsing).</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>input_field_code</td>\n<td>string</td>\n<td>Yes</td>\n<td>Source custom field code</td>\n</tr>\n<tr>\n<td>output_field_code</td>\n<td>string</td>\n<td>Yes</td>\n<td>Destination custom field code</td>\n</tr>\n<tr>\n<td>transformation_type</td>\n<td>string</td>\n<td>Yes</td>\n<td>One of: <code>string_to_date</code>, <code>string_to_datetime</code>, <code>date_to_string</code>, <code>datetime_to_string</code>, <code>json_to_json</code>, <code>json_to_text</code></td>\n</tr>\n<tr>\n<td>date_format</td>\n<td>string</td>\n<td>No</td>\n<td>Date format pattern. Required for date transformations. Uses format tokens: <code>DD</code> (day), <code>MM</code> (month), <code>YYYY</code> (year), <code>HH</code> (hour), <code>mm</code> (minute), <code>ss</code> (second). Examples: <code>\"DD/MM/YYYY\"</code>, <code>\"YYYY-MM-DD\"</code>, <code>\"DD/MM/YYYY HH:mm\"</code></td>\n</tr>\n<tr>\n<td>json_mapping</td>\n<td>string</td>\n<td>No</td>\n<td>JSON mapping template for <code>json_to_json</code> and <code>json_to_text</code> transformations. A template string that extracts values from the source JSON field using dot-notation paths</td>\n</tr>\n<tr>\n<td>json_input_example</td>\n<td>string</td>\n<td>No</td>\n<td>Example JSON input for preview/testing purposes</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Date transformation example:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"TransformContactField\",\n    \"input_field_code\": \"birth_date_text\",\n    \"output_field_code\": \"birth_date\",\n    \"transformation_type\": \"string_to_date\",\n    \"date_format\": \"DD/MM/YYYY\"\n}\n\n</code></pre>\n<p><strong>JSON transformation example:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"TransformContactField\",\n    \"input_field_code\": \"webhook_response\",\n    \"output_field_code\": \"order_summary\",\n    \"transformation_type\": \"json_to_text\",\n    \"json_mapping\": \"Order #{{order.id}} - Total: {{order.total}}\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"hubspotwebhook\">HubSpotWebhook</h3>\n<p>Sends a webhook to HubSpot.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>url</td>\n<td>string (URL)</td>\n<td>Yes</td>\n<td>HubSpot webhook URL</td>\n</tr>\n<tr>\n<td>method</td>\n<td>string</td>\n<td>No</td>\n<td>HTTP method. Default: <code>POST</code></td>\n</tr>\n<tr>\n<td>payload_config</td>\n<td>object</td>\n<td>No</td>\n<td>Payload configuration</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"HubSpotWebhook\",\n    \"url\": \"https://api.hubapi.com/webhooks/v1/...\",\n    \"method\": \"POST\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"gohighlevelwebhook\">GoHighLevelWebhook</h3>\n<p>Sends a webhook to GoHighLevel.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>url</td>\n<td>string (URL)</td>\n<td>Yes</td>\n<td>GoHighLevel webhook URL</td>\n</tr>\n<tr>\n<td>method</td>\n<td>string</td>\n<td>No</td>\n<td>HTTP method. Default: <code>POST</code></td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"GoHighLevelWebhook\",\n    \"url\": \"https://services.leadconnectorhq.com/hooks/...\"\n}\n\n</code></pre>\n<hr />\n<h3 id=\"googlegmail\">GoogleGmail</h3>\n<p>Sends an email or creates a draft via Gmail.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>configuration</td>\n<td>object</td>\n<td>No</td>\n<td>Gmail configuration</td>\n</tr>\n</tbody>\n</table>\n</div><p>Configuration fields:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>operation</td>\n<td>string</td>\n<td>Yes</td>\n<td><code>send_email</code> or <code>create_draft</code></td>\n</tr>\n<tr>\n<td>to</td>\n<td>array[string]</td>\n<td>Yes</td>\n<td>Recipient email addresses</td>\n</tr>\n<tr>\n<td>subject</td>\n<td>string</td>\n<td>Yes</td>\n<td>Email subject</td>\n</tr>\n<tr>\n<td>body</td>\n<td>string</td>\n<td>Yes</td>\n<td>Email body (HTML supported)</td>\n</tr>\n<tr>\n<td>cc</td>\n<td>array[string]</td>\n<td>No</td>\n<td>CC recipients</td>\n</tr>\n<tr>\n<td>bcc</td>\n<td>array[string]</td>\n<td>No</td>\n<td>BCC recipients</td>\n</tr>\n<tr>\n<td>from_name</td>\n<td>string</td>\n<td>No</td>\n<td>Sender display name</td>\n</tr>\n<tr>\n<td>reply_to</td>\n<td>string</td>\n<td>No</td>\n<td>Reply-to address</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"GoogleGmail\",\n    \"configuration\": {\n        \"operation\": \"send_email\",\n        \"to\": [\"customer@example.com\"],\n        \"subject\": \"Order Confirmation\",\n        \"body\": \"&lt;h1 class=&amp;#x27;preserveHtml&amp;#x27; class=&amp;#x27;preserveHtml&amp;#x27; class=&amp;#x27;preserveHtml&amp;#x27; class=&amp;#x27;preserveHtml&amp;#x27;&gt;Thank you!&lt;/h1&gt;&lt;p class=&amp;#x27;preserveHtml&amp;#x27; class=&amp;#x27;preserveHtml&amp;#x27; class=&amp;#x27;preserveHtml&amp;#x27; class=&amp;#x27;preserveHtml&amp;#x27;&gt;Your order has been confirmed.&lt;/p&gt;\"\n    }\n}\n\n</code></pre>\n<hr />\n<h3 id=\"updatedeal\">UpdateDeal</h3>\n<p>Updates an existing deal associated with the contact.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>deal</td>\n<td>object</td>\n<td>No</td>\n<td>Deal configuration</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"deal-object\">deal object</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>pipeline</td>\n<td>integer</td>\n<td>No</td>\n<td>Pipeline ID</td>\n</tr>\n<tr>\n<td>stage</td>\n<td>integer</td>\n<td>No</td>\n<td>Stage ID within the pipeline</td>\n</tr>\n<tr>\n<td>title</td>\n<td>string</td>\n<td>No</td>\n<td>Deal title (supports dynamic fields, e.g., <code>\"John\"</code>)</td>\n</tr>\n<tr>\n<td>value</td>\n<td>string</td>\n<td>No</td>\n<td>Deal monetary value</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"UpdateDeal\",\n    \"deal\": {\n        \"stage\": 3,\n        \"value\": \"5000\"\n    }\n}\n\n</code></pre>\n<hr />\n<h3 id=\"createdeal\">CreateDeal</h3>\n<p>Creates a new deal. Same structure as <a href=\"#updatedeal\">UpdateDeal</a>.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"CreateDeal\",\n    \"deal\": {\n        \"pipeline\": 1,\n        \"stage\": 1,\n        \"title\": \"New deal from John\",\n        \"value\": \"1000\"\n    }\n}\n\n</code></pre>\n<hr />\n<h3 id=\"voice\">Voice</h3>\n<p>Initiates a Spoki Voice call.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>agent_id</td>\n<td>string</td>\n<td>Yes</td>\n<td>Voice agent ID</td>\n</tr>\n<tr>\n<td>agent_phonenumber_id</td>\n<td>string</td>\n<td>No</td>\n<td>Phone number ID (auto-fetched if not provided)</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"step_type\": \"Voice\",\n    \"agent_id\": \"agent_abc123\"\n}\n\n</code></pre>\n<hr />\n<h2 id=\"trigger-types-reference\">Trigger Types Reference</h2>\n<h3 id=\"webhook_set\">webhook_set</h3>\n<p>Creates a webhook trigger that starts the automation when called.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>name</td>\n<td>string</td>\n<td>Yes</td>\n<td>Name of the webhook trigger</td>\n</tr>\n<tr>\n<td>platform</td>\n<td>string</td>\n<td>Yes</td>\n<td>Integration platform label (case-insensitive)</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Available platform values:</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Label</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>webhook</code></td>\n<td>Generic Webhook</td>\n</tr>\n<tr>\n<td><code>api</code></td>\n<td>API</td>\n</tr>\n<tr>\n<td><code>zapier</code></td>\n<td>Zapier</td>\n</tr>\n<tr>\n<td><code>make</code></td>\n<td>Make (Integromat)</td>\n</tr>\n<tr>\n<td><code>n8n</code></td>\n<td>n8n</td>\n</tr>\n<tr>\n<td><code>activecampaign</code></td>\n<td>Active Campaign</td>\n</tr>\n<tr>\n<td><code>hubspot</code></td>\n<td>HubSpot</td>\n</tr>\n<tr>\n<td><code>shopify</code></td>\n<td>Shopify</td>\n</tr>\n<tr>\n<td><code>woocommerce</code></td>\n<td>WooCommerce</td>\n</tr>\n<tr>\n<td><code>magento</code></td>\n<td>Magento</td>\n</tr>\n<tr>\n<td><code>prestashop</code></td>\n<td>PrestaShop</td>\n</tr>\n<tr>\n<td><code>pipedrive</code></td>\n<td>Pipedrive</td>\n</tr>\n<tr>\n<td><code>salesforce</code></td>\n<td>Salesforce</td>\n</tr>\n<tr>\n<td><code>gohighlevel</code></td>\n<td>GoHighLevel</td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"webhook_set\": [\n        {\n            \"name\": \"Inbound Webhook\",\n            \"platform\": \"webhook\"\n        }\n    ]\n}\n\n</code></pre>\n<h3 id=\"onfirstmessagestarter_set\">onfirstmessagestarter_set</h3>\n<p>Triggers the automation when a contact sends a first message.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>first_message_ever</td>\n<td>boolean</td>\n<td>No</td>\n<td>If <code>true</code>, triggers only on the very first message the contact has ever sent. Default: <code>false</code></td>\n</tr>\n</tbody>\n</table>\n</div><pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"onfirstmessagestarter_set\": [\n        {\n            \"first_message_ever\": true\n        }\n    ]\n}\n\n</code></pre>\n<h3 id=\"fieldconditionstarter_set\">fieldconditionstarter_set</h3>\n<p>Triggers the automation when a contact's custom field matches a condition.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>custom_field</td>\n<td>integer</td>\n<td>Yes</td>\n<td>Custom field ID to monitor (must belong to your account)</td>\n</tr>\n<tr>\n<td>value</td>\n<td>string</td>\n<td>No</td>\n<td>Value to compare against</td>\n</tr>\n<tr>\n<td>operator</td>\n<td>string</td>\n<td>No</td>\n<td>Comparison operator: <code>\"=\"</code> (equal), <code>\"&lt;\"</code> (before), <code>\"&lt;=\"</code> (before or equal), <code>\"&gt;\"</code> (after), <code>\"&gt;=\"</code> (after or equal)</td>\n</tr>\n<tr>\n<td>condition_type</td>\n<td>integer</td>\n<td>No</td>\n<td>Condition type: <code>1</code> = Date condition</td>\n</tr>\n<tr>\n<td>time</td>\n<td>string</td>\n<td>No</td>\n<td>Time of day to check, in <code>HH:MM:SS</code> format (e.g., <code>\"09:00:00\"</code>)</td>\n</tr>\n<tr>\n<td>time_delta</td>\n<td>integer</td>\n<td>No</td>\n<td>Time offset in seconds relative to the matched date (e.g., <code>3600</code> = 1 hour after)</td>\n</tr>\n<tr>\n<td>ignore_year</td>\n<td>boolean</td>\n<td>No</td>\n<td>If <code>true</code>, ignores the year in date comparisons (useful for birthdays). Default: <code>true</code></td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Example — trigger when custom field equals a value:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"fieldconditionstarter_set\": [\n        {\n            \"custom_field\": 55,\n            \"value\": \"VIP\",\n            \"operator\": \"=\"\n        }\n    ]\n}\n\n</code></pre>\n<p><strong>Example — trigger on a date field (e.g., birthday), ignoring year:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"fieldconditionstarter_set\": [\n        {\n            \"custom_field\": 100,\n            \"operator\": \"=\",\n            \"condition_type\": 1,\n            \"time\": \"09:00:00\",\n            \"ignore_year\": true\n        }\n    ]\n}\n\n</code></pre>\n<hr />\n<h2 id=\"full-examples\">Full Examples</h2>\n<h3 id=\"minimal--automation-with-no-steps\">Minimal — Automation with no steps</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl --location 'https://api.spoki.com/api/1/automations/' \\\n--header 'X-Spoki-Api-Key: {{Api-Key}}' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"name\": \"Empty Automation\"\n}'\n\n</code></pre>\n<h3 id=\"automation-with-delay--template-message\">Automation with delay + template message</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl --location 'https://api.spoki.com/api/1/automations/' \\\n--header 'X-Spoki-Api-Key: {{Api-Key}}' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"name\": \"Template Automation\",\n    \"steps\": [\n        {\n            \"step_type\": \"Delay\",\n            \"delay_seconds\": 3600\n        },\n        {\n            \"step_type\": \"TemplateMessage\",\n            \"template\": 456\n        }\n    ]\n}'\n\n</code></pre>\n<h3 id=\"automation-with-ifelse-on-contact-name\">Automation with If/Else on contact name</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl --location 'https://api.spoki.com/api/1/automations/' \\\n--header 'X-Spoki-Api-Key: {{Api-Key}}' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"name\": \"Conditional Automation\",\n    \"steps\": [\n        {\n            \"step_type\": \"Delay\",\n            \"delay_seconds\": 600\n        },\n        {\n            \"step_type\": \"IfElse\",\n            \"conditions\": {\n                \"and_conditions\": [\n                    {\n                        \"and_conditions\": [\n                            {\n                                \"key\": \"first_name\",\n                                \"condition\": \"contains\",\n                                \"value\": \"Alessandro\",\n                                \"metadata\": \"first_name\"\n                            }\n                        ]\n                    }\n                ]\n            }\n        },\n        {\n            \"step_type\": \"TemplateMessage\",\n            \"template\": 2550\n        }\n    ]\n}'\n\n</code></pre>\n<h3 id=\"automation-with-webhook-trigger--tags--free-message\">Automation with webhook trigger + tags + free message</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl --location 'https://api.spoki.com/api/1/automations/' \\\n--header 'X-Spoki-Api-Key: {{Api-Key}}' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"name\": \"Welcome Flow\",\n    \"is_active\": true,\n    \"steps\": [\n        {\n            \"step_type\": \"Delay\",\n            \"delay_seconds\": 60\n        },\n        {\n            \"step_type\": \"FreeMessage\",\n            \"text\": \"Hello! Welcome to our service.\"\n        },\n        {\n            \"step_type\": \"AddTag\",\n            \"tag\": 123\n        }\n    ],\n    \"webhook_set\": [\n        {\n            \"name\": \"Inbound Webhook\",\n            \"platform\": \"webhook\"\n        }\n    ],\n    \"onfirstmessagestarter_set\": [\n        {\n            \"first_message_ever\": true\n        }\n    ]\n}'\n\n</code></pre>\n<h3 id=\"automation-with-automation-groups\">Automation with automation groups</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl --location 'https://api.spoki.com/api/1/automations/' \\\n--header 'X-Spoki-Api-Key: {{Api-Key}}' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"name\": \"Grouped Automation\",\n    \"automation_groups\": [1, 2],\n    \"steps\": [\n        {\n            \"step_type\": \"FreeMessage\",\n            \"text\": \"Hello from a grouped automation!\"\n        }\n    ]\n}'\n\n</code></pre>\n<h3 id=\"complete-example--multi-step-with-webhook-ifelse-tag-and-sub-automation\">Complete example — Multi-step with webhook, If/Else, tag, and sub-automation</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl --location 'https://api.spoki.com/api/1/automations/' \\\n--header 'X-Spoki-Api-Key: {{Api-Key}}' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"name\": \"Complete Onboarding Flow\",\n    \"is_active\": true,\n    \"steps\": [\n        {\n            \"step_type\": \"Delay\",\n            \"delay_seconds\": 30\n        },\n        {\n            \"step_type\": \"FreeMessage\",\n            \"text\": \"Welcome! Let us get you set up.\"\n        },\n        {\n            \"step_type\": \"IfElse\",\n            \"conditions\": {\n                \"and_conditions\": [\n                    {\n                        \"and_conditions\": [\n                            {\n                                \"key\": \"email\",\n                                \"condition\": \"not_empty\",\n                                \"value\": \"\",\n                                \"metadata\": \"email\"\n                            }\n                        ]\n                    }\n                ]\n            }\n        },\n        {\n            \"step_type\": \"AddTag\",\n            \"tag\": 100\n        },\n        {\n            \"step_type\": \"Webhook\",\n            \"url\": \"https://api.example.com/new-lead\",\n            \"method\": \"POST\"\n        },\n        {\n            \"step_type\": \"SubAutomation\",\n            \"automation_to_start\": 5678\n        }\n    ],\n    \"onfirstmessagestarter_set\": [\n        {\n            \"first_message_ever\": true\n        }\n    ]\n}'\n\n</code></pre>\n<h3 id=\"complete-example--ifelse-with-branching--switchcase-routing\">Complete example — IfElse with branching + SwitchCase routing</h3>\n<p>This example creates an automation with:</p>\n<ol>\n<li><p>A template message</p>\n</li>\n<li><p>An IfElse that checks if the contact has a first name:</p>\n<ul>\n<li><p><strong>True branch</strong> → two AddTag steps (main flow continues)</p>\n</li>\n<li><p><strong>False branch</strong> → two AddTag steps (via <code>step_set</code>)</p>\n</li>\n</ul>\n</li>\n<li><p>A SwitchCase that routes by language (Italiano, English, Español + default)</p>\n</li>\n<li><p>A webhook</p>\n</li>\n</ol>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl --location 'https://api.spoki.com/api/1/automations/' \\\n--header 'X-Spoki-Api-Key: {{Api-Key}}' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"name\": \"Branching Flow Example\",\n    \"is_active\": true,\n    \"steps\": [\n        {\n            \"step_type\": \"TemplateMessage\",\n            \"position\": 0,\n            \"template\": 2996\n        },\n        {\n            \"step_type\": \"IfElse\",\n            \"position\": 1,\n            \"conditions\": {\n                \"and_conditions\": [\n                    {\n                        \"and_conditions\": [\n                            {\n                                \"key\": \"first_name\",\n                                \"condition\": \"not_empty\",\n                                \"value\": \"\",\n                                \"metadata\": \"first_name\"\n                            }\n                        ]\n                    }\n                ]\n            },\n            \"step_set\": [\n                {\"step_type\": \"AddTag\", \"position\": 0, \"tag\": 200},\n                {\"step_type\": \"AddTag\", \"position\": 1, \"tag\": 201}\n            ]\n        },\n        {\n            \"step_type\": \"AddTag\",\n            \"position\": 2,\n            \"tag\": 100\n        },\n        {\n            \"step_type\": \"AddTag\",\n            \"position\": 3,\n            \"tag\": 101\n        },\n        {\n            \"step_type\": \"SwitchCase\",\n            \"position\": 4,\n            \"handled_conditions\": [\"IT\", \"EN\", \"ES\", \"DEFAULT_CASE_KEY\"],\n            \"key_metadata\": \"{\\\"casesName\\\":[\\\"Italiano\\\",\\\"English\\\",\\\"Español\\\",\\\"DEFAULT_CASE_KEY\\\"],\\\"key\\\":\\\"language\\\"}\"\n        },\n        {\n            \"step_type\": \"Webhook\",\n            \"position\": 5,\n            \"url\": \"https://api.example.com/webhook\",\n            \"method\": \"POST\"\n        }\n    ]\n}'\n\n</code></pre>\n<p><strong>Flow breakdown:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Template (#0)\n    ↓\nIfElse (#1): first_name not empty?\n    ├─ TRUE  → AddTag 100 (#2) → AddTag 101 (#3) → SwitchCase (#4) → Webhook (#5)\n    └─ FALSE → AddTag 200 (step_set[0]) → AddTag 201 (step_set[1])\nSwitchCase (#4): language?\n    ├─ IT       → (Italiano branch)\n    ├─ EN       → (English branch)\n    ├─ ES       → (Español branch)\n    └─ DEFAULT  → (fallback branch)\n\n</code></pre><hr />\n<h2 id=\"response\">Response</h2>\n<h3 id=\"201-created\">201 Created</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"id\": 12345,\n    \"name\": \"Welcome Flow\",\n    \"first_message_text\": \"Hello! Welcome to our service.\",\n    \"webhook_set\": [\n        {\n            \"id\": 678,\n            \"name\": \"Inbound Webhook\",\n            \"platform\": \"Webhook\",\n            \"link\": \"https://api.spoki.com/wh/ap/{uuid}/\"\n        }\n    ],\n    \"is_active\": true,\n    \"is_favorite\": false,\n    \"created_datetime\": \"2026-02-20T10:30:00Z\",\n    \"updated_datetime\": \"2026-02-20T10:30:00Z\",\n    \"updated_user\": null,\n    \"automation_groups\": []\n}\n\n</code></pre>\n<h3 id=\"error-responses\">Error Responses</h3>\n<p><strong>400 Bad Request</strong> — Invalid or missing required fields</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"error_code\": \"INVALID_REQUEST_BODY\",\n    \"detail\": {\n        \"steps\": {\n            \"step_0\": {\n                \"template\": [\"This field is required.\"]\n            }\n        }\n    }\n}\n\n</code></pre>\n<p><strong>400 Bad Request</strong> — Missing step_type</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"error_code\": \"INVALID_REQUEST_BODY\",\n    \"detail\": {\n        \"steps\": [\"step_type is required for step at position 0\"]\n    }\n}\n\n</code></pre>\n<p><strong>400 Bad Request</strong> — Resource belongs to another account</p>\n<p>Steps that reference account-scoped resources (template, tag, list, custom_field, automation_to_start, role) are validated for ownership. If a resource ID does not belong to your account, the request is rejected.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"error_code\": \"INVALID_REQUEST_BODY\",\n    \"detail\": {\n        \"template\": [\"Template with id 999 does not belong to your account.\"]\n    }\n}\n\n</code></pre>\n<p>This also applies to M2M fields (tags, lists, roles):</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"error_code\": \"INVALID_REQUEST_BODY\",\n    \"detail\": {\n        \"tags\": [\"Tag ids [55, 77] do not belong to your account.\"]\n    }\n}\n\n</code></pre>\n<p><strong>403 Forbidden</strong> — Missing or invalid API key</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"detail\": \"Authentication credentials were not provided.\"\n}\n\n</code></pre>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"d4c9e9e1-781d-4cf8-a037-b2f92bd7f2fa","id":"d4c9e9e1-781d-4cf8-a037-b2f92bd7f2fa","name":"Automations","type":"folder"}},"urlObject":{"path":["api","1","automations",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e3731a3d-af6d-457b-a498-dfa27c293787"},{"name":"Custom fields used","id":"50b69da1-a8df-4127-8bdc-f7e42014dfec","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/automations/{{id}}/custom-fields-used/","description":"<p>Returns all dynamic fields (placeholders) used across an automation's steps. Use this to know which contact fields and custom fields are required when triggering the automation via API.</p>\n<h2 id=\"endpoint\">Endpoint</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /api/1/automations/{id}/custom-fields-used/\n\n</code></pre><p><strong>Rate Limit:</strong> 60/min</p>\n<h2 id=\"authentication\">Authentication</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Header</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>x-spoki-api-key</code></td>\n<td>Yes</td>\n<td>Your account API key</td>\n</tr>\n</tbody>\n</table>\n</div><h2 id=\"path-parameters\">Path Parameters</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>id</code></td>\n<td>integer</td>\n<td>The automation ID</td>\n</tr>\n</tbody>\n</table>\n</div><h2 id=\"response\">Response</h2>\n<h3 id=\"200-ok\">200 OK</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n  \"raw_codes\": [\n    \"%%DATA_E_ORA_APPUNTAMENTO%%\",\n    \"%%FIRST_NAME%%\"\n  ],\n  \"contact_fields\": [\n    \"phone\",\n    \"first_name\"\n  ],\n  \"custom_fields\": [\n    {\n      \"id\": 188859,\n      \"label\": \"Data e ora appuntamento\",\n      \"field_type\": 2,\n      \"is_linked\": true,\n      \"code\": \"DATA_E_ORA_APPUNTAMENTO\",\n      \"example\": \"05/09/24\"\n    }\n  ],\n  \"static_custom_fields\": [\n    {\n      \"field_name\": \"PRODUCTO\",\n      \"value\": \"example product\",\n      \"step_id\": 12345\n    }\n  ]\n}\n\n</code></pre><h3 id=\"response-fields\">Response Fields</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>raw_codes</code></td>\n<td>array of strings</td>\n<td>All placeholder codes found in the automation steps (e.g. <code>%%FIRST_NAME%%</code>, <code>%%CUSTOM_FIELD%%</code>)</td>\n</tr>\n<tr>\n<td><code>contact_fields</code></td>\n<td>array of strings</td>\n<td>Built-in contact fields used by the automation. Always includes <code>phone</code>. May also include <code>first_name</code>, <code>last_name</code>, <code>email</code></td>\n</tr>\n<tr>\n<td><code>custom_fields</code></td>\n<td>array of objects</td>\n<td>All custom field definitions referenced by the automation (from template placeholders)</td>\n</tr>\n<tr>\n<td><code>custom_fields[].id</code></td>\n<td>integer</td>\n<td>Custom field ID</td>\n</tr>\n<tr>\n<td><code>custom_fields[].label</code></td>\n<td>string</td>\n<td>Human-readable label</td>\n</tr>\n<tr>\n<td><code>custom_fields[].field_type</code></td>\n<td>integer</td>\n<td>Field type: <code>1</code> = Text, <code>2</code> = Date, <code>3</code> = Number, <code>4</code> = URL</td>\n</tr>\n<tr>\n<td><code>custom_fields[].is_linked</code></td>\n<td>boolean</td>\n<td>Whether the field is linked to an external source</td>\n</tr>\n<tr>\n<td><code>custom_fields[].code</code></td>\n<td>string</td>\n<td>Field code (without <code>%%</code> delimiters)</td>\n</tr>\n<tr>\n<td><code>custom_fields[].example</code></td>\n<td>string</td>\n<td>Example value for the field</td>\n</tr>\n<tr>\n<td><code>static_custom_fields</code></td>\n<td>array of objects</td>\n<td>Custom fields used exclusively with a static (fixed) value across all steps. A field that is used statically in one step and dynamically in another is <strong>not</strong> included here</td>\n</tr>\n<tr>\n<td><code>static_custom_fields[].field_name</code></td>\n<td>string</td>\n<td>The field code (e.g. <code>PRODUCTO</code>)</td>\n</tr>\n<tr>\n<td><code>static_custom_fields[].value</code></td>\n<td>string</td>\n<td>The static value configured in the step</td>\n</tr>\n<tr>\n<td><code>static_custom_fields[].step_id</code></td>\n<td>integer</td>\n<td>The ID of the step where this static value is set</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"404-not-found\">404 Not Found</h3>\n<p>The automation does not exist or does not belong to your account.</p>\n<h3 id=\"429-too-many-requests\">429 Too Many Requests</h3>\n<p>Rate limit exceeded (5 requests per minute).</p>\n<h2 id=\"example\">Example</h2>\n<h3 id=\"curl\">cURL</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>curl -X GET \"https://app.spoki.it/api/1/automations/501754/custom-fields-used/\" \\\n  -H \"x-spoki-api-key: YOUR_API_KEY\"\n\n</code></pre><h3 id=\"python\">Python</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>import requests\nresponse = requests.get(\n    \"https://app.spoki.it/api/1/automations/501754/custom-fields-used/\",\n    headers={\"x-spoki-api-key\": \"YOUR_API_KEY\"}\n)\ndata = response.json()\nprint(\"Required contact fields:\", data[\"contact_fields\"])\nprint(\"Custom fields:\", [f[\"label\"] for f in data[\"custom_fields\"]])\n\n</code></pre><h2 id=\"notes\">Notes</h2>\n<ul>\n<li><p>The <code>phone</code> field is always included in <code>contact_fields</code> regardless of automation content.</p>\n</li>\n<li><p>Only <strong>active</strong> steps are analyzed.</p>\n</li>\n<li><p>Only <strong>active</strong> custom fields are returned.</p>\n</li>\n<li><p>Placeholders are extracted from: template messages, free messages, interactive messages, PayPal steps, and Stripe steps.</p>\n</li>\n<li><p><code>static_custom_fields</code> only includes fields that are <strong>never</strong> used dynamically (populated from contact) in any step of the automation. If the same field is static in one step and dynamic in another, it will appear only in <code>custom_fields</code>, not in <code>static_custom_fields</code>.</p>\n</li>\n</ul>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"d4c9e9e1-781d-4cf8-a037-b2f92bd7f2fa","id":"d4c9e9e1-781d-4cf8-a037-b2f92bd7f2fa","name":"Automations","type":"folder"}},"urlObject":{"path":["api","1","automations","{{id}}","custom-fields-used",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"39423cdd-5ae6-4a08-b446-7bd7894c77c2","name":"200 OK Copy","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/automations/{{id}}/custom-fields-used/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Thu, 22 Dec 2022 13:59:22 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"412"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n  \"raw_codes\": [\n    \"%%DATA_E_ORA_APPUNTAMENTO%%\",\n    \"%%FIRST_NAME%%\"\n  ],\n  \"contact_fields\": [\n    \"phone\",\n    \"first_name\"\n  ],\n  \"static_custom_fields\": [\n    {\n      \"field_name\": \"PRODUCTO\",\n      \"value\": \"example product\",\n      \"step_id\": 12345\n    }\n  ],\n  \"custom_fields\": [\n    {\n      \"id\": 1234,\n      \"label\": \"Data e ora appuntamento\",\n      \"field_type\": 2,\n      \"is_linked\": true,\n      \"code\": \"DATA_E_ORA_APPUNTAMENTO\",\n      \"example\": \"05/09/24\"\n    }\n  ]\n}"}],"_postman_id":"50b69da1-a8df-4127-8bdc-f7e42014dfec"}],"id":"d4c9e9e1-781d-4cf8-a037-b2f92bd7f2fa","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"5ab49dd2-6e25-4f4b-96b1-a89dc04c2443","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"5cc1f4c6-269f-4228-b914-6fabe71e91b1","type":"text/javascript","exec":[""]}}],"_postman_id":"d4c9e9e1-781d-4cf8-a037-b2f92bd7f2fa","description":""},{"name":"Campaigns","item":[{"name":"List, search, and filter campaigns","id":"cc3fc38f-8155-4131-9d7d-1b84f9c179a2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/campaigns/","description":"<p><strong>Rate Limit:</strong> 5/min<br /><strong>Caching Policy</strong>: Some attributes will be cached</p>\n<p><strong>2 min</strong></p>\n<p><code>contacts_count</code></p>\n<p><strong>24h</strong> after the campaign is completed</p>\n<p><code>automation_started</code>, <code>automation_completed</code>, <code>automation_failed</code>, <code>automation_valid_failed</code>, <code>automation_interacted_with</code>, <code>messages_sent</code>, <code>messages_received</code>, <code>messages_read</code>, <code>messages_failed</code></p>\n<p>Retrieves a list of campaigns from the specified endpoint.</p>\n<h3 id=\"response\">Response</h3>\n<p>The response will be a JSON object containing the following fields:</p>\n<ul>\n<li><p><code>count</code>: The total count of campaigns for the provided account.</p>\n</li>\n<li><p><code>next</code>: A link to the next page of results, if available.</p>\n</li>\n<li><p><code>previous</code>: A link to the previous page of results, if available.</p>\n</li>\n<li><p><code>results</code>: An array containing details of each campaign.</p>\n</li>\n</ul>\n<p>Each campaign object in the <code>results</code> array includes the following fields:</p>\n<ul>\n<li><p><code>id</code>: The unique identifier of the campaign.</p>\n</li>\n<li><p><code>name</code>: The name of the campaign.</p>\n</li>\n<li><p><code>status</code>: The status of the campaign.</p>\n<ul>\n<li><p>Draft</p>\n</li>\n<li><p>Scheduled</p>\n</li>\n<li><p>Processing</p>\n</li>\n<li><p>Completed</p>\n</li>\n</ul>\n</li>\n<li><p><code>automation</code>: Details of the associated automation, including its ID and name.</p>\n</li>\n<li><p><code>lists</code>: An array containing details of lists associated with the campaign, including their IDs, names, colors, creation datetime, and contact counts.</p>\n</li>\n<li><p><code>scheduled_datetime</code>: The datetime at which the campaign is scheduled.</p>\n</li>\n<li><p><code>other_contacts</code>: Additional contacts associated with the campaign.</p>\n</li>\n<li><p><code>contacts_count</code>: The total count of contacts associated with the campaign.</p>\n</li>\n<li><p><code>automation_started</code>: The count of automation processes started for the campaign.</p>\n</li>\n<li><p><code>automation_completed</code>: The count of automation processes completed for the campaign.</p>\n</li>\n<li><p><code>automation_failed</code>: The count of failed automation processes for the campaign.</p>\n</li>\n<li><p><code>automation_valid_failed</code>: The count of valid failed automation processes for the campaign.</p>\n</li>\n<li><p><code>automation_interacted_with</code>: The count of interactions with the automation for the campaign.</p>\n</li>\n<li><p><code>messages_sent</code>: The count of messages sent for the campaign.</p>\n</li>\n<li><p><code>messages_received</code>: The count of messages received for the campaign.</p>\n</li>\n<li><p><code>messages_read</code>: The count of messages read for the campaign.</p>\n</li>\n<li><p><code>messages_failed</code>: The count of failed messages for the campaign.</p>\n</li>\n<li><p><code>created_datetime</code>: The datetime at which the campaign was created.</p>\n</li>\n</ul>\n","urlObject":{"path":["api","1","campaigns",""],"host":["{{Base-URL}}"],"query":[{"disabled":true,"key":"scheduled_datetime_gte","value":"2024-01-01T00:00:00"},{"disabled":true,"key":"scheduled_datetime_lte","value":"2024-01-01T00:00:00"}],"variable":[]}},"response":[{"id":"aa83cd3c-d7ce-4a12-8e3f-114b4488ce45","name":"200 OK","originalRequest":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/campaigns/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:17:17 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=2801.1810000000423;desc=\"User CPU time\", TimerPanel_stime;dur=593.042999999966;desc=\"System CPU time\", TimerPanel_total;dur=3394.2240000000083;desc=\"Total CPU time\", TimerPanel_total_time;dur=3741.213321685791;desc=\"Elapsed time\", SQLPanel_sql_time;dur=106.60886764526367;desc=\"SQL 33 queries\", CachePanel_total_time;dur=16.034841537475586;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"2930"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 1,\n    \"next\": null,\n    \"previous\": null,\n    \"results\": [\n        {\n            \"id\": 35122,\n            \"name\": \"MyCampaign\",\n            \"status\": \"Scheduled\",\n            \"automation\": {\n                \"id\": 253226,\n                \"name\": \"Lorem Automation\"\n            },\n            \"lists\": [\n                {\n                    \"id\": 4238,\n                    \"name\": \"MyList\",\n                    \"color\": null,\n                    \"created_datetime\": \"2023-05-24T12:51:42.763583+02:00\",\n                    \"contacts_count\": 0\n                }\n            ],\n            \"scheduled_datetime\": \"2023-08-25T15:30:00.218000+02:00\",\n            \"other_contacts\": [],\n            \"contacts_count\": 0,\n            \"automation_started\": 0,\n            \"automation_completed\": 0,\n            \"automation_failed\": 0,\n            \"automation_valid_failed\": 0,\n            \"automation_interacted_with\": 0,\n            \"messages_sent\": 0,\n            \"messages_received\": 0,\n            \"messages_read\": 0,\n            \"messages_failed\": 0,\n            \"created_datetime\": \"2023-08-25T10:47:19.635070+02:00\"\n        }\n    ]\n}"}],"_postman_id":"cc3fc38f-8155-4131-9d7d-1b84f9c179a2"},{"name":"Create campaign","id":"adb674d2-0129-48fb-b3ae-092185c11926","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"MyCampaign\",\n    \"scheduled_datetime\": \"2024-08-28T10:00:00.000Z\",\n    \"status\": \"Scheduled\",\n    \"automation\": {{id}},\n    \"lists\": [{{id}}],\n    \"template\": {{id}}\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/campaigns/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n<p>You can decide to create a campaign based on an already existing automation or with a template.  </p>\n<p>If you create it by template you don't have to send the automation key in the request payload and viceversa.  </p>\n<p>When you create a campaign by template an automation will be automatically created by Spoki.</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<h4 id=\"in-case-the-body-isnt-correct\">In case the body isn't correct:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"field\": [\n        \"Error description.\"\n    ]\n}\n\n</code></pre>\n<h4 id=\"in-case-the-body-is-correct-other-error-code\">In case the body is correct, other error code:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"https://app.spoki.it/errors/spoki::3004\",\n    \"title\": \"The request body is not correct\",\n    \"code\": \"spoki::3004\",\n    \"status\": 400,\n    \"datail\": \"Invalid automation_id specified.\"\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>The scheduled_datetime is valid but is not after now.</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid scheduled_datetime. Send 'scheduled_datetime' in ISO 8601 format.Example: 2020-01-01T00:00:00.000Z\"</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no status specified. Use 'status'</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no automation specified. Use 'automation_id'</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no lists specified. Use 'list_ids'.</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid list_id specified</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Error adding a field to the body</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3007</td>\n<td>Invalid request header</td>\n<td>Invalid or no account specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","campaigns",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"2d539ac7-6628-494a-b67c-fc2ebcedf9d2","name":"201 Created","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"MyCampaign\",\n    \"scheduled_datetime\": \"2024-08-28T10:00:00.000Z\",\n    \"status\": \"Scheduled\",\n    \"template\": {{id}},\n    \"lists\": [{{id}}]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/campaigns/"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:25:37 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1296.68700000002;desc=\"User CPU time\", TimerPanel_stime;dur=267.5800000000663;desc=\"System CPU time\", TimerPanel_total;dur=1564.2670000000862;desc=\"Total CPU time\", TimerPanel_total_time;dur=1593.4910774230957;desc=\"Elapsed time\", SQLPanel_sql_time;dur=29.886484146118164;desc=\"SQL 9 queries\", CachePanel_total_time;dur=4.533052444458008;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"184"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 12121223,\n    \"name\": \"MyCampaign\",\n    \"status\": \"Scheduled\",\n    \"automation\": 2524,\n    \"lists\": [\n        48\n    ],\n    \"scheduled_datetime\": \"2024-08-28T10:00:00+02:00\",\n    \"created_datetime\": \"2023-08-28T14:25:37.316419+02:00\"\n}"}],"_postman_id":"adb674d2-0129-48fb-b3ae-092185c11926"},{"name":"Retrieve campaign","id":"6a4b6b02-7dce-42e2-b21d-aab39c666543","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/campaigns/{{id}}/","description":"<p><strong>Rate Limit:</strong> 5/min<br /><strong>Caching Policy</strong>: Some attributes will be cached.</p>\n","urlObject":{"path":["api","1","campaigns","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"04c8e232-020f-4211-a682-346235d95f3f","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/campaigns/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Fri, 25 Aug 2023 08:24:08 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"604"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 12121223,\n    \"name\": \"MyCampaign\",\n    \"status\": 4,\n    \"automation\": {\n        \"id\": 11556237,\n        \"name\": \"Lorem Automazione\"\n    },\n    \"lists\": [\n        {\n            \"id\": 4623451,\n            \"name\": \"MyList\",\n            \"color\": null,\n            \"created_datetime\": \"2023-08-09T15:38:57.760934+02:00\",\n            \"contacts_count\": 3\n        }\n    ],\n    \"scheduled_datetime\": \"2023-08-09T16:20:00.308000+02:00\",\n    \"other_contacts\": [],\n    \"contacts_count\": 3,\n    \"automation_started\": 0,\n    \"automation_completed\": 3,\n    \"automation_failed\": 0,\n    \"automation_valid_failed\": 0,\n    \"automation_interacted_with\": 2,\n    \"messages_sent\": 0,\n    \"messages_received\": 3,\n    \"messages_read\": 0,\n    \"messages_failed\": 0,\n    \"created_datetime\": \"2023-08-09T16:18:13.394228+02:00\"\n}"}],"_postman_id":"6a4b6b02-7dce-42e2-b21d-aab39c666543"},{"name":"Update campaign","id":"7f6fe06c-511c-4c86-97b3-39ecfbdb8c3f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PATCH","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"MyCampaign Updated\",\n    \"scheduled_datetime\": \"2024-08-29T10:00:00.000Z\",\n    \"status\": \"Scheduled\",\n    \"automation\": {{id}},\n    \"lists\": [{{id}}]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/campaigns/{{id}}/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<h4 id=\"in-case-the-body-isnt-correct\">In case the body isn't correct:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"field\": [\n        \"Error description.\"\n    ]\n}\n\n</code></pre>\n<h4 id=\"in-case-the-body-is-correct-other-error-code\">In case the body is correct, other error code:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"https://app.spoki.it/errors/spoki::3004\",\n    \"title\": \"The request body is not correct\",\n    \"code\": \"spoki::3004\",\n    \"status\": 400,\n    \"datail\": \"Invalid automation_id specified.\"\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>The scheduled_datetime is valid but is not after now.</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid scheduled_datetime. Send 'scheduled_datetime' in ISO 8601 format.Example: 2020-01-01T00:00:00.000Z\"</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no status specified. Use 'status'</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid automation_id specified</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid status. The campaign is not in a valid state to be updated.</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid list_id specified</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3007</td>\n<td>Invalid request header</td>\n<td>Invalid or no account specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","campaigns","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"a64da7dc-dedb-4f78-a9e4-d5d52478b2cc","name":"200 OK","originalRequest":{"method":"PATCH","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"MyCampaign Updated\",\n    \"scheduled_datetime\": \"2024-08-29T10:00:00.000Z\",\n    \"status\": \"Scheduled\",\n    \"automation\": {{id}},\n    \"lists\": [{{id}}]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/campaigns/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:26:21 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1329.4760000001133;desc=\"User CPU time\", TimerPanel_stime;dur=230.733999999984;desc=\"System CPU time\", TimerPanel_total;dur=1560.2100000000974;desc=\"Total CPU time\", TimerPanel_total_time;dur=1530.2419662475586;desc=\"Elapsed time\", SQLPanel_sql_time;dur=6.609678268432617;desc=\"SQL 9 queries\", CachePanel_total_time;dur=3.7584304809570312;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"192"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 12121223,\n    \"name\": \"MyCampaign Updated\",\n    \"status\": \"Scheduled\",\n    \"automation\": 2524,\n    \"lists\": [\n        48\n    ],\n    \"scheduled_datetime\": \"2024-08-29T10:00:00+02:00\",\n    \"created_datetime\": \"2023-08-28T14:25:37.316419+02:00\"\n}"}],"_postman_id":"7f6fe06c-511c-4c86-97b3-39ecfbdb8c3f"},{"name":"Delete campaign","id":"113c4069-d044-4932-9881-1170e16d19c0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/campaigns/{{id}}/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>403</td>\n<td>spoki::403</td>\n<td>Access denied</td>\n<td>You can't delete a campaign while it's processing</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3007</td>\n<td>Invalid request header</td>\n<td>Invalid or no account specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","campaigns","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"4dae59ba-0797-49a5-a6a7-4772c73a7a62","name":"204 No Content","originalRequest":{"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/campaigns/{{id}}/"},"status":"No Content","code":204,"_postman_previewlanguage":"plain","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:26:38 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1070.9779999999682;desc=\"User CPU time\", TimerPanel_stime;dur=224.4150000000218;desc=\"System CPU time\", TimerPanel_total;dur=1295.39299999999;desc=\"Total CPU time\", TimerPanel_total_time;dur=1268.4416770935059;desc=\"Elapsed time\", SQLPanel_sql_time;dur=18.60809326171875;desc=\"SQL 6 queries\", CachePanel_total_time;dur=6.557226181030273;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"0"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"113c4069-d044-4932-9881-1170e16d19c0"}],"id":"aaccb7c7-a76c-4fe3-82c9-18165837d222","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"80e404ff-9b36-4af5-b381-528f2a11cc4b","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"8eee7611-fbc0-40e7-aa2c-5536c8e7064b","type":"text/javascript","exec":[""]}}],"_postman_id":"aaccb7c7-a76c-4fe3-82c9-18165837d222","description":""},{"name":"Contacts","item":[{"name":"List, search, and filter contacts","id":"fb468cb2-73fe-4777-ae4b-d952eb103f5b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/contacts/","description":"<p><strong>Rate Limit:</strong> 120/min</p>\n","urlObject":{"path":["api","1","contacts",""],"host":["{{Base-URL}}"],"query":[{"disabled":true,"description":{"content":"<p>Search in: 'phone', 'email', 'first_name', 'last_name', 'language', 'notes'</p>\n","type":"text/plain"},"key":"search","value":""},{"disabled":true,"description":{"content":"<p>Filter by tag id</p>\n","type":"text/plain"},"key":"tag","value":""},{"disabled":true,"description":{"content":"<p>true | false\nGet blocked contacts only</p>\n","type":"text/plain"},"key":"is_blocked","value":""},{"disabled":true,"description":{"content":"<p>e.g. <a href=\"mailto:john.doe@domain.com\">john.doe@domain.com</a></p>\n","type":"text/plain"},"key":"email","value":null},{"disabled":true,"description":{"content":"<p>e.g. +393331234567</p>\n","type":"text/plain"},"key":"phone","value":null},{"disabled":true,"description":{"content":"<p>e.g. 'en'</p>\n","type":"text/plain"},"key":"language","value":null},{"disabled":true,"description":{"content":"<p>e.g. 'John'</p>\n","type":"text/plain"},"key":"first_name","value":null},{"disabled":true,"description":{"content":"<p>e.g. 'Doe'</p>\n","type":"text/plain"},"key":"last_name","value":null}],"variable":[]}},"response":[{"id":"dde3cd67-22a2-4a7b-a213-4db0a775cd44","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"}],"url":"{{Base-URL}}/api/1/contacts/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Thu, 15 Sep 2022 13:14:03 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"4939"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 1,\n    \"next\": null,\n    \"previous\": null,\n    \"results\": [\n        {\n            \"id\": 1091234,\n            \"first_name\": \"Mario\",\n            \"last_name\": \"Rossi\",\n            \"phone\": \"+39333123456789\",\n            \"email\": \"mario.rossi@domain.com\",\n            \"language\": \"it\",\n            \"has_invalid_phone\": false,\n            \"chat_link\": \"https://spoki.app/chats/DhxyQBtLMaqy0myzqnap\",\n            \"created_datetime\": \"2021-04-19T16:24:02.567450+02:00\",\n            \"contactfield_set\": [ \n                {\n                    \"id\": 937944,\n                    \"field\": 152,\n                    \"visual_code\": \"%%WEBSITE%%\",\n                    \"value\": \"https://mywebsite.com\",\n                    \"value_datetime\": null\n                }\n            ],\n            \"tag_set\": [\n                {\n                    \"id\": 62,\n                    \"name\": \"To Reply\",\n                    \"color\": \"#16d46d\",\n                    \"order\": 2\n                }\n            ],\n            \"list_set\": [\n                {\n                    \"id\": 1234,\n                    \"name\": \"Prova Demo\",\n                    \"color\": null,\n                    \"created_datetime\": \"2022-03-18T10:16:45.040626+01:00\",\n                    \"contacts_count\": 3\n                }\n            ]\n        }\n    ]\n}"}],"_postman_id":"fb468cb2-73fe-4777-ae4b-d952eb103f5b"},{"name":"Sync contacts","id":"0ff9a650-b4cb-4f6b-8b91-8b4a45c44c74","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"[\n    {\n        \"phone\": \"{{phone}}\",\n        \"first_name\": \"John\",\n        \"last_name\": \"Doe\",\n        \"email\": \"john.doe@domain.com\",\n        \"language\": \"en\",\n        \"custom_fields\": {\n            \"ORDER_ID\": \"1234\"\n        }\n    }\n]","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/contacts/sync_all/","description":"<p><strong>Rate Limit:</strong> 1/min</p>\n<p><strong>Note</strong>:</p>\n<p><em>Do not update the contact using this API before initiating an automation for it. The contact will be automatically updated when the 'Start automation' API is called.</em></p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<h4 id=\"in-case-the-body-isnt-correct\">In case the body isn't correct:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"field\": [\n        \"Error description.\"\n    ]\n}\n\n</code></pre>\n<h4 id=\"in-case-the-body-is-correct-other-error-code\">In case the body is correct, other error code:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"https://app.spoki.it/errors/spoki::3004\",\n    \"title\": \"The request body is not correct\",\n    \"code\": \"spoki::3004\",\n    \"status\": 400,\n    \"datail\": \"Too many contacts. Max 500 allowed.\"\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Too many contacts. Max 500 allowed.</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3007</td>\n<td>Invalid request header</td>\n<td>Invalid or no account specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","contacts","sync_all",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"93b589ee-e0b1-4bd2-b455-88ff5e41e048","name":"200 OK","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"[\n    {\n        \"phone\": \"{{phone}}\",\n        \"first_name\": \"John\",\n        \"last_name\": \"Doe\",\n        \"email\": \"john.doe@domain.com\",\n        \"language\": \"en\",\n        \"contactfield_set\": [\n            {\n                \"field\": 14,\n                \"value\": \"Milano\"\n            }\n        ]\n    }\n]","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/contacts/sync_all/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Thu, 15 Sep 2022 15:33:58 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"13"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"POST, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [],\n    \"contacts\": [\n        {\n            \"id\": 1091234,\n            \"first_name\": \"Mario\",\n            \"last_name\": \"Rossi\",\n            \"phone\": \"+39333123456789\",\n            \"email\": \"mario.rossi@domain.com\",\n            \"has_invalid_phone\": false,\n            \"language\": \"it\",\n            \"chat_link\": \"https://spoki.app/chats/DhxyQBtLMaqy0myzqnap\"\n        }\n    ]\n}"}],"_postman_id":"0ff9a650-b4cb-4f6b-8b91-8b4a45c44c74"},{"name":"Add Operator","id":"cff00c66-08be-43c1-b51b-e5c25bdbd46c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"email\": \"john.doe@domain.com\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/contacts/{{id}}/add_operator/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n<p>Assign an operator to the contact, so its chat.</p>\n<p>Before the assignment the User must be intived to join the account form the Spoki Platform (<a href=\"https://spoki.app/users-and-roles\">https://spoki.app/users-and-roles</a>).</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<h4 id=\"in-case-the-body-isnt-correct\">In case the body isn't correct:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"field\": [\n        \"Error description.\"\n    ]\n}\n\n</code></pre>\n<h4 id=\"in-case-the-body-is-correct-other-error-code\">In case the body is correct, other error code:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"https://app.spoki.it/errors/spoki::3004\",\n    \"title\": \"The request body is not correct\",\n    \"code\": \"spoki::3004\",\n    \"status\": 400,\n    \"datail\": \"Invalid data type'\"\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid data type</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>No email specified</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>No operator found with this email</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3007</td>\n<td>Invalid request header</td>\n<td>Invalid or no account specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","contacts","{{id}}","add_operator",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"d0f854c7-362e-4c4c-b773-0e1e21519f70","name":"200 OK","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"email\": \"john.doe@domain.com\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/contacts/{{id}}/add_operator/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.18.0 (Ubuntu)"},{"key":"Date","value":"Tue, 16 Jul 2024 09:42:31 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"2"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"POST, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{}"}],"_postman_id":"cff00c66-08be-43c1-b51b-e5c25bdbd46c"},{"name":"Remove Operator","id":"570ba401-d857-4ade-926e-110f2fe56f9c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"email\": \"john.doe@domain.com\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/contacts/{{id}}/remove_operator/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<h4 id=\"in-case-the-body-isnt-correct\">In case the body isn't correct:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"field\": [\n        \"Error description.\"\n    ]\n}\n\n</code></pre>\n<h4 id=\"in-case-the-body-is-correct-other-error-code\">In case the body is correct, other error code:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"https://app.spoki.it/errors/spoki::3004\",\n    \"title\": \"The request body is not correct\",\n    \"code\": \"spoki::3004\",\n    \"status\": 400,\n    \"datail\": \"Invalid data type'\"\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid data type</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>No email specified</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>No operator found with this email</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3007</td>\n<td>Invalid request header</td>\n<td>Invalid or no account specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","contacts","{{id}}","remove_operator",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"ed2375d1-ead9-40ea-b9b6-bc0054756732","name":"200 OK","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"email\": \"john.doe@domain.com\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/contacts/{{id}}/remove_operator/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.18.0 (Ubuntu)"},{"key":"Date","value":"Tue, 16 Jul 2024 09:42:59 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"2"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"POST, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{}"}],"_postman_id":"570ba401-d857-4ade-926e-110f2fe56f9c"},{"name":"Create or update contact","id":"ffd54183-71c1-47e5-808b-66e2d1a92ef1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"phone\": \"{{phone}}\",\n    \"first_name\": \"John\",\n    \"last_name\": \"Doe\",\n    \"email\": \"john.doe@domain.com\",\n    \"language\": \"en\",\n    \"custom_fields\": {\n        \"WEBSITE\": \"https://mywebsite.com\"\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/contacts/sync/","description":"<p><strong>Rate Limit:</strong> 120/min</p>\n<p><strong>Note</strong>:</p>\n<ul>\n<li><p><em>If you need to update multiple contacts use \"Sync contacts\"</em></p>\n</li>\n<li><p><em>Do not update the contact using this API before initiating an automation for it. The contact will be automatically updated when the 'Start automation' API is called.</em></p>\n</li>\n</ul>\n","urlObject":{"path":["api","1","contacts","sync",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"22d6794a-c886-4d5a-b1ee-fcc93fef0372","name":"200 OK","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"phone\": \"{{phone}}\",\n    \"first_name\": \"John\",\n    \"last_name\": \"Doe\",\n    \"email\": \"john.doe@domain.com\",\n    \"language\": \"en\",\n    \"custom_fields\": {}\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/contacts/sync/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Thu, 15 Sep 2022 15:34:36 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"154"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"POST, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 1091234,\n    \"first_name\": \"Mario\",\n    \"last_name\": \"Rossi\",\n    \"phone\": \"+39333123456789\",\n    \"email\": \"mario.rossi@domain.com\",\n    \"has_invalid_phone\": false,\n    \"language\": \"it\",\n    \"chat_link\": \"https://spoki.app/chats/DhxyQBtLMaqy0myzqnap\"\n}"}],"_postman_id":"ffd54183-71c1-47e5-808b-66e2d1a92ef1"},{"name":"Retrieve contact","id":"db498140-6894-48e2-9dfb-9ccc5c9c9987","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/contacts/{{id}}/","description":"<p><strong>Rate Limit:</strong> 120/min</p>\n","urlObject":{"path":["api","1","contacts","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"b555bdfa-e33a-4bab-add9-3b2f1c69b0b6","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"}],"url":"{{Base-URL}}/api/1/contacts/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Thu, 15 Sep 2022 15:36:26 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"797"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 1091234,\n    \"first_name\": \"Mario\",\n    \"last_name\": \"Rossi\",\n    \"phone\": \"+393337981329\",\n    \"email\": \"mario.rossi@domain.com\",\n    \"language\": \"it\",\n    \"has_invalid_phone\": false,\n    \"chat_link\": \"https://spoki.app/chats/DhxyQBtLMaqy0myzqnap\",\n    \"created_datetime\": \"2021-04-19T16:24:02.567450+02:00\",\n    \"contactfield_set\": [\n        {\n            \"id\": 937944,\n            \"field\": 152,\n            \"visual_code\": \"%%WEBSITE%%\",\n            \"value\": \"https://mywebsite.com\",\n            \"value_datetime\": null\n        }\n    ],\n    \"tag_set\": [\n        {\n            \"id\": 62,\n            \"name\": \"To Reply\",\n            \"color\": \"#16d46d\",\n            \"order\": 2\n        }\n    ],\n    \"list_set\": [\n        {\n            \"id\": 1809,\n            \"name\": \"Prova Demo\",\n            \"color\": null,\n            \"created_datetime\": \"2022-03-18T10:16:45.040626+01:00\",\n            \"contacts_count\": 3\n        }\n    ]\n}"}],"_postman_id":"db498140-6894-48e2-9dfb-9ccc5c9c9987"},{"name":"Update contact","id":"8645d84a-ae08-40c4-a34f-0cd843c3dfae","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PATCH","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"phone\": \"{{phone}}\",\n    \"first_name\": \"John\",\n    \"last_name\": \"Doe\",\n    \"email\": \"john.doe@domain.com\",\n    \"language\": \"en\",\n    \"custom_fields\": {\n        \"WEBSITE\": \"https://mywebsite.com\"\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/contacts/{{id}}/","description":"<p><strong>Rate Limit:</strong> 120/min</p>\n","urlObject":{"path":["api","1","contacts","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"08574f89-fa14-48e3-9cc0-f9c5e0b5263a","name":"200 OK","originalRequest":{"method":"PATCH","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"}],"body":{"mode":"raw","raw":"{\n    \"phone\": \"{{phone}}\",\n    \"first_name\": \"John\",\n    \"last_name\": \"Doe\",\n    \"email\": \"john.doe@domain.com\",\n    \"language\": \"en\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/contacts/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Wed, 21 Jun 2023 13:06:24 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"527"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 1091234,\n    \"first_name\": \"Mario\",\n    \"last_name\": \"Rossi\",\n    \"phone\": \"+39333123456789\",\n    \"email\": \"mario.rossi@domain.com\",\n    \"language\": \"it\",\n    \"contactfield_set\": [\n        {\n            \"id\": 937944,\n            \"field\": 152,\n            \"visual_code\": \"%%WEBSITE%%\",\n            \"value\": \"https://mywebsite.com\",\n            \"value_datetime\": null\n        }\n    ],\n    \"chat_link\": \"https://spoki.app/chats/DhxyQBtLMaqy0myzqnap\"\n}"}],"_postman_id":"8645d84a-ae08-40c4-a34f-0cd843c3dfae"},{"name":"Delete contact","id":"5b38eb15-b5b7-4b48-a463-ee831fa5b1f9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/contacts/{{id}}/","description":"<p><strong>Rate Limit:</strong> 120/min</p>\n","urlObject":{"path":["api","1","contacts","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"5b38eb15-b5b7-4b48-a463-ee831fa5b1f9"},{"name":"Block Contact","id":"6df0a8d2-0ba0-4228-b2d2-b3d89c56df6c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"is_blocked\": true\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/contacts/{{id}}/","description":"<p><strong>Rate Limit:</strong> 120/min</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"83340f76-58e1-4fa3-a7d3-ae639b786d25","id":"83340f76-58e1-4fa3-a7d3-ae639b786d25","name":"Contacts","type":"folder"}},"urlObject":{"path":["api","1","contacts","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"6df0a8d2-0ba0-4228-b2d2-b3d89c56df6c"},{"name":"Unlock Contact","id":"1c170ca3-6ad4-48d0-bf04-bf9213c3ea44","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"is_blocked\": false\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/contacts/{{id}}/?is_blocked=true","description":"<p><strong>Rate Limit:</strong> 120/min</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"83340f76-58e1-4fa3-a7d3-ae639b786d25","id":"83340f76-58e1-4fa3-a7d3-ae639b786d25","name":"Contacts","type":"folder"}},"urlObject":{"path":["api","1","contacts","{{id}}",""],"host":["{{Base-URL}}"],"query":[{"key":"is_blocked","value":"true"},{"disabled":true,"key":"","value":""}],"variable":[]}},"response":[],"_postman_id":"1c170ca3-6ad4-48d0-bf04-bf9213c3ea44"}],"id":"83340f76-58e1-4fa3-a7d3-ae639b786d25","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"78572fa5-6b93-4270-b1fe-fa186f6ab202","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"dbb6c49b-3874-4475-9861-91665c07ac9b","type":"text/javascript","exec":[""]}}],"_postman_id":"83340f76-58e1-4fa3-a7d3-ae639b786d25","description":""},{"name":"Custom Fields","item":[{"name":"List, search, and filter custom fields","id":"b69f83ad-a10f-473f-8b41-bf3711ee9667","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/custom-fields/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n","urlObject":{"path":["api","1","custom-fields",""],"host":["{{Base-URL}}"],"query":[{"disabled":true,"description":{"content":"<p>You can search by: 'label', 'code'</p>\n","type":"text/plain"},"key":"search","value":null}],"variable":[]}},"response":[],"_postman_id":"b69f83ad-a10f-473f-8b41-bf3711ee9667"},{"name":"Create custom field","id":"f065b9bf-6c6d-47ed-8552-985f610065bc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"label\": \"MY_FIELD\",\n    \"code\": \"MY_FIELD\", \n    \"field_type\": 1,\n    \"example\": \"Lorem ipsum\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/custom-fields/","description":"<p><strong>Rate Limit:</strong> 5/min  </p>\n<p>Field Types:<br />TEXT = 1<br />DATE = 2<br />DATETIME = 3</p>\n<p>Do not use this API to create reserved fields:<br />FIRST_NAME, FIRSTNAME, LAST_NAME, LASTNAME, EMAIL, PHONE, ACCOUNT_NAME, LANGUAGE</p>\n","urlObject":{"path":["api","1","custom-fields",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"f065b9bf-6c6d-47ed-8552-985f610065bc"},{"name":"Retrieve custom field","id":"21c9bf54-5dd6-4f12-9edf-655e3c676ad6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/custom-fields/{{id}}/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n","urlObject":{"path":["api","1","custom-fields","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"21c9bf54-5dd6-4f12-9edf-655e3c676ad6"},{"name":"Update custom field","id":"af88d4f4-28dc-4821-97c5-dd89c72711e8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PATCH","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"label\": \"TestField\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/custom-fields/{{id}}/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n","urlObject":{"path":["api","1","custom-fields","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"af88d4f4-28dc-4821-97c5-dd89c72711e8"},{"name":"Delete custom field","id":"fc4d8278-25ad-4617-8e68-e4b74261b0e3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/custom-fields/{{id}}/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>403</td>\n<td>spoki::3005</td>\n<td></td>\n<td>The custom field cannot be deleted because it is present in one or more automations</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>No email specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","custom-fields","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"fc4d8278-25ad-4617-8e68-e4b74261b0e3"}],"id":"3084470a-cf61-482f-8181-d9522e08b231","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"61f933db-947d-4cec-acbf-bbc6d57f7020","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"29025adc-ae9b-42ca-8b83-38b22e0c762b","type":"text/javascript","exec":[""]}}],"_postman_id":"3084470a-cf61-482f-8181-d9522e08b231","description":""},{"name":"Embedding via iframe","item":[{"name":"Auth User","id":"74937f1b-08a2-4552-92a7-9e917b58b691","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"email\": \"john.doe@domain.com\",\n    \"private_key\": \"{{Private-Key}}\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/auth/get_authentication_token/","description":"<h4 id=\"possible-error-codes\"><strong>Possible Error Codes:</strong></h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th><strong>Datail</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>Invalid request body</td>\n<td>Invalid data type in body</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>Invalid request body</td>\n<td>No email specified</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>Invalid request body</td>\n<td>No private_key specified</td>\n</tr>\n<tr>\n<td>403</td>\n<td>spoki::403</td>\n<td>Access denied</td>\n<td>Access not authorizied</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","auth","get_authentication_token",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"2d03bc15-aabc-4c69-a7cf-37df9065dad1","name":"200 OK","originalRequest":{"method":"POST","header":[{"warning":"This is a duplicate header and will be overridden by the X-Spoki-Api-Key header generated by Postman.","key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"email\": \"john.doe@domain.com\",\n    \"private_key\": \"{{Private-Key}}\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/auth/get_authentication_token/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Mon, 06 Feb 2023 11:32:10 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"64"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"POST, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"token\": \"bj94hm-dx611474610f0046a2165b4964ea98g2\",\n    \"uid\": \"NjK6\"\n}"}],"_postman_id":"74937f1b-08a2-4552-92a7-9e917b58b691"}],"id":"bb7ac7d0-3dfe-4365-a6e3-94d59acb3332","description":"<p>You can embed Spoki via iframe.</p>\n<p><a href=\"https://support.spoki.it/docs/integrazioni/embed-spoki-on-your-software/\">Check the complete guide</a></p>\n<p>1. In your HTML page insert an empty div with <strong>id=\"spoki-embedding\"</strong></p>\n<p>2. Use the function below to init the iframe:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">function initSpokiIframe () {\n    const headers = new Headers();\n    headers.append(\"Content-Type\", \"application/json\");\n    headers.append(\"X-Spoki-Api-Key\", \"{{Api-Key}}\");\n    const body = JSON.stringify({\n        email: \"john.doe@domain.com\",\n        private_key: \"{{Private-Key}}\",\n    });\n    const requestOptions = {\n        method: 'POST',\n        headers,\n        body,\n        redirect: 'follow'\n    };\n    fetch(\"https://spoki.app/api/1/auth/get_authentication_token/\", requestOptions)\n        .then(response =&gt; response.json())\n        .then(result =&gt; {\n            console.log(result);\n            const iframeParent = document.getElementById(\"spoki-embedding\");\n            const iframeEl = document.createElement(\"iframe\")\n            iframeEl.setAttribute(\"frameborder\", \"0\");\n            iframeEl.setAttribute(\"style\", \"position:fixed;bottom:10px;right:10px;height:600px;width:450px;border:2px solid #cccccc;border-radius: 8px;\");\n            iframeEl.setAttribute(\"src\", `https://spoki.app/chats?auth_token=${result.token}&amp;auth_uid=${result.uid}`);\n            iframeParent.appendChild(iframeEl);\n        })\n        .catch(error =&gt; console.log('error', error));\n}\n\n</code></pre>\n","_postman_id":"bb7ac7d0-3dfe-4365-a6e3-94d59acb3332","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}}},{"name":"Invitations","item":[{"name":"List, search, and filter invitations","id":"2e5ab420-3a11-48a2-96a1-99c0867d48a5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/invitations/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n","urlObject":{"path":["api","1","invitations",""],"host":["{{Base-URL}}"],"query":[{"disabled":true,"description":{"content":"<p>search by id, email, first_name, last_name</p>\n","type":"text/plain"},"key":"search","value":""}],"variable":[]}},"response":[{"id":"12ffc54b-6699-49eb-9918-de480f4f92b2","name":"200 OK","originalRequest":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/campaigns/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:17:17 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=2801.1810000000423;desc=\"User CPU time\", TimerPanel_stime;dur=593.042999999966;desc=\"System CPU time\", TimerPanel_total;dur=3394.2240000000083;desc=\"Total CPU time\", TimerPanel_total_time;dur=3741.213321685791;desc=\"Elapsed time\", SQLPanel_sql_time;dur=106.60886764526367;desc=\"SQL 33 queries\", CachePanel_total_time;dur=16.034841537475586;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"2930"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 1,\n    \"next\": null,\n    \"previous\": null,\n    \"results\": [\n        {\n            \"id\": 35122,\n            \"name\": \"MyCampaign\",\n            \"status\": \"Scheduled\",\n            \"automation\": {\n                \"id\": 253226,\n                \"name\": \"Lorem Automation\"\n            },\n            \"lists\": [\n                {\n                    \"id\": 4238,\n                    \"name\": \"MyList\",\n                    \"color\": null,\n                    \"created_datetime\": \"2023-05-24T12:51:42.763583+02:00\",\n                    \"contacts_count\": 0\n                }\n            ],\n            \"scheduled_datetime\": \"2023-08-25T15:30:00.218000+02:00\",\n            \"other_contacts\": [],\n            \"contacts_count\": 0,\n            \"automation_started\": 0,\n            \"automation_completed\": 0,\n            \"automation_failed\": 0,\n            \"automation_valid_failed\": 0,\n            \"automation_interacted_with\": 0,\n            \"messages_sent\": 0,\n            \"messages_received\": 0,\n            \"messages_read\": 0,\n            \"messages_failed\": 0,\n            \"created_datetime\": \"2023-08-25T10:47:19.635070+02:00\"\n        }\n    ]\n}"}],"_postman_id":"2e5ab420-3a11-48a2-96a1-99c0867d48a5"},{"name":"Retrieve invitation","id":"3d72f6ee-785a-4185-9457-14946b9e974c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/invitations/{{id}}/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n","urlObject":{"path":["api","1","invitations","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"3063f20e-f1d2-4693-87f8-e42df2e2f420","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/campaigns/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Fri, 25 Aug 2023 08:24:08 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"604"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 12121223,\n    \"name\": \"MyCampaign\",\n    \"status\": 4,\n    \"automation\": {\n        \"id\": 11556237,\n        \"name\": \"Lorem Automazione\"\n    },\n    \"lists\": [\n        {\n            \"id\": 4623451,\n            \"name\": \"MyList\",\n            \"color\": null,\n            \"created_datetime\": \"2023-08-09T15:38:57.760934+02:00\",\n            \"contacts_count\": 3\n        }\n    ],\n    \"scheduled_datetime\": \"2023-08-09T16:20:00.308000+02:00\",\n    \"other_contacts\": [],\n    \"contacts_count\": 3,\n    \"automation_started\": 0,\n    \"automation_completed\": 3,\n    \"automation_failed\": 0,\n    \"automation_valid_failed\": 0,\n    \"automation_interacted_with\": 2,\n    \"messages_sent\": 0,\n    \"messages_received\": 3,\n    \"messages_read\": 0,\n    \"messages_failed\": 0,\n    \"created_datetime\": \"2023-08-09T16:18:13.394228+02:00\"\n}"}],"_postman_id":"3d72f6ee-785a-4185-9457-14946b9e974c"},{"name":"Invite new user by email","id":"3ac86644-33f3-45bf-920a-0d4064e2dbf8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"email\": \"john.doe@domain.com\",\n    \"role\": \"Administrator\",\n    \"additional_info\": {\n        \"first_name\": \"John\",\n        \"last_name\": \"Doe\"\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/invitations/","description":"<p><strong>Rate Limit:</strong> 10/min  </p>\n<p>Allowed roles: Owner, Administrator, Chat Operator Manager, Chat Operator</p>\n<h4 id=\"possible-error-codes\"><strong>Possible Error Codes:</strong></h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th><strong>Datail</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>Invalid request body</td>\n<td>Invalid or no role specified</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>Invalid request body</td>\n<td>No email specified</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>Invalid request body</td>\n<td>No private_key specified</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3007</td>\n<td>Invalid request header</td>\n<td>Invalid or no account specified</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3007</td>\n<td>Invalid request header</td>\n<td>Invitation already exists</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","invitations",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"cf263076-b822-4a99-a802-8d59dd6ea4ee","name":"201 Created","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"MyCampaign\",\n    \"scheduled_datetime\": \"2024-08-28T10:00:00.000Z\",\n    \"status\": \"Scheduled\",\n    \"automation\": {{id}},\n    \"lists\": [{{id}}]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/campaigns/"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:25:37 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1296.68700000002;desc=\"User CPU time\", TimerPanel_stime;dur=267.5800000000663;desc=\"System CPU time\", TimerPanel_total;dur=1564.2670000000862;desc=\"Total CPU time\", TimerPanel_total_time;dur=1593.4910774230957;desc=\"Elapsed time\", SQLPanel_sql_time;dur=29.886484146118164;desc=\"SQL 9 queries\", CachePanel_total_time;dur=4.533052444458008;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"184"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 12121223,\n    \"name\": \"MyCampaign\",\n    \"status\": \"Scheduled\",\n    \"automation\": 2524,\n    \"lists\": [\n        48\n    ],\n    \"scheduled_datetime\": \"2024-08-28T10:00:00+02:00\",\n    \"created_datetime\": \"2023-08-28T14:25:37.316419+02:00\"\n}"}],"_postman_id":"3ac86644-33f3-45bf-920a-0d4064e2dbf8"},{"name":"Resend invitation email","id":"008a39b2-5df2-40f1-a6bd-dca96a905ded","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/invitations/{{id}}/send/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n","urlObject":{"path":["api","1","invitations","{{id}}","send",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"9253f3f0-6aaa-4fb3-9947-617ab22df8a8","name":"201 Created","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"MyCampaign\",\n    \"scheduled_datetime\": \"2024-08-28T10:00:00.000Z\",\n    \"status\": \"Scheduled\",\n    \"automation\": {{id}},\n    \"lists\": [{{id}}]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/campaigns/"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:25:37 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1296.68700000002;desc=\"User CPU time\", TimerPanel_stime;dur=267.5800000000663;desc=\"System CPU time\", TimerPanel_total;dur=1564.2670000000862;desc=\"Total CPU time\", TimerPanel_total_time;dur=1593.4910774230957;desc=\"Elapsed time\", SQLPanel_sql_time;dur=29.886484146118164;desc=\"SQL 9 queries\", CachePanel_total_time;dur=4.533052444458008;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"184"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 12121223,\n    \"name\": \"MyCampaign\",\n    \"status\": \"Scheduled\",\n    \"automation\": 2524,\n    \"lists\": [\n        48\n    ],\n    \"scheduled_datetime\": \"2024-08-28T10:00:00+02:00\",\n    \"created_datetime\": \"2023-08-28T14:25:37.316419+02:00\"\n}"}],"_postman_id":"008a39b2-5df2-40f1-a6bd-dca96a905ded"},{"name":"Update role","id":"80ec97c6-b61c-4436-be85-3b6ab39e0863","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"role\": \"Chat Operator Manager\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/invitations/{{id}}/update_role/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n<p>Allowed roles: Owner, Administrator, Chat Operator Manager, Chat Operator</p>\n<h4 id=\"possible-error-codes\"><strong>Possible Error Codes:</strong></h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th><strong>Datail</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>Invalid request body</td>\n<td>Invalid or no role specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","invitations","{{id}}","update_role",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"f348b0b8-1029-4841-bc91-76eaf3135495","name":"201 Created","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"MyCampaign\",\n    \"scheduled_datetime\": \"2024-08-28T10:00:00.000Z\",\n    \"status\": \"Scheduled\",\n    \"automation\": {{id}},\n    \"lists\": [{{id}}]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/campaigns/"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:25:37 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1296.68700000002;desc=\"User CPU time\", TimerPanel_stime;dur=267.5800000000663;desc=\"System CPU time\", TimerPanel_total;dur=1564.2670000000862;desc=\"Total CPU time\", TimerPanel_total_time;dur=1593.4910774230957;desc=\"Elapsed time\", SQLPanel_sql_time;dur=29.886484146118164;desc=\"SQL 9 queries\", CachePanel_total_time;dur=4.533052444458008;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"184"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 12121223,\n    \"name\": \"MyCampaign\",\n    \"status\": \"Scheduled\",\n    \"automation\": 2524,\n    \"lists\": [\n        48\n    ],\n    \"scheduled_datetime\": \"2024-08-28T10:00:00+02:00\",\n    \"created_datetime\": \"2023-08-28T14:25:37.316419+02:00\"\n}"}],"_postman_id":"80ec97c6-b61c-4436-be85-3b6ab39e0863"},{"name":"Delete invitation","id":"9b1f57df-fefe-4f71-aa9b-a2d66278101c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/invitations/{{id}}/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n","urlObject":{"path":["api","1","invitations","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"60b98702-f8d1-40cc-b807-feac2282d80b","name":"204 No Content","originalRequest":{"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/campaigns/{{id}}/"},"status":"No Content","code":204,"_postman_previewlanguage":"plain","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:26:38 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1070.9779999999682;desc=\"User CPU time\", TimerPanel_stime;dur=224.4150000000218;desc=\"System CPU time\", TimerPanel_total;dur=1295.39299999999;desc=\"Total CPU time\", TimerPanel_total_time;dur=1268.4416770935059;desc=\"Elapsed time\", SQLPanel_sql_time;dur=18.60809326171875;desc=\"SQL 6 queries\", CachePanel_total_time;dur=6.557226181030273;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"0"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"9b1f57df-fefe-4f71-aa9b-a2d66278101c"}],"id":"191c78fa-be99-4c92-bba6-3778634f030f","_postman_id":"191c78fa-be99-4c92-bba6-3778634f030f","description":"","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}}},{"name":"Lists","item":[{"name":"List, search, and filter lists","id":"f8c62d36-0bdd-40df-8190-333a52882dd9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/lists/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n","urlObject":{"path":["api","1","lists",""],"host":["{{Base-URL}}"],"query":[{"disabled":true,"description":{"content":"<p>You can search by list name</p>\n","type":"text/plain"},"key":"search","value":""}],"variable":[]}},"response":[],"_postman_id":"f8c62d36-0bdd-40df-8190-333a52882dd9"},{"name":"Create list","id":"e5f244d0-f742-40ae-b052-c31f31c273ba","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"Newsletter\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/lists/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n","urlObject":{"path":["api","1","lists",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e5f244d0-f742-40ae-b052-c31f31c273ba"},{"name":"Retrieve list","id":"55433c8b-807b-4e6e-a78a-08762948913a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/lists/{{id}}/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n","urlObject":{"path":["api","1","lists","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"55433c8b-807b-4e6e-a78a-08762948913a"},{"name":"Create or update contacts, then add to the list","id":"2a151261-20f7-4a5f-a3d2-e0922d440a67","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"contacts\": [\n        {\n            \"phone\": \"{{phone}}\",\n            \"first_name\": \"John\",\n            \"last_name\": \"Doe\",\n            \"email\": \"john.doe@domain.com\",\n            \"language\": \"en\",\n            \"custom_fields\": {\n                \"ORDER_ID\": \"1234\"\n            }\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/lists/{{id}}/sync_contacts/","description":"<p><strong>Rate Limit:</strong> 1/min</p>\n<p><strong>Note</strong>:<br /><em>Do not update the contact using this API before initiating an automation for it. The contact will be automatically updated when the 'Start automation' API is called.</em></p>\n<p>Max contacts allowed: 500.</p>\n<p>Possible Error Codes:</p>\n<h4 id=\"in-case-the-body-isnt-correct\">In case the body isn't correct:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"field\": [\n        \"Error description.\"\n    ]\n}\n\n</code></pre>\n<h4 id=\"in-case-the-body-is-correct-other-error-code\">In case the body is correct, other error code:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"https://app.spoki.it/errors/spoki::3004\",\n    \"title\": \"The request body is not correct\",\n    \"code\": \"spoki::3004\",\n    \"status\": 400,\n    \"datail\": \"Too many contacts. Max 500 allowed.\"\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Too many contacts. Max 500 allowed.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","lists","{{id}}","sync_contacts",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"2a151261-20f7-4a5f-a3d2-e0922d440a67"},{"name":"Remove all contacts","id":"2889ba08-a4b6-4a23-b99b-0d90a973f95e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/lists/{{id}}/remove_all_contacts/","description":"<p><strong>Rate Limit</strong>: 5/min</p>\n","urlObject":{"path":["api","1","lists","{{id}}","remove_all_contacts",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"8777d8f0-6729-4cec-8fee-6e2bd7d72b15","name":"200 OK","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/lists/{{id}}/remove_all_contacts/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Tue, 10 Oct 2023 15:32:08 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"2"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"POST, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{}"}],"_postman_id":"2889ba08-a4b6-4a23-b99b-0d90a973f95e"},{"name":"Delete list","id":"85656655-5fff-4baa-8b83-949b0c64dce8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/lists/{{id}}/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n","urlObject":{"path":["api","1","lists","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"85656655-5fff-4baa-8b83-949b0c64dce8"},{"name":"Remove contacts","id":"90906014-1c60-4118-bc2c-0fb64d8af7f2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"contacts\": [\n        \"john.doe@example.com\",\n        \"mario.rossi@example.com\"\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/lists/{{id}}/remove_contacts/","description":"<p><strong>Rate Limit</strong>: 5/min</p>\n","urlObject":{"path":["api","1","lists","{{id}}","remove_contacts",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"90906014-1c60-4118-bc2c-0fb64d8af7f2"}],"id":"03b49212-b28b-43d1-a29a-1a02d10d86bc","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"80e404ff-9b36-4af5-b381-528f2a11cc4b","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"8eee7611-fbc0-40e7-aa2c-5536c8e7064b","type":"text/javascript","exec":[""]}}],"_postman_id":"03b49212-b28b-43d1-a29a-1a02d10d86bc","description":""},{"name":"Messages","item":[{"name":"Send Template","id":"22eb28b9-2ae1-435a-9364-0f32cf88b51c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"type\": \"Template\",\n    \"phone\": \"{{phone}}\",\n    \"template\": {{id}},\n    \"email\": \"john.doe@domain.com\",\n    \"language\": \"IT\",\n    \"custom_fields\": {\n        \"APPOINTMENT_DURATION\": \"2 hours\",\n        \"APPOINTMENT_TYPE\": \"Haircut\"\n    },\n    \"buttons\": [\n        {\n            \"order\": 0,\n            \"payload\": \"your_unique_optional_payload_for_button_0_to_be_returned_in_the_webhook\"\n        },\n        {\n            \"order\": 1,\n            \"payload\": \"your_unique_optional_payload_for_button_1_to_be_returned_in_the_webhook\"\n        }\n    ],\n    \"metadata\": {\n        \"your_str_meta\": \"lorem ipsum\",\n        \"your_int_meta\": 3,\n        \"your_float_meta\": 42.5,\n        \"your_bool_meta\": true\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/messages/send/","description":"<p>Sends a message using a pre-approved WhatsApp template.</p>\n<hr />\n<h2 id=\"channel_id-optional-body-field--edited\">channel_id (Optional Body Field) — EDITED</h2>\n<p>An optional <code>channel_id</code> can now be included in the request body to explicitly route the message through a specific channel.</p>\n<h4 id=\"routing-behaviour\">Routing Behaviour</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><code>channel_id</code></th>\n<th>Behaviour</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>Omitted</strong></td>\n<td>Server resolves the routing channel from the account's primary channel that is compatible with the message type. Compatibility: <code>Template</code>, <code>Buttons</code>, <code>List</code> → WhatsApp only; <code>Free</code> → WhatsApp, SMS, SMS 2-Ways. If the primary channel is not compatible, the server may fall back to the first compatible active channel (subject to ongoing refinement).</td>\n</tr>\n<tr>\n<td><strong>Supplied (valid)</strong></td>\n<td>Channel must be tenant-scoped, in the compatible set for the message type, and have <code>status == ACTIVE</code>. For <code>type=Template</code> an additional guard checks <code>template.waba == channel.client_id</code>; a mismatch returns <code>400</code>.</td>\n</tr>\n<tr>\n<td><strong>Supplied (invalid)</strong></td>\n<td>Cross-tenant or non-numeric → <code>404</code>. Wrong platform or non-active → <code>400</code>.</td>\n</tr>\n</tbody>\n</table>\n</div><p>The resolved channel is persisted on <code>Message.attributes[\"channel\"]</code>, enabling subsequent <code>GET /messages/?channel_id=...</code> queries to filter on it.</p>\n<h4 id=\"example-request-body\">Example Request Body</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"type\": \"Template\",\n  \"channel_id\": 17,\n  \"phone_number\": \"+39...\",\n  \"template_id\": 3068\n}\n</code></pre>\n<h4 id=\"response\">Response</h4>\n<p>Returns the message dispatcher's response. Status code varies by message type:</p>\n<ul>\n<li><code>200</code> — synchronous dispatch</li>\n<li><code>201</code> — resource created</li>\n<li><code>202</code> — accepted for async dispatch</li>\n</ul>\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","messages","send",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"22eb28b9-2ae1-435a-9364-0f32cf88b51c"},{"name":"Send Template With Dynamic Header Media","id":"44870031-97c5-41a0-8a5d-389be885b49d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"type\": \"Template\",\n    \"phone\": \"{{phone}}\",\n    \"template\": {{id}},\n    \"email\": \"john.doe@domain.com\",\n    \"header_media\": {\n        \"url\": \"https://upload.wikimedia.org/wikipedia/commons/9/96/Google_web_search.png\",\n        \"filename\": \"Google_web_search.png\"\n    },\n    \"custom_fields\": {\n        \"APPOINTMENT_DURATION\": \"2 hours\",\n        \"APPOINTMENT_TYPE\": \"Haircut\"\n    },\n    \"metadata\": {\n        \"your_str_meta\": \"lorem ipsum\",\n        \"your_int_meta\": 3,\n        \"your_float_meta\": 42.5,\n        \"your_bool_meta\": true\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/messages/send/","description":"<p><strong>Rate Limit:</strong> 60/min</p>\n<p>Send a template with media header with a dynamic media url.</p>\n<p>IMPORTANT: The dynamic media must be of the same type.</p>\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","messages","send",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"44870031-97c5-41a0-8a5d-389be885b49d"},{"name":"Send Template Carousel With Dynamic Header Medias","id":"9b645a98-2247-4213-af11-80b014909f96","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"type\": \"Template\",\n    \"phone\": \"{{phone}}\",\n    \"template\": {{id}},\n    \"email\": \"john.doe@domain.com\",\n    \"header_media_set\": [\n        {\n            \"url\": \"https://roma-servizi.it/wp-content/uploads/saettone-serpente-1024x682.png\",\n            \"filename\": \"Google_web_search.png\"\n        },\n        {\n            \"url\": \"https://statickodami.akamaized.net/wp-content/uploads/sites/31/2022/07/iStock-1298772937.jpg\",\n            \"filename\": \"Google_web_search.png\"\n        }\n    ],\n    \"custom_fields\": {\n        \"APPOINTMENT_DURATION\": \"2 hours\",\n        \"APPOINTMENT_TYPE\": \"Haircut\"\n    },\n    \"metadata\": {\n        \"your_str_meta\": \"lorem ipsum\",\n        \"your_int_meta\": 3,\n        \"your_float_meta\": 42.5,\n        \"your_bool_meta\": true\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/messages/send/","description":"<p><strong>Rate Limit:</strong> 60/min</p>\n<p>Send a template carousel with dynamic media urls.</p>\n<p>IMPORTANT: The dynamic media must be of the same type.</p>\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","messages","send",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"9b645a98-2247-4213-af11-80b014909f96"},{"name":"Send Template Carousel With Dynamic Multilanguage Header Medias","id":"5e1e424f-c049-470d-9c01-9d55cd721d1b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"type\": \"Template\",\n    \"phone\": \"{{phone}}\",\n    \"template\": {{id}},\n    \"email\": \"john.doe@domain.com\",\n    \"header_media_set\": [\n        {\n            \"url\": \"https://roma-servizi.it/wp-content/uploads/saettone-serpente-1024x682.png\",\n            \"filename\": \"Google_web_search.png\"\n        },\n        {\n            \"url\": \"https://statickodami.akamaized.net/wp-content/uploads/sites/31/2022/07/iStock-1298772937.jpg\",\n            \"filename\": \"Google_web_search.png\"\n        },\n        {\n            \"url\": \"https://upload.wikimedia.org/wikipedia/commons/9/96/Google_web_search.png\",\n            \"filename\": \"Google_web_search.png\",\n            \"language\": \"en\"\n        },\n        {\n            \"url\": \"https://upload.wikimedia.org/wikipedia/commons/9/96/Google_web_search.png\",\n            \"filename\": \"Google_web_search.png\",\n            \"language\": \"en\"\n        },\n        {\n            \"url\": \"https://roma-servizi.it/wp-content/uploads/saettone-serpente-1024x682.png\",\n            \"filename\": \"Google_web_search.png\",\n            \"language\": \"it\"\n        },\n        {\n            \"url\": \"https://statickodami.akamaized.net/wp-content/uploads/sites/31/2022/07/iStock-1298772937.jpg\",\n            \"filename\": \"Google_web_search.png\",\n            \"language\": \"it\"\n        }\n    ],\n    \"custom_fields\": {\n        \"APPOINTMENT_DURATION\": \"2 hours\",\n        \"APPOINTMENT_TYPE\": \"Haircut\"\n    },\n    \"metadata\": {\n        \"your_str_meta\": \"lorem ipsum\",\n        \"your_int_meta\": 3,\n        \"your_float_meta\": 42.5,\n        \"your_bool_meta\": true\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/messages/send/","description":"<p><strong>Rate Limit:</strong> 60/min</p>\n<p>Send a template carousel with dynamic media urls.</p>\n<p>You can specify \"language\" for a media, in order to send different media based on contact language.</p>\n<p>If the language is not set, it will be used for all the other languages.</p>\n<p>IMPORTANT: The dynamic media must be of the same type.</p>\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","messages","send",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"5e1e424f-c049-470d-9c01-9d55cd721d1b"},{"name":"Send Message Text","id":"052fb225-5f88-470d-9b37-fc5649df77ed","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"type\": \"Message\",\n    \"content_type\": \"Text\",\n    \"phone\": \"{{phone}}\",\n    \"text\": \"Hi how can I help you?\",\n    \"metadata\": {\n        \"your_str_meta\": \"lorem ipsum\",\n        \"your_int_meta\": 3,\n        \"your_float_meta\": 42.5,\n        \"your_bool_meta\": true\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/messages/send/","description":"<p><strong>Rate Limit:</strong> 120/min</p>\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","messages","send",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"052fb225-5f88-470d-9b37-fc5649df77ed"},{"name":"Send Message With Buttons","id":"fe6c1cc1-3f8f-4c77-82af-a59941e988be","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"type\": \"Message\",\n    \"content_type\": \"Interactive\",\n    \"phone\": \"{{phone}}\",\n    \"text\": \"Hi %%FIRST_NAME%%,\\nWe're delighted to celebrate your special day with you and wish you many happy returns!\\nThank you for choosing our company to meet your needs, and we hope to continue providing you with the best service possible.\\n\\nWe have a gift for you 🎁\",\n    \"header\": {\n        \"format\": \"text\",\n        \"text\": \"Happy Birthday!\"\n    },\n    \"footer\": {\n        \"text\": \"MyCompany.com\"\n    },\n    \"buttons\": [\n        {\n            \"button_type\": \"quick_reply\",\n            \"text\": \"Give me the gift\",\n            \"order\": 0,\n            \"payload\": \"your_unique_optional_payload_for_button_0_to_be_returned_in_the_webhook\"\n        },\n        {\n            \"button_type\": \"quick_reply\",\n            \"text\": \"Cheers!\",\n            \"order\": 1,\n            \"payload\": \"your_unique_optional_payload_for_button_1_to_be_returned_in_the_webhook\"\n        }\n    ],\n    \"metadata\": {\n        \"your_str_meta\": \"lorem ipsum\",\n        \"your_int_meta\": 3,\n        \"your_float_meta\": 42.5,\n        \"your_bool_meta\": true\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/messages/send/","description":"<p><strong>Rate Limit:</strong> 60/min</p>\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","messages","send",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"fe6c1cc1-3f8f-4c77-82af-a59941e988be"},{"name":"Send Message List","id":"05f909e5-c29a-4802-a11a-d82d86bf61e2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"type\": \"Message\",\n    \"content_type\": \"List\",\n    \"phone\": \"{{phone}}\",\n    \"text\": \"Hi %%FIRST_NAME%%,\\nselect your menu from the bottom list. Dressings and toppings are selected later on\",\n    \"header\": {\n        \"format\": \"text\",\n        \"text\": \"Choose your menu\"\n    },\n    \"footer\": {\n        \"text\": \"MyCompany.com\"\n    },\n    \"list\": {\n        \"title\": \"Choose Menu\",\n        \"sections\": [\n            {\n                \"title\": \"Vegan\",\n                \"rows\": [\n                    {\n                        \"title\": \"Green dream\",\n                        \"description\": \"A bowl full of tasty leaves, soy beans and cucumber\",\n                        \"payload\": \"your_unique_optional_payload_for_row_0_to_be_returned_in_the_webhook\"\n                    },\n                    {\n                        \"title\": \"Rainbow meets rice\",\n                        \"description\": \"A colorful selection of vegetables on a cozy bed of basmati rice\",\n                        \"payload\": \"your_unique_optional_payload_for_row_1_to_be_returned_in_the_webhook\"\n                    }\n                ]\n            },\n            {\n                \"title\": \"Vegetarian\",\n                \"rows\": [\n                    {\n                        \"title\": \"Italo Classic\",\n                        \"description\": \"Slices of tomates, with plucked pieces of mozzarella and basil leaves\",\n                        \"payload\": \"your_unique_optional_payload_for_row_2_to_be_returned_in_the_webhook\"\n                    },\n                    {\n                        \"title\": \"Egg & Peas\",\n                        \"description\": \"Tasty slices of eggs, on a whole wheat pasta salad with peas\",\n                        \"payload\": \"your_unique_optional_payload_for_row_3_to_be_returned_in_the_webhook\"\n                    }\n                ]\n            }\n        ]\n    },\n    \"metadata\": {\n        \"your_str_meta\": \"lorem ipsum\",\n        \"your_int_meta\": 3,\n        \"your_float_meta\": 42.5,\n        \"your_bool_meta\": true\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/messages/send/","description":"<p><strong>Rate Limit:</strong> 60/min</p>\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","messages","send",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"05f909e5-c29a-4802-a11a-d82d86bf61e2"},{"name":"Add Note","id":"da95690a-ee3a-4613-aee9-68b0d1dabd51","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"type\": \"Note\",\n    \"content_type\": \"Text\",\n    \"phone\": \"{{phone}}\",\n    \"text\": \"Interested in tshirt\",\n    \"metadata\": {\n        \"your_str_meta\": \"lorem ipsum\",\n        \"your_int_meta\": 3,\n        \"your_float_meta\": 42.5,\n        \"your_bool_meta\": true\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/messages/send/","description":"<p><strong>Rate Limit:</strong> 240/min</p>\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","messages","send",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"da95690a-ee3a-4613-aee9-68b0d1dabd51"},{"name":"List, search, and filter messages","id":"e49c20de-4ec4-4e93-aea7-1b53bbc11510","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/messages/","description":"<p>Returns the paginated list of messages belonging to the authenticated account.</p>\n<p>This endpoint was previously POST-only. GET now returns paginated message history. Without <code>channel_id</code> the full account message history is returned.</p>\n<h4 id=\"query-parameters\">Query Parameters</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>channel_id</code></td>\n<td>No</td>\n<td>Filter messages whose <code>attributes[\"channel\"]</code> matches the given channel ID. Resolved via <code>resolve_channel</code> — cross-tenant or non-numeric values return 404.</td>\n</tr>\n<tr>\n<td><code>page</code></td>\n<td>No</td>\n<td>Page number for pagination (1-based).</td>\n</tr>\n<tr>\n<td><code>page_size</code></td>\n<td>No</td>\n<td>Number of results per page.</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"channel_id-validation\">channel_id Validation</h4>\n<p>When <code>channel_id</code> is provided:</p>\n<ul>\n<li><strong>Cross-tenant or non-numeric</strong> → <code>404 { \"code\": \"spoki::404\", \"detail\": \"Channel not found\" }</code></li>\n</ul>\n<h4 id=\"example-requests\">Example Requests</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /api/1/messages/\n→ 200  full account message history\nGET /api/1/messages/?channel_id=17\n→ 200  { \"count\": 5493, \"results\": [ ... ] }\nGET /api/1/messages/?channel_id=7   (cross-tenant)\n→ 404  { \"code\": \"spoki::404\", \"detail\": \"Channel not found\" }\n\n</code></pre><h4 id=\"response-200-ok\">Response (200 OK)</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"count\": 5493,\n  \"next\": \"https://api.spoki.it/api/1/messages/?page=2\",\n  \"previous\": null,\n  \"results\": [\n    {\n      \"id\": 98001,\n      \"type\": \"Template\",\n      \"phone_number\": \"+391234567890\",\n      \"status\": \"delivered\",\n      \"attributes\": {\n        \"channel\": 17\n      },\n      \"created_at\": \"2025-05-10T08:30:00Z\"\n    }\n  ]\n}\n\n</code></pre>\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","messages",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e49c20de-4ec4-4e93-aea7-1b53bbc11510"}],"id":"5cb20d6e-bbf8-4885-9844-f63f484c3537","_postman_id":"5cb20d6e-bbf8-4885-9844-f63f484c3537","description":"","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}}},{"name":"Reports","item":[{"name":"List, search, and filter reports","id":"456d5374-c581-46e6-bb78-1fcb74b35099","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/reports/","description":"<p><strong>Rate Limit:</strong> 5/min<br /><strong>Caching Policy</strong>: The report for the current period is updated once a day or manually from the Spoki platform dashboard and will be cached for 30 minutes.</p>\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","reports",""],"host":["{{Base-URL}}"],"query":[{"disabled":true,"description":{"content":"<p>Day, Month, Year</p>\n","type":"text/plain"},"key":"granularity","value":"Day"},{"disabled":true,"description":{"content":"<p>YYYY-MM-DD</p>\n","type":"text/plain"},"key":"start_date","value":""},{"disabled":true,"description":{"content":"<p>YYYY-MM-DD</p>\n","type":"text/plain"},"key":"end_date","value":""}],"variable":[]}},"response":[{"id":"13e59170-c63a-4881-939e-764d88aa4b25","name":"200 OK","originalRequest":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/reports/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Wed, 21 Jun 2023 13:11:07 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"4488"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 2,\n    \"next\": null,\n    \"previous\": null,\n    \"results\": [\n        {\n            \"account\": 1384211,\n            \"period_start\": \"2023-06-01\",\n            \"contacted_contacts\": 1101,\n            \"template_message_count\": 2577,\n            \"free_message_count\": 2583,\n            \"incoming_message_count\": 3869,\n            \"exchanged_messages\": 9029,\n            \"sent_message_count\": 5160,\n            \"delivered_message_count\": 5160,\n            \"read_message_count\": 4031,\n            \"conversation_count\": 2220\n        },\n        {\n            \"account\": 1384211,\n            \"period_start\": \"2023-05-01\",\n            \"contacted_contacts\": 1390,\n            \"template_message_count\": 4083,\n            \"free_message_count\": 4744,\n            \"incoming_message_count\": 6564,\n            \"exchanged_messages\": 15391,\n            \"sent_message_count\": 8827,\n            \"delivered_message_count\": 8827,\n            \"read_message_count\": 7028,\n            \"conversation_count\": 2857\n        }\n    ]\n}"}],"_postman_id":"456d5374-c581-46e6-bb78-1fcb74b35099"}],"id":"10e5fcfd-e274-46e4-9582-d0e2d1a39b34","_postman_id":"10e5fcfd-e274-46e4-9582-d0e2d1a39b34","description":"","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}}},{"name":"Roles","item":[{"name":"List, search, and filter roles","id":"3f281e4c-3672-43ec-854b-aef81787b8b4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/roles/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n","urlObject":{"path":["api","1","roles",""],"host":["{{Base-URL}}"],"query":[{"disabled":true,"description":{"content":"<p>search by id, email, first_name, last_name</p>\n","type":"text/plain"},"key":"search","value":""}],"variable":[]}},"response":[{"id":"a565bdcc-e28f-492b-8797-b10f227fc791","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":{"raw":"{{Base-URL}}/api/1/roles/","host":["{{Base-URL}}"],"path":["api","1","roles",""],"query":[{"key":"search","value":"","description":"search by id, email, first_name, last_name","disabled":true}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.27.0"},{"key":"Date","value":"Fri, 18 Oct 2024 14:16:22 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"3485"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 10,\n    \"next\": null,\n    \"previous\": null,\n    \"results\": [\n        {\n            \"id\": 89112,\n            \"user\": {\n                \"id\": 71054,\n                \"email\": \"john.doe@mydomain.com\",\n                \"uid\": \"cea1a1f181fc4629aec47890cdf3d0db\",\n                \"firstname\": \"John\",\n                \"surname\": \"Doe\",\n                \"image\": \"\",\n                \"is_service\": false\n            },\n            \"role\": \"Owner\",\n            \"is_active\": true,\n            \"created_datetime\": \"2024-01-09T16:46:21.679770+01:00\",\n            \"updated_datetime\": \"2024-01-09T16:46:21.679820+01:00\"\n        },\n        {\n            \"id\": 99136,\n            \"user\": {\n                \"id\": 71058,\n                \"email\": \"mario.rossi@mydomain.com\",\n                \"uid\": \"f18f7abe01f34eba8fa9077dae42aefc\",\n                \"firstname\": \"Mario\",\n                \"surname\": \"Rossi\",\n                \"image\": \"\",\n                \"is_service\": false\n            },\n            \"role\": \"Administrator\",\n            \"is_active\": true,\n            \"created_datetime\": \"2024-06-20T12:51:48.164447+02:00\",\n            \"updated_datetime\": \"2024-06-20T12:51:48.164473+02:00\"\n        }\n    ]\n}"}],"_postman_id":"3f281e4c-3672-43ec-854b-aef81787b8b4"},{"name":"Retrieve role","id":"1ca449a6-7643-47bf-a17e-44bc23dce419","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/roles/{{id}}/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n","urlObject":{"path":["api","1","roles","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"091749d4-6a9c-439b-be79-afe85239962f","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/roles/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.27.0"},{"key":"Date","value":"Fri, 18 Oct 2024 14:18:45 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"365"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"GET, DELETE, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 89112,\n    \"user\": {\n        \"id\": 71054,\n        \"email\": \"john.doe@mydomain.com\",\n        \"uid\": \"cea1a1f181fc4629aec47890cdf3d0db\",\n        \"firstname\": \"John\",\n        \"surname\": \"Doe\",\n        \"image\": \"\",\n        \"is_service\": false\n    },\n    \"role\": \"Owner\",\n    \"is_active\": true,\n    \"created_datetime\": \"2024-04-12T17:48:53.463898+02:00\",\n    \"updated_datetime\": \"2024-04-12T17:48:53.463924+02:00\"\n}"}],"_postman_id":"1ca449a6-7643-47bf-a17e-44bc23dce419"},{"name":"Add Service User","id":"d8130563-21e9-4160-8cd2-e5588003bed8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"role\": \"Administrator\",\n    \"name\": \"John\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/roles/add_service_user/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<h4 id=\"in-case-the-body-is-correct-other-error-code\">In case the body is correct, other error code:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"https://app.spoki.it/errors/spoki::3004\",\n    \"title\": \"The request body is not correct\",\n    \"code\": \"spoki::3004\",\n    \"status\": 400,\n    \"datail\": \"Invalid or no role specified.\"\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no role specified</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>name not specified</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>specify a valid role</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","roles","add_service_user",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"bd2beb37-5d1b-4f82-b852-a3f65fabde0c","name":"201 Created","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"role\": \"Administrator\",\n    \"name\": \"John\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/roles/add_service_user/"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.27.0"},{"key":"Date","value":"Fri, 18 Oct 2024 14:23:57 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"347"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"POST, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 914453,\n    \"user\": {\n        \"id\": 445684,\n        \"email\": \"f8d964d0-955f-4c0r-af17-be8258c94v94@serviceuser.spoki.it\",\n        \"uid\": \"0969f2205b494ae884773253516376bb\",\n        \"firstname\": \"John\",\n        \"surname\": \"\",\n        \"image\": \"\",\n        \"is_service\": true\n    },\n    \"role\": \"Administrator\",\n    \"is_active\": true,\n    \"created_datetime\": \"2024-10-18T16:23:57.861650+02:00\",\n    \"updated_datetime\": \"2024-10-18T16:23:57.861670+02:00\"\n}"}],"_postman_id":"d8130563-21e9-4160-8cd2-e5588003bed8"},{"name":"Generate Private Key","id":"ea7fb344-9e14-4ce1-bfb1-dc1f0fe49938","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/roles/{{id}}/generate_private_key/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n<p>Generate Private Key of a Service User</p>\n","urlObject":{"path":["api","1","roles","{{id}}","generate_private_key",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"cfe66aa2-6d09-4ecf-aa35-bec0b393f4d2","name":"200 OK","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/roles/{{id}}/generate_private_key/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.27.0"},{"key":"Date","value":"Fri, 18 Oct 2024 14:22:59 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"66"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"POST, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"\"b5e0ce522de128e01d7c37d6aba8b5cac6f19c1c84e76872c469cdb1733v819d\""}],"_postman_id":"ea7fb344-9e14-4ce1-bfb1-dc1f0fe49938"},{"name":"Has Private Key","id":"89451f9a-0ac9-4a4d-9a5b-c6bf90d60bb1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/roles/{{id}}/has_private_key/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n","urlObject":{"path":["api","1","roles","{{id}}","has_private_key",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"d044512f-098f-4ba2-bc8e-b18426ef9ba5","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/roles/{{id}}/has_private_key/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.27.0"},{"key":"Date","value":"Fri, 18 Oct 2024 14:22:45 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"5"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"false"}],"_postman_id":"89451f9a-0ac9-4a4d-9a5b-c6bf90d60bb1"},{"name":"Update Role","id":"e04f5e38-3de5-489d-a2be-93b61258534b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"role\": \"Chat Operator\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/roles/{{id}}/update_role/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<h4 id=\"in-case-the-body-is-correct-other-error-code\">In case the body is correct, other error code:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"https://app.spoki.it/errors/spoki::3004\",\n    \"title\": \"The request body is not correct\",\n    \"code\": \"spoki::3004\",\n    \"status\": 400,\n    \"datail\": \"Invalid or no role specified.\"\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no role specified</td>\n</tr>\n<tr>\n<td>403</td>\n<td>spoki::403</td>\n<td>Access denied</td>\n<td>you cannot change the role of the sole admin of the account</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>specify a valid role</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","roles","{{id}}","update_role",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"24ec43d7-26b5-45e8-8e21-8335f0314fa9","name":"204 No Content","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"role\": \"Chat Operator Manager\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/roles/{{id}}/update_role/"},"status":"No Content","code":204,"_postman_previewlanguage":"plain","header":[{"key":"Server","value":"nginx/1.27.0"},{"key":"Date","value":"Fri, 18 Oct 2024 14:23:30 GMT"},{"key":"Content-Length","value":"0"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"POST, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"e04f5e38-3de5-489d-a2be-93b61258534b"},{"name":"Delete role","id":"118b15a2-7a40-4ec7-b43d-ef0b73060bbb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/roles/{{id}}/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>403</td>\n<td>spoki::403</td>\n<td>Access denied</td>\n<td>you cannot delete the role of the sole admin of the account</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","roles","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"b3beb819-a9c6-4642-b98e-dc5be455aaa9","name":"204 No Content","originalRequest":{"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/roles/{{id}}/"},"status":"No Content","code":204,"_postman_previewlanguage":"plain","header":[{"key":"Server","value":"nginx/1.27.0"},{"key":"Date","value":"Fri, 18 Oct 2024 14:25:14 GMT"},{"key":"Content-Length","value":"0"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"GET, DELETE, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"118b15a2-7a40-4ec7-b43d-ef0b73060bbb"}],"id":"ea4241bf-b974-4729-8f16-b4297005cd3f","_postman_id":"ea4241bf-b974-4729-8f16-b4297005cd3f","description":"","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}}},{"name":"Tags","item":[{"name":"List, search, and filter tags","id":"a0766e4c-3567-4369-8428-b39ce3710cff","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/tags/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n","urlObject":{"path":["api","1","tags",""],"host":["{{Base-URL}}"],"query":[{"disabled":true,"key":"","value":""}],"variable":[]}},"response":[{"id":"44b69777-d079-4e46-ab0e-6cc6da6a759d","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":{"raw":"{{Base-URL}}/api/1/tags/","host":["{{Base-URL}}"],"path":["api","1","tags",""],"query":[{"key":"","value":"","disabled":true}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Fri, 02 Feb 2024 10:38:32 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"282"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 4,\n    \"next\": null,\n    \"previous\": null,\n    \"results\": [\n        {\n            \"id\": 232321,\n            \"name\": \"cold\",\n            \"color\": \"#16d46d\",\n            \"order\": 3\n        },\n        {\n            \"id\": 232323,\n            \"name\": \"blue-monday\",\n            \"color\": \"#16d46d\",\n            \"order\": 2\n        },\n        {\n            \"id\": 232324,\n            \"name\": \"hot\",\n            \"color\": \"#16d46d\",\n            \"order\": 1\n        },\n        {\n            \"id\": 232325,\n            \"name\": \"black-friday\",\n            \"color\": \"#16d46d\",\n            \"order\": 0\n        }\n    ]\n}"}],"_postman_id":"a0766e4c-3567-4369-8428-b39ce3710cff"},{"name":"Retrieve tag","id":"dc89e0d0-f563-493c-be54-7fe4bb8cc97b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/tags/{{id}}/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n","urlObject":{"path":["api","1","tags","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"9d9ad919-b5fd-4fed-ab18-e820358001ce","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/tags/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Fri, 02 Feb 2024 10:40:31 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"59"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 232323,\n    \"name\": \"blue-monday\",\n    \"color\": \"#16d46d\",\n    \"order\": 2\n}"}],"_postman_id":"dc89e0d0-f563-493c-be54-7fe4bb8cc97b"}],"id":"dc6bae68-8104-4375-a581-b46f15478705","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"80e404ff-9b36-4af5-b381-528f2a11cc4b","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"8eee7611-fbc0-40e7-aa2c-5536c8e7064b","type":"text/javascript","exec":[""]}}],"_postman_id":"dc6bae68-8104-4375-a581-b46f15478705","description":""},{"name":"Templates","item":[{"name":"List, search, and filter templates","id":"1a205d63-9a95-40d0-944c-050591db7a4b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/templates/","description":"<p>Returns the paginated list of templates belonging to the authenticated account.</p>\n<p>Templates are matched by <code>Template.waba == channel.client_id</code>. Without <code>channel_id</code> the full account template set is returned. With <code>channel_id</code>, only templates whose <code>waba</code> matches that channel's <code>client_id</code> are returned.</p>\n<h4 id=\"query-parameters\">Query Parameters</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>channel_id</code></td>\n<td>number</td>\n<td>No</td>\n<td>Filter templates to those whose <code>waba</code> matches the given channel's <code>client_id</code>. The channel is validated before filtering — see error responses below.</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"channel_id-validation\">channel_id Validation</h4>\n<p>When <code>channel_id</code> is provided, the following checks are applied in order:</p>\n<ol>\n<li><strong>Non-numeric or cross-tenant</strong> → <code>404 { \"code\": \"spoki::404\", \"detail\": \"Channel not found\" }</code></li>\n<li><strong>Not a WhatsApp channel</strong> → <code>400 { \"detail\": \"Channel must be a WhatsApp channel\" }</code></li>\n<li><strong>Not ACTIVE (status ≠ Active)</strong> → <code>400 { \"detail\": \"Channel must be active\" }</code></li>\n</ol>\n<h4 id=\"example-requests\">Example Requests</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /api/1/templates/\n→ 200  full account template set\n\nGET /api/1/templates/?channel_id=17\n→ 200  { \"count\": 12, \"results\": [ ... ] }\n\nGET /api/1/templates/?channel_id=7   (cross-tenant)\n→ 404  { \"code\": \"spoki::404\", \"detail\": \"Channel not found\" }\n</code></pre><h4 id=\"multi-waba-caller-pattern\">Multi-WABA Caller Pattern</h4>\n<p>For callers managing multiple WABAs, use the following two-request pattern:</p>\n<ol>\n<li><code>GET /channel/?whatsapp_business_account=&lt;waba_id&gt;</code> → pick the row whose <code>status == 3</code> (Active)</li>\n<li><code>GET /templates/?channel_id=&lt;picked.id&gt;</code></li>\n</ol>\n<h4 id=\"response-200-ok\">Response (200 OK)</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"count\": 12,\n  \"next\": null,\n  \"previous\": null,\n  \"results\": [\n    {\n      \"id\": 101,\n      \"name\": \"promo_spring\",\n      \"language\": \"it\",\n      \"category\": \"MARKETING\",\n      \"status\": \"APPROVED\",\n      \"waba\": \"123456789\",\n      \"components\": [\n        { \"type\": \"BODY\", \"text\": \"Scopri le nostre offerte primaverili!\" }\n      ]\n    }\n  ]\n}\n</code></pre>\n","urlObject":{"path":["api","1","templates",""],"host":["{{Base-URL}}"],"query":[{"disabled":true,"description":{"content":"<p>You can search by: 'id', 'name', 'text'</p>\n","type":"text/plain"},"key":"search","value":null}],"variable":[]}},"response":[{"id":"b0a6f639-38f7-48d0-8273-c744217752ac","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/templates/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Thu, 01 Jun 2023 13:24:45 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"14369"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 3,\n    \"next\": null,\n    \"previous\": null,\n    \"results\": [\n        {\n            \"id\": 260,\n            \"name\": \"promo_costumi\",\n            \"category\": \"ACCOUNT_UPDATE\",\n            \"is_approved\": true,\n            \"is_favorite\": false,\n            \"customfield_set\": [],\n            \"templatelocalization_set\": [\n                {\n                    \"language\": \"it\",\n                    \"status\": \"APPROVED\",\n                    \"rejection_reason\": null,\n                    \"header\": null,\n                    \"body\": {\n                        \"component_type\": \"body\",\n                        \"format\": \"text\",\n                        \"text\": \"Ciao, abbiamo una bellissima notizia per te! 😍\\n\\nDa oggi *fino a fine mese* avrai la possibilità di acquistare *i tuoi costumi preferiti* a *metà prezzo* 🛍!\\n\\nSfoglia il catalogo e scegli il tuo modello preferito 👇\"\n                    },\n                    \"footer\": null,\n                    \"button_set\": [\n                        {\n                            \"order\": 0,\n                            \"button_type\": \"quick_reply\",\n                            \"text\": \"Guarda il Catalogo\",\n                            \"phone_number\": null,\n                            \"url\": null\n                        }\n                    ],\n                    \"default_header_media\": null\n                }\n            ]\n        },\n        {\n            \"id\": 189,\n            \"name\": \"Custom Message\",\n            \"category\": \"ACCOUNT_UPDATE\",\n            \"is_approved\": true,\n            \"is_favorite\": true,\n            \"customfield_set\": [\n                \"%%SENTENCE%%\"\n            ],\n            \"templatelocalization_set\": [\n                {\n                    \"language\": \"it\",\n                    \"status\": \"APPROVED\",\n                    \"rejection_reason\": null,\n                    \"header\": null,\n                    \"body\": {\n                        \"component_type\": \"body\",\n                        \"format\": \"text\",\n                        \"text\": \"Ciao! %%SENTENCE%%\"\n                    },\n                    \"footer\": null,\n                    \"button_set\": [],\n                    \"default_header_media\": null\n                }\n            ]\n        },\n        {\n            \"id\": 249,\n            \"name\": \"ordine_tracking_official_sf\",\n            \"category\": \"ACCOUNT_UPDATE\",\n            \"is_approved\": true,\n            \"is_favorite\": false,\n            \"customfield_set\": [\n                \"%%FIRST_NAME%%\",\n                \"%%FLEX_LINK%%\",\n                \"%%WOO_TRACKING_INFO%%\",\n                \"%%WOO_ORDER_ID%%\",\n                \"%%FLEX_ACCOUNT_NAME%%\"\n            ],\n            \"templatelocalization_set\": [\n                {\n                    \"language\": \"en\",\n                    \"status\": \"APPROVED\",\n                    \"rejection_reason\": null,\n                    \"header\": null,\n                    \"body\": {\n                        \"component_type\": \"body\",\n                        \"format\": \"text\",\n                        \"text\": \"👋 Hi %%FIRST_NAME%%, we have some news about your order n° %%WOO_ORDER_ID%% 🛍 for the store %%FLEX_ACCOUNT_NAME%%! Here the shipping info: %%WOO_TRACKING_INFO%%👍 Do you need support? ➡️➡️➡️ %%FLEX_LINK%% _do_ _not_ _reply_ _to_ _this_ _message_\"\n                    },\n                    \"footer\": null,\n                    \"button_set\": [],\n                    \"default_header_media\": null\n                },\n                {\n                    \"language\": \"es\",\n                    \"status\": \"PENDING\",\n                    \"rejection_reason\": null,\n                    \"header\": null,\n                    \"body\": {\n                        \"component_type\": \"body\",\n                        \"format\": \"text\",\n                        \"text\": \"👋 Hola %%FIRST_NAME%%, tu número de pedido %%WOO_ORDER_ID%% 🛍 de la tienda %%FLEX_ACCOUNT_NAME%% ha sido enviado 🚀  Aquí está la información de envío: %%WOO_TRACKING_INFO%%. 👍 ¿Necesitas ayuda? ➡️➡️➡️ %%FLEX_LINK%% _no_ _contestes_ _a_ _este_ _mensaje_\"\n                    },\n                    \"footer\": null,\n                    \"button_set\": [],\n                    \"default_header_media\": null\n                },\n                {\n                    \"language\": \"pt_PT\",\n                    \"status\": \"PENDING\",\n                    \"rejection_reason\": null,\n                    \"header\": null,\n                    \"body\": {\n                        \"component_type\": \"body\",\n                        \"format\": \"text\",\n                        \"text\": \"👋 Olá %%FIRST_NAME%%, temos notícias sobre o rastreamento de seu pedido nº %%WOO_ORDER_ID%% 🛍 da loja %%FLEX_ACCOUNT_NAME%% 🚀 Aqui estão as informações de envio: %%WOO_TRACKING_INFO%%. Precisa de ajuda? ➡️➡️➡️ %%FLEX_LINK%%  _ não_ _ responda _ _ a _ _ essa _ _ mensagem_\"\n                    },\n                    \"footer\": null,\n                    \"button_set\": [],\n                    \"default_header_media\": null\n                },\n                {\n                    \"language\": \"fr\",\n                    \"status\": \"APPROVED\",\n                    \"rejection_reason\": null,\n                    \"header\": null,\n                    \"body\": {\n                        \"component_type\": \"body\",\n                        \"format\": \"text\",\n                        \"text\": \"👋 Salut {{1}}  il y a des nouvelles des données de poursuite de votre commande n°{{2}} 🛍 de votre compte {{3}} 🚀  Voici les informations: {{4}}. Vous avez besoin d’aide? ➡️➡️➡️ {{5}} _ne_ pas _ _ répondre_\"\n                    },\n                    \"footer\": null,\n                    \"button_set\": [],\n                    \"default_header_media\": null\n                }\n            ]\n        }\n    ]\n}"}],"_postman_id":"1a205d63-9a95-40d0-944c-050591db7a4b"},{"name":"Create template","id":"32a93c88-68c0-41bf-9efa-77a4c225305f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"black_friday_example\",\n    \"category\": \"MARKETING\",\n    \"subcategory\": \"CLASSIC\",\n    \"templatelocalization_set\": [\n        {\n            \"language\": \"en\",\n            \"status\": 0,\n            \"header_template_component\": {\n                \"component_type\": \"header\",\n                \"parameters\": [],\n                \"format\": \"text\",\n                \"text\": \"Black Friday Special Offer!\"\n            },\n            \"body_template_component\": {\n                \"component_type\": \"body\",\n                \"parameters\": [],\n                \"format\": null,\n                \"text\": \"Hi %%FIRST_NAME%%!\\n*Don't miss out* on our exclusive Black Friday promotion!\\n\\nGet your favorite white t-shirt at a fantastic *50% off*!\\n\\nThis is a limited-time offer, so make sure to grab yours before it's gone.\\n\\n*Shop now* and elevate your wardrobe with this essential piece!\"\n            },\n            \"footer_template_component\": {\n                \"component_type\": \"footer\",\n                \"parameters\": [],\n                \"format\": null,\n                \"text\": \"MyCompany\"\n            },\n            \"templatebuttoncomponent_set\": [\n                {\n                    \"component_type\": null,\n                    \"text\": \"Shop Now\",\n                    \"order\": 0,\n                    \"button_type\": \"url\",\n                    \"phone_number\": null,\n                    \"form_id\": null,\n                    \"url\": \"https://myshop.com/my-product?coupon=MYCOUPON\",\n                    \"send_as_shortlink\": true\n                },\n                {\n                    \"component_type\": null,\n                    \"text\": \"Unsubscribe\",\n                    \"order\": 1,\n                    \"button_type\": \"unsubscribe\",\n                    \"phone_number\": null,\n                    \"form_id\": null,\n                    \"url\": null,\n                    \"send_as_shortlink\": null\n                }\n            ],\n            \"example_custom_fields\": {\n                \"FIRST_NAME\": \"John\"\n            },\n            \"example_header_media\": null,\n            \"default_header_media\": null,\n            \"templatecarouselcomponent_set\": null\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/templates/","description":"<p>Creates a new template for the authenticated account.</p>\n<p>When <code>channel_id</code> is provided in the request body, the created template's <code>waba</code> is automatically set to that channel's <code>client_id</code>. Without <code>channel_id</code>, the template is created under the account's default WABA.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>channel_id</code></td>\n<td>number</td>\n<td>No</td>\n<td>The ID of the channel whose <code>client_id</code> will be used as the template's <code>waba</code>. The channel must be a WhatsApp channel and must be ACTIVE.</td>\n</tr>\n<tr>\n<td><code>name</code></td>\n<td>string</td>\n<td>Yes</td>\n<td>The name of the template (snake_case, e.g. <code>promo_spring</code>).</td>\n</tr>\n<tr>\n<td><code>language</code></td>\n<td>string</td>\n<td>Yes</td>\n<td>The language code for the template (e.g. <code>it</code>, <code>en</code>).</td>\n</tr>\n<tr>\n<td><code>category</code></td>\n<td>string</td>\n<td>Yes</td>\n<td>The template category. One of: <code>MARKETING</code>, <code>UTILITY</code>, <code>AUTHENTICATION</code>.</td>\n</tr>\n<tr>\n<td><code>components</code></td>\n<td>array</td>\n<td>Yes</td>\n<td>Array of component objects defining the template structure (e.g. HEADER, BODY, FOOTER, BUTTONS).</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"channel_id-validation\">channel_id Validation</h4>\n<p>When <code>channel_id</code> is provided, the following checks are applied in order:</p>\n<ol>\n<li><strong>Non-numeric or cross-tenant</strong> → <code>404 { \"code\": \"spoki::404\", \"detail\": \"Channel not found\" }</code></li>\n<li><strong>Not a WhatsApp channel</strong> → <code>400 { \"detail\": \"Channel must be a WhatsApp channel\" }</code></li>\n<li><strong>Not ACTIVE (status ≠ Active)</strong> → <code>400 { \"detail\": \"Channel must be active\" }</code></li>\n</ol>\n<h4 id=\"example-request-body\">Example Request Body</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"channel_id\": 17,\n  \"name\": \"promo_spring\",\n  \"language\": \"it\",\n  \"category\": \"MARKETING\",\n  \"components\": [\n    { \"type\": \"BODY\", \"text\": \"Scopri le nostre offerte primaverili!\" }\n  ]\n}\n</code></pre>\n<h4 id=\"multi-waba-caller-pattern\">Multi-WABA Caller Pattern</h4>\n<p>For callers managing multiple WABAs, use the following two-request pattern:</p>\n<ol>\n<li><code>GET /channel/?whatsapp_business_account=&lt;waba_id&gt;</code> → pick the row whose <code>status == 3</code> (Active)</li>\n<li><code>POST /templates/</code> with <code>channel_id=&lt;picked.id&gt;</code> in the body</li>\n</ol>\n<h4 id=\"response-201-created\">Response (201 Created)</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"id\": 101,\n  \"name\": \"promo_spring\",\n  \"language\": \"it\",\n  \"category\": \"MARKETING\",\n  \"status\": \"PENDING\",\n  \"waba\": \"123456789\",\n  \"components\": [\n    { \"type\": \"BODY\", \"text\": \"Scopri le nostre offerte primaverili!\" }\n  ]\n}\n</code></pre>\n","urlObject":{"path":["api","1","templates",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"e9b7d386-57a1-485a-8420-e7f88343cefd","name":"201 Created","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"black_friday_example\",\n    \"category\": \"MARKETING\",\n    \"subcategory\": \"CLASSIC\",\n    \"templatelocalization_set\": [\n        {\n            \"language\": \"en\",\n            \"status\": 0,\n            \"header_template_component\": {\n                \"component_type\": \"header\",\n                \"parameters\": [],\n                \"format\": \"text\",\n                \"text\": \"Black Friday Special Offer!\"\n            },\n            \"body_template_component\": {\n                \"component_type\": \"body\",\n                \"parameters\": [],\n                \"format\": null,\n                \"text\": \"Hi %%FIRST_NAME%%!\\n*Don't miss out* on our exclusive Black Friday promotion!\\n\\nGet your favorite white t-shirt at a fantastic *50% off*!\\n\\nThis is a limited-time offer, so make sure to grab yours before it's gone.\\n\\n*Shop now* and elevate your wardrobe with this essential piece!\"\n            },\n            \"footer_template_component\": {\n                \"component_type\": \"footer\",\n                \"parameters\": [],\n                \"format\": null,\n                \"text\": \"MyCompany\"\n            },\n            \"templatebuttoncomponent_set\": [\n                {\n                    \"component_type\": null,\n                    \"text\": \"Shop Now\",\n                    \"order\": 0,\n                    \"button_type\": \"url\",\n                    \"phone_number\": null,\n                    \"form_id\": null,\n                    \"url\": \"https://myshop.com/my-product?coupon=MYCOUPON\",\n                    \"send_as_shortlink\": true\n                },\n                {\n                    \"component_type\": null,\n                    \"text\": \"Unsubscribe\",\n                    \"order\": 1,\n                    \"button_type\": \"unsubscribe\",\n                    \"phone_number\": null,\n                    \"form_id\": null,\n                    \"url\": null,\n                    \"send_as_shortlink\": null\n                }\n            ],\n            \"example_custom_fields\": {\n                \"FIRST_NAME\": \"John\"\n            },\n            \"example_header_media\": null,\n            \"default_header_media\": null,\n            \"templatecarouselcomponent_set\": null\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/templates/"},"status":"Created","code":201,"_postman_previewlanguage":null,"header":[{"key":"Server","value":"nginx/1.29.3"},{"key":"Date","value":"Mon, 10 Nov 2025 11:20:58 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"1304"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 123456789,\n    \"name\": \"black_friday_example\",\n    \"category\": \"MARKETING\",\n    \"subcategory\": \"CLASSIC\",\n    \"is_approved\": false,\n    \"is_favorite\": false,\n    \"customfield_set\": [\n        \"%%FIRST_NAME%%\"\n    ],\n    \"templatelocalization_set\": [\n        {\n            \"id\": 12121212,\n            \"language\": \"en\",\n            \"status\": \"DRAFT\",\n            \"rejection_reason\": null,\n            \"default_header_media\": null,\n            \"header_template_component\": {\n                \"component_type\": \"header\",\n                \"format\": \"text\",\n                \"text\": \"Black Friday Special Offer!\"\n            },\n            \"body_template_component\": {\n                \"component_type\": \"body\",\n                \"format\": null,\n                \"text\": \"Hi %%FIRST_NAME%%!\\n*Don't miss out* on our exclusive Black Friday promotion!\\n\\nGet your favorite white t-shirt at a fantastic *50% off*!\\n\\nThis is a limited-time offer, so make sure to grab yours before it's gone.\\n\\n*Shop now* and elevate your wardrobe with this essential piece!\"\n            },\n            \"footer_template_component\": {\n                \"component_type\": \"footer\",\n                \"format\": null,\n                \"text\": \"MyCompany\"\n            },\n            \"templatebuttoncomponent_set\": [\n                {\n                    \"order\": 0,\n                    \"button_type\": \"url\",\n                    \"text\": \"Shop Now\",\n                    \"phone_number\": null,\n                    \"url\": \"https://myshop.com/my-product?coupon=MYCOUPON\",\n                    \"form_id\": null,\n                    \"send_as_shortlink\": true,\n                    \"shortlink_code\": \"k6OvHQjOb4i1\"\n                },\n                {\n                    \"order\": 1,\n                    \"button_type\": \"unsubscribe\",\n                    \"text\": \"Unsubscribe\",\n                    \"phone_number\": null,\n                    \"url\": null,\n                    \"form_id\": null,\n                    \"send_as_shortlink\": false,\n                    \"shortlink_code\": null\n                }\n            ],\n            \"templatecarouselcomponent_set\": []\n        }\n    ],\n    \"template_groups\": []\n}"}],"_postman_id":"32a93c88-68c0-41bf-9efa-77a4c225305f"},{"name":"Clone template","id":"51c7104a-6629-4da8-94ab-0332fae34590","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/templates/{{id}}/clone/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n<h2 id=\"overview\">Overview</h2>\n<p>Create a duplicate copy of an existing template. The clone is independent and starts in DRAFT status, allowing you to modify it without affecting the original.</p>\n<h2 id=\"what-gets-cloned\">What Gets Cloned</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Element</th>\n<th>Cloned?</th>\n<th>Notes</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>✅ Template name</td>\n<td>Yes</td>\n<td>Appended with _1, _2, etc.</td>\n</tr>\n<tr>\n<td>✅ Category</td>\n<td>Yes</td>\n<td>Exact copy</td>\n</tr>\n<tr>\n<td>✅ Subcategory</td>\n<td>Yes</td>\n<td>Exact copy</td>\n</tr>\n<tr>\n<td>✅ All localizations</td>\n<td>Yes</td>\n<td>All languages copied</td>\n</tr>\n<tr>\n<td>✅ Components</td>\n<td>Yes</td>\n<td>Header, body, footer</td>\n</tr>\n<tr>\n<td>✅ Buttons</td>\n<td>Yes</td>\n<td>All button configurations</td>\n</tr>\n<tr>\n<td>✅ Carousel cards</td>\n<td>Yes</td>\n<td>All cards if carousel template</td>\n</tr>\n<tr>\n<td>✅ Custom fields</td>\n<td>Yes</td>\n<td>All variables preserved</td>\n</tr>\n<tr>\n<td>✅ Media references</td>\n<td>Yes</td>\n<td>Same media IDs</td>\n</tr>\n<tr>\n<td>❌ Template ID</td>\n<td>No</td>\n<td>New ID assigned</td>\n</tr>\n<tr>\n<td>❌ Approval status</td>\n<td>No</td>\n<td>Starts as DRAFT</td>\n</tr>\n<tr>\n<td>❌ Provider ID</td>\n<td>No</td>\n<td>Starts as null</td>\n</tr>\n<tr>\n<td>❌ Template groups</td>\n<td>No</td>\n<td>Not copied</td>\n</tr>\n<tr>\n<td>❌ Favorite status</td>\n<td>No</td>\n<td>Defaults to false</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h2 id=\"whats-different\">What's Different</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Original Template</th>\n<th>Cloned Template</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>id: 12345</td>\n<td>id: 67890 (new)</td>\n</tr>\n<tr>\n<td>name: \"order_confirmation\"</td>\n<td>name: \"order_confirmation_1\"</td>\n</tr>\n<tr>\n<td>is_approved: true</td>\n<td>is_approved: false</td>\n</tr>\n<tr>\n<td>status: APPROVED</td>\n<td>status: DRAFT</td>\n</tr>\n<tr>\n<td>template_groups: [1, 5]</td>\n<td>template_groups: []</td>\n</tr>\n<tr>\n<td>is_favorite: true</td>\n<td>is_favorite: false</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h2 id=\"when-to-use-clone\">When to Use Clone</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Scenario</th>\n<th>Use Clone?</th>\n<th>Why</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Create template variation</td>\n<td>✅ Yes</td>\n<td>Safe A/B testing</td>\n</tr>\n<tr>\n<td>Update production template</td>\n<td>✅ Yes</td>\n<td>Maintain uptime</td>\n</tr>\n<tr>\n<td>Test content changes</td>\n<td>✅ Yes</td>\n<td>Original stays live</td>\n</tr>\n<tr>\n<td>Multi-language rollout</td>\n<td>✅ Yes</td>\n<td>Test per language</td>\n</tr>\n<tr>\n<td>Seasonal versions</td>\n<td>✅ Yes</td>\n<td>Holiday vs regular</td>\n</tr>\n<tr>\n<td>Fix rejected template</td>\n<td>❌ No</td>\n<td>Use back_to_draft</td>\n</tr>\n<tr>\n<td>Quick typo fix</td>\n<td>⚠️ Maybe</td>\n<td>Consider back_to_draft</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h2 id=\"clone-vs-back-to-draft\">Clone vs Back to Draft</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Aspect</th>\n<th>Clone</th>\n<th>Back to Draft</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Original template</td>\n<td>Unchanged</td>\n<td>Reverted to DRAFT</td>\n</tr>\n<tr>\n<td>New template</td>\n<td>Created</td>\n<td>None</td>\n</tr>\n<tr>\n<td>Original availability</td>\n<td>✅ Stays active</td>\n<td>❌ Becomes unavailable</td>\n</tr>\n<tr>\n<td>Downtime</td>\n<td>❌ None</td>\n<td>✅ 1-3 days</td>\n</tr>\n<tr>\n<td>Use case</td>\n<td>Production updates</td>\n<td>Quick fixes</td>\n</tr>\n<tr>\n<td>Template ID</td>\n<td>New ID</td>\n<td>Same ID</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h2 id=\"comparison-table\">Comparison Table</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Operation</th>\n<th>Clone</th>\n<th>Back to Draft</th>\n<th>PATCH</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Creates new template</td>\n<td>✅ Yes</td>\n<td>❌ No</td>\n<td>❌ No</td>\n</tr>\n<tr>\n<td>Preserves original</td>\n<td>✅ Yes</td>\n<td>❌ No</td>\n<td>✅ Yes</td>\n</tr>\n<tr>\n<td>Causes downtime</td>\n<td>❌ No</td>\n<td>✅ Yes</td>\n<td>Depends</td>\n</tr>\n<tr>\n<td>New ID</td>\n<td>✅ Yes</td>\n<td>❌ No</td>\n<td>❌ No</td>\n</tr>\n<tr>\n<td>Requires approval</td>\n<td>✅ Yes</td>\n<td>✅ Yes (if content changed)</td>\n<td>Depends</td>\n</tr>\n<tr>\n<td>Best for production</td>\n<td>✅ Yes</td>\n<td>⚠️ Risky</td>\n<td>⚠️ Depends</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n","urlObject":{"path":["api","1","templates","{{id}}","clone",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"2a12702b-cb2f-4665-b092-b3a58c5c9eaa","name":"201 Created","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/templates/{{id}}/clone/"},"status":"Created","code":201,"_postman_previewlanguage":null,"header":[{"key":"Server","value":"nginx/1.29.3"},{"key":"Date","value":"Mon, 10 Nov 2025 11:58:30 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"1306"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 123456789,\n    \"name\": \"black_friday_example_1\",\n    \"category\": \"MARKETING\",\n    \"subcategory\": \"CLASSIC\",\n    \"integration\": -1,\n    \"is_approved\": false,\n    \"is_favorite\": false,\n    \"customfield_set\": [\n        \"%%FIRST_NAME%%\"\n    ],\n    \"templatelocalization_set\": [\n        {\n            \"id\": 121212,\n            \"language\": \"en\",\n            \"status\": \"DRAFT\",\n            \"rejection_reason\": null,\n            \"default_header_media\": null,\n            \"header_template_component\": {\n                \"component_type\": \"header\",\n                \"format\": \"text\",\n                \"text\": \"Black Friday Special Offer!\"\n            },\n            \"body_template_component\": {\n                \"component_type\": \"body\",\n                \"format\": null,\n                \"text\": \"Hi %%FIRST_NAME%%!\\n*Don't miss out* on our exclusive Black Friday promotion!\\n\\nGet your favorite white t-shirt at a fantastic *50% off*!\\n\\nThis is a limited-time offer, so make sure to grab yours before it's gone.\\n\\n*Shop now* and elevate your wardrobe with this essential piece.\"\n            },\n            \"footer_template_component\": {\n                \"component_type\": \"footer\",\n                \"format\": null,\n                \"text\": \"MyCompany\"\n            },\n            \"templatebuttoncomponent_set\": [\n                {\n                    \"order\": 0,\n                    \"button_type\": \"url\",\n                    \"text\": \"Shop Now\",\n                    \"phone_number\": null,\n                    \"url\": \"https://myshop.com/my-product?coupon=MYCOUPON\",\n                    \"form_id\": null,\n                    \"send_as_shortlink\": true,\n                    \"shortlink_code\": \"k6OvHQjOb4i1\"\n                },\n                {\n                    \"order\": 1,\n                    \"button_type\": \"unsubscribe\",\n                    \"text\": \"Unsubscribe\",\n                    \"phone_number\": null,\n                    \"url\": null,\n                    \"form_id\": null,\n                    \"send_as_shortlink\": false,\n                    \"shortlink_code\": null\n                }\n            ],\n            \"templatecarouselcomponent_set\": []\n        }\n    ],\n    \"template_groups\": []\n}"}],"_postman_id":"51c7104a-6629-4da8-94ab-0332fae34590"},{"name":"Update template","id":"e8653467-6e21-4054-a1a4-74a01da1ca63","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PATCH","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"black_friday_example\",\n    \"category\": \"MARKETING\",\n    \"subcategory\": \"CLASSIC\",\n    \"template_groups\": [],\n    \"templatelocalization_set\": [\n        {\n            \"id\": 12121212,\n            \"language\": \"en\",\n            \"status\": 0,\n            \"header_template_component\": {\n                \"component_type\": \"header\",\n                \"parameters\": [],\n                \"format\": \"text\",\n                \"text\": \"Black Friday Special Offer!\"\n            },\n            \"body_template_component\": {\n                \"component_type\": \"body\",\n                \"parameters\": [],\n                \"format\": null,\n                \"text\": \"Hi %%FIRST_NAME%%!\\n*Don't miss out* on our exclusive Black Friday promotion!\\n\\nGet your favorite white t-shirt at a fantastic *50% off*!\\n\\nThis is a limited-time offer, so make sure to grab yours before it's gone.\\n\\n*Shop now* and elevate your wardrobe with this essential piece.\"\n            },\n            \"footer_template_component\": {\n                \"component_type\": \"footer\",\n                \"parameters\": [],\n                \"format\": null,\n                \"text\": \"MyCompany\"\n            },\n            \"templatebuttoncomponent_set\": [\n                {\n                    \"component_type\": null,\n                    \"text\": \"Shop Now\",\n                    \"order\": 0,\n                    \"button_type\": \"url\",\n                    \"phone_number\": null,\n                    \"form_id\": null,\n                    \"url\": \"https://myshop.com/my-product?coupon=MYCOUPON\",\n                    \"send_as_shortlink\": true\n                },\n                {\n                    \"component_type\": null,\n                    \"text\": \"Unsubscribe\",\n                    \"order\": 1,\n                    \"button_type\": \"unsubscribe\",\n                    \"phone_number\": null,\n                    \"form_id\": null,\n                    \"url\": null,\n                    \"send_as_shortlink\": null\n                }\n            ],\n            \"example_custom_fields\": {\n                \"FIRST_NAME\": \"John\"\n            },\n            \"example_header_media\": null,\n            \"default_header_media\": null,\n            \"templatecarouselcomponent_set\": []\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/templates/{{id}}/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n<h2 id=\"overview\">Overview</h2>\n<p>Update an existing WhatsApp template. The PATCH endpoint follows the same structure as POST but allows partial updates and modifies an existing template instead of creating a new one.</p>\n","urlObject":{"path":["api","1","templates","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"5298c69b-1959-4527-af40-9f47c82367f5","name":"200 OK","originalRequest":{"method":"PATCH","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"black_friday_example\",\n    \"category\": \"MARKETING\",\n    \"subcategory\": \"CLASSIC\",\n    \"template_groups\": [],\n    \"templatelocalization_set\": [\n        {\n            \"id\": 12121212,\n            \"language\": \"en\",\n            \"status\": 0,\n            \"header_template_component\": {\n                \"component_type\": \"header\",\n                \"parameters\": [],\n                \"format\": \"text\",\n                \"text\": \"Black Friday Special Offer!\"\n            },\n            \"body_template_component\": {\n                \"component_type\": \"body\",\n                \"parameters\": [],\n                \"format\": null,\n                \"text\": \"Hi %%FIRST_NAME%%!\\n*Don't miss out* on our exclusive Black Friday promotion!\\n\\nGet your favorite white t-shirt at a fantastic *50% off*!\\n\\nThis is a limited-time offer, so make sure to grab yours before it's gone.\\n\\n*Shop now* and elevate your wardrobe with this essential piece.\"\n            },\n            \"footer_template_component\": {\n                \"component_type\": \"footer\",\n                \"parameters\": [],\n                \"format\": null,\n                \"text\": \"MyCompany\"\n            },\n            \"templatebuttoncomponent_set\": [\n                {\n                    \"component_type\": null,\n                    \"text\": \"Shop Now\",\n                    \"order\": 0,\n                    \"button_type\": \"url\",\n                    \"phone_number\": null,\n                    \"form_id\": null,\n                    \"url\": \"https://myshop.com/my-product?coupon=MYCOUPON\",\n                    \"send_as_shortlink\": true\n                },\n                {\n                    \"component_type\": null,\n                    \"text\": \"Unsubscribe\",\n                    \"order\": 1,\n                    \"button_type\": \"unsubscribe\",\n                    \"phone_number\": null,\n                    \"form_id\": null,\n                    \"url\": null,\n                    \"send_as_shortlink\": null\n                }\n            ],\n            \"example_custom_fields\": {\n                \"FIRST_NAME\": \"John\"\n            },\n            \"example_header_media\": null,\n            \"default_header_media\": null,\n            \"templatecarouselcomponent_set\": []\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/templates/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Server","value":"nginx/1.29.3"},{"key":"Date","value":"Mon, 10 Nov 2025 11:28:46 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"1304"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 2449,\n    \"name\": \"black_friday_example\",\n    \"category\": \"MARKETING\",\n    \"subcategory\": \"CLASSIC\",\n    \"integration\": -1,\n    \"is_approved\": false,\n    \"is_favorite\": false,\n    \"customfield_set\": [\n        \"%%FIRST_NAME%%\"\n    ],\n    \"templatelocalization_set\": [\n        {\n            \"id\": 3252,\n            \"language\": \"en\",\n            \"status\": \"DRAFT\",\n            \"rejection_reason\": null,\n            \"default_header_media\": null,\n            \"header_template_component\": {\n                \"component_type\": \"header\",\n                \"format\": \"text\",\n                \"text\": \"Black Friday Special Offer!\"\n            },\n            \"body_template_component\": {\n                \"component_type\": \"body\",\n                \"format\": null,\n                \"text\": \"Hi %%FIRST_NAME%%!\\n*Don't miss out* on our exclusive Black Friday promotion!\\n\\nGet your favorite white t-shirt at a fantastic *50% off*!\\n\\nThis is a limited-time offer, so make sure to grab yours before it's gone.\\n\\n*Shop now* and elevate your wardrobe with this essential piece.\"\n            },\n            \"footer_template_component\": {\n                \"component_type\": \"footer\",\n                \"format\": null,\n                \"text\": \"MyCompany\"\n            },\n            \"templatebuttoncomponent_set\": [\n                {\n                    \"order\": 0,\n                    \"button_type\": \"url\",\n                    \"text\": \"Shop Now\",\n                    \"phone_number\": null,\n                    \"url\": \"https://myshop.com/my-product?coupon=MYCOUPON\",\n                    \"form_id\": null,\n                    \"send_as_shortlink\": true,\n                    \"shortlink_code\": \"k6OvHQjOb4i1\"\n                },\n                {\n                    \"order\": 1,\n                    \"button_type\": \"unsubscribe\",\n                    \"text\": \"Unsubscribe\",\n                    \"phone_number\": null,\n                    \"url\": null,\n                    \"form_id\": null,\n                    \"send_as_shortlink\": false,\n                    \"shortlink_code\": null\n                }\n            ],\n            \"templatecarouselcomponent_set\": []\n        }\n    ],\n    \"template_groups\": []\n}"}],"_postman_id":"e8653467-6e21-4054-a1a4-74a01da1ca63"},{"name":"Request template","id":"7ed3aa26-2a0e-49f5-8377-96934ad525c8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/templates/{{id}}/submit/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n<h2 id=\"overview\">Overview</h2>\n<p>Submit a template to WhatsApp for review and approval. This endpoint sends your template to WhatsApp's servers where it will be reviewed according to their messaging policies. Templates must be approved before they can be used to send messages.</p>\n<h2 id=\"how-it-works\">How It Works</h2>\n<h3 id=\"submission-flow\">Submission Flow</h3>\n<ol>\n<li><p>Template Created (Status: DRAFT) ↓</p>\n</li>\n<li><p>POST /templates/{id}/submit/ ↓</p>\n</li>\n<li><p>Spoki validates template ↓</p>\n</li>\n<li><p>Sent to WhatsApp provider ↓</p>\n</li>\n<li><p>WhatsApp reviews template (24-48 hours typically) ↓</p>\n</li>\n<li><p>Template Status: PENDING → APPROVED or REJECTED</p>\n</li>\n</ol>\n<h3 id=\"what-happens-when-you-submit\">What Happens When You Submit</h3>\n<p>First-time submission (template has no twilio_id):</p>\n<ol>\n<li><p>Validates that your account has a WhatsApp API provider configured</p>\n</li>\n<li><p>Sends the entire template with all localizations to your provider</p>\n</li>\n<li><p>Provider forwards to WhatsApp for review</p>\n</li>\n<li><p>Template receives a provider ID from WhatsApp</p>\n</li>\n<li><p>All localizations change from DRAFT to PENDING status</p>\n</li>\n</ol>\n<p>Subsequent submissions (template already has twilio_id):</p>\n<ol>\n<li><p>Only sends localizations with status DRAFT to provider</p>\n</li>\n<li><p>Existing approved localizations remain unchanged</p>\n</li>\n<li><p>New or modified localizations enter review</p>\n</li>\n<li><p>Useful for adding new languages without affecting approved ones</p>\n</li>\n</ol>\n<hr />\n<h2 id=\"prerequisites\">Prerequisites</h2>\n<h3 id=\"before-you-submit\">Before You Submit</h3>\n<p>✅ Required:</p>\n<ol>\n<li><p>WhatsApp API Provider configured - Your account must have a WhatsApp Business API provider set up</p>\n</li>\n<li><p>Template in DRAFT status - Template or its localizations must be in DRAFT state</p>\n</li>\n<li><p>Valid template structure - All required fields properly filled</p>\n</li>\n<li><p>Category selected - Valid WhatsApp category assigned</p>\n</li>\n<li><p>At least one localization - Template must have content in at least one language</p>\n</li>\n<li><p>Example custom fields provided - Helps WhatsApp reviewers understand your template</p>\n</li>\n</ol>\n<p>⚠️ Recommended:</p>\n<ol>\n<li><p>Clear, policy-compliant content - Follow WhatsApp's messaging policies</p>\n</li>\n<li><p>Proper button configuration - All buttons work and URLs are valid</p>\n</li>\n</ol>\n<h3 id=\"error-responses\">Error Responses</h3>\n<h4 id=\"400-bad-request---no-whatsapp-provider\">400 Bad Request - No WhatsApp Provider</h4>\n<p>{ \"code\": \"PREREQUISITE_NOT_MET\", \"message\": \"Prerequisites not met\", \"detail\": \"WhatsApp API Provider is not set for the account\"}</p>\n<p>Cause: Your account doesn't have a WhatsApp Business API provider configuredSolution:</p>\n<ol>\n<li><p>Configure a WhatsApp provider in your account settings</p>\n</li>\n<li><p>Contact Spoki support to set up WhatsApp Business API</p>\n</li>\n<li><p>Verify your WhatsApp Business Account is active</p>\n</li>\n</ol>\n<hr />\n<h4 id=\"400-bad-request---provider-submission-failed\">400 Bad Request - Provider Submission Failed</h4>\n<p>{ \"error\": \"Template name already exists\"}  </p>\n<p>Common error messages:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error</th>\n<th>Cause</th>\n<th>Solution</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>\"Template name already exists\"</td>\n<td>Template with this name already exists at WhatsApp</td>\n<td>Change template name to something unique</td>\n</tr>\n<tr>\n<td>\"Invalid template format\"</td>\n<td>Template structure doesn't meet WhatsApp requirements</td>\n<td>Review and fix template structure</td>\n</tr>\n<tr>\n<td>\"Invalid category\"</td>\n<td>Category not accepted by provider</td>\n<td>Use valid category (TRANSACTIONAL, MARKETING, OTP)</td>\n</tr>\n<tr>\n<td>\"Missing required fields\"</td>\n<td>Template missing required components</td>\n<td>Add all required fields (at least body)</td>\n</tr>\n<tr>\n<td>\"Invalid button configuration\"</td>\n<td>Button setup violates WhatsApp rules</td>\n<td>Fix button types, counts, or URLs</td>\n</tr>\n<tr>\n<td>\"Media not found\"</td>\n<td>Header media doesn't exist</td>\n<td>Upload media before submitting</td>\n</tr>\n<tr>\n<td>\"Provider API error\"</td>\n<td>Issue communicating with WhatsApp provider</td>\n<td>Retry submission, contact support if persists</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h4 id=\"404-not-found\">404 Not Found</h4>\n<p>{ \"detail\": \"Not found.\"}</p>\n<p>Cause: Template ID doesn't exist or doesn't belong to your account</p>\n<p>Solution: Verify template ID is correct and belongs to your account</p>\n<hr />\n<h4 id=\"401-unauthorized\">401 Unauthorized</h4>\n<p>{ \"code\": \"INVALID_REQUEST_HEADER\", \"message\": \"Invalid or missing API key\"}</p>\n<p>Cause: Missing or invalid API key</p>\n<p>Solution: Include valid API key in X-Api-Key header</p>\n<hr />\n<h2 id=\"template-status-lifecycle\">Template Status Lifecycle</h2>\n<h3 id=\"status-flow\">Status Flow</h3>\n<p>DRAFT → [submit] → PENDING/WAITING_FOR_REVIEW → [WhatsApp reviews] → APPROVED ✅ or REJECTED ❌</p>\n<h3 id=\"status-reference\">Status Reference</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th>Code</th>\n<th>Description</th>\n<th>Actions Available</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>DRAFT</td>\n<td>0</td>\n<td>Not submitted yet</td>\n<td>Submit, Edit, Delete</td>\n</tr>\n<tr>\n<td>PENDING</td>\n<td>1</td>\n<td>In provider queue</td>\n<td>View only</td>\n</tr>\n<tr>\n<td>WAITING_FOR_REVIEW</td>\n<td>2</td>\n<td>WhatsApp reviewing</td>\n<td>View only</td>\n</tr>\n<tr>\n<td>APPROVED</td>\n<td>3</td>\n<td>Ready to use ✅</td>\n<td>Send messages, Clone, Revert to draft</td>\n</tr>\n<tr>\n<td>REJECTED</td>\n<td>4</td>\n<td>Not approved ❌</td>\n<td>View reason, Revert to draft, Fix &amp; resubmit</td>\n</tr>\n<tr>\n<td>PAUSED</td>\n<td>9</td>\n<td>Temporarily paused</td>\n<td>Contact support</td>\n</tr>\n<tr>\n<td>FLAGGED</td>\n<td>11</td>\n<td>Under review</td>\n<td>Limited use</td>\n</tr>\n<tr>\n<td>DISABLED</td>\n<td>14</td>\n<td>Deactivated</td>\n<td>Contact support</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"can-i-submit\">Can I Submit?</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th>Submit Allowed?</th>\n<th>Notes</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>DRAFT</td>\n<td>✅ Yes</td>\n<td>Primary submission</td>\n</tr>\n<tr>\n<td>PENDING</td>\n<td>❌ No</td>\n<td>Already submitted</td>\n</tr>\n<tr>\n<td>WAITING_FOR_REVIEW</td>\n<td>❌ No</td>\n<td>Under review</td>\n</tr>\n<tr>\n<td>APPROVED</td>\n<td>❌ No</td>\n<td>Must revert to draft first</td>\n</tr>\n<tr>\n<td>REJECTED</td>\n<td>❌ No</td>\n<td>Must revert to draft first</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"can-i-use-for-messaging\">Can I Use for Messaging?</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th>Send Messages?</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>DRAFT</td>\n<td>❌ No</td>\n</tr>\n<tr>\n<td>PENDING</td>\n<td>❌ No</td>\n</tr>\n<tr>\n<td>WAITING_FOR_REVIEW</td>\n<td>❌ No</td>\n</tr>\n<tr>\n<td>APPROVED</td>\n<td>✅ Yes</td>\n</tr>\n<tr>\n<td>REJECTED</td>\n<td>❌ No</td>\n</tr>\n<tr>\n<td>PAUSED</td>\n<td>❌ No</td>\n</tr>\n<tr>\n<td>FLAGGED</td>\n<td>⚠️ Limited</td>\n</tr>\n<tr>\n<td>DISABLED</td>\n<td>❌ No</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","templates","{{id}}","submit",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"360054b9-e27f-4f59-81a0-315ea127f3d6","name":"204 No Content","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/templates/{{id}}/submit/"},"status":"No Content","code":204,"_postman_previewlanguage":null,"header":[{"key":"Server","value":"nginx/1.29.3"},{"key":"Date","value":"Mon, 10 Nov 2025 11:43:57 GMT"},{"key":"Content-Length","value":"0"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"POST, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"7ed3aa26-2a0e-49f5-8377-96934ad525c8"},{"name":"Back template to Draft","id":"9a75230f-13d5-4b05-b0fc-aad32088e327","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/templates/{{id}}/back_to_draft/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n<h2 id=\"overview\">Overview</h2>\n<p>Revert a template back to DRAFT status, removing it from WhatsApp's servers. This allows you to modify an approved or rejected template before resubmitting.</p>\n<h2 id=\"what-it-does\">What It Does</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Action</th>\n<th>Result</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Deletes from WhatsApp provider</td>\n<td>Template removed from Provider</td>\n</tr>\n<tr>\n<td>Clears twilio_id</td>\n<td>Set to null</td>\n</tr>\n<tr>\n<td>Resets is_approved</td>\n<td>Set to false</td>\n</tr>\n<tr>\n<td>Clears rejection_reason</td>\n<td>Set to null</td>\n</tr>\n<tr>\n<td>Sets status</td>\n<td>All localizations to DRAFT (0)</td>\n</tr>\n</tbody>\n</table>\n</div><p>After reverting:</p>\n<ul>\n<li><p>✅ Can edit template</p>\n</li>\n<li><p>✅ Can resubmit</p>\n</li>\n<li><p>❌ Cannot send messages</p>\n</li>\n<li><p>⚠️ Template unavailable until reapproved</p>\n</li>\n</ul>\n<hr />\n<h2 id=\"when-to-use\">When to Use</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Scenario</th>\n<th>Use back_to_draft?</th>\n<th>Alternative</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Fix rejected template</td>\n<td>✅ Yes</td>\n<td>-</td>\n</tr>\n<tr>\n<td>Update approved template content</td>\n<td>✅ Yes</td>\n<td>Clone if actively used</td>\n</tr>\n<tr>\n<td>Change body/buttons/media</td>\n<td>✅ Yes</td>\n<td>Clone if actively used</td>\n</tr>\n<tr>\n<td>Add custom fields</td>\n<td>✅ Yes</td>\n<td>Clone if actively used</td>\n</tr>\n<tr>\n<td>Update name/groups only</td>\n<td>❌ No</td>\n<td>PATCH directly</td>\n</tr>\n<tr>\n<td>Create variation</td>\n<td>❌ No</td>\n<td>Clone instead</td>\n</tr>\n<tr>\n<td>Template actively sending</td>\n<td>❌ No</td>\n<td>Clone instead</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h2 id=\"status-changes\">Status Changes</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Before</th>\n<th>After</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>status</td>\n<td>APPROVED/REJECTED/PENDING</td>\n<td>DRAFT (0)</td>\n</tr>\n<tr>\n<td>is_approved</td>\n<td>true/false</td>\n<td>false</td>\n</tr>\n<tr>\n<td>rejection_reason</td>\n<td>Any</td>\n<td>null</td>\n</tr>\n<tr>\n<td>Localization status</td>\n<td>Any</td>\n<td>DRAFT (0)</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h2 id=\"important-considerations\">Important Considerations</h2>\n<h3 id=\"⚠️-impact\">⚠️ Impact</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Impact Area</th>\n<th>Effect</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Active automations</td>\n<td>May fail if template unavailable</td>\n</tr>\n<tr>\n<td>Scheduled campaigns</td>\n<td>Will fail to send</td>\n</tr>\n<tr>\n<td>Live messaging</td>\n<td>Immediately unavailable</td>\n</tr>\n<tr>\n<td>Past messages</td>\n<td>Unaffected</td>\n</tr>\n<tr>\n<td>Downtime</td>\n<td>1-3 days (includes re-approval time)</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"clone-vs-revert\">Clone vs Revert</h3>\n<p>Use Clone when:</p>\n<ul>\n<li><p>Template is actively used in campaigns</p>\n</li>\n<li><p>Need to maintain uptime</p>\n</li>\n<li><p>Testing variations</p>\n</li>\n</ul>\n<p>Use Revert when:</p>\n<ul>\n<li><p>Fixing rejected template</p>\n</li>\n<li><p>Template not actively used</p>\n</li>\n<li><p>Major content overhaul needed</p>\n</li>\n</ul>\n<hr />\n<h2 id=\"best-practices\">Best Practices</h2>\n<ol>\n<li><p>Check usage first - Verify template isn't in active campaigns</p>\n</li>\n<li><p>Plan for downtime - 24-48 hours re-approval time</p>\n</li>\n<li><p>Batch all changes - Make all edits before resubmitting</p>\n</li>\n<li><p>Clone if active - Use clone for production templates</p>\n</li>\n<li><p>Verify before reverting - Double-check template ID</p>\n</li>\n</ol>\n<hr />\n<h2 id=\"checklist-before-reverting\">Checklist Before Reverting</h2>\n<ul>\n<li><p>[ ] Template is not used in active automations</p>\n</li>\n<li><p>[ ] Not used in scheduled campaigns</p>\n</li>\n<li><p>[ ] Have all changes ready to apply</p>\n</li>\n<li><p>[ ] Team notified of downtime</p>\n</li>\n<li><p>[ ] Considered cloning instead</p>\n</li>\n</ul>\n","urlObject":{"path":["api","1","templates","{{id}}","back_to_draft",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"276a4901-3301-4b73-9343-c5b9a51f1021","name":"200 OK","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/templates/{{id}}/back_to_draft/"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Server","value":"nginx/1.29.3"},{"key":"Date","value":"Mon, 10 Nov 2025 11:53:20 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"15"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"POST, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"ok\"\n}"}],"_postman_id":"9a75230f-13d5-4b05-b0fc-aad32088e327"},{"name":"Retrieve template","id":"9144a679-c7c9-41e4-b322-61f48a8fffd2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/templates/{{id}}/","description":"<p>Returns a single template by its ID.</p>\n<p>Templates are matched by <code>Template.waba == channel.client_id</code>. The optional <code>channel_id</code> query parameter can be used to assert that the template belongs to a specific channel — useful when managing multiple WABAs.</p>\n<h4 id=\"path-parameters\">Path Parameters</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>id</code></td>\n<td>number</td>\n<td>Yes</td>\n<td>The unique identifier of the template to retrieve.</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"query-parameters\">Query Parameters</h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>channel_id</code></td>\n<td>number</td>\n<td>No</td>\n<td>Assert that the template's <code>waba</code> matches the given channel's <code>client_id</code>. The channel is validated before the lookup — see error responses below.</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"channel_id-validation\">channel_id Validation</h4>\n<p>When <code>channel_id</code> is provided, the following checks are applied in order:</p>\n<ol>\n<li><strong>Non-numeric or cross-tenant</strong> → <code>404 { \"code\": \"spoki::404\", \"detail\": \"Channel not found\" }</code></li>\n<li><strong>Not a WhatsApp channel</strong> → <code>400 { \"detail\": \"Channel must be a WhatsApp channel\" }</code></li>\n<li><strong>Not ACTIVE (status ≠ Active)</strong> → <code>400 { \"detail\": \"Channel must be active\" }</code></li>\n</ol>\n<h4 id=\"example-requests\">Example Requests</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /api/1/templates/101/\n→ 200  single template object\n\nGET /api/1/templates/101/?channel_id=17\n→ 200  template scoped to channel 17's WABA\n\nGET /api/1/templates/101/?channel_id=7   (cross-tenant)\n→ 404  { \"code\": \"spoki::404\", \"detail\": \"Channel not found\" }\n</code></pre><h4 id=\"multi-waba-caller-pattern\">Multi-WABA Caller Pattern</h4>\n<p>For callers managing multiple WABAs, use the following two-request pattern:</p>\n<ol>\n<li><code>GET /channel/?whatsapp_business_account=&lt;waba_id&gt;</code> → pick the row whose <code>status == 3</code> (Active)</li>\n<li><code>GET /templates/&lt;id&gt;/?channel_id=&lt;picked.id&gt;</code></li>\n</ol>\n<h4 id=\"response-200-ok\">Response (200 OK)</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"id\": 101,\n  \"name\": \"promo_spring\",\n  \"language\": \"it\",\n  \"category\": \"MARKETING\",\n  \"status\": \"APPROVED\",\n  \"waba\": \"123456789\",\n  \"components\": [\n    { \"type\": \"BODY\", \"text\": \"Scopri le nostre offerte primaverili!\" }\n  ]\n}\n</code></pre>\n","urlObject":{"path":["api","1","templates","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"7e6a394c-7382-499c-8928-62e28386318b","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/templates/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Thu, 01 Jun 2023 14:36:45 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"668"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 260,\n    \"name\": \"promo_costumi\",\n    \"category\": \"ACCOUNT_UPDATE\",\n    \"is_approved\": true,\n    \"is_favorite\": false,\n    \"customfield_set\": [],\n    \"templatelocalization_set\": [\n        {\n            \"language\": \"it\",\n            \"status\": \"APPROVED\",\n            \"rejection_reason\": null,\n            \"header\": null,\n            \"body\": {\n                \"component_type\": \"body\",\n                \"format\": \"text\",\n                \"text\": \"Ciao, abbiamo una bellissima notizia per te! 😍\\n\\nDa oggi *fino a fine mese* avrai la possibilità di acquistare *i tuoi costumi preferiti* a *metà prezzo* 🛍!\\n\\nSfoglia il catalogo e scegli il tuo modello preferito 👇\"\n            },\n            \"footer\": null,\n            \"button_set\": [\n                {\n                    \"order\": 0,\n                    \"button_type\": \"quick_reply\",\n                    \"text\": \"Guarda il Catalogo\",\n                    \"phone_number\": null,\n                    \"url\": null\n                }\n            ],\n            \"default_header_media\": null\n        }\n    ]\n}"}],"_postman_id":"9144a679-c7c9-41e4-b322-61f48a8fffd2"},{"name":"Delete template","id":"4e07eda6-93cd-44f0-bfea-5edbc6e51c32","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/templates/{{id}}/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n<h2 id=\"overview\">Overview</h2>\n<p>Delete a template from your account.</p>\n<h2 id=\"automation-protection\">Automation Protection</h2>\n<h3 id=\"delete-scenarios\">Delete Scenarios</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Scenario</th>\n<th>force_delete</th>\n<th>Result</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Not used in automations</td>\n<td>Not needed</td>\n<td>✅ Delete succeeds</td>\n</tr>\n<tr>\n<td>Used in automations</td>\n<td>false (default)</td>\n<td>❌ Blocked, returns automation list</td>\n</tr>\n<tr>\n<td>Used in automations</td>\n<td>true</td>\n<td>✅ Deletes + deactivates automation steps</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"force_deletetrue-requirements\">force_delete=true Requirements</h3>\n<ul>\n<li><p>Must have role/access in all accounts where template is used</p>\n</li>\n<li><p>Automation steps set to is_active=false</p>\n</li>\n<li><p>Automations continue but skip deleted template steps</p>\n</li>\n</ul>\n<h2 id=\"when-to-delete\">When to Delete</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Scenario</th>\n<th>Safe to Delete?</th>\n<th>Notes</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Draft/rejected templates</td>\n<td>✅ Yes</td>\n<td>No dependencies</td>\n</tr>\n<tr>\n<td>Old clones/tests</td>\n<td>✅ Yes</td>\n<td>Clean up clutter</td>\n</tr>\n<tr>\n<td>Superseded versions</td>\n<td>✅ Yes</td>\n<td>After migration complete</td>\n</tr>\n<tr>\n<td>Used in active automations</td>\n<td>⚠️ Careful</td>\n<td>Use force_delete=true</td>\n</tr>\n<tr>\n<td>Production templates</td>\n<td>❌ No</td>\n<td>Consider alternatives first</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h2 id=\"decision-flow\">Decision Flow</h2>\n<p>DELETE /templates/{id}/ ↓<br />Is template used in automations? ↓<br />NO → ✅ Delete succeeds ↓<br />YES → force_delete=true? ↓<br />NO → ❌ Returns automation list (403) ↓<br />YES → Have access to accounts? ↓<br />YES → ✅ Delete succeeds, steps deactivated ↓<br />NO → ❌ Access denied (403)</p>\n<hr />\n<h2 id=\"best-practices\">Best Practices</h2>\n<ul>\n<li><p>✅ Check template usage before deleting</p>\n</li>\n<li><p>✅ Remove from automations manually when possible</p>\n</li>\n<li><p>✅ Use force_delete only when necessary</p>\n</li>\n<li><p>✅ Keep backups (clone before deleting)</p>\n</li>\n<li><p>⚠️ Verify access to all affected accounts</p>\n</li>\n<li><p>❌ Don't force delete production templates without planning</p>\n</li>\n</ul>\n<hr />\n<h2 id=\"alternatives-to-deletion\">Alternatives to Deletion</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Instead of Delete</th>\n<th>Use</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Temporarily disable</td>\n<td>POST /templates/{id}/back_to_draft/</td>\n</tr>\n<tr>\n<td>Create new version</td>\n<td>GET /templates/{id}/clone/</td>\n</tr>\n<tr>\n<td>Update content</td>\n<td>PATCH /templates/{id}/</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n","urlObject":{"path":["api","1","templates","{{id}}",""],"host":["{{Base-URL}}"],"query":[{"disabled":true,"key":"force_delete","value":"true"}],"variable":[]}},"response":[{"id":"1eaf564e-e874-4703-9260-a4c0f9d169d6","name":"200 OK","originalRequest":{"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/templates/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Server","value":"nginx/1.29.3"},{"key":"Date","value":"Mon, 10 Nov 2025 11:59:59 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"16"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"\"delete success\""}],"_postman_id":"4e07eda6-93cd-44f0-bfea-5edbc6e51c32"}],"id":"47da0fed-b8a1-40b6-af5b-666149a5d845","_postman_id":"47da0fed-b8a1-40b6-af5b-666149a5d845","description":"","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}}},{"name":"Tickets","item":[{"name":"List, search, and filter tickets","id":"8b83183a-97d2-4a34-8281-8422e511fb52","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/tickets/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n","urlObject":{"path":["api","1","tickets",""],"host":["{{Base-URL}}"],"query":[{"disabled":true,"key":"","value":""}],"variable":[]}},"response":[{"id":"78d1417a-6491-4344-a482-23c305746913","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":{"raw":"{{Base-URL}}/api/1/tickets/","host":["{{Base-URL}}"],"path":["api","1","tickets",""],"query":[{"key":"","value":"","disabled":true}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:29:14 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=2354.089000000158;desc=\"User CPU time\", TimerPanel_stime;dur=287.75900000005095;desc=\"System CPU time\", TimerPanel_total;dur=2641.848000000209;desc=\"Total CPU time\", TimerPanel_total_time;dur=2610.058069229126;desc=\"Elapsed time\", SQLPanel_sql_time;dur=14.770984649658203;desc=\"SQL 19 queries\", CachePanel_total_time;dur=2.125263214111328;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"3943"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 1,\n    \"next\": null,\n    \"previous\": null,\n    \"results\": [\n        {\n            \"id\": 4121212,\n            \"contact\": {\n                \"id\": 42378,\n                \"first_name\": \"John\",\n                \"last_name\": \"Doe\",\n                \"phone\": \"+3933312345678\",\n                \"email\": \"john.doe@domain.com\",\n                \"has_invalid_phone\": false,\n                \"language\": \"it\",\n                \"chat_link\": \"https://spoki.app/chats/4c436818nfa44d3f88f7bf05577531pq\",\n                \"role_set\": [\n                    {\n                        \"id\": 77234,\n                        \"user\": {\n                            \"id\": 62336,\n                            \"email\": \"mario.rossi@domain.com\",\n                            \"uid\": \"zqmN340exPVokfOlvTQq9CRP2R02\",\n                            \"firstname\": \"Mario\",\n                            \"surname\": \"Rossi\",\n                            \"image\": \"http://localhost:8000/media/users/e8b97413-aah8-4755-b341-d6537ff8bd65.jpg\",\n                            \"is_service\": false\n                        },\n                        \"role\": \"Owner\"\n                    }\n                ]\n            },\n            \"title\": \"My ticket\",\n            \"description\": \"Lorem *ipsum* dolor\",\n            \"reference\": \"custom_ref\",\n            \"status\": \"Open\",\n            \"priority\": \"Medium\",\n            \"owner\": {\n                \"id\": 62336,\n                \"email\": \"mario.rossi@domain.com\",\n                \"uid\": \"zqmN340exPVokfOlvTQq9CRP2R02\",\n                \"firstname\": \"Mario\",\n                \"surname\": \"Rossi\",\n                \"image\": \"http://localhost:8000/media/users/e8b97413-aah8-4755-b341-d6537ff8bd65.jpg\",\n                \"is_service\": false\n            },\n            \"created_datetime\": \"2023-08-28T14:27:55.686774+02:00\",\n            \"updated_datetime\": \"2023-08-28T14:28:39.877141+02:00\",\n            \"closed_datetime\": null\n        }\n    ]\n}"}],"_postman_id":"8b83183a-97d2-4a34-8281-8422e511fb52"},{"name":"Create ticket","id":"4a14960d-7a4c-49a0-a051-beaca538af58","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"contact_phone\": \"{{phone}}\",\n    \"title\": \"My ticket\",\n    \"status\": \"Open\",\n    \"priority\": \"Medium\",\n    \"description\": \"Lorem *ipsum* dolor\",\n    \"reference\": \"custom_ref\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/tickets/","description":"<p><strong>Rate Limit:</strong> 120/min</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<h4 id=\"in-case-the-body-isnt-correct\">In case the body isn't correct:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"field\": [\n        \"Error description.\"\n    ]\n}\n\n</code></pre>\n<h4 id=\"in-case-the-body-is-correct-other-error-code\">In case the body is correct, other error code:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"https://app.spoki.it/errors/spoki::3004\",\n    \"title\": \"The request body is not correct\",\n    \"code\": \"spoki::3004\",\n    \"status\": 400,\n    \"datail\": \"Invalid or no title specified. Use 'title'\"\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no contact specified Use 'contact_phone'.</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no title specified. Use 'title'</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no status specified. Use 'status'</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no status specified. Use 'status'. Accepted values are OPEN, PENDING,  <br />WAITING_ON_CUSTOMER,  <br />RESOLVED,  <br />CLOSED</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no priority specified. Use 'priority'. Accepted values are LOWEST, LOW,  <br />MEDIUM,  <br />HIGH,  <br />HIGHETS</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3007</td>\n<td>Invalid request header</td>\n<td>Invalid or no account specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","tickets",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"f9d1c060-127c-4e0b-846a-84633e4be695","name":"201 Created","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"contact_phone\": \"{{phone}}\",\n    \"title\": \"My ticket\",\n    \"status\": \"Open\",\n    \"priority\": \"Medium\",\n    \"description\": \"Lorem *ipsum* dolor\",\n    \"reference\": \"custom_ref\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/tickets/"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:27:56 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=2221.6040000000703;desc=\"User CPU time\", TimerPanel_stime;dur=552.5239999999485;desc=\"System CPU time\", TimerPanel_total;dur=2774.128000000019;desc=\"Total CPU time\", TimerPanel_total_time;dur=2873.5029697418213;desc=\"Elapsed time\", SQLPanel_sql_time;dur=17.703533172607422;desc=\"SQL 14 queries\", CachePanel_total_time;dur=2.3651123046875;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"991"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 4121212,\n    \"contact\": {\n        \"id\": 42378,\n        \"first_name\": \"John\",\n        \"last_name\": \"Doe\",\n        \"phone\": \"+3933312345678\",\n        \"email\": \"john.doe@domain.com\",\n        \"has_invalid_phone\": false,\n        \"language\": \"it\",\n        \"chat_link\": \"https://spoki.app/chats/4c436818nfa44d3f88f7bf05577531pq\",\n        \"role_set\": [\n            {\n                \"id\": 77234,\n                \"user\": {\n                    \"id\": 62336,\n                    \"email\": \"mario.rossi@domain.com\",\n                    \"uid\": \"zqmN340exPVokfOlvTQq9CRP2R02\",\n                    \"firstname\": \"Mario\",\n                    \"surname\": \"Rossi\",\n                    \"image\": \"http://localhost:8000/media/users/e8b97413-aah8-4755-b341-d6537ff8bd65.jpg\",\n                    \"is_service\": false\n                },\n                \"role\": \"Owner\"\n            }\n        ]\n    },\n    \"title\": \"My ticket\",\n    \"description\": \"Lorem *ipsum* dolor\",\n    \"reference\": \"custom_ref\",\n    \"status\": \"Open\",\n    \"priority\": \"Medium\",\n    \"created_datetime\": \"2023-08-28T14:27:55.686774+02:00\",\n    \"updated_datetime\": \"2023-08-28T14:27:55.686813+02:00\",\n    \"closed_datetime\": null\n}"}],"_postman_id":"4a14960d-7a4c-49a0-a051-beaca538af58"},{"name":"Retrieve ticket","id":"86a75482-1a05-4aed-9e8b-0e36d908da8a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/tickets/{{id}}/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n","urlObject":{"path":["api","1","tickets","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"3be4391a-f171-4857-ba7a-bd582da7c44f","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/tickets/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:28:24 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1307.0129999998699;desc=\"User CPU time\", TimerPanel_stime;dur=217.5359999999955;desc=\"System CPU time\", TimerPanel_total;dur=1524.5489999998654;desc=\"Total CPU time\", TimerPanel_total_time;dur=1453.8509845733643;desc=\"Elapsed time\", SQLPanel_sql_time;dur=5.584955215454102;desc=\"SQL 6 queries\", CachePanel_total_time;dur=4.088401794433594;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"991"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 4121212,\n    \"contact\": {\n        \"id\": 42378,\n        \"first_name\": \"John\",\n        \"last_name\": \"Doe\",\n        \"phone\": \"+3933312345678\",\n        \"email\": \"john.doe@domain.com\",\n        \"has_invalid_phone\": false,\n        \"language\": \"it\",\n        \"chat_link\": \"https://spoki.app/chats/4c436818nfa44d3f88f7bf05577531pq\",\n        \"role_set\": [\n            {\n                \"id\": 77234,\n                \"user\": {\n                    \"id\": 62336,\n                    \"email\": \"mario.rossi@domain.com\",\n                    \"uid\": \"zqmN340exPVokfOlvTQq9CRP2R02\",\n                    \"firstname\": \"Mario\",\n                    \"surname\": \"Rossi\",\n                    \"image\": \"http://localhost:8000/media/users/e8b97413-aah8-4755-b341-d6537ff8bd65.jpg\",\n                    \"is_service\": false\n                },\n                \"role\": \"Owner\"\n            }\n        ]\n    },\n    \"title\": \"My ticket\",\n    \"description\": \"Lorem *ipsum* dolor\",\n    \"reference\": \"custom_ref\",\n    \"status\": \"Open\",\n    \"priority\": \"Medium\",\n    \"created_datetime\": \"2023-08-28T14:27:55.686774+02:00\",\n    \"updated_datetime\": \"2023-08-28T14:27:55.686813+02:00\",\n    \"closed_datetime\": null\n}"}],"_postman_id":"86a75482-1a05-4aed-9e8b-0e36d908da8a"},{"name":"Update ticket","id":"69c46807-e089-4387-a99c-4f629da69ac7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PATCH","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"contact_phone\": \"{{phone}}\",\n    \"title\": \"My ticket\",\n    \"status\": \"Open\",\n    \"priority\": \"Medium\",\n    \"description\": \"Lorem *ipsum* dolor\",\n    \"reference\": \"custom_ref\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/tickets/{{id}}/","description":"<p><strong>Rate Limit:</strong> 120/min</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<h4 id=\"in-case-the-body-isnt-correct\">In case the body isn't correct:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"field\": [\n        \"Error description.\"\n    ]\n}\n\n</code></pre>\n<h4 id=\"in-case-the-body-is-correct-other-error-code\">In case the body is correct, other error code:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"https://app.spoki.it/errors/spoki::3004\",\n    \"title\": \"The request body is not correct\",\n    \"code\": \"spoki::3004\",\n    \"status\": 400,\n    \"datail\": \"Invalid or no title specified. Use 'title'\"\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no status specified. Use 'status'. Accepted values are OPEN, PENDING,  <br />WAITING_ON_CUSTOMER,  <br />RESOLVED,  <br />CLOSED</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no priority specified. Use 'priority'. Accepted values are LOWEST, LOW,  <br />MEDIUM,  <br />HIGH,  <br />HIGHETS</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3007</td>\n<td>Invalid request header</td>\n<td>Invalid or no account specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","tickets","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"00bbe078-0f4b-4120-8820-7e26a62243b9","name":"200 OK","originalRequest":{"method":"PATCH","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"contact_phone\": \"{{phone}}\",\n    \"title\": \"My ticket\",\n    \"status\": \"Open\",\n    \"priority\": \"Medium\",\n    \"description\": \"Lorem *ipsum* dolor\",\n    \"reference\": \"custom_ref\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/tickets/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:28:41 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1831.0979999998835;desc=\"User CPU time\", TimerPanel_stime;dur=219.61499999997613;desc=\"System CPU time\", TimerPanel_total;dur=2050.7129999998597;desc=\"Total CPU time\", TimerPanel_total_time;dur=2011.4519596099854;desc=\"Elapsed time\", SQLPanel_sql_time;dur=7.870674133300781;desc=\"SQL 10 queries\", CachePanel_total_time;dur=2.469301223754883;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"991"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 4121212,\n    \"contact\": {\n        \"id\": 42378,\n        \"first_name\": \"John\",\n        \"last_name\": \"Doe\",\n        \"phone\": \"+3933312345678\",\n        \"email\": \"john.doe@domain.com\",\n        \"has_invalid_phone\": false,\n        \"language\": \"it\",\n        \"chat_link\": \"https://spoki.app/chats/4c436818nfa44d3f88f7bf05577531pq\",\n        \"role_set\": [\n            {\n                \"id\": 77234,\n                \"user\": {\n                    \"id\": 62336,\n                    \"email\": \"mario.rossi@domain.com\",\n                    \"uid\": \"zqmN340exPVokfOlvTQq9CRP2R02\",\n                    \"firstname\": \"Mario\",\n                    \"surname\": \"Rossi\",\n                    \"image\": \"http://localhost:8000/media/users/e8b97413-aah8-4755-b341-d6537ff8bd65.jpg\",\n                    \"is_service\": false\n                },\n                \"role\": \"Owner\"\n            }\n        ]\n    },\n    \"title\": \"My ticket\",\n    \"description\": \"Lorem *ipsum* dolor\",\n    \"reference\": \"custom_ref\",\n    \"status\": \"Open\",\n    \"priority\": \"Medium\",\n    \"created_datetime\": \"2023-08-28T14:27:55.686774+02:00\",\n    \"updated_datetime\": \"2023-08-28T14:28:39.877141+02:00\",\n    \"closed_datetime\": null\n}"}],"_postman_id":"69c46807-e089-4387-a99c-4f629da69ac7"},{"name":"Delete ticket","id":"c8a0ae1f-b06f-4848-a76f-9ba1846337cc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/tickets/{{id}}/","description":"<p><strong>Rate Limit:</strong> 60/min</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3007</td>\n<td>Invalid request header</td>\n<td>Invalid or no account specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","tickets","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"a3a32327-f606-4b8a-89ca-7df4128b4542","name":"204 No Content","originalRequest":{"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/tickets/{{id}}/"},"status":"No Content","code":204,"_postman_previewlanguage":"plain","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:30:09 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1123.7280000000283;desc=\"User CPU time\", TimerPanel_stime;dur=193.74900000002526;desc=\"System CPU time\", TimerPanel_total;dur=1317.4770000000535;desc=\"Total CPU time\", TimerPanel_total_time;dur=1266.9718265533447;desc=\"Elapsed time\", SQLPanel_sql_time;dur=18.163681030273438;desc=\"SQL 5 queries\", CachePanel_total_time;dur=2.4340152740478516;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"0"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"c8a0ae1f-b06f-4848-a76f-9ba1846337cc"}],"id":"473c167a-f5b3-453e-9e52-2905915b19cc","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"80e404ff-9b36-4af5-b381-528f2a11cc4b","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"8eee7611-fbc0-40e7-aa2c-5536c8e7064b","type":"text/javascript","exec":[""]}}],"_postman_id":"473c167a-f5b3-453e-9e52-2905915b19cc","description":""},{"name":"Media","item":[{"name":"List, search, and filter media","id":"f516f904-bdf7-42b5-af0a-9a0a39d2a84a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/media/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n","urlObject":{"path":["api","1","media",""],"host":["{{Base-URL}}"],"query":[{"disabled":true,"key":"","value":""}],"variable":[]}},"response":[{"id":"53451d3e-2ea5-4dd1-b2ff-622f7ba88ea7","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":{"raw":"{{Base-URL}}/api/1/media/","host":["{{Base-URL}}"],"path":["api","1","media",""],"query":[{"key":"","value":"","disabled":true}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:29:14 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=2354.089000000158;desc=\"User CPU time\", TimerPanel_stime;dur=287.75900000005095;desc=\"System CPU time\", TimerPanel_total;dur=2641.848000000209;desc=\"Total CPU time\", TimerPanel_total_time;dur=2610.058069229126;desc=\"Elapsed time\", SQLPanel_sql_time;dur=14.770984649658203;desc=\"SQL 19 queries\", CachePanel_total_time;dur=2.125263214111328;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"3943"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 1,\n    \"next\": null,\n    \"previous\": null,\n    \"results\": [\n        {\n            \"id\": 1234,\n            \"title\": \"External Image\",\n            \"media\": null,\n            \"content_type\": \"image/jpeg\",\n            \"format_type\": \"image\",\n            \"external_url\": \"https://example.com/my_image.jpg\",\n            \"external_id\": null,\n            \"is_deleted\": false\n        }\n    ]\n}"}],"_postman_id":"f516f904-bdf7-42b5-af0a-9a0a39d2a84a"},{"name":"Create media","id":"b7826838-a9a4-4542-bc55-000dd95ef78d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"title\": \"External Image\",\n    \"external_url\": \"https://example.com/my_image.jpg\",\n    \"format_type\": \"image\",\n    \"content_type\": \"image/jpeg\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/media/","description":"<p><strong>Rate Limit:</strong> 120/min</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<h4 id=\"in-case-the-body-isnt-correct\">In case the body isn't correct:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"field\": [\n        \"Error description.\"\n    ]\n}\n\n</code></pre>\n<h4 id=\"in-case-the-body-is-correct-other-error-code\">In case the body is correct, other error code:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"https://app.spoki.it/errors/spoki::3004\",\n    \"title\": \"The request body is not correct\",\n    \"code\": \"spoki::3004\",\n    \"status\": 400,\n    \"datail\": \"Invalid or no title specified. Use 'title'\"\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no contact specified Use 'contact_phone'.</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no title specified. Use 'title'</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no status specified. Use 'status'</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no status specified. Use 'status'. Accepted values are OPEN, PENDING,  <br />WAITING_ON_CUSTOMER,  <br />RESOLVED,  <br />CLOSED</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no priority specified. Use 'priority'. Accepted values are LOWEST, LOW,  <br />MEDIUM,  <br />HIGH,  <br />HIGHETS</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3007</td>\n<td>Invalid request header</td>\n<td>Invalid or no account specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","media",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"be23f179-2f40-43e8-8132-3ef5de8b52ef","name":"201 Created","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"title\": \"External Image\",\n    \"external_url\": \"https://example.com/my_image.jpg\",\n    \"format_type\": \"image\",\n    \"content_type\": \"image/jpeg\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/media/{{id}}/"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:27:56 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=2221.6040000000703;desc=\"User CPU time\", TimerPanel_stime;dur=552.5239999999485;desc=\"System CPU time\", TimerPanel_total;dur=2774.128000000019;desc=\"Total CPU time\", TimerPanel_total_time;dur=2873.5029697418213;desc=\"Elapsed time\", SQLPanel_sql_time;dur=17.703533172607422;desc=\"SQL 14 queries\", CachePanel_total_time;dur=2.3651123046875;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"991"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 1234,\n    \"title\": \"External Image\",\n    \"media\": null,\n    \"content_type\": \"image/jpeg\",\n    \"format_type\": \"image\",\n    \"external_url\": \"https://example.com/my_image.jpg\",\n    \"external_id\": null,\n    \"is_deleted\": false\n}"}],"_postman_id":"b7826838-a9a4-4542-bc55-000dd95ef78d"},{"name":"Retrieve media","id":"5f450e7c-cf9b-408e-bc64-d3a92aef97e3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/media/{{id}}/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n","urlObject":{"path":["api","1","media","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"9910d051-108b-4087-b787-ed60e3af88f1","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/media/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:28:24 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1307.0129999998699;desc=\"User CPU time\", TimerPanel_stime;dur=217.5359999999955;desc=\"System CPU time\", TimerPanel_total;dur=1524.5489999998654;desc=\"Total CPU time\", TimerPanel_total_time;dur=1453.8509845733643;desc=\"Elapsed time\", SQLPanel_sql_time;dur=5.584955215454102;desc=\"SQL 6 queries\", CachePanel_total_time;dur=4.088401794433594;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"991"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 1234,\n    \"title\": \"External Image\",\n    \"media\": null,\n    \"content_type\": \"image/jpeg\",\n    \"format_type\": \"image\",\n    \"external_url\": \"https://example.com/my_image.jpg\",\n    \"external_id\": null,\n    \"is_deleted\": false\n}"}],"_postman_id":"5f450e7c-cf9b-408e-bc64-d3a92aef97e3"},{"name":"Update media","id":"15381626-80f3-424e-b50e-e43258509943","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PATCH","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"title\": \"External Image A\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/media/{{id}}/","description":"<p><strong>Rate Limit:</strong> 120/min</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<h4 id=\"in-case-the-body-isnt-correct\">In case the body isn't correct:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"field\": [\n        \"Error description.\"\n    ]\n}\n\n</code></pre>\n<h4 id=\"in-case-the-body-is-correct-other-error-code\">In case the body is correct, other error code:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"https://app.spoki.it/errors/spoki::3004\",\n    \"title\": \"The request body is not correct\",\n    \"code\": \"spoki::3004\",\n    \"status\": 400,\n    \"datail\": \"Invalid or no title specified. Use 'title'\"\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no status specified. Use 'status'. Accepted values are OPEN, PENDING,  <br />WAITING_ON_CUSTOMER,  <br />RESOLVED,  <br />CLOSED</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no priority specified. Use 'priority'. Accepted values are LOWEST, LOW,  <br />MEDIUM,  <br />HIGH,  <br />HIGHETS</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3007</td>\n<td>Invalid request header</td>\n<td>Invalid or no account specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","media","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"7ad1cac8-eec9-4a1c-83c5-c0e4f7241794","name":"200 OK","originalRequest":{"method":"PATCH","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"title\": \"External Image A\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/media/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:28:41 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1831.0979999998835;desc=\"User CPU time\", TimerPanel_stime;dur=219.61499999997613;desc=\"System CPU time\", TimerPanel_total;dur=2050.7129999998597;desc=\"Total CPU time\", TimerPanel_total_time;dur=2011.4519596099854;desc=\"Elapsed time\", SQLPanel_sql_time;dur=7.870674133300781;desc=\"SQL 10 queries\", CachePanel_total_time;dur=2.469301223754883;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"991"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 1234,\n    \"title\": \"External Image A\",\n    \"media\": null,\n    \"content_type\": \"image/jpeg\",\n    \"format_type\": \"image\",\n    \"external_url\": \"https://example.com/my_image.jpg\",\n    \"external_id\": null,\n    \"is_deleted\": false\n}"}],"_postman_id":"15381626-80f3-424e-b50e-e43258509943"},{"name":"Delete media","id":"bc5732fd-ea45-4213-9f6a-23d9187922e8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/media/{{id}}/","description":"<p><strong>Rate Limit:</strong> 60/min</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3007</td>\n<td>Invalid request header</td>\n<td>Invalid or no account specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","media","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"dd591268-4128-436f-a8a1-2392ab6892a5","name":"204 No Content","originalRequest":{"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/media/{{id}}/"},"status":"No Content","code":204,"_postman_previewlanguage":"plain","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:30:09 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1123.7280000000283;desc=\"User CPU time\", TimerPanel_stime;dur=193.74900000002526;desc=\"System CPU time\", TimerPanel_total;dur=1317.4770000000535;desc=\"Total CPU time\", TimerPanel_total_time;dur=1266.9718265533447;desc=\"Elapsed time\", SQLPanel_sql_time;dur=18.163681030273438;desc=\"SQL 5 queries\", CachePanel_total_time;dur=2.4340152740478516;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"0"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"bc5732fd-ea45-4213-9f6a-23d9187922e8"}],"id":"5454cac0-8f47-44ce-9e5a-ecddbd651322","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"80e404ff-9b36-4af5-b381-528f2a11cc4b","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"8eee7611-fbc0-40e7-aa2c-5536c8e7064b","type":"text/javascript","exec":[""]}}],"_postman_id":"5454cac0-8f47-44ce-9e5a-ecddbd651322","description":""},{"name":"Webhooks","item":[{"name":"API","item":[{"name":"List, search, and filter webhooks","id":"966164e0-f7bf-4705-ad2e-cafc8ea973d2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/external-webhooks/","description":"<p><strong>Rate Limit:</strong> 30/min</p>\n<p>Returns a list of webhooks for the authenticated account.</p>\n<h3 id=\"response\">Response</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">[\n    {\n        \"id\": 123,\n        \"version\": 2,\n        \"url\": \"https://example.com/webhook\",\n        \"event\": \"message.inbound\",\n        \"is_active\": true,\n        \"account\": 456,\n        \"secret\": \"whsec_a1b2c3...\",\n        \"requested_expands\": [\"contact\"],\n        \"approved_expands\": [\"contact\"]\n    }\n]\n</code></pre>\n","urlObject":{"path":["api","1","external-webhooks",""],"host":["{{Base-URL}}"],"query":[{"disabled":true,"description":{"content":"<p>true | false</p>\n","type":"text/plain"},"key":"is_active","value":""},{"disabled":true,"description":{"content":"<p>Possible events:\nchat.has_unread_messages\nmessage.outbound\nmessage.inbound\nmessage.note\ncontact.created\ncontact.updated\ncontact.deleted\ncontact_tag.created\ncontact_tag.deleted\ncontact_list.created\ncontact_list.deleted\ncontact_field.created_or_updated\ncontact_field.deleted\nform_answer.submitted\ntemplate.created\ntemplate.updated\ntemplate.deleted\nchannel.whatsapp.status\nchannel.sms_one_way.status\nchannel.sms_two_way.status\nchannel.whatsapp.violation\nchannel.whatsapp.restriction\nchannel.whatsapp.tier_changed\nchannel.activation\ncampaign.created\ncampaign.deleted\ncampaign.status_changed</p>\n","type":"text/plain"},"key":"event","value":""}],"variable":[]}},"response":[{"id":"90b6bc5c-1efe-4c20-9c98-886262ef6e26","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":{"raw":"{{Base-URL}}/api/1/external-webhooks/","host":["{{Base-URL}}"],"path":["api","1","external-webhooks",""],"query":[{"key":"","value":"","disabled":true}]}},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Server","value":"nginx/1.29.1"},{"key":"Date","value":"Tue, 23 Sep 2025 13:32:09 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"176"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Vary","value":"origin, Accept-Language, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": 1796,\n        \"version\": 1,\n        \"url\": \"https://example.com/webhook\",\n        \"event\": \"chat.has_unread_messages\",\n        \"is_active\": true,\n        \"account\": 1384,\n        \"secret\": \"46b3f28e-9349-424a-9f05-4fdc96bbf354\"\n    }\n]"},{"id":"0e4d0f22-805f-48ed-95ac-d91884822aed","name":"200 OK (Filter)","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":{"raw":"{{Base-URL}}/api/1/external-webhooks/?is_active=true&event=chat.has_unread_messages","host":["{{Base-URL}}"],"path":["api","1","external-webhooks",""],"query":[{"key":"is_active","value":"true"},{"key":"event","value":"chat.has_unread_messages","type":"text"}]}},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Server","value":"nginx/1.29.1"},{"key":"Date","value":"Tue, 23 Sep 2025 13:46:00 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"176"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Vary","value":"origin, Accept-Language, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": 1797,\n        \"version\": 1,\n        \"url\": \"https://example.com/webhook\",\n        \"event\": \"chat.has_unread_messages\",\n        \"is_active\": true,\n        \"account\": 1384,\n        \"secret\": \"46b3f28e-9349-424a-9f05-4fdc96bbf354\"\n    }\n]"}],"_postman_id":"966164e0-f7bf-4705-ad2e-cafc8ea973d2"},{"name":"Create webhook","id":"24636aae-68e8-497d-81a9-0727fb4c4403","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"event\": \"{{event_type}}\",\n    \"version\": 2,\n    \"url\": \"https://example.com/webhook\",\n    \"is_active\": true\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/external-webhooks/","description":"<h1 id=\"create-external-webhook\">Create External Webhook</h1>\n<h2 id=\"endpoint\">Endpoint</h2>\n<p><code>POST /api/wh/external_webhooks/</code></p>\n<h2 id=\"rate-limit\">Rate Limit</h2>\n<p><code>30/min</code></p>\n<h2 id=\"description\">Description</h2>\n<p>Creates a new webhook for the authenticated account.</p>\n<h2 id=\"version\">Version</h2>\n<p>Set <code>version</code> to <code>2</code> (recommended) for the latest webhook format with:</p>\n<ul>\n<li><p>HMAC-SHA256 signature via <code>X-Spoki-Signature</code> header</p>\n</li>\n<li><p>Expand system to customize payload fields</p>\n</li>\n<li><p>Secret token auto-generated as <code>whsec_...</code> (256-bit entropy)</p>\n</li>\n</ul>\n<p>Set <code>version</code> to <code>1</code> for the legacy format (<code>PBKDF2</code> signature via <code>X-SPOKI-HASH</code> header).</p>\n<h2 id=\"request-body\">Request Body</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"version\": 2,\n    \"url\": \"https://example.com/webhook\",\n    \"event\": \"message.inbound\",\n    \"is_active\": true\n}\n\n</code></pre><h2 id=\"possible-event-types\">Possible Event Types</h2>\n<ul>\n<li><p><code>chat.has_unread_messages</code></p>\n</li>\n<li><p><code>message.outbound</code></p>\n</li>\n<li><p><code>message.inbound</code></p>\n</li>\n<li><p><code>message.note</code></p>\n</li>\n<li><p><code>contact.created</code></p>\n</li>\n<li><p><code>contact.updated</code></p>\n</li>\n<li><p><code>contact.deleted</code></p>\n</li>\n<li><p><code>contact_tag.created</code></p>\n</li>\n<li><p><code>contact_tag.deleted</code></p>\n</li>\n<li><p><code>contact_list.created</code></p>\n</li>\n<li><p><code>contact_list.deleted</code></p>\n</li>\n<li><p><code>contact_field.created_or_updated</code></p>\n</li>\n<li><p><code>contact_field.deleted</code></p>\n</li>\n<li><p><code>form_answer.submitted</code></p>\n</li>\n<li><p><code>template.created</code></p>\n</li>\n<li><p><code>template.updated</code></p>\n</li>\n<li><p><code>template.deleted</code></p>\n</li>\n<li><p><code>channel.whatsapp.status</code></p>\n</li>\n<li><p><code>channel.sms_one_way.status</code></p>\n</li>\n<li><p><code>channel.sms_two_way.status</code></p>\n</li>\n<li><p><code>channel.whatsapp.violation</code></p>\n</li>\n<li><p><code>channel.whatsapp.restriction</code></p>\n</li>\n<li><p><code>channel.whatsapp.tier_changed</code></p>\n</li>\n<li><p><code>channel.activation</code></p>\n</li>\n<li><p><code>campaign.created</code></p>\n</li>\n<li><p><code>campaign.deleted</code></p>\n</li>\n<li><p><code>campaign.status_changed</code></p>\n</li>\n</ul>\n<h2 id=\"response\">Response</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"id\": 123,\n    \"version\": 2,\n    \"url\": \"https://example.com/webhook\",\n    \"event\": \"message.inbound\",\n    \"is_active\": true,\n    \"account\": 456,\n    \"secret\": \"whsec_a1b2c3d4...\",\n    \"requested_expands\": [],\n    \"approved_expands\": []\n}\n\n</code></pre><h2 id=\"response-fields\">Response Fields</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>id</code></td>\n<td>integer</td>\n<td>Webhook ID</td>\n</tr>\n<tr>\n<td><code>version</code></td>\n<td>integer</td>\n<td><code>1</code> or <code>2</code></td>\n</tr>\n<tr>\n<td><code>url</code></td>\n<td>string</td>\n<td>Delivery URL (max <code>2000</code> chars)</td>\n</tr>\n<tr>\n<td><code>event</code></td>\n<td>string</td>\n<td>Event type</td>\n</tr>\n<tr>\n<td><code>is_active</code></td>\n<td>boolean</td>\n<td>Whether the webhook is active</td>\n</tr>\n<tr>\n<td><code>account</code></td>\n<td>integer</td>\n<td>Account ID (read-only)</td>\n</tr>\n<tr>\n<td><code>secret</code></td>\n<td>string</td>\n<td>Webhook secret for signature verification (read-only, auto-generated)</td>\n</tr>\n<tr>\n<td><code>requested_expands</code></td>\n<td>string[]</td>\n<td>Requested expand tokens (read-only, V2 only)</td>\n</tr>\n<tr>\n<td><code>approved_expands</code></td>\n<td>string[]</td>\n<td>Approved expand tokens (read-only, V2 only)</td>\n</tr>\n</tbody>\n</table>\n</div><h2 id=\"possible-error-codes\">Possible Error Codes</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th>Code</th>\n<th>Title</th>\n<th>Detail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>400</code></td>\n<td><code>spoki::400</code></td>\n<td>Unknown error</td>\n<td>Invalid or no account specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","external-webhooks",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"bae01437-4fd6-47ae-bf7b-bff95bc1062e","name":"201 Created","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"event\": \"{{event_type}}\",\n    \"version\": 1,\n    \"url\": \"https://example.com/webhook\",\n    \"is_active\": true\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/external-webhooks/"},"status":"Created","code":201,"_postman_previewlanguage":null,"header":[{"key":"Server","value":"nginx/1.29.1"},{"key":"Date","value":"Tue, 23 Sep 2025 13:31:19 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"174"},{"key":"Connection","value":"keep-alive"},{"key":"Location","value":"https://example.com/webhook"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Vary","value":"origin, Accept-Language, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 1796,\n    \"version\": 1,\n    \"url\": \"https://example.com/webhook\",\n    \"event\": \"chat.has_unread_messages\",\n    \"is_active\": true,\n    \"account\": 1384,\n    \"secret\": \"46b3f28e-9349-424a-9f05-4fdc96bbf354\"\n}"}],"_postman_id":"24636aae-68e8-497d-81a9-0727fb4c4403"},{"name":"Retrieve webhook","id":"58eea4f7-3f6a-491e-849e-7a60e9b403eb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/external-webhooks/{{id}}/","description":"<p><strong>Rate Limit:</strong> 30/min</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"path":["api","1","external-webhooks","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"b0f8e8d2-6225-4771-a3d7-e2149f4ad9d7","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/external-webhooks/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Server","value":"nginx/1.29.1"},{"key":"Date","value":"Tue, 23 Sep 2025 13:32:38 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"174"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Vary","value":"origin, Accept-Language, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 1796,\n    \"version\": 1,\n    \"url\": \"https://example.com/webhook\",\n    \"event\": \"chat.has_unread_messages\",\n    \"is_active\": true,\n    \"account\": 1384,\n    \"secret\": \"46b3f28e-9349-424a-9f05-4fdc96bbf354\"\n}"}],"_postman_id":"58eea4f7-3f6a-491e-849e-7a60e9b403eb"},{"name":"Update webhook","id":"502e4c6b-50b8-4df2-8210-ed075b190261","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PATCH","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"event\": \"{{event_type}}\",\n    \"version\": 2,\n    \"url\": \"https://example.com/webhook\",\n    \"is_active\": true\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/external-webhooks/{{id}}/","description":"<p><strong>Rate Limit:</strong> 30/min</p>\n<p>Updates a webhook. Acts like a PATCH — only the fields you send are updated.</p>\n<p><strong>Note:</strong> You cannot downgrade the webhook version (e.g. from V2 to V1). If upgrading from V1 to V2, a new secret is automatically generated.</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th>Code</th>\n<th>Title</th>\n<th>Detail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::400</td>\n<td>Unknown error</td>\n<td>Invalid or no account specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","external-webhooks","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"2d1e2ee9-0571-4e6b-b627-cb78769fc0a1","name":"200 OK","originalRequest":{"method":"PATCH","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"event\": \"{{event_type}}\",\n    \"version\": 1,\n    \"url\": \"https://example.com/webhook\",\n    \"is_active\": true\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/external-webhooks/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Server","value":"nginx/1.29.1"},{"key":"Date","value":"Tue, 23 Sep 2025 13:32:50 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"174"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Vary","value":"origin, Accept-Language, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 1796,\n    \"version\": 1,\n    \"url\": \"https://example.com/webhook\",\n    \"event\": \"chat.has_unread_messages\",\n    \"is_active\": true,\n    \"account\": 1384,\n    \"secret\": \"46b3f28e-9349-424a-9f05-4fdc96bbf354\"\n}"}],"_postman_id":"502e4c6b-50b8-4df2-8210-ed075b190261"},{"name":"Delete webhook","id":"10c9ef46-ad8b-4e88-ac17-4c8d1867a4c5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/external-webhooks/{{id}}/","description":"<p><strong>Rate Limit:</strong> 30/min</p>\n<h4 id=\"in-case-the-body-is-correct-other-error-code\">In case the body is correct, other error code:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"https://app.spoki.it/errors/spoki::400\",\n    \"title\": \"Unknown error\",\n    \"code\": \"spoki::400\",\n    \"status\": 400,\n    \"datail\": \"Invalid or no account specified\"\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::400</td>\n<td>Unknown error</td>\n<td>Invalid or no account specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","external-webhooks","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"c06cfeb4-792a-44d8-9fa9-e538603b86e0","name":"204 No Content","originalRequest":{"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/external-webhooks/{{id}}/"},"status":"No Content","code":204,"_postman_previewlanguage":null,"header":[{"key":"Server","value":"nginx/1.29.1"},{"key":"Date","value":"Tue, 23 Sep 2025 13:33:01 GMT"},{"key":"Content-Length","value":"0"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Vary","value":"origin, Accept-Language, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"10c9ef46-ad8b-4e88-ac17-4c8d1867a4c5"},{"name":"Get expands","id":"e9554726-2611-2d21-732f-b4e080fd4663","request":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/external-webhooks/{{id}}/expands/","description":"<p><strong>Rate Limit:</strong> 30/min</p>\n<p><strong>V2 only.</strong> Returns the expand configuration for a webhook, including which tokens are requested, approved, and available.</p>\n<h3 id=\"response\">Response</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"requested_expands\": [\"contact\", \"tag_set\"],\n    \"approved_expands\": [\"contact\"],\n    \"allowed_expands\": [\"contact\", \"sender\", \"tag_set\", \"list_set\", \"contactfield_set\", \"contactfield_values\"]\n}\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>requested_expands</td>\n<td>string[]</td>\n<td>Expand tokens requested by the account</td>\n</tr>\n<tr>\n<td>approved_expands</td>\n<td>string[]</td>\n<td>Expand tokens approved and active</td>\n</tr>\n<tr>\n<td>allowed_expands</td>\n<td>string[]</td>\n<td>All expand tokens available for this event type</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"expand-tokens\">Expand tokens</h3>\n<p>Some expand tokens are <strong>auto-approved</strong> (e.g. <code>contact</code>, <code>sender</code>, <code>tag</code>, <code>list</code>), while others require <strong>manual approval</strong> by Spoki (e.g. <code>tag_set</code>, <code>list_set</code>, <code>contactfield_set</code>, <code>contactfield_values</code>). Use the \"Set expands\" endpoint to request tokens.</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"path":["api","1","external-webhooks","{{id}}","expands",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e9554726-2611-2d21-732f-b4e080fd4663"},{"name":"Set expands","id":"d286bd47-8d48-ec4a-4e47-6ddf51e8d3c0","request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"expands\": [\"contact\", \"tag_set\"]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/external-webhooks/{{id}}/expands/","description":"<p><strong>Rate Limit:</strong> 30/min</p>\n<p><strong>V2 only.</strong> Request or update expand tokens for a webhook. Expand tokens add additional fields to the webhook payload.</p>\n<h3 id=\"auto-approved--requires-manual-approval\">Auto-approved / Requires manual approval</h3>\n<p>Some tokens are <strong>auto-approved</strong> and take effect immediately. Others require <strong>manual approval</strong> by Spoki and will appear in <code>pending_approval</code> until approved.</p>\n<p>Expand tokens support a maximum nesting depth of 2 (e.g. <code>contact.tag_set</code> is allowed). First-level expansion tokens are automatically approved, second-level tokens require manual approval</p>\n<h3 id=\"response\">Response</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"requested_expands\": [\"contact\", \"tag_set\"],\n    \"approved_expands\": [\"contact\"],\n    \"pending_approval\": [\"tag_set\"],\n    \"allowed_expands\": [\"contact\", \"sender\", \"tag_set\", \"list_set\", ...]\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>requested_expands</td>\n<td>string[]</td>\n<td>All expand tokens you requested</td>\n</tr>\n<tr>\n<td>approved_expands</td>\n<td>string[]</td>\n<td>Tokens currently approved and active</td>\n</tr>\n<tr>\n<td>pending_approval</td>\n<td>string[]</td>\n<td>Tokens awaiting manual approval by Spoki</td>\n</tr>\n<tr>\n<td>allowed_expands</td>\n<td>string[]</td>\n<td>All available tokens for this event type</td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"path":["api","1","external-webhooks","{{id}}","expands",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"d286bd47-8d48-ec4a-4e47-6ddf51e8d3c0"},{"name":"Send test webhook","id":"0847c411-bb0c-7824-5a44-06cf2d04c5ca","request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/external-webhooks/{{id}}/test/","description":"<p><strong>Rate Limit:</strong> 30/min</p>\n<p>Sends a test webhook event to validate your webhook setup. Creates a PENDING event and dispatches it asynchronously to your webhook URL with mock data matching the webhook's event type and version.</p>\n<p>The test payload includes mocked data for all approved expand fields.</p>\n<h3 id=\"response-202-accepted\">Response (202 Accepted)</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"event_id\": 456\n}\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>event_id</td>\n<td>integer</td>\n<td>ID of the test event created. Use the webhook events endpoint to check delivery status.</td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"path":["api","1","external-webhooks","{{id}}","test",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"0847c411-bb0c-7824-5a44-06cf2d04c5ca"},{"name":"Rotate secret","id":"72a6e733-fd55-2d19-b4d7-94e570067bdb","request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/external-webhooks/{{id}}/rotate_secret/","description":"<p><strong>Rate Limit:</strong> 30/min</p>\n<p>Generates a new secret for the webhook. The previous secret is immediately invalidated. Returns the full webhook object with the new <code>secret</code> field.</p>\n<p>Use this if you suspect your webhook secret has been compromised, or to periodically rotate secrets.</p>\n<h3 id=\"response-200-ok\">Response (200 OK)</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"id\": 123,\n    \"version\": 2,\n    \"url\": \"https://example.com/webhook\",\n    \"event\": \"message.inbound\",\n    \"is_active\": true,\n    \"account\": 456,\n    \"secret\": \"whsec_new_secret_here...\",\n    \"requested_expands\": [\"contact\"],\n    \"approved_expands\": [\"contact\"]\n}\n</code></pre>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"path":["api","1","external-webhooks","{{id}}","rotate_secret",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"72a6e733-fd55-2d19-b4d7-94e570067bdb"}],"id":"afd58e7e-7f20-46de-b9b1-cae4719019a7","_postman_id":"afd58e7e-7f20-46de-b9b1-cae4719019a7","description":"","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}}},{"name":"Webhooks body content","item":[{"name":"Message received","item":[{"name":"Message Text received","id":"4fee6f34-be05-468d-aa36-24b016c094f7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n    \"version\": 1,\n    \"event\": \"message.inbound\",\n    \"data\": {\n        \"uuid\": \"b78213e075564866807dbd1780eaa09d\",\n        \"delivered_datetime\": null,\n        \"sent_datetime\": \"2023-05-12T12:59:21+02:00\",\n        \"direction\": \"Inbound\",\n        \"type\": \"Incoming Message\",\n        \"content_type\": \"Text\",\n        \"from_phone\": \"{{phone}}\",\n        \"is_hidden\": false,\n        \"send_status\": \"---\",\n        \"send_error_message\": null,\n        \"error_code\": null,\n        \"error_url\": null,\n        \"preview\": {\n            \"body\": \"Thanks\"\n        },\n        \"to_phone\": \"{{to_phone}}\",\n        \"text\": \"Thanks\",\n        \"timestamp\": 1683889161466,\n        \"created_datetime\": \"2023-05-12T10:59:21+00:00\",\n        \"mediamessage_set\": [],\n        \"locationmessage\": null,\n        \"sender\": null,\n        \"contactsmessage_set\": [],\n        \"contact\": {\n            \"id\": 42413,\n            \"first_name\": \"John\",\n            \"last_name\": \"Doe\",\n            \"phone\": \"{{phone}}\",\n            \"email\": \"john.doe@domain.com\",\n            \"language\": \"en\",\n            \"has_invalid_phone\": false,\n            \"chat_link\": \"https://spoki.app/chats/6490641ba9a049f49f95f1561c9bbe3c\",\n            \"created_datetime\": \"2023-03-21T14:16:26.256109+01:00\",\n            \"contactfield_set\": [\n                {\n                    \"id\": 292850,\n                    \"field\": 440,\n                    \"code\": \"ACCOUNT_NAME\",\n                    \"visual_code\": \"%%ACCOUNT_NAME%%\",\n                    \"value\": \"MyShop\",\n                    \"value_datetime\": null\n                }\n            ],\n            \"contactfield_values\": {\n                \"ACCOUNT_NAME\": \"MyShop\"\n            },\n            \"tag_set\": [],\n            \"list_set\": []\n        },\n        \"metadata\": {\n            \"your_str_meta\": \"lorem ipsum\",\n            \"your_int_meta\": 3,\n            \"your_float_meta\": 42.5,\n            \"your_bool_meta\": true\n        },\n        \"payload\": \"your_unique_optional_payload_given_if_this_text_is_form_a_button\"\n    }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a text message has been received.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format. See the V2 example in the saved response tab.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>In V2, the <code>contact</code> object (with tag_set, list_set, contactfield_set, contactfield_values) is <strong>not included by default</strong>. Request it via the expands API.</p>\n<p>V2 default fields: <code>uuid</code>, <code>delivered_datetime</code>, <code>sent_datetime</code>, <code>direction</code>, <code>type</code>, <code>content_type</code>, <code>from_phone</code>, <code>to_phone</code>, <code>text</code>, <code>is_hidden</code>, <code>send_status</code>, <code>send_error_message</code>, <code>error_code</code>, <code>error_url</code>, <code>preview</code>, <code>timestamp</code>, <code>created_datetime</code>, <code>chat_link</code>, <code>contact_id</code>, <code>contact_ref</code>, <code>mediamessage_set</code>, <code>locationmessage</code>, <code>contactsmessage_set</code>, <code>metadata</code>, <code>payload</code></p>\n<p><strong>Available expands:</strong> <code>contact</code>, <code>contact.tag_set</code>, <code>contact.list_set</code>, <code>contact.role_set</code>, <code>contact.contactfield_set</code>, <code>contact.contactfield_values</code></p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"4fee6f34-be05-468d-aa36-24b016c094f7"},{"name":"Message Image received","id":"bf396e67-6ef4-42ae-a294-203be4f65809","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n    \"version\": 1,\n    \"event\": \"message.inbound\",\n    \"data\": {\n        \"uuid\": \"b78213e075564866807dbd1780eaa09d\",\n        \"delivered_datetime\": null,\n        \"sent_datetime\": \"2023-05-12T12:59:21+02:00\",\n        \"direction\": \"Inbound\",\n        \"type\": \"Incoming Message\",\n        \"content_type\": \"Image\",\n        \"from_phone\": \"{{phone}}\",\n        \"is_hidden\": false,\n        \"send_status\": \"---\",\n        \"send_error_message\": null,\n        \"error_code\": null,\n        \"error_url\": null,\n        \"preview\": {\n            \"body\": \"Thanks\"\n        },\n        \"to_phone\": \"{{to_phone}}\",\n        \"text\": \"Thanks\",\n        \"timestamp\": 1683889161466,\n        \"created_datetime\": \"2023-05-12T10:59:21+00:00\",\n        \"locationmessage\": null,\n        \"sender\": null,\n        \"mediamessage_set\": [\n            {\n                \"id\": 6881581212,\n                \"title\": \"07x825b1-c8b8-4dfc-ac91-x643befe0cx5\",\n                \"content_type\": \"image/jpeg\",\n                \"media\": \"https://app.spoki.it/md/076825b1-c8b8-4dfc-ac91-3643befe0c25.jpeg?key=bw2b6T5uk64L5mnEvri-bxbn2sbv-xx51kIxTw1o1TU\",\n                \"timestamp\": 1700042846907\n            }\n        ],\n        \"contact\": {\n            \"id\": 42413,\n            \"first_name\": \"John\",\n            \"last_name\": \"Doe\",\n            \"phone\": \"{{phone}}\",\n            \"email\": \"john.doe@domain.com\",\n            \"language\": \"en\",\n            \"has_invalid_phone\": false,\n            \"chat_link\": \"https://spoki.app/chats/6490641ba9a049f49f95f1561c9bbe3c\",\n            \"created_datetime\": \"2023-03-21T14:16:26.256109+01:00\",\n            \"contactfield_set\": [\n                {\n                    \"id\": 292850,\n                    \"field\": 440,\n                    \"code\": \"ACCOUNT_NAME\",\n                    \"visual_code\": \"%%ACCOUNT_NAME%%\",\n                    \"value\": \"MyShop\",\n                    \"value_datetime\": null\n                }\n            ],\n            \"contactfield_values\": {\n                \"ACCOUNT_NAME\": \"MyShop\"\n            },\n            \"tag_set\": [],\n            \"list_set\": []\n        },\n        \"metadata\": {\n            \"your_str_meta\": \"lorem ipsum\",\n            \"your_int_meta\": 3,\n            \"your_float_meta\": 42.5,\n            \"your_bool_meta\": true\n        }\n    }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when an image message has been received.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format. </p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Same structure as Message Text received but with <code>mediamessage_set</code> included by default. <code>contact</code> requires expands.</p>\n<p><strong>Available expands:</strong> <code>contact</code>, <code>contact.tag_set</code>, <code>contact.list_set</code>, <code>contact.role_set</code>, <code>contact.contactfield_set</code>, <code>contact.contactfield_values</code></p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"bf396e67-6ef4-42ae-a294-203be4f65809"},{"name":"Message Video received","id":"b091c849-6c69-43b1-babb-1494db017624","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n    \"version\": 1,\n    \"event\": \"message.inbound\",\n    \"data\": {\n        \"uuid\": \"b78213e075564866807dbd1780eaa09d\",\n        \"delivered_datetime\": null,\n        \"sent_datetime\": \"2023-05-12T12:59:21+02:00\",\n        \"direction\": \"Inbound\",\n        \"type\": \"Incoming Message\",\n        \"content_type\": \"Video\",\n        \"from_phone\": \"{{phone}}\",\n        \"is_hidden\": false,\n        \"send_status\": \"---\",\n        \"send_error_message\": null,\n        \"error_code\": null,\n        \"error_url\": null,\n        \"preview\": {\n            \"body\": \"Thanks\"\n        },\n        \"to_phone\": \"{{to_phone}}\",\n        \"text\": \"Thanks\",\n        \"timestamp\": 1683889161466,\n        \"created_datetime\": \"2023-05-12T10:59:21+00:00\",\n        \"locationmessage\": null,\n        \"sender\": null,\n        \"mediamessage_set\": [\n            {\n                \"id\": 688217,\n                \"title\": \"ebf9b50f-2c05-4e08-960d-a94214069a57\",\n                \"content_type\": \"video/mp4\",\n                \"media\": \"https://app.spoki.it/md/ebf9b50f-2c05-4e08-960d-a94214069a57.mp4?key=68iFxF1_ikiWrw6CQSS8wwRA1DkcQ5S3d127vhLNc2A\",\n                \"timestamp\": 1700043806831\n            }\n        ],\n        \"contact\": {\n            \"id\": 42413,\n            \"first_name\": \"John\",\n            \"last_name\": \"Doe\",\n            \"phone\": \"{{phone}}\",\n            \"email\": \"john.doe@domain.com\",\n            \"language\": \"en\",\n            \"has_invalid_phone\": false,\n            \"chat_link\": \"https://spoki.app/chats/6490641ba9a049f49f95f1561c9bbe3c\",\n            \"created_datetime\": \"2023-03-21T14:16:26.256109+01:00\",\n            \"contactfield_set\": [\n                {\n                    \"id\": 292850,\n                    \"field\": 440,\n                    \"code\": \"ACCOUNT_NAME\",\n                    \"visual_code\": \"%%ACCOUNT_NAME%%\",\n                    \"value\": \"MyShop\",\n                    \"value_datetime\": null\n                }\n            ],\n            \"contactfield_values\": {\n                \"ACCOUNT_NAME\": \"MyShop\"\n            },\n            \"tag_set\": [],\n            \"list_set\": []\n        },\n        \"metadata\": {\n            \"your_str_meta\": \"lorem ipsum\",\n            \"your_int_meta\": 3,\n            \"your_float_meta\": 42.5,\n            \"your_bool_meta\": true\n        }\n    }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a video message has been received.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format. </p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Same as Image received — <code>mediamessage_set</code> included by default with content_type: \"video/mp4\". <code>contact</code> requires expands.</p>\n<p><strong>Available expands:</strong> <code>contact</code>, <code>contact.tag_set</code>, <code>contact.list_set</code>, <code>contact.role_set</code>, <code>contact.contactfield_set</code>, <code>contact.contactfield_values</code></p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"b091c849-6c69-43b1-babb-1494db017624"},{"name":"Message Audio received","id":"1d3bf445-b616-4e11-a0e8-84fb3c87ed9d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n    \"version\": 1,\n    \"event\": \"message.inbound\",\n    \"data\": {\n        \"uuid\": \"b78213e075564866807dbd1780eaa09d\",\n        \"delivered_datetime\": null,\n        \"sent_datetime\": \"2023-05-12T12:59:21+02:00\",\n        \"direction\": \"Inbound\",\n        \"type\": \"Incoming Message\",\n        \"content_type\": \"Audio\",\n        \"from_phone\": \"{{phone}}\",\n        \"is_hidden\": false,\n        \"send_status\": \"---\",\n        \"send_error_message\": null,\n        \"error_code\": null,\n        \"error_url\": null,\n        \"preview\": {\n            \"body\": \"Thanks\"\n        },\n        \"to_phone\": \"{{to_phone}}\",\n        \"text\": \"Thanks\",\n        \"timestamp\": 1683889161466,\n        \"created_datetime\": \"2023-05-12T10:59:21+00:00\",\n        \"locationmessage\": null,\n        \"sender\": null,\n        \"mediamessage_set\": [\n            {\n                \"id\": 4882061242332,\n                \"title\": \"4d260cx7-58x4-45f9-a2b1-c6c51fdbcd22\",\n                \"content_type\": \"audio/ogg; codecs=opus\",\n                \"media\": \"https://app.spoki.it/md/4d260c87-58x4-4xf9-a2x1-c6c51fdbcd22.ogg?key=PF-FEfpeuDqWX5EIdc_S9eDzvK3xBPmOCxXiqDmmEUE\",\n                \"timestamp\": 1700043629896\n            }\n        ],\n        \"contact\": {\n            \"id\": 42413,\n            \"first_name\": \"John\",\n            \"last_name\": \"Doe\",\n            \"phone\": \"{{phone}}\",\n            \"email\": \"john.doe@domain.com\",\n            \"language\": \"en\",\n            \"has_invalid_phone\": false,\n            \"chat_link\": \"https://spoki.app/chats/6490641ba9a049f49f95f1561c9bbe3c\",\n            \"created_datetime\": \"2023-03-21T14:16:26.256109+01:00\",\n            \"contactfield_set\": [\n                {\n                    \"id\": 292850,\n                    \"field\": 440,\n                    \"code\": \"ACCOUNT_NAME\",\n                    \"visual_code\": \"%%ACCOUNT_NAME%%\",\n                    \"value\": \"MyShop\",\n                    \"value_datetime\": null\n                }\n            ],\n            \"contactfield_values\": {\n                \"ACCOUNT_NAME\": \"MyShop\"\n            },\n            \"tag_set\": [],\n            \"list_set\": []\n        },\n        \"metadata\": {\n            \"your_str_meta\": \"lorem ipsum\",\n            \"your_int_meta\": 3,\n            \"your_float_meta\": 42.5,\n            \"your_bool_meta\": true\n        }\n    }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when an audio message has been received.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Same as Image received — <code>mediamessage_set</code> included by default with content_type: \"audio/ogg\". <code>contact</code> requires expands.</p>\n<p><strong>Available expands:</strong> <code>contact</code>, <code>contact.tag_set</code>, <code>contact.list_set</code>, <code>contact.role_set</code>, <code>contact.contactfield_set</code>, <code>contact.contactfield_values</code></p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"1d3bf445-b616-4e11-a0e8-84fb3c87ed9d"},{"name":"Message Document received","id":"4358ed29-8ee8-4810-bdb0-80fd34980f43","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n    \"version\": 1,\n    \"event\": \"message.inbound\",\n    \"data\": {\n        \"uuid\": \"b78213e075564866807dbd1780eaa09d\",\n        \"delivered_datetime\": null,\n        \"sent_datetime\": \"2023-05-12T12:59:21+02:00\",\n        \"direction\": \"Inbound\",\n        \"type\": \"Incoming Message\",\n        \"content_type\": \"Document\",\n        \"from_phone\": \"{{phone}}\",\n        \"is_hidden\": false,\n        \"send_status\": \"---\",\n        \"send_error_message\": null,\n        \"error_code\": null,\n        \"error_url\": null,\n        \"preview\": {\n            \"body\": \"Thanks\"\n        },\n        \"to_phone\": \"{{to_phone}}\",\n        \"text\": \"Thanks\",\n        \"timestamp\": 1683889161466,\n        \"created_datetime\": \"2023-05-12T10:59:21+00:00\",\n        \"locationmessage\": null,\n        \"sender\": null,\n        \"mediamessage_set\": [\n            {\n                \"id\": 1288228532,\n                \"title\": \"1a6168x9-8618-4x81-897d-e255xb115e1a\",\n                \"content_type\": \"application/pdf\",\n                \"media\": \"https://app.spoki.it/md/1a61x859-8x18-4481-8x7d-e2551b115x1a.pdf?key=CyhTx4VJ5cwLqkVUfIgMDmMS7sJVWH_G411xHxM0J_E\",\n                \"timestamp\": 1700043849086\n            }\n        ],\n        \"contact\": {\n            \"id\": 42413,\n            \"first_name\": \"John\",\n            \"last_name\": \"Doe\",\n            \"phone\": \"{{phone}}\",\n            \"email\": \"john.doe@domain.com\",\n            \"language\": \"en\",\n            \"has_invalid_phone\": false,\n            \"chat_link\": \"https://spoki.app/chats/6490641ba9a049f49f95f1561c9bbe3c\",\n            \"created_datetime\": \"2023-03-21T14:16:26.256109+01:00\",\n            \"contactfield_set\": [\n                {\n                    \"id\": 292850,\n                    \"field\": 440,\n                    \"code\": \"ACCOUNT_NAME\",\n                    \"visual_code\": \"%%ACCOUNT_NAME%%\",\n                    \"value\": \"MyShop\",\n                    \"value_datetime\": null\n                }\n            ],\n            \"contactfield_values\": {\n                \"ACCOUNT_NAME\": \"MyShop\"\n            },\n            \"tag_set\": [],\n            \"list_set\": []\n        },\n        \"metadata\": {\n            \"your_str_meta\": \"lorem ipsum\",\n            \"your_int_meta\": 3,\n            \"your_float_meta\": 42.5,\n            \"your_bool_meta\": true\n        }\n    }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a document message has been received.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Same as Image received — <code>mediamessage_set</code> included by default. <code>contact</code> requires expands.</p>\n<p><strong>Available expands:</strong> <code>contact</code>, <code>contact.tag_set</code>, <code>contact.list_set</code>, <code>contact.role_set</code>, <code>contact.contactfield_set</code>, <code>contact.contactfield_values</code></p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"4358ed29-8ee8-4810-bdb0-80fd34980f43"},{"name":"Message Sticker received","id":"ffac7eb3-8925-4b74-b651-eff41721884a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n    \"version\": 1,\n    \"event\": \"message.inbound\",\n    \"data\": {\n        \"uuid\": \"b78213e075564866807dbd1780eaa09d\",\n        \"delivered_datetime\": null,\n        \"sent_datetime\": \"2023-05-12T12:59:21+02:00\",\n        \"direction\": \"Inbound\",\n        \"type\": \"Incoming Message\",\n        \"content_type\": \"Sticker\",\n        \"from_phone\": \"{{phone}}\",\n        \"is_hidden\": false,\n        \"send_status\": \"---\",\n        \"send_error_message\": null,\n        \"error_code\": null,\n        \"error_url\": null,\n        \"preview\": {\n            \"body\": \"Thanks\"\n        },\n        \"to_phone\": \"{{to_phone}}\",\n        \"text\": \"Thanks\",\n        \"timestamp\": 1683889161466,\n        \"created_datetime\": \"2023-05-12T10:59:21+00:00\",\n        \"locationmessage\": null,\n        \"sender\": null,\n        \"mediamessage_set\": [\n            {\n                \"id\": 5688220233223,\n                \"title\": \"006ffxbe-ffxe-4xaf-9965-65b5c5640dd6\",\n                \"content_type\": \"image/webp\",\n                \"media\": \"https://app.spoki.it/md/0x6ffxbe-ff9e-49af-9965-65b5cx640dd6.webp?key=3KjxFaCMG6tYp6xyTZTZwYQaARVyOL9kbNsxB6f9LJQ\",\n                \"timestamp\": 1700043820707\n            }\n        ],\n        \"contact\": {\n            \"id\": 42413,\n            \"first_name\": \"John\",\n            \"last_name\": \"Doe\",\n            \"phone\": \"{{phone}}\",\n            \"email\": \"john.doe@domain.com\",\n            \"language\": \"en\",\n            \"has_invalid_phone\": false,\n            \"chat_link\": \"https://spoki.app/chats/6490641ba9a049f49f95f1561c9bbe3c\",\n            \"created_datetime\": \"2023-03-21T14:16:26.256109+01:00\",\n            \"contactfield_set\": [\n                {\n                    \"id\": 292850,\n                    \"field\": 440,\n                    \"code\": \"ACCOUNT_NAME\",\n                    \"visual_code\": \"%%ACCOUNT_NAME%%\",\n                    \"value\": \"MyShop\",\n                    \"value_datetime\": null\n                }\n            ],\n            \"contactfield_values\": {\n                \"ACCOUNT_NAME\": \"MyShop\"\n            },\n            \"tag_set\": [],\n            \"list_set\": []\n        },\n        \"metadata\": {\n            \"your_str_meta\": \"lorem ipsum\",\n            \"your_int_meta\": 3,\n            \"your_float_meta\": 42.5,\n            \"your_bool_meta\": true\n        }\n    }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a sticker message has been received.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Same as Image received — <code>mediamessage_set</code> included by default. <code>contact</code> requires expands.</p>\n<p><strong>Available expands:</strong> <code>contact</code>, <code>contact.tag_set</code>, <code>contact.list_set</code>, <code>contact.role_set</code>, <code>contact.contactfield_set</code>, <code>contact.contactfield_values</code></p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"ffac7eb3-8925-4b74-b651-eff41721884a"}],"id":"11e90ce0-c505-439b-8299-557d9cdfe398","description":"<p>This webhook will be triggered by any update of every received message. Therefore, you will receive more than one webhook for the same message.</p>\n<p>You can find the message type information in <code>data.content_type</code>. The values of interest to you are: Image, Video, Audio, Document, Sticker.</p>\n<p>For your specific use case, you should only consider webhooks with <code>data.mediamessage_set</code> that have elements in the array. You will receive different links for the same media message:</p>\n<ul>\n<li><p>TO IGNORE: The first link is temporary and indicates the <code>content_type</code> provided by WhatsApp (e.g., image / voice / video / sticker / document).</p>\n</li>\n<li><p>TO CONSIDER: In the second link, you will receive the final media with a detailed <code>content_type</code> (e.g., image/jpeg). You can then consider the webhooks with a valid content type and download it through the link indicated in media.</p>\n</li>\n</ul>\n","_postman_id":"11e90ce0-c505-439b-8299-557d9cdfe398","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}}},{"name":"Message sent","id":"5fe73944-0550-4efb-9898-6a89c1cb3359","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n    \"version\": 1,\n    \"event\": \"message.outbound\",\n    \"data\": {\n        \"uuid\": \"8992ce1214744cbfbc0bc1dbf79b3a7e\",\n        \"delivered_datetime\": null,\n        \"sent_datetime\": null,\n        \"direction\": \"Outbound\",\n        \"type\": \"Message\",\n        \"content_type\": \"Text\",\n        \"from_phone\": \"{{from_phone}}\",\n        \"is_hidden\": false,\n        \"send_status\": \"Delivered\",\n        \"send_error_message\": null,\n        \"error_code\": null,\n        \"error_url\": null,\n        \"preview\": {\n            \"body\": \"a presto\"\n        },\n        \"to_phone\": \"{{phone}}\",\n        \"text\": \"a presto\",\n        \"timestamp\": 1683893130979,\n        \"created_datetime\": \"2023-05-12T12:05:30.978568+00:00\",\n        \"mediamessage_set\": [],\n        \"locationmessage\": null,\n        \"sender\": {\n            \"id\": 641,\n            \"email\": \"jane.doe@mywebsite.com\",\n            \"uid\": \"832cb8414e104ef89f3ff7ed1d1ff06a\",\n            \"firstname\": \"Jane\",\n            \"surname\": \"Doe\",\n            \"image\": \"\",\n            \"is_service\": false\n        },\n        \"contactsmessage_set\": [],\n        \"contact\": {\n            \"id\": 42413,\n            \"first_name\": \"John\",\n            \"last_name\": \"Doe\",\n            \"phone\": \"{{phone}}\",\n            \"email\": \"john.doe@domain.com\",\n            \"language\": \"en\",\n            \"has_invalid_phone\": false,\n            \"chat_link\": \"https://spoki.app/chats/6490641ba9a049f49f95f1561c9bbe3c\",\n            \"created_datetime\": \"2023-03-21T14:16:26.256109+01:00\",\n            \"contactfield_set\": [\n                {\n                    \"id\": 292850,\n                    \"field\": 440,\n                    \"code\": \"ACCOUNT_NAME\",\n                    \"visual_code\": \"%%ACCOUNT_NAME%%\",\n                    \"value\": \"MyShop\",\n                    \"value_datetime\": null\n                }\n            ],\n            \"contactfield_values\": {\n                \"ACCOUNT_NAME\": \"MyShop\"\n            },\n            \"tag_set\": [],\n            \"list_set\": []\n        },\n        \"metadata\": {\n            \"your_str_meta\": \"lorem ipsum\",\n            \"your_int_meta\": 3,\n            \"your_float_meta\": 42.5,\n            \"your_bool_meta\": true\n        }\n    }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a message has been sent.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>In V2, the <code>contact</code>, <code>sender</code>, and <code>template</code> are <strong>not included by default</strong>. Request them via the expands API.</p>\n<p>V2 includes all inbound message fields plus: <code>sender_id</code>, <code>sender_ref</code>.</p>\n<p><strong>Available expands:</strong> <code>contact</code>, <code>sender</code>, <code>template</code>, <code>contact.tag_set</code>, <code>contact.list_set</code>, <code>contact.role_set</code>, <code>contact.contactfield_set</code>, <code>contact.contactfield_values</code></p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"5fe73944-0550-4efb-9898-6a89c1cb3359"},{"name":"Note added","id":"721ef7a5-8989-4d8f-b742-0fda81a1d179","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n    \"version\": 1,\n    \"event\": \"message.note\",\n    \"data\": {\n        \"uuid\": \"e85c9fb0ec864b499dc7b4a6a047be5a\",\n        \"delivered_datetime\": null,\n        \"sent_datetime\": null,\n        \"direction\": \"---\",\n        \"type\": \"Note\",\n        \"content_type\": \"Text\",\n        \"from_phone\": null,\n        \"is_hidden\": false,\n        \"send_status\": \"---\",\n        \"send_error_message\": null,\n        \"error_code\": null,\n        \"error_url\": null,\n        \"preview\": {\n            \"body\": \"User interested\"\n        },\n        \"to_phone\": \"+393409525995\",\n        \"text\": \"User interested\",\n        \"timestamp\": 1683896959614,\n        \"created_datetime\": \"2023-05-12T13:09:19.613796+00:00\",\n        \"mediamessage_set\": [],\n        \"locationmessage\": null,\n        \"sender\": {\n            \"id\": 641,\n            \"email\": \"jane.doe@mywebsite.com\",\n            \"uid\": \"832cb8414e104ef89f3ff7ed1d1ff06a\",\n            \"firstname\": \"Jane\",\n            \"surname\": \"Doe\",\n            \"image\": \"\",\n            \"is_service\": false\n        },\n        \"contactsmessage_set\": [],\n        \"contact\": {\n            \"id\": 42413,\n            \"first_name\": \"John\",\n            \"last_name\": \"Doe\",\n            \"phone\": \"{{phone}}\",\n            \"email\": \"john.doe@domain.com\",\n            \"language\": \"en\",\n            \"has_invalid_phone\": false,\n            \"chat_link\": \"https://spoki.app/chats/6490641ba9a049f49f95f1561c9bbe3c\",\n            \"created_datetime\": \"2023-03-21T14:16:26.256109+01:00\",\n            \"contactfield_set\": [\n                {\n                    \"id\": 292850,\n                    \"field\": 440,\n                    \"code\": \"ACCOUNT_NAME\",\n                    \"visual_code\": \"%%ACCOUNT_NAME%%\",\n                    \"value\": \"MyShop\",\n                    \"value_datetime\": null\n                }\n            ],\n            \"contactfield_values\": {\n                \"ACCOUNT_NAME\": \"MyShop\"\n            },\n            \"tag_set\": [],\n            \"list_set\": []\n        },\n        \"metadata\": {\n            \"your_str_meta\": \"lorem ipsum\",\n            \"your_int_meta\": 3,\n            \"your_float_meta\": 42.5,\n            \"your_bool_meta\": true\n        }\n    }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a note has been added to the chat.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>In V2, the <code>contact</code>, <code>sender</code>, and <code>template</code> are <strong>not included by default</strong>. Request them via the expands API.</p>\n<p>V2 includes all inbound message fields plus: <code>sender_id</code>, <code>sender_ref</code>.</p>\n<p><strong>Available expands:</strong> <code>contact</code>, <code>sender</code>, <code>template</code>, <code>contact.tag_set</code>, <code>contact.list_set</code>, <code>contact.role_set</code>, <code>contact.contactfield_set</code>, <code>contact.contactfield_values</code></p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"721ef7a5-8989-4d8f-b742-0fda81a1d179"},{"name":"Chat has unread messages","id":"cbcc0cad-2640-471c-a74d-bc898790a4bf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n    \"version\": 1,\n    \"event\": \"chat.has_unread_messages\",\n    \"data\": {\n        \"uuid\": \"6490641ba9a049f49f95f1561c9bbe3c\",\n        \"has_unread_messages\": true,\n        \"contact\": {\n            \"id\": 42413,\n            \"first_name\": \"John\",\n            \"last_name\": \"Doe\",\n            \"phone\": \"{{phone}}\",\n            \"email\": \"john.doe@domain.com\",\n            \"language\": \"en\",\n            \"has_invalid_phone\": false,\n            \"chat_link\": \"https://spoki.app/chats/6490641ba9a049f49f95f1561c9bbe3c\",\n            \"created_datetime\": \"2023-03-21T14:16:26.256109+01:00\",\n            \"contactfield_set\": [\n                {\n                    \"id\": 292850,\n                    \"field\": 440,\n                    \"code\": \"ACCOUNT_NAME\",\n                    \"visual_code\": \"%%ACCOUNT_NAME%%\",\n                    \"value\": \"MyShop\",\n                    \"value_datetime\": null\n                }\n            ],\n            \"contactfield_values\": {\n                \"ACCOUNT_NAME\": \"MyShop\"\n            },\n            \"tag_set\": [],\n            \"list_set\": []\n        }\n    }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a chat has unread messages, or when it has none left. It's the equivalent of the green chat badge shown in Platform.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>V2 default: <code>uuid</code>, <code>chat_link</code>, <code>has_unread_messages</code>, <code>unread_count</code>. Full <code>contact</code> object requires expand.</p>\n<p><strong>Available expands:</strong> <code>contact</code>, <code>contact.tag_set</code>, <code>contact.list_set</code>, <code>contact.role_set</code>, <code>contact.contactfield_set</code>, <code>contact.contactfield_values</code></p>\n<h3 id=\"v2-example\">V2 Example</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"version\": 2,\n    \"event\": \"chat.has_unread_messages\",\n    \"event_uuid\": \"6490641b-a9a0-49f4-9f95-f1561c9bbe3c\",\n    \"timestamp\": 1683889000.0,\n    \"data\": {\n        \"uuid\": \"6490641ba9a049f49f95f1561c9bbe3c\",\n        \"chat_link\": \"https://spoki.app/chats/6490641ba9a049f49f95f1561c9bbe3c\",\n        \"has_unread_messages\": true,\n        \"unread_count\": 3\n    }\n}\n</code></pre>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"cbcc0cad-2640-471c-a74d-bc898790a4bf"},{"name":"Contact created","id":"657efd6d-2030-4df1-92ca-2e1e179c03d5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"contact.created\",\n  \"event_uuid\": null,\n  \"timestamp\": 1708352661.811551,\n  \"data\": {\n    \"id\": 43429,\n    \"first_name\": \"Mario\",\n    \"last_name\": \"Rossi\",\n    \"phone\": \"+394563782346\",\n    \"email\": null,\n    \"has_invalid_phone\": false,\n    \"language\": \"it\",\n    \"chat_link\": \"https://site-name/chats/7gg7rtgd983h\",\n    \"is_restricted\": false\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a contact has been created.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>V2 adds <code>ref</code>, <code>status</code>, <code>is_blocked</code>. Nested fields require expands.</p>\n<p><strong>Available expands:</strong> <code>tag_set</code>, <code>list_set</code>, <code>role_set</code>, <code>contactfield_set</code>, <code>contactfield_values</code></p>\n<h3 id=\"v2-example\">V2 Example</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"version\": 2,\n    \"event\": \"contact.created\",\n    \"event_uuid\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n    \"timestamp\": 1708352661.811551,\n    \"data\": {\n        \"id\": 43429,\n        \"ref\": \"con_x7k9m2p4\",\n        \"first_name\": \"Mario\",\n        \"last_name\": \"Rossi\",\n        \"phone\": \"+394563782346\",\n        \"email\": null,\n        \"status\": \"Active\",\n        \"has_invalid_phone\": false,\n        \"language\": \"it\",\n        \"chat_link\": \"https://spoki.app/chats/7gg7rtgd983h\",\n        \"created_datetime\": \"2024-02-19T14:24:21+01:00\",\n        \"is_restricted\": false,\n        \"is_blocked\": false\n    }\n}\n</code></pre>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"657efd6d-2030-4df1-92ca-2e1e179c03d5"},{"name":"Contact updated","id":"4b784b11-b6b3-4f72-b3b4-f041541eca27","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"contact.updated\",\n  \"event_uuid\": null,\n  \"timestamp\": 1708352661.811551,\n  \"data\": {\n    \"id\": 43429,\n    \"first_name\": \"Mario\",\n    \"last_name\": \"Rossi\",\n    \"phone\": \"+394563782346\",\n    \"email\": null,\n    \"has_invalid_phone\": false,\n    \"language\": \"it\",\n    \"chat_link\": \"https://site-name/chats/7gg7rtgd983h\",\n    \"is_restricted\": false\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a contact has been updated.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>V2 adds <code>ref</code>, <code>status</code>, <code>is_blocked</code>. Nested fields require expands.</p>\n<p><strong>Available expands:</strong> <code>tag_set</code>, <code>list_set</code>, <code>role_set</code>, <code>contactfield_set</code>, <code>contactfield_values</code></p>\n<h3 id=\"v2-example\">V2 Example</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"version\": 2,\n    \"event\": \"contact.updated\",\n    \"event_uuid\": \"b2c3d4e5-f6a7-8901-bcde-f12345678901\",\n    \"timestamp\": 1708352661.811551,\n    \"data\": {\n        \"id\": 43429,\n        \"ref\": \"con_x7k9m2p4\",\n        \"first_name\": \"Mario\",\n        \"last_name\": \"Rossi\",\n        \"phone\": \"+394563782346\",\n        \"email\": \"mario.rossi@email.it\",\n        \"status\": \"Active\",\n        \"has_invalid_phone\": false,\n        \"language\": \"it\",\n        \"chat_link\": \"https://spoki.app/chats/7gg7rtgd983h\",\n        \"created_datetime\": \"2024-02-19T14:24:21+01:00\",\n        \"is_restricted\": false,\n        \"is_blocked\": false\n    }\n}\n</code></pre>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"4b784b11-b6b3-4f72-b3b4-f041541eca27"},{"name":"Contact deleted","id":"d1152ba6-ee66-4ecc-a834-8e7413299899","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"contact.deleted\",\n  \"event_uuid\": null,\n  \"timestamp\": 1708352661.811551,\n  \"data\": {\n    \"id\": 43429,\n    \"first_name\": \"Mario\",\n    \"last_name\": \"Rossi\",\n    \"phone\": \"+394563782346\",\n    \"email\": null,\n    \"has_invalid_phone\": false,\n    \"language\": \"it\",\n    \"chat_link\": \"https://site-name/chats/7gg7rtgd983h\",\n    \"is_restricted\": false\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a contact has been deleted.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>V2 default includes only <code>id</code> and <code>ref</code>.</p>\n<h3 id=\"v2-example\">V2 Example</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"version\": 2,\n    \"event\": \"contact.deleted\",\n    \"event_uuid\": \"c3d4e5f6-a7b8-9012-cdef-123456789012\",\n    \"timestamp\": 1708352661.811551,\n    \"data\": {\n        \"id\": 43429,\n        \"ref\": \"con_x7k9m2p4\"\n    }\n}\n</code></pre>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"d1152ba6-ee66-4ecc-a834-8e7413299899"},{"name":"Contact tag created","id":"e706932c-3d34-4205-8584-371dc4aa3fe8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"contact_tag.created\",\n  \"event_uuid\": null,\n  \"timestamp\": 1708353164.639808,\n  \"data\": {\n    \"contact\": {\n      \"id\": 42720,\n      \"first_name\": \"Mario\",\n      \"last_name\": \"Rossi\",\n      \"phone\": \"+396754634537\",\n      \"email\": \"mario.rossi@mail.it\",\n      \"has_invalid_phone\": false,\n      \"language\": \"it\",\n      \"chat_link\": \"https://site-name/chats/5e8e95d4\",\n      \"is_restricted\": false\n    },\n    \"tag\": {\n      \"id\": 2,\n      \"name\": \"Bug\",\n      \"color\": \"#d4164f\",\n      \"order\": 1\n    }\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a contact tag has been created.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>V2 default: <code>contact_id</code>, <code>contact_ref</code>, <code>tag_id</code>, <code>tag_ref</code>. Full objects require expands.</p>\n<p><strong>Available expands:</strong> <code>contact</code>, <code>tag</code>, <code>contact.tag_set</code>, <code>contact.list_set</code>, <code>contact.role_set</code>, <code>contact.contactfield_set</code>, <code>contact.contactfield_values</code></p>\n<h3 id=\"v2-example\">V2 Example</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"version\": 2,\n    \"event\": \"contact_tag.created\",\n    \"event_uuid\": \"d4e5f6a7-b8c9-0123-def0-234567890123\",\n    \"timestamp\": 1708353164.639808,\n    \"data\": {\n        \"contact_id\": 42720,\n        \"contact_ref\": \"con_m3n4o5p6\",\n        \"tag_id\": 2,\n        \"tag_ref\": \"tag_q7r8s9t0\"\n    }\n}\n</code></pre>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"e706932c-3d34-4205-8584-371dc4aa3fe8"},{"name":"Contact tag deleted","id":"05c25d75-d244-427d-879f-841760cb9b12","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"contact_tag.deleted\",\n  \"event_uuid\": null,\n  \"timestamp\": 1708353164.639808,\n  \"data\": {\n    \"contact\": {\n      \"id\": 42720,\n      \"first_name\": \"Mario\",\n      \"last_name\": \"Rossi\",\n      \"phone\": \"+396754634537\",\n      \"email\": \"mario.rossi@mail.it\",\n      \"has_invalid_phone\": false,\n      \"language\": \"it\",\n      \"chat_link\": \"https://site-name/chats/5e8e95d4\",\n      \"is_restricted\": false\n    },\n    \"tag\": {\n      \"id\": 2,\n      \"name\": \"Bug\",\n      \"color\": \"#d4164f\",\n      \"order\": 1\n    }\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a contact tag has been deleted.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>V2 default: <code>contact_id</code>, <code>contact_ref</code>, <code>tag_id</code>, <code>tag_ref</code>. Full objects require expands.</p>\n<p><strong>Available expands:</strong> <code>contact</code>, <code>tag</code>, <code>contact.tag_set</code>, <code>contact.list_set</code>, <code>contact.role_set</code>, <code>contact.contactfield_set</code>, <code>contact.contactfield_values</code></p>\n<h3 id=\"v2-example\">V2 Example</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"version\": 2,\n    \"event\": \"contact_tag.deleted\",\n    \"event_uuid\": \"e5f6a7b8-c9d0-1234-ef01-345678901234\",\n    \"timestamp\": 1708353164.639808,\n    \"data\": {\n        \"contact_id\": 42720,\n        \"contact_ref\": \"con_m3n4o5p6\",\n        \"tag_id\": 2,\n        \"tag_ref\": \"tag_q7r8s9t0\"\n    }\n}\n</code></pre>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"05c25d75-d244-427d-879f-841760cb9b12"},{"name":"Contact list created","id":"90cbcb42-cf5c-45e8-9512-0885405b1bca","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"contact_list.created\",\n  \"event_uuid\": null,\n  \"timestamp\": 1708353468.752674,\n  \"data\": {\n    \"contact\": {\n      \"id\": 43416,\n      \"first_name\": \"Mario\",\n      \"last_name\": \"Rossi\",\n      \"phone\": \"+393331234567\",\n      \"email\": \"mario.rossi@domain.com\",\n      \"has_invalid_phone\": false,\n      \"language\": \"it\",\n      \"chat_link\": \"https://site-name/chats/56894dcb55\",\n      \"is_restricted\": false\n    },\n    \"list\": {\n      \"id\": 469,\n      \"name\": \"import_sample (30).csv\",\n      \"color\": null,\n      \"created_datetime\": \"2024-02-19T11:26:36.453079+01:00\",\n      \"contacts_count\": 1\n    }\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a contact has been added to a list.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>V2 default: <code>contact_id</code>, <code>contact_ref</code>, <code>list_id</code>, <code>list_ref</code>. Full objects require expands.</p>\n<p><strong>Available expands:</strong> <code>contact</code>, <code>list</code>, <code>contact.tag_set</code>, <code>contact.list_set</code>, <code>contact.role_set</code>, <code>contact.contactfield_set</code>, <code>contact.contactfield_values</code></p>\n<h3 id=\"v2-example\">V2 Example</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"version\": 2,\n    \"event\": \"contact_list.created\",\n    \"event_uuid\": \"f6a7b8c9-d0e1-2345-f012-456789012345\",\n    \"timestamp\": 1708353468.752674,\n    \"data\": {\n        \"contact_id\": 43416,\n        \"contact_ref\": \"con_u1v2w3x4\",\n        \"list_id\": 469,\n        \"list_ref\": \"lst_y5z6a7b8\"\n    }\n}\n</code></pre>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"90cbcb42-cf5c-45e8-9512-0885405b1bca"},{"name":"Contact list deleted","id":"697d8e59-8bc5-4776-a265-bd5f3a0ee61d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"contact_list.deleted\",\n  \"event_uuid\": null,\n  \"timestamp\": 1708353468.752674,\n  \"data\": {\n    \"contact\": {\n      \"id\": 43416,\n      \"first_name\": \"Mario\",\n      \"last_name\": \"Rossi\",\n      \"phone\": \"+393331234567\",\n      \"email\": \"mario.rossi@domain.com\",\n      \"has_invalid_phone\": false,\n      \"language\": \"it\",\n      \"chat_link\": \"https://site-name/chats/56894dcb55\",\n      \"is_restricted\": false\n    },\n    \"list\": {\n      \"id\": 469,\n      \"name\": \"import_sample (30).csv\",\n      \"color\": null,\n      \"created_datetime\": \"2024-02-19T11:26:36.453079+01:00\",\n      \"contacts_count\": 1\n    }\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a contact has been removed from a list.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>V2 default: <code>contact_id</code>, <code>contact_ref</code>, <code>list_id</code>, <code>list_ref</code>. Full objects require expands.</p>\n<p><strong>Available expands:</strong> <code>contact</code>, <code>list</code>, <code>contact.tag_set</code>, <code>contact.list_set</code>, <code>contact.role_set</code>, <code>contact.contactfield_set</code>, <code>contact.contactfield_values</code></p>\n<h3 id=\"v2-example\">V2 Example</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"version\": 2,\n    \"event\": \"contact_list.deleted\",\n    \"event_uuid\": \"a7b8c9d0-e1f2-3456-0123-567890123456\",\n    \"timestamp\": 1708353468.752674,\n    \"data\": {\n        \"contact_id\": 43416,\n        \"contact_ref\": \"con_u1v2w3x4\",\n        \"list_id\": 469,\n        \"list_ref\": \"lst_y5z6a7b8\"\n    }\n}\n</code></pre>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"697d8e59-8bc5-4776-a265-bd5f3a0ee61d"},{"name":"Contact field created or updated","id":"063392f8-7f23-4272-91c0-0f9b8de473eb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"contact_field.created_or_updated\",\n  \"event_uuid\": null,\n  \"timestamp\": 1708353779.160536,\n  \"data\": {\n    \"contact\": {\n      \"id\": 43421,\n      \"first_name\": \"Mario\",\n      \"last_name\": \"Rossi\",\n      \"phone\": \"+394767456321\",\n      \"email\": null,\n      \"has_invalid_phone\": false,\n      \"language\": \"it\",\n      \"chat_link\": \"https://site-name/chats/12608f8468ac\",\n      \"is_restricted\": false\n    },\n    \"contact_field\": {\n      \"id\": 293013,\n      \"field\": 116,\n      \"code\": \"ZABAIONE\",\n      \"visual_code\": \"%%ZABAIONE%%\",\n      \"value\": \"this is a test message\",\n      \"value_datetime\": null\n    }\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a contact field has been created or updated.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>V2 default: <code>contact_id</code>, <code>contact_ref</code>, <code>contact_field</code> (nested object with <code>ref</code>, <code>field_ref</code>, <code>code</code>, <code>visual_code</code>, <code>value</code>, <code>value_datetime</code>). Full <code>contact</code> object requires expand.</p>\n<p><strong>Available expands:</strong> <code>contact</code>, <code>contact.tag_set</code>, <code>contact.list_set</code>, <code>contact.role_set</code>, <code>contact.contactfield_set</code>, <code>contact.contactfield_values</code></p>\n<h3 id=\"v2-example\">V2 Example</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"version\": 2,\n    \"event\": \"contact_field.created_or_updated\",\n    \"event_uuid\": \"b8c9d0e1-f2a3-4567-1234-678901234567\",\n    \"timestamp\": 1708353779.160536,\n    \"data\": {\n        \"contact_id\": 43421,\n        \"contact_ref\": \"con_c9d0e1f2\",\n        \"contact_field\": {\n            \"ref\": \"cfld_a1b2c3d4\",\n            \"field_ref\": \"fld_g3h4i5j6\",\n            \"code\": \"CITY\",\n            \"visual_code\": \"%%CITY%%\",\n            \"value\": \"Milano\",\n            \"value_datetime\": null\n        }\n    }\n}\n</code></pre>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"063392f8-7f23-4272-91c0-0f9b8de473eb"},{"name":"Contact field deleted","id":"52b197e4-4dcd-4aad-802a-6e4e6853a1e5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"contact_field.deleted\",\n  \"event_uuid\": null,\n  \"timestamp\": 1708353779.160536,\n  \"data\": {\n    \"contact\": {\n      \"id\": 43421,\n      \"first_name\": \"Mario\",\n      \"last_name\": \"Rossi\",\n      \"phone\": \"+394767456321\",\n      \"email\": null,\n      \"has_invalid_phone\": false,\n      \"language\": \"it\",\n      \"chat_link\": \"https://site-name/chats/12608f8468ac\",\n      \"is_restricted\": false\n    },\n    \"contact_field\": {\n      \"id\": 293013,\n      \"field\": 116,\n      \"code\": \"ZABAIONE\",\n      \"visual_code\": \"%%ZABAIONE%%\",\n      \"value\": \"this is a test message\",\n      \"value_datetime\": null\n    }\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a contact field has been deleted.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>V2 default: <code>contact_id</code>, <code>contact_ref</code>, <code>contact_field</code> (nested object with <code>ref</code>, <code>field_ref</code>, <code>code</code>, <code>visual_code</code>, <code>value</code>, <code>value_datetime</code>). Full <code>contact</code> object requires expand.</p>\n<p><strong>Available expands:</strong> <code>contact</code>, <code>contact.tag_set</code>, <code>contact.list_set</code>, <code>contact.role_set</code>, <code>contact.contactfield_set</code>, <code>contact.contactfield_values</code></p>\n<h3 id=\"v2-example\">V2 Example</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"version\": 2,\n    \"event\": \"contact_field.deleted\",\n    \"event_uuid\": \"c9d0e1f2-a3b4-5678-2345-789012345678\",\n    \"timestamp\": 1708353779.160536,\n    \"data\": {\n        \"contact_id\": 43421,\n        \"contact_ref\": \"con_c9d0e1f2\",\n        \"contact_field\": {\n            \"ref\": \"cfld_a1b2c3d4\",\n            \"field_ref\": \"fld_g3h4i5j6\",\n            \"code\": \"CITY\",\n            \"visual_code\": \"%%CITY%%\",\n            \"value\": \"Milano\",\n            \"value_datetime\": null\n        }\n    }\n}\n</code></pre>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"52b197e4-4dcd-4aad-802a-6e4e6853a1e5"},{"name":"Form filled","id":"9d2bc554-901d-4164-b062-20e66e4ead92","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"form_answer.submitted\",\n  \"event_uuid\": \"de87becb-9230-4956-a068-b651a3199707\",\n  \"timestamp\": 1758640115.678934,\n  \"data\": {\n    \"version\": 1,\n    \"event\": \"form_answer.submitted\",\n    \"event_uuid\": \"7720237a-f608-4a02-a857-7e8bbf6c6d4e\",\n    \"timestamp\": 1746018902.049365,\n    \"data\": {\n      \"id\": \"64fb688675b34da5937d2f6da2113dc7\",\n      \"form\": {\n        \"id\": \"d91eb5363adb4a4ab10826fbb9a8293b\",\n        \"name\": \"Lead Generation\"\n      },\n      \"contact\": {\n        \"id\": 1234567890,\n        \"phone\": \"+393409525995\",\n        \"email\": \"ds@dd.it\",\n        \"first_name\": \"Mario\",\n        \"last_name\": \"Rossi\",\n        \"full_name\": \"Mario Rossi\"\n      },\n      \"response_data\": {\n        \"email\": \"mario.rossi@example.it\",\n        \"form_id\": \"d91eb5363adb4a4ab10826fbsssss293b\",\n        \"last_name\": \"Rossi\",\n        \"first_name\": \"Mario\",\n        \"flow_token\": \"unused\"\n      },\n      \"completed_screens\": [],\n      \"is_completed\": true,\n      \"attributes\": null,\n      \"created_datetime\": \"2025-04-30T15:15:02.029299+02:00\",\n      \"updated_datetime\": \"2025-04-30T15:15:02.029310+02:00\",\n      \"extracted_fields\": {}\n    }\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a form answer has been submitted.</p>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> The body example below shows V1 format.</p>\n</blockquote>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>V2 default: <code>id</code>, <code>ref</code>, <code>form_id</code>, <code>form_ref</code>, <code>contact_id</code>, <code>contact_ref</code>, <code>source</code>, <code>platform</code>. All nested objects require expands.</p>\n<p><strong>Available expands:</strong> <code>form</code>, <code>contact</code>, <code>response_data</code>, <code>completed_screens</code>, <code>attributes</code>, <code>extracted_fields</code>, <code>contact.tag_set</code>, <code>contact.list_set</code>, <code>contact.contactfield_set</code>, <code>contact.contactfield_values</code></p>\n<h3 id=\"v2-example\">V2 Example</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"version\": 2,\n    \"event\": \"form_answer.submitted\",\n    \"event_uuid\": \"de87becb-9230-4956-a068-b651a3199707\",\n    \"timestamp\": 1758640115.678934,\n    \"data\": {\n        \"id\": \"64fb688675b34da5937d2f6da2113dc7\",\n        \"ref\": \"fa_k7l8m9n0\",\n        \"form_id\": \"d91eb5363adb4a4ab10826fbb9a8293b\",\n        \"form_ref\": \"frm_p1q2r3s4\",\n        \"contact_id\": 1234567890,\n        \"contact_ref\": \"con_t5u6v7w8\",\n        \"source\": \"whatsapp\",\n        \"platform\": \"flows\"\n    }\n}\n</code></pre>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"9d2bc554-901d-4164-b062-20e66e4ead92"},{"name":"Template created","id":"184deda4-c32d-4162-bb25-e3dd58eecb68","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"template.created\",\n  \"event_uuid\": \"2b71ebf7-3f00-4b12-9ca2-543974eef630\",\n  \"timestamp\": 1758640330.036732,\n  \"data\": {\n    \"id\": 45678,\n    \"name\": \"Lorem Ipsum\",\n    \"category\": \"MARKETING\",\n    \"subcategory\": \"CLASSIC\",\n    \"integration\": -1,\n    \"is_approved\": false,\n    \"is_favorite\": false,\n    \"customfield_set\": [\n      \"%%FIRST_NAME%%\"\n    ],\n    \"templatelocalization_set\": [\n      {\n        \"language\": \"it\",\n        \"status\": \"DRAFT\",\n        \"rejection_reason\": null,\n        \"header\": null,\n        \"body\": {\n          \"component_type\": \"body\",\n          \"format\": null,\n          \"text\": \"Ciao %%FIRST_NAME%%! 🌟 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec ante vel ante finibus finibus. Nullam nec ante vel ante finibus finibus. Nullam nec ante vel ante finibus finibus.\"\n        },\n        \"footer\": null,\n        \"button_set\": [\n          {\n            \"order\": 0,\n            \"button_type\": \"unsubscribe\",\n            \"text\": \"Disiscriviti\",\n            \"phone_number\": null,\n            \"url\": null,\n            \"form_id\": null\n          }\n        ],\n        \"carouselcomponent_set\": [],\n        \"default_header_media\": null\n      }\n    ],\n    \"template_groups\": []\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a template has been created.</p>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Template events are an exception — in V2, the nested fields (<code>templatelocalization_set</code>, <code>template_groups</code>, <code>customfield_set</code>) are <strong>always included</strong> without requiring expands. No expands are needed or available for this event type.</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"184deda4-c32d-4162-bb25-e3dd58eecb68"},{"name":"Template updated","id":"d5bf72d6-be22-4740-b532-90498a2b3476","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"template.updated\",\n  \"event_uuid\": \"ae8b25b0-05fb-4ec0-9f92-239be7f20e9c\",\n  \"timestamp\": 1758640386.190504,\n  \"data\": {\n    \"id\": 45678,\n    \"name\": \"Lorem Ipsum\",\n    \"category\": \"MARKETING\",\n    \"subcategory\": \"CLASSIC\",\n    \"integration\": -1,\n    \"is_approved\": false,\n    \"is_favorite\": false,\n    \"customfield_set\": [\n      \"%%FIRST_NAME%%\"\n    ],\n    \"templatelocalization_set\": [\n      {\n        \"language\": \"it\",\n        \"status\": \"DRAFT\",\n        \"rejection_reason\": null,\n        \"header\": null,\n        \"body\": {\n          \"component_type\": \"body\",\n          \"format\": null,\n          \"text\": \"Ciao %%FIRST_NAME%%! 🌟 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec ante vel ante finibus finibus. Nullam nec ante vel ante finibus finibus. Nullam nec ante vel ante finibus finibus.\"\n        },\n        \"footer\": null,\n        \"button_set\": [\n          {\n            \"order\": 0,\n            \"button_type\": \"unsubscribe\",\n            \"text\": \"Disiscriviti\",\n            \"phone_number\": null,\n            \"url\": null,\n            \"form_id\": null\n          }\n        ],\n        \"carouselcomponent_set\": [],\n        \"default_header_media\": null\n      }\n    ],\n    \"template_groups\": []\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a template has been updated.</p>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Template events are an exception — in V2, the nested fields (<code>templatelocalization_set</code>, <code>template_groups</code>, <code>customfield_set</code>) are <strong>always included</strong> without requiring expands. No expands are needed or available for this event type.</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"d5bf72d6-be22-4740-b532-90498a2b3476"},{"name":"Template deleted","id":"282a343e-501f-4aaa-95bc-e6cb74353d02","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"template.deleted\",\n  \"event_uuid\": \"a56799ae-a606-4904-aee1-04ed688aed31\",\n  \"timestamp\": 1758640505.536392,\n  \"data\": {\n    \"id\": 2337\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a template has been deleted.</p>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Template events are an exception — in V2, the nested fields are <strong>always included</strong> without requiring expands. For deletion, only the <code>id</code> and <code>ref</code> are sent. No expands are needed or available for this event type.</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"282a343e-501f-4aaa-95bc-e6cb74353d02"},{"name":"Whatsapp channel status","id":"1a017348-8ff2-465a-bd53-0137f1ebe2e7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"channel.whatsapp.status\",\n  \"event_uuid\": \"5a973c07-a8a8-45c7-afd4-dd57460c8a62\",\n  \"timestamp\": 1758640650.27122,\n  \"data\": {\n    \"account_id\": 9968,\n    \"phone\": \"390831981810\",\n    \"is_enabled\": true,\n    \"is_active\": true,\n    \"phone_status\": \"Connected\",\n    \"quality_score\": \"Green\",\n    \"quality_reasons\": \"\"\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when the WhatsApp channel status changes.</p>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Channel status events have the same payload in V1 and V2. No expands are available for this event type.</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"1a017348-8ff2-465a-bd53-0137f1ebe2e7"},{"name":"SMS One-way channel status","id":"18a624ca-54f1-403c-82f0-0d18a8e68312","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"channel.sms_one_way.status\",\n  \"event_uuid\": \"0cdab304-c9c2-45bd-b09e-2145b5e46c8d\",\n  \"timestamp\": 1758640742.426857,\n  \"data\": {\n    \"account_id\": 9968,\n    \"phone\": \"390831981810\",\n    \"is_enabled\": true,\n    \"is_active\": false\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when the SMS One-way channel status changes.</p>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Channel status events have the same payload in V1 and V2. No expands are available for this event type.</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"18a624ca-54f1-403c-82f0-0d18a8e68312"},{"name":"SMS Two-way channel status","id":"9e51841c-9947-4ec3-b5df-000b31c0a8f5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"channel.sms_two_way.status\",\n  \"event_uuid\": \"d91f9b45-5b02-45a2-ba44-0018d0fb4936\",\n  \"timestamp\": 1758640775.731556,\n  \"data\": {\n    \"account_id\": 9968,\n    \"phone\": \"390831981810\",\n    \"is_enabled\": true,\n    \"is_active\": false\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when the SMS Two-way channel status changes.</p>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Channel status events have the same payload in V1 and V2. No expands are available for this event type.</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"9e51841c-9947-4ec3-b5df-000b31c0a8f5"},{"name":"Account Violation","id":"a4fdbb77-a551-48c2-868f-ae234ec68140","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"channel.whatsapp.violation\",\n  \"event_uuid\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"timestamp\": 1708353164.639808,\n  \"data\": {\n    \"account_id\": 123,\n    \"violation\": {\n      \"type\": \"SPAM\",\n      \"event_id\": \"817884dd-fecd-4442-80fd-6b25d7cf302f\",\n      \"property\": \"ACCOUNT_VIOLATION\",\n      \"timestamp\": \"2025-12-02T16:05:49.741335+00:00\",\n      \"waba_name\": \"Test name\"\n    }\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when an account violation is detected.</p>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Account violation events have the same payload in V1 and V2. No expands are available for this event type.</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"a4fdbb77-a551-48c2-868f-ae234ec68140"},{"name":"Account Restriction","id":"17b040c1-a4a1-44f3-afc5-cbcb5cb2836d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"channel.whatsapp.restriction\",\n  \"event_uuid\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"timestamp\": 1708353164.639808,\n  \"data\": {\n    \"account_id\": 123,\n    \"restrictions\": [\n      {\n        \"expiration\": \"2026-01-01T16:05:32+0000\",\n        \"restrictionType\": \"RESTRICTED_ADD_PHONE_NUMBER_ACTION\"\n      },\n      {\n        \"expiration\": \"2026-01-01T16:05:32+0000\",\n        \"restrictionType\": \"RESTRICTED_BIZ_INITIATED_MESSAGING\"\n      },\n      {\n        \"expiration\": \"2026-01-01T16:05:32+0000\",\n        \"restrictionType\": \"RESTRICTED_CUSTOMER_INITIATED_MESSAGING\"\n      }\n    ]\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when an account restriction is applied.</p>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Account restriction events have the same payload in V1 and V2. No expands are available for this event type.</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"17b040c1-a4a1-44f3-afc5-cbcb5cb2836d"},{"name":"Account Tier Changed","id":"7e7df60c-c775-412e-9ad1-b32f10fa1ac5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"channel.whatsapp.tier_changed\",\n  \"event_uuid\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"timestamp\": 1708353164.639808,\n  \"data\": {\n    \"account_id\": 123,\n    \"phone\": \"+393331234567\",\n    \"daily_limit\": 100000,\n    \"previous_daily_limit\": 10000\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when the account messaging tier changes.</p>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Account tier changed events have the same payload in V1 and V2. No expands are available for this event type.</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"7e7df60c-c775-412e-9ad1-b32f10fa1ac5"},{"name":"Campaign created","id":"bbf1a213-a756-4e71-9c45-8b73452e6882","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"campaign.created\",\n  \"event_uuid\": \"365cd5f1-18e0-4271-b019-cda8deedd1c1e\",\n  \"timestamp\": 1773242105.131103,\n  \"data\": {\n    \"id\": 123,\n    \"name\": \"example campaign\",\n    \"status\": \"Scheduled\",\n    \"campaign_type\": \"Scheduled\",\n    \"scheduled_datetime\": \"2026-03-11T15:16:00.058000+00:00\",\n    \"start_datetime\": null,\n    \"end_datetime\": null,\n    \"created_datetime\": \"2026-03-11T15:15:05.117370+00:00\"\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a campaign has been created.</p>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Campaign events have the same payload in V1 and V2. No expands are available for this event type.</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"bbf1a213-a756-4e71-9c45-8b73452e6882"},{"name":"Campaign deleted","id":"c9a5f59f-0025-4b10-a928-c9a2ca999f32","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"campaign.created\",\n  \"event_uuid\": \"365cd5f1-18e0-4271-b019-cda8deedd1c1e\",\n  \"timestamp\": 1773242105.131103,\n  \"data\": {\n    \"id\": 123,\n    \"name\": \"example campaign\",\n    \"status\": \"Scheduled\",\n    \"campaign_type\": \"Scheduled\",\n    \"scheduled_datetime\": \"2026-03-11T15:16:00.058000+00:00\",\n    \"start_datetime\": null,\n    \"end_datetime\": null,\n    \"created_datetime\": \"2026-03-11T15:15:05.117370+00:00\"\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a campaign has been deleted.</p>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Campaign events have the same payload in V1 and V2. No expands are available for this event type.</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"c9a5f59f-0025-4b10-a928-c9a2ca999f32"},{"name":"Campaign status changed","id":"1f23f1d2-6505-4816-bf3b-0c1692515ac2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"campaign.status_changed\",\n  \"event_uuid\": \"3e75fafb-xxxx-xxxx-a93e-89cf4c88afdf\",\n  \"timestamp\": 1773242144.625431,\n  \"data\": {\n    \"id\": 123,\n    \"name\": \"example campaign\",\n    \"old_status\": \"Scheduled\",\n    \"new_status\": \"Processing\",\n    \"campaign_type\": \"Scheduled\",\n    \"scheduled_datetime\": \"2026-03-11T15:16:00.058000+00:00\",\n    \"start_datetime\": \"2026-03-11T15:15:44.272751+00:00\",\n    \"end_datetime\": null,\n    \"created_datetime\": \"2026-03-11T15:15:05.117370+00:00\"\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified when a campaign status changes (e.g. started, completed, paused).</p>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Campaign events have the same payload in V1 and V2. No expands are available for this event type.</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"1f23f1d2-6505-4816-bf3b-0c1692515ac2"},{"name":"Channel Activation","id":"c712dba4-57e6-41f8-8cc1-159dc4d9e7d3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n  \"version\": 1,\n  \"event\": \"channel.activation\",\n  \"event_uuid\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n  \"timestamp\": 1710000000.0,\n  \"data\": {\n    \"account_id\": 123,\n    \"action_type\": \"activation_started\",\n    \"phone\": \"+15555555555\",\n    \"account_name\": \"My Business\",\n    \"user\": \"user@example.com\",\n    \"metadata\": {}\n  }\n}","options":{"raw":{"language":"json"}}},"description":"<p>This event is notified during the channel activation process (onboarding steps).</p>\n<h3 id=\"v2-payload\">V2 payload</h3>\n<p>Channel activation events have the same payload in V1 and V2. No expands are available for this event type.</p>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"c712dba4-57e6-41f8-8cc1-159dc4d9e7d3"}],"id":"cdd3cba2-4345-476d-a3c0-d7ab6689a2ff","description":"<p>The <strong>webhooks body content</strong> represents the structured payload that Spoki sends to your endpoint whenever an external webhook event is triggered. It contains the contextual data of the event, organized by type (e.g., message received, delivery updates, status changes).</p>\n<p>All webhook payloads share these top-level fields:</p>\n<ul>\n<li><p><strong>version</strong> <em>(integer)</em> – The webhook schema version (currently 1).</p>\n</li>\n<li><p><strong>event</strong> <em>(string)</em> – The type of event that triggered the webhook (e.g., message.received, channel.whatsapp.status).</p>\n</li>\n<li><p><strong>event_uuid</strong> <em>(string, UUID)</em> – A unique identifier for the webhook event, useful for idempotency and tracing.</p>\n</li>\n<li><p><strong>timestamp</strong> <em>(float)</em> – The time the event occurred, expressed as a Unix timestamp in seconds.</p>\n</li>\n<li><p><strong>data</strong> <em>(object)</em> – An object containing the event-specific payload. Its structure varies depending on the event type.</p>\n</li>\n</ul>\n<p>This body allows your system to parse and respond programmatically to events coming from Spoki, ensuring proper handling of user interactions and message flows.</p>\n","_postman_id":"cdd3cba2-4345-476d-a3c0-d7ab6689a2ff","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}}},{"name":"Signature Verification","id":"90e16d10-0213-035d-45a2-1e39550ca4ce","request":{"method":"VIEW","header":[],"description":"<p>Every webhook delivery includes a signature header so you can verify that the request was sent by Spoki and not a third party.</p>\n<hr />\n<h2 id=\"v2-signature\">V2 Signature</h2>\n<p>V2 webhooks use <strong>HMAC-SHA256</strong>. The signature is sent in the <code>X-Spoki-Signature</code> header:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>X-Spoki-Signature: t=1683889161,v2=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8f9\n\n</code></pre><h3 id=\"how-to-verify\">How to verify</h3>\n<ol>\n<li><p>Extract the <code>t</code> (timestamp) and <code>v2</code> (signature) values from the header</p>\n</li>\n<li><p>Build the signed payload: <code>{timestamp}.{raw_json_body}</code></p>\n</li>\n<li><p>Compute <code>HMAC-SHA256</code> using your webhook secret (<code>whsec_...</code>) as the key</p>\n</li>\n<li><p>Compare the computed signature with the <code>v2</code> value</p>\n</li>\n<li><p>(Optional) Check that <code>t</code> is within an acceptable time window (e.g. 5 minutes) to prevent replay attacks</p>\n</li>\n</ol>\n<h3 id=\"python\">Python</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-python\">import hmac\nimport hashlib\nimport time\ndef verify_v2_signature(payload: bytes, header: str, secret: str, tolerance: int = 300) -&gt; bool:\n    parts = dict(p.split(\"=\", 1) for p in header.split(\",\"))\n    timestamp = parts[\"t\"]\n    signature = parts[\"v2\"]\n    signed_payload = f\"{timestamp}.{payload.decode()}\"\n    expected = hmac.new(secret.encode(), signed_payload.encode(), hashlib.sha256).hexdigest()\n    if not hmac.compare_digest(expected, signature):\n        return False\n    if abs(time.time() - int(timestamp)) &gt; tolerance:\n        return False\n    return True\n\n</code></pre>\n<h3 id=\"nodejs\">Node.js</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">const crypto = require(\"crypto\");\nfunction verifyV2Signature(payload, header, secret, tolerance = 300) {\n    const parts = Object.fromEntries(header.split(\",\").map(p =&gt; p.split(\"=\", 2)));\n    const { t: timestamp, v2: signature } = parts;\n    const signedPayload = `${timestamp}.${payload}`;\n    const expected = crypto.createHmac(\"sha256\", secret).update(signedPayload).digest(\"hex\");\n    if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature))) {\n        return false;\n    }\n    if (Math.abs(Date.now() / 1000 - parseInt(timestamp)) &gt; tolerance) {\n        return false;\n    }\n    return true;\n}\n\n</code></pre>\n<h3 id=\"php\">PHP</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-php\">function verifyV2Signature(string $payload, string $header, string $secret, int $tolerance = 300): bool {\n    $parts = [];\n    foreach (explode(\",\", $header) as $part) {\n        [$key, $value] = explode(\"=\", $part, 2);\n        $parts[$key] = $value;\n    }\n    $signedPayload = $parts[\"t\"] . \".\" . $payload;\n    $expected = hash_hmac(\"sha256\", $signedPayload, $secret);\n    if (!hash_equals($expected, $parts[\"v2\"])) {\n        return false;\n    }\n    if (abs(time() - intval($parts[\"t\"])) &gt; $tolerance) {\n        return false;\n    }\n    return true;\n}\n\n</code></pre>\n<h3 id=\"go\">Go</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-go\">import (\n    \"crypto/hmac\"\n    \"crypto/sha256\"\n    \"encoding/hex\"\n    \"fmt\"\n    \"math\"\n    \"strconv\"\n    \"strings\"\n    \"time\"\n)\nfunc VerifyV2Signature(payload, header, secret string, tolerance int64) bool {\n    parts := make(map[string]string)\n    for _, p := range strings.Split(header, \",\") {\n        kv := strings.SplitN(p, \"=\", 2)\n        parts[kv[0]] = kv[1]\n    }\n    signedPayload := fmt.Sprintf(\"%s.%s\", parts[\"t\"], payload)\n    mac := hmac.New(sha256.New, []byte(secret))\n    mac.Write([]byte(signedPayload))\n    expected := hex.EncodeToString(mac.Sum(nil))\n    if !hmac.Equal([]byte(expected), []byte(parts[\"v2\"])) {\n        return false\n    }\n    ts, _ := strconv.ParseInt(parts[\"t\"], 10, 64)\n    if math.Abs(float64(time.Now().Unix()-ts)) &gt; float64(tolerance) {\n        return false\n    }\n    return true\n}\n\n</code></pre>\n<hr />\n<h2 id=\"v1-signature-deprecated\">V1 Signature (Deprecated)</h2>\n<blockquote>\n<p><strong>V1 is deprecated.</strong> New webhooks should use V2. </p>\n</blockquote>\n<p>V1 webhooks use <strong>PBKDF2-HMAC-SHA256</strong> with 200,000 iterations. The signature is sent in the <code>X-SPOKI-HASH</code> header:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>X-SPOKI-HASH: a1b2c3d4e5f6...\n\n</code></pre><h3 id=\"how-to-verify-python\">How to verify (Python)</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-python\">import hashlib\ndef verify_v1_signature(payload: bytes, header_hash: str, secret: str) -&gt; bool:\n    expected = hashlib.pbkdf2_hmac(\"sha256\", payload, secret.encode(), 200000).hex()\n    return expected == header_hash\n\n</code></pre>\n<hr />\n<h2 id=\"headers-sent-with-every-webhook\">Headers sent with every webhook</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Header</th>\n<th>Version</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>Content-Type</code></td>\n<td>V1, V2</td>\n<td><code>application/json</code></td>\n</tr>\n<tr>\n<td><code>User-Agent</code></td>\n<td>V1, V2</td>\n<td><code>Spoki/{version}</code></td>\n</tr>\n<tr>\n<td><code>X-SPOKI-ACCOUNT</code></td>\n<td>V1, V2</td>\n<td>Account ID</td>\n</tr>\n<tr>\n<td><code>X-SPOKI-HASH</code></td>\n<td>V1 only</td>\n<td>PBKDF2-HMAC-SHA256 signature</td>\n</tr>\n<tr>\n<td><code>X-Spoki-Signature</code></td>\n<td>V2 only</td>\n<td><code>t={timestamp},v2={hmac_sha256_hex}</code></td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","name":"Webhooks","type":"folder"}},"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"90e16d10-0213-035d-45a2-1e39550ca4ce"}],"id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1","description":"<p>Webhooks are user-defined HTTP callbacks that are triggered by specific events. Whenever that trigger event occurs, the WhatsApp Business API client captures the event, collects the data, and immediately sends a notification (HTTPs request) to the Webhook URL configured in the Webhooks setup step.</p>\n<p>Spoki Webhooks deliver real-time HTTP POST notifications to your server when events occur in your account — contacts created, messages received, templates updated, and more.V2 webhooks introduce <strong>minimal payloads by default</strong>, an <strong>expands system</strong> to request only the data you need, <strong>HMAC-SHA256 signature verification</strong> with replay protection.</p>\n<p>For the purposes of this use case, your Webhooks server must be reachable and have HTTPs support and a valid SSL certificate.</p>\n<p>To get Webhooks notifications, your application must subscribe.</p>\n<p>Webhooks in Spoki</p>\n<p>following these steps:</p>\n<ol>\n<li><p>Navigate to Spoki / Integrations / Webhook.</p>\n</li>\n<li><p>Click on 'Add Webhook', then select the webhook, and set the webhook URL. This URL is where a POST request will be sent from our server.</p>\n</li>\n<li><p>Add the webhook.</p>\n</li>\n</ol>\n<img src=\"https://content.pstmn.io/9f868a0c-45a8-4355-ab2c-35a3af8d1278/U2NyZWVuc2hvdCAyMDI2LTAzLTE5IGF0IDExLjUwLjQ2LnBuZw==\" width=\"1014\" height=\"330\" />","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"7277a7c9-7061-461e-86c9-1439eb46b273","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"7fdd2668-f5ed-4974-9c1c-b3b5ea851afb","type":"text/javascript","exec":[""]}}],"_postman_id":"1aaf0d9e-9fd2-4358-b142-dbfcbc21dae1"},{"name":"Webhook Contact in automation step","item":[{"name":"Contact in automation step","id":"909bd313-aa0f-407d-ac1b-91268713b5e9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"{\n    \"contact\": {\n        \"id\": 10,\n        \"phone\": \"{{phone}}\",\n        \"first_name\": \"John\",\n        \"last_name\": \"Doe\",\n        \"email\": \"john.doe@domain.com\",\n        \"language\": \"en\",\n        \"chat_link\": \"https://spoki.app/chats/fV1raxSvcEqOG6KSXOk4\",\n        \"contactfield_set\": [\n            {\n                \"filed\": 13,\n                \"visual_code\": \"%%CITY%%\",\n                \"value\": \"Milano\"\n            }\n        ],\n        \"contactfield_values\": {\n            \"CITY\": \"Milano\"\n        }\n    },\n    \"metadata\": {\n        \"your_str_meta\": \"lorem ipsum\",\n        \"your_int_meta\": 3,\n        \"your_float_meta\": 42.5,\n        \"your_bool_meta\": true\n    }\n}","options":{"raw":{"language":"json"}}},"url":"","description":"<p>Receive Webhook From Spoki when a contact reaches the step.</p>\n<h3 id=\"1-http-request-methods\">1. HTTP Request Methods</h3>\n<p>You can select the HTTP method you want to use from the dropdown menu available in the webhook configuration, you can select between:</p>\n<ul>\n<li><p><code>GET</code></p>\n</li>\n<li><p><code>POST</code></p>\n</li>\n<li><p><code>PUT</code></p>\n</li>\n<li><p><code>PATCH</code></p>\n</li>\n<li><p><code>DELETE</code></p>\n</li>\n</ul>\n<h3 id=\"2-custom-json-payload-creation\">2. Custom JSON Payload Creation</h3>\n<p>Use the provided text editor to build highly customized JSON payloads, including static fields, nested objects, and arrays. You have complete control over the structure of the payload. Ensure the JSON syntax is valid.</p>\n<p><strong>Supported Variable Types in the Payload:</strong></p>\n<ul>\n<li><p><strong>System Objects (Variables):</strong> These start with <code>{{</code> and end with <code>}}</code>. These variables represent predefined objects available in our system, such as:</p>\n<ul>\n<li><p><code>{{ contact }}</code>: Contains contact data (e.g., <code>contact.first_name</code>, <code>contact.email</code>).</p>\n</li>\n<li><p><code>{{ metadata }}</code>: Contains metadata related to the contact in the automation.</p>\n</li>\n<li><p><code>{{ context }}</code>: Contains context related to the contact in the automation.</p>\n</li>\n<li><p><code>{{ automation }}</code>: Contains the id of the current automation run.</p>\n</li>\n</ul>\n</li>\n</ul>\n<p><strong>Important:</strong> For complex objects like <code>contact</code> or <code>automation</code>, it is not necessary to include the entire object if only a specific field is wanted. The object can be expanded to directly access its attributes using dot notation.</p>\n<ul>\n<li><p><strong>Example:</strong> Instead of including the entire <code>{{ contact }}</code> object, if only the first name is needed, use <code>{{ contact.first_name }}</code>. Similarly, for the automation ID, use <code>{{ automation.id }}</code>.</p>\n</li>\n<li><p><strong>Dynamic Fields:</strong> These start and end with <code>%%</code>.</p>\n<p>  <strong>Example:</strong> <code>%%FIRST_NAME%%</code></p>\n</li>\n<li><p><strong>Static Fields:</strong> Any literal text, numeric, boolean value inserted directly into the payload.</p>\n</li>\n<li><p><strong>Inner Objects:</strong> Nested JSON structures used to organize data.</p>\n</li>\n<li><p><strong>Arrays:</strong> Lists of values or objects.</p>\n</li>\n</ul>\n<p><strong>Example JSON Payload (with variables):</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"user_data\": {\n    \"name\": \"{{ contact.first_name }}\",\n    \"surname\": \"{{ contact.last_name }}\",\n    \"email\": \"{{ contact.email }}\",\n    \"name_list\": [\n      \"%%DYNAMIC_FIELD_1%%\",\n      \"%%DYNAMIC_FIELD_2%%\",\n      \"%%DYNAMIC_FIELD_3%%\"\n    ],\n    \"operation_status\": \"success\",\n    \"additional_details\": {\n      \"automation_info\": {\n        \"automation_id\": \"{{ automation.id }}\",\n        \"type\": \"whatsapp_campaign\",\n      },\n      \"context\": \"{{ context }}\",\n    }\n  }\n}\n\n</code></pre>\n<p><strong>Example Final JSON Payload (simulated data with John Doe):</strong></p>\n<p>This example shows how the final payload might appear once all variables and dynamic fields have been resolved and populated with real data.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"user_data\": {\n    \"name\": \"John\",\n    \"surname\": \"Doe\",\n    \"email\": \"john.doe@example.com\",\n    \"name_list\": [\n      \"John\"\n    ],\n    \"operation_status\": \"success\",\n    \"additional_details\": {\n      \"automation_info\": {\n        \"automation_id\": \"1234\",\n        \"type\": \"whatsapp_campaign\",\n      },\n      \"context\": {\n        \"%%FIRST_NAME%%\": \"John\",\n        \"%%FIRSTNAME%%\": \"John\",\n        \"%%LAST_NAME%%\": \"Doe\",\n        \"%%LASTNAME%%\": \"Doe\",\n        \"%%EMAIL%%\": \"john.doe@example.com\",\n        \"%%PHONE%%\": \"+123334445555\"\n      }\n    }\n  }\n}\n\n</code></pre>\n<h3 id=\"3-using-dynamic-fields-in-headers-and-urls\">3. Using Dynamic Fields in Headers and URLs</h3>\n<img src=\"https://content.pstmn.io/5e2859cc-b9b2-44f4-92a6-ad205680c0dd/aW1hZ2UucG5n\" width=\"1484\" height=\"522\" />\n\n<p>Dynamic fields can be inserted not only within the payload but also within the values of request headers and directly in the URL.</p>\n<p>You can press the <code>Add Dynamic Field</code> button near the URL field and the header's values fields to add a dynamic field to the request.</p>\n<p><strong>Customized URL Example:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">https://your-webhook-url.com/endpoint/%%PHONE%%?first_name=%%FIRST_NAME%%\n\n</code></pre>\n<h3 id=\"4-response-handling-webhook-response-parsing\">4. Response Handling (Webhook Response Parsing)</h3>\n<img src=\"https://content.pstmn.io/94c49815-cc51-4925-92fe-797dc2d93c2e/aW1hZ2UucG5n\" width=\"1482\" height=\"410\" />\n\n<p>This feature allows our platform to parse the response payload sent by your webhook and save specific data into pre-defined <code>dynamic fields</code>. To leverage this functionality, your webhook's response must be structured in JSON format.</p>\n<p><strong>How to configure response parsing:</strong></p>\n<ol>\n<li><p><strong>Define Dynamic Fields:</strong> First, create the <code>dynamic fields</code> where you wish to save the response data (e.g. <code>SPECIFIC_KEY_VALUE</code>, <code>EVENT_DATE</code>, <code>STATUS</code>, <code>MY_CONTACT_ID</code>).</p>\n</li>\n<li><p><strong>Map JSON Paths:</strong> Specify the JSON Path within your webhook's JSON response that corresponds to the data to be extracted, and the <code>dynamic field</code> where it should be saved.</p>\n<p> <strong>Example (adapted from screenshots):</strong></p>\n<ul>\n<li><p><code>data.status</code> -&gt; <code>STATUS</code>: The value of the <code>status</code> field within the <code>data</code> object will be saved into the <code>STATUS</code> dynamic field.</p>\n</li>\n<li><p><code>data.data.inner.updated_at</code> -&gt; <code>EVENT_DATE</code>: The value of the <code>updated_at</code> field within the <code>inner</code> object will be saved into the <code>EVENT_DATE</code> dynamic field.</p>\n</li>\n<li><p><code>data.data.updated_contacts.0.contact_id</code> -&gt; <code>MY_CONTACT_ID</code>: The value of the <code>contact_id</code> field within the first object of the <code>updated_contacts</code> array will be saved into the <code>MY_CONTACT_ID</code> dynamic field.</p>\n</li>\n</ul>\n</li>\n</ol>\n<p><strong>Example of a possible JSON response from your webhook:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"status\": \"success\",\n  \"message\": \"Operation completed successfully\",\n  \"data\": {\n    \"transaction_id\": \"TXN_789012\",\n    \"response_timestamp\": \"2025-07-03T10:30:00Z\",\n    \"inner\": {\n      \"detail_description\": \"Data updated correctly\",\n      \"updated_at\": \"2025-07-03\"\n    },\n    \"updated_contacts\": [\n      {\n        \"contact_id\": \"TXN_789012\"\n      }\n    ]\n  }\n}\n\n</code></pre>\n<p>In this example, our platform will save:</p>\n<ul>\n<li><p>\"success\" into the <code>%%STATUS%%</code> field.</p>\n</li>\n<li><p>\"2025-07-03\" into the <code>%%EVENT_DATE%%</code> field.</p>\n</li>\n<li><p>\"TXN_789012\" into the <code>%%MY_CONTACT_ID%%</code> field.</p>\n</li>\n</ul>\n<h3 id=\"curl-example\">cURL Example</h3>\n<p>Here is an example of how the final request might look using <code>curl</code>, a popular command-line tool for making HTTP requests. This example includes the payload with \"John Doe\" data and an example header.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl -X POST \\\n  'https://your-webhook-url.com/endpoint' \\\n  -H 'Content-Type: application/json' \\\n  -H 'Authorization: Bearer YOUR_API_TOKEN' \\\n  -d '{\n    \"user_data\": {\n        \"name\": \"{{ contact.first_name }}\",\n        \"surname\": \"{{ contact.last_name }}\",\n        \"email\": \"{{ contact.email }}\",\n        \"name_list\": [\n            \"%%DYNAMIC_FIELD_1%%\",\n            \"%%DYNAMIC_FIELD_2%%\",\n            \"%%DYNAMIC_FIELD_3%%\"\n        ],\n        \"operation_status\": \"success\",\n        \"additional_details\": {\n            \"automation_info\": {\n                \"automation_id\": \"{{ automation.id }}\",\n                \"type\": \"whatsapp_campaign\",\n            },\n            \"context\": \"{{ context }}\",\n        }\n    }\n  }'\n\n</code></pre>\n<hr />\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"query":[],"variable":[]}},"response":[],"_postman_id":"909bd313-aa0f-407d-ac1b-91268713b5e9"}],"id":"45372124-4b8a-47fe-a61f-083608951866","_postman_id":"45372124-4b8a-47fe-a61f-083608951866","description":"","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}}},{"name":"Partners","item":[{"name":"Partners","item":[{"name":"Deprecated","item":[{"name":"Create Conversations Subrecharge - Software Vendor Only - DEPRECATED","id":"08b4b643-82be-4751-8cd8-689feabe9195","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"destination_account\": 1,\n    \"conversations\": 250\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partners/create_conversations_subrecharge/","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","partners","create_conversations_subrecharge",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"36ec57e8-68b3-4677-aec3-a362fd93148c","name":"Create Conversations Subrecharge - Software Vendor Only","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"destination_account\": 1,\n    \"conversations\": 250\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partners/create_conversations_subrecharge/"},"status":"No Content","code":204,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"08b4b643-82be-4751-8cd8-689feabe9195"}],"id":"07ee92c7-a644-40b5-b9bc-39ac8936e3db","_postman_id":"07ee92c7-a644-40b5-b9bc-39ac8936e3db","description":"","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}}},{"name":"List, search and filter partners","id":"d4648867-bb34-4dfd-b453-996f1d9bd2af","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/partners/","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","partners",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"f692b940-8ad0-4b68-8099-6e7c7e81f9c1","name":"200 OK","originalRequest":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/partners/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"[\n    {\n            \"id\": 1,\n            \"name\": \"MyPartner\",\n            \"email\": \"email@email.com\",\n            \"phone\": \"+391234567890\",\n            \"logo\": \"src_to_logo\",\n            \"extended_logo\": \"src_to_logo\"\n    }\n]"}],"_postman_id":"d4648867-bb34-4dfd-b453-996f1d9bd2af"},{"name":"Get associated accounts","id":"7997bbc6-00ea-427b-912c-e7e2317c0cad","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/partners/accounts/","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","partners","accounts",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"d7dee4c9-81b1-46d9-af45-b1c61c18f588","name":"200 OK","originalRequest":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/partners/accounts/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": 13128334,\n        \"name\": \"MyShop\",\n        \"current_credit\": 8556300,\n        \"status\": \"Active\",\n        \"default_language\": \"it\",\n        \"phone\": \"3933312345678\",\n        \"has_official_verification\": false,\n        \"daily_limit\": 100000,\n        \"phone_status\": \"🟢 Connected\",\n        \"quality_score\": 1,\n        \"quality_reasons\": null,\n        \"is_active\": true,\n        \"country_code\": \"\",\n        \"estimated_available_conversations\": 85563,\n        \"account_type\": 2,\n        \"default_pricing_delta\": 0,\n        \"low_credit_threshold\": 15000,\n        \"has_low_credit_alert\": false,\n        \"default_prefix\": \"+39\",\n        \"default_country_code\": \"IT\",\n        \"timezone\": \"Europe/Rome\",\n        \"contacted_in_24h\": 150,\n        \"contacted_in_7d\": 602\n    }\n]"}],"_postman_id":"7997bbc6-00ea-427b-912c-e7e2317c0cad"},{"name":"Create Onboarding Link","id":"ff4002b7-ecec-4431-99c4-8a3545133516","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"account\": 1\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partners/onboarding/","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","partners","onboarding",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"ec6d06ee-d838-4e9f-9979-e206f7803bc1","name":"Create Onboarding Link","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"account\": 1\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partners/onboarding/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"redirect_url\": \"<onboarding_link>\"\n}"}],"_postman_id":"ff4002b7-ecec-4431-99c4-8a3545133516"},{"name":"Create API Key For Account","id":"8179dbcb-0a9c-4437-83d7-ecd9f1ea6e9c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"account\": 1\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partners/create_api_key_for_account/","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","partners","create_api_key_for_account",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"1afa8191-2146-4124-9581-3dbd7ee40216","name":"Create API Key For Account","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"account\": 1\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partners/create_api_key_for_account/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"api_key\": \"<api_key>\"\n}"}],"_postman_id":"8179dbcb-0a9c-4437-83d7-ecd9f1ea6e9c"},{"name":"Revoke API Key For Account","id":"cf555789-8032-4d85-a979-a996be34deba","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"account\": 1\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partners/revoke_api_key_for_account/","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","partners","revoke_api_key_for_account",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"a0b6f073-57e0-4e66-825b-567a30b4a52d","name":"Create API Key For Account","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"account\": 1\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partners/revoke_api_key_for_account/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"ok\"\n}"}],"_postman_id":"cf555789-8032-4d85-a979-a996be34deba"},{"name":"Add Software Vendor Clients","id":"1d91767d-1849-4e75-b83d-794c9c0c00de","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"[\n    {\n        \"account_name\": \"MyClient\",\n        \"country\": \"it\",\n        \"country_code\": \"IT\",\n        \"email\": \"email@email.com\",\n        \"first_name\": \"First name\",\n        \"vat_amount\": 2200\n    },\n    {\n        \"account_name\": \"MyClient2\",\n        \"country\": \"it\",\n        \"country_code\": \"IT\",\n        \"email\": \"email@email.com\",\n        \"first_name\": \"First name2\",\n        \"vat_amount\": 2200\n    }\n]","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partners/add_sv_clients/","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","partners","add_sv_clients",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"f9c1f345-58bf-4826-a310-f5bbd0e4abf0","name":"Add Software Vendor Clients","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"[\n    {\n        \"account_name\": \"MyClient\",\n        \"country\": \"it\",\n        \"country_code\": \"IT\",\n        \"email\": \"email@email.com\",\n        \"first_name\": \"First name\",\n        \"vat_amount\": 2200\n    },\n    {\n        \"account_name\": \"MyClient2\",\n        \"country\": \"it\",\n        \"country_code\": \"IT\",\n        \"email\": \"email@email.com\",\n        \"first_name\": \"First name2\",\n        \"vat_amount\": 2200\n    }\n]","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partners/add_sv_clients/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.29.2"},{"key":"Date","value":"Fri, 10 Oct 2025 13:51:06 GMT"},{"key":"Content-Type","value":"application/json","description":"","type":"text"},{"key":"Content-Length","value":"1042"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"POST, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[{"expires":"Invalid Date","domain":"","path":""}],"responseTime":null,"body":"[\n    {\n        \"id\": 2336,\n        \"name\": \"MyClient\",\n        \"current_credit\": 0,\n        \"status\": \"Created\",\n        \"default_language\": \"it\",\n        \"phone\": null,\n        \"has_official_verification\": false,\n        \"daily_limit\": 1000,\n        \"phone_status\": \"Undefined\",\n        \"quality_score\": 0,\n        \"quality_reasons\": null,\n        \"is_active\": false,\n        \"country_code\": \"IT\",\n        \"estimated_available_conversations\": 0,\n        \"account_type\": 2,\n        \"default_pricing_delta\": 0,\n        \"low_credit_threshold\": 15000,\n        \"has_low_credit_alert\": false,\n        \"default_prefix\": \"+39\",\n        \"default_country_code\": \"IT\",\n        \"timezone\": \"Europe/Rome\",\n        \"contacted_in_24h\": 0,\n        \"contacted_in_7d\": 0\n    },\n    {\n        \"id\": 2337,\n        \"name\": \"MyClient2\",\n        \"current_credit\": 0,\n        \"status\": \"Created\",\n        \"default_language\": \"it\",\n        \"phone\": null,\n        \"has_official_verification\": false,\n        \"daily_limit\": 1000,\n        \"phone_status\": \"Undefined\",\n        \"quality_score\": 0,\n        \"quality_reasons\": null,\n        \"is_active\": false,\n        \"country_code\": \"IT\",\n        \"estimated_available_conversations\": 0,\n        \"account_type\": 2,\n        \"default_pricing_delta\": 0,\n        \"low_credit_threshold\": 15000,\n        \"has_low_credit_alert\": false,\n        \"default_prefix\": \"+39\",\n        \"default_country_code\": \"IT\",\n        \"timezone\": \"Europe/Rome\",\n        \"contacted_in_24h\": 0,\n        \"contacted_in_7d\": 0\n    }\n]"}],"_postman_id":"1d91767d-1849-4e75-b83d-794c9c0c00de"},{"name":"Create Meta Credit Subrecharge","id":"604323bf-d2b3-463c-aa2d-b93f5d348597","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"destination_account\": 1,\n    \"amount\": 10000 /* in thousandths eg: 10 = 10 * 1000 */\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partners/create_subrecharge/","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","partners","create_subrecharge",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"57a40bfb-9b34-42c5-bd54-2a98c9c5fb77","name":"204 NO CONTENT","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"destination_account\": 1,\n    \"amount\": 10000 /* in thousandths eg: 10 = 10 * 1000 */\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partners/create_subrecharge/"},"status":"No Content","code":204,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"604323bf-d2b3-463c-aa2d-b93f5d348597"},{"name":"Set Account Profit Margins - Software Vendor Only","id":"e745d299-d131-4768-a47a-e42686c2183d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"destination_account\": 1,\n    \"sms_profit_margin\": 49, /* in thousandths eg: 0,049 = 49 */\n    \"sms_one_way_profit_margin\": 49, /* in thousandths eg: 0,049 = 49 */\n    \"utility_profit_margin\": 49, /* in thousandths eg: 0,049 = 49 */\n    \"authentication_profit_margin\": 49, /* in thousandths eg: 0,049 = 49 */\n    \"marketing_profit_margin\": 49, /* in thousandths eg: 0,049 = 49 */\n    \"service_profit_margin\": 49, /* in thousandths eg: 0,049 = 49 */\n    \"conversation_profit_margin\": 49 /* in thousandths eg: 0,049 = 49 */\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partners/set_profits/","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","partners","set_profits",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"835ff76c-5bac-4004-96b2-5a90d4e58e45","name":"Set Account Profit Margins - Software Vendor Only","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"destination_account\": 1,\n    \"amount\": 10000 /* in thousandths eg: 10 = 10 * 1000 */\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partners/create_subrecharge/"},"status":"No Content","code":204,"_postman_previewlanguage":"","header":[],"cookie":[{"expires":"Invalid Date","domain":"","path":""}],"responseTime":null,"body":""}],"_postman_id":"e745d299-d131-4768-a47a-e42686c2183d"},{"name":"Move Credit From Account - Software Vendor Only","id":"65e247ed-2b64-4a44-9693-e2ade4795c35","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"account_id\": 1,\n    \"credit_to_move\": 10000 /* in thousandths eg: 10 = 10000 */\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partners/move_credit_from_account/","description":"<p>Moves available recharge credit from a Software Vendor partner's child account back into the partner's wallet, deducting it from the account</p>\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","partners","move_credit_from_account",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"865df602-f9ac-441b-b7d5-15bea4714530","name":"Move Credit From Account - Software Vendor Only","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"account_id\": 1,\n    \"credit_to_move\": 10000 /* in thousandths eg: 10 = 10000 */\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partners/move_credit_from_account/"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"65e247ed-2b64-4a44-9693-e2ade4795c35"},{"name":"Get account report","id":"ed2792a4-2716-4fbc-b422-99d7bbf95218","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/partners/get_account_report/?account_id=1&granularity=2&startDate=YYYY-MM-DD&endDate=YYYY-MM-DD","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","partners","get_account_report",""],"host":["{{Base-URL}}"],"query":[{"key":"account_id","value":"1"},{"key":"granularity","value":"2"},{"key":"startDate","value":"YYYY-MM-DD"},{"key":"endDate","value":"YYYY-MM-DD"}],"variable":[]}},"response":[{"id":"0376ab28-6752-436b-8fde-bb59f81adeee","name":"Get account report","originalRequest":{"method":"GET","header":[],"url":{"raw":"{{Base-URL}}/api/1/partners/get_account_report/?account_id=1&granularity=0&startDate=YYYY-MM-DD&endDate=YYYY-MM-DD","host":["{{Base-URL}}"],"path":["api","1","partners","get_account_report",""],"query":[{"key":"account_id","value":"1"},{"key":"granularity","value":"0","description":"Possible values: by DAY = 0; by MONTH = 2"},{"key":"startDate","value":"YYYY-MM-DD","description":"Format example: 2025-09-01"},{"key":"endDate","value":"YYYY-MM-DD","description":"Format example: 2025-09-30"}]}},"code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[{"expires":"Invalid Date","domain":"","path":""}],"responseTime":null,"body":"{\n  \"granularity\": 0,\n  \"reports\": {\n    \"2025-09-01\": {\n      \"whatsapp_channel\": {\n        \"contacted_contacts_inbound\": 0,\n        \"contacted_contacts_outbound\": 1,\n        \"messages\": {\n          \"incoming\": 10,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {\n            \"delivered\": 0,\n            \"error\": 0,\n            \"no_status\": 0,\n            \"read\": 10,\n            \"sent\": 0\n          }\n        },\n        \"transaction_amount\": -280,\n        \"recharge_amount\": 0,\n        \"conversations\": {\n          \"marketing\": 2,\n          \"service\": 1\n        }\n      },\n      \"sms_channel\": {\n        \"contacted_contacts_inbound\": 0,\n        \"contacted_contacts_outbound\": 0,\n        \"messages\": {\n          \"incoming\": 0,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {}\n        }\n      },\n      \"partner\": {\n        \"amount_profit_in_thousandth\": 0,\n        \"amount_profit_conversations_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_marketing_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_transactional_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_authentication_in_thousandth\": 0,\n        \"amount_profit_whatsapp_messages_service_in_thousandth\": 0,\n        \"amount_profit_sms_one_way_messages_in_thousandth\": 0,\n        \"amount_profit_sms_two_way_messages_in_thousandth\": 0\n      }\n    },\n    \"2025-09-02\": {\n      \"whatsapp_channel\": {\n        \"contacted_contacts_inbound\": 1,\n        \"contacted_contacts_outbound\": 1,\n        \"messages\": {\n          \"incoming\": 1,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {\n            \"delivered\": 0,\n            \"no_status\": 0,\n            \"read\": 1,\n            \"sent\": 0\n          }\n        },\n        \"transaction_amount\": -70,\n        \"recharge_amount\": 0,\n        \"conversations\": {\n          \"marketing\": 1\n        }\n      },\n      \"sms_channel\": {\n        \"contacted_contacts_inbound\": 0,\n        \"contacted_contacts_outbound\": 0,\n        \"messages\": {\n          \"incoming\": 0,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {}\n        }\n      },\n      \"partner\": {\n        \"amount_profit_in_thousandth\": 0,\n        \"amount_profit_conversations_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_marketing_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_transactional_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_authentication_in_thousandth\": 0,\n        \"amount_profit_whatsapp_messages_service_in_thousandth\": 0,\n        \"amount_profit_sms_one_way_messages_in_thousandth\": 0,\n        \"amount_profit_sms_two_way_messages_in_thousandth\": 0\n      }\n    },\n    \"2025-09-03\": {\n      \"whatsapp_channel\": {\n        \"contacted_contacts_inbound\": 5,\n        \"contacted_contacts_outbound\": 4,\n        \"messages\": {\n          \"incoming\": 12,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {\n            \"delivered\": 0,\n            \"no_status\": 0,\n            \"read\": 14,\n            \"sent\": 0\n          }\n        },\n        \"transaction_amount\": -35560,\n        \"recharge_amount\": 35350,\n        \"conversations\": {\n          \"marketing\": 4,\n          \"service\": 1\n        }\n      },\n      \"sms_channel\": {\n        \"contacted_contacts_inbound\": 0,\n        \"contacted_contacts_outbound\": 0,\n        \"messages\": {\n          \"incoming\": 0,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {}\n        }\n      },\n      \"partner\": {\n        \"amount_profit_in_thousandth\": 0,\n        \"amount_profit_conversations_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_marketing_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_transactional_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_authentication_in_thousandth\": 0,\n        \"amount_profit_whatsapp_messages_service_in_thousandth\": 0,\n        \"amount_profit_sms_one_way_messages_in_thousandth\": 0,\n        \"amount_profit_sms_two_way_messages_in_thousandth\": 0\n      }\n    },\n    \"2025-09-04\": {\n      \"whatsapp_channel\": {\n        \"contacted_contacts_inbound\": 1,\n        \"contacted_contacts_outbound\": 1,\n        \"messages\": {\n          \"incoming\": 3,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {\n            \"delivered\": 0,\n            \"no_status\": 0,\n            \"read\": 2,\n            \"sent\": 0\n          }\n        },\n        \"transaction_amount\": 0,\n        \"recharge_amount\": 0,\n        \"conversations\": {\n          \"service\": 1\n        }\n      },\n      \"sms_channel\": {\n        \"contacted_contacts_inbound\": 0,\n        \"contacted_contacts_outbound\": 0,\n        \"messages\": {\n          \"incoming\": 0,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {}\n        }\n      },\n      \"partner\": {\n        \"amount_profit_in_thousandth\": 0,\n        \"amount_profit_conversations_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_marketing_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_transactional_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_authentication_in_thousandth\": 0,\n        \"amount_profit_whatsapp_messages_service_in_thousandth\": 0,\n        \"amount_profit_sms_one_way_messages_in_thousandth\": 0,\n        \"amount_profit_sms_two_way_messages_in_thousandth\": 0\n      }\n    },\n    \"2025-09-05\": {\n      \"whatsapp_channel\": {\n        \"contacted_contacts_inbound\": 3,\n        \"contacted_contacts_outbound\": 7,\n        \"messages\": {\n          \"incoming\": 15,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {\n            \"delivered\": 0,\n            \"error\": 3,\n            \"no_status\": 0,\n            \"read\": 9,\n            \"sent\": 0\n          }\n        },\n        \"transaction_amount\": -280,\n        \"recharge_amount\": 0,\n        \"conversations\": {\n          \"marketing\": 5,\n          \"service\": 4\n        }\n      },\n      \"sms_channel\": {\n        \"contacted_contacts_inbound\": 0,\n        \"contacted_contacts_outbound\": 3,\n        \"messages\": {\n          \"incoming\": 0,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {\n            \"delivered\": 3,\n            \"no_status\": 0,\n            \"sent\": 1\n          }\n        }\n      },\n      \"partner\": {\n        \"amount_profit_in_thousandth\": 0,\n        \"amount_profit_conversations_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_marketing_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_transactional_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_authentication_in_thousandth\": 0,\n        \"amount_profit_whatsapp_messages_service_in_thousandth\": 0,\n        \"amount_profit_sms_one_way_messages_in_thousandth\": 0,\n        \"amount_profit_sms_two_way_messages_in_thousandth\": 0\n      }\n    },\n    \"2025-09-08\": {\n      \"whatsapp_channel\": {\n        \"contacted_contacts_inbound\": 0,\n        \"contacted_contacts_outbound\": 1,\n        \"messages\": {\n          \"incoming\": 11,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {\n            \"delivered\": 1,\n            \"no_status\": 0,\n            \"read\": 4,\n            \"sent\": 0\n          }\n        },\n        \"transaction_amount\": -70,\n        \"recharge_amount\": 0,\n        \"conversations\": {\n          \"marketing\": 1,\n          \"service\": 2\n        }\n      },\n      \"sms_channel\": {\n        \"contacted_contacts_inbound\": 0,\n        \"contacted_contacts_outbound\": 0,\n        \"messages\": {\n          \"incoming\": 0,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {}\n        }\n      },\n      \"partner\": {\n        \"amount_profit_in_thousandth\": 0,\n        \"amount_profit_conversations_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_marketing_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_transactional_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_authentication_in_thousandth\": 0,\n        \"amount_profit_whatsapp_messages_service_in_thousandth\": 0,\n        \"amount_profit_sms_one_way_messages_in_thousandth\": 0,\n        \"amount_profit_sms_two_way_messages_in_thousandth\": 0\n      }\n    },\n    \"2025-09-09\": {\n      \"whatsapp_channel\": {\n        \"contacted_contacts_inbound\": 2,\n        \"contacted_contacts_outbound\": 1,\n        \"messages\": {\n          \"incoming\": 19,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {\n            \"delivered\": 0,\n            \"no_status\": 0,\n            \"read\": 22,\n            \"sent\": 0\n          }\n        },\n        \"transaction_amount\": -200,\n        \"recharge_amount\": 0,\n        \"conversations\": {\n          \"marketing\": 1,\n          \"service\": 1\n        }\n      },\n      \"sms_channel\": {\n        \"contacted_contacts_inbound\": 0,\n        \"contacted_contacts_outbound\": 0,\n        \"messages\": {\n          \"incoming\": 0,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {}\n        }\n      },\n      \"partner\": {\n        \"amount_profit_in_thousandth\": 0,\n        \"amount_profit_conversations_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_marketing_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_transactional_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_authentication_in_thousandth\": 0,\n        \"amount_profit_whatsapp_messages_service_in_thousandth\": 0,\n        \"amount_profit_sms_one_way_messages_in_thousandth\": 0,\n        \"amount_profit_sms_two_way_messages_in_thousandth\": 0\n      }\n    },\n    \"2025-09-11\": {\n      \"whatsapp_channel\": {\n        \"contacted_contacts_inbound\": 2,\n        \"contacted_contacts_outbound\": 3,\n        \"messages\": {\n          \"incoming\": 24,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {\n            \"delivered\": 0,\n            \"error\": 1,\n            \"no_status\": 0,\n            \"read\": 35,\n            \"sent\": 0\n          }\n        },\n        \"transaction_amount\": 0,\n        \"recharge_amount\": 0,\n        \"conversations\": {\n          \"service\": 1\n        }\n      },\n      \"sms_channel\": {\n        \"contacted_contacts_inbound\": 0,\n        \"contacted_contacts_outbound\": 0,\n        \"messages\": {\n          \"incoming\": 0,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {}\n        }\n      },\n      \"partner\": {\n        \"amount_profit_in_thousandth\": 0,\n        \"amount_profit_conversations_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_marketing_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_transactional_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_authentication_in_thousandth\": 0,\n        \"amount_profit_whatsapp_messages_service_in_thousandth\": 0,\n        \"amount_profit_sms_one_way_messages_in_thousandth\": 0,\n        \"amount_profit_sms_two_way_messages_in_thousandth\": 0\n      }\n    },\n    \"2025-09-12\": {\n      \"whatsapp_channel\": {\n        \"contacted_contacts_inbound\": 3,\n        \"contacted_contacts_outbound\": 1,\n        \"messages\": {\n          \"incoming\": 14,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {\n            \"delivered\": 0,\n            \"no_status\": 0,\n            \"read\": 10,\n            \"sent\": 0\n          }\n        },\n        \"transaction_amount\": 0,\n        \"recharge_amount\": 0,\n        \"conversations\": {}\n      },\n      \"sms_channel\": {\n        \"contacted_contacts_inbound\": 0,\n        \"contacted_contacts_outbound\": 0,\n        \"messages\": {\n          \"incoming\": 0,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {}\n        }\n      },\n      \"partner\": {\n        \"amount_profit_in_thousandth\": 0,\n        \"amount_profit_conversations_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_marketing_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_transactional_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_authentication_in_thousandth\": 0,\n        \"amount_profit_whatsapp_messages_service_in_thousandth\": 0,\n        \"amount_profit_sms_one_way_messages_in_thousandth\": 0,\n        \"amount_profit_sms_two_way_messages_in_thousandth\": 0\n      }\n    },\n    \"2025-09-15\": {\n      \"whatsapp_channel\": {\n        \"contacted_contacts_inbound\": 1,\n        \"contacted_contacts_outbound\": 2,\n        \"messages\": {\n          \"incoming\": 1,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {\n            \"delivered\": 0,\n            \"no_status\": 0,\n            \"read\": 8,\n            \"sent\": -1\n          }\n        },\n        \"transaction_amount\": -700,\n        \"recharge_amount\": 0,\n        \"conversations\": {\n          \"marketing\": 2\n        }\n      },\n      \"sms_channel\": {\n        \"contacted_contacts_inbound\": 0,\n        \"contacted_contacts_outbound\": 0,\n        \"messages\": {\n          \"incoming\": 0,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {}\n        }\n      },\n      \"partner\": {\n        \"amount_profit_in_thousandth\": 43,\n        \"amount_profit_conversations_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_marketing_in_thousandth\": 43,\n        \"amount_profit_whatsapp_templates_transactional_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_authentication_in_thousandth\": 0,\n        \"amount_profit_whatsapp_messages_service_in_thousandth\": 0,\n        \"amount_profit_sms_one_way_messages_in_thousandth\": 0,\n        \"amount_profit_sms_two_way_messages_in_thousandth\": 0\n      }\n    },\n    \"2025-09-16\": {\n      \"whatsapp_channel\": {\n        \"contacted_contacts_inbound\": 0,\n        \"contacted_contacts_outbound\": 1,\n        \"messages\": {\n          \"incoming\": 0,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {\n            \"delivered\": 2,\n            \"no_status\": 0,\n            \"sent\": 0\n          }\n        },\n        \"transaction_amount\": -120200,\n        \"recharge_amount\": 120000,\n        \"conversations\": {\n          \"marketing\": 1\n        }\n      },\n      \"sms_channel\": {\n        \"contacted_contacts_inbound\": 0,\n        \"contacted_contacts_outbound\": 1,\n        \"messages\": {\n          \"incoming\": 0,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {\n            \"no_status\": 0,\n            \"sent\": 1\n          }\n        }\n      },\n      \"partner\": {\n        \"amount_profit_in_thousandth\": 96,\n        \"amount_profit_conversations_in_thousandth\": 10,\n        \"amount_profit_whatsapp_templates_marketing_in_thousandth\": 86,\n        \"amount_profit_whatsapp_templates_transactional_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_authentication_in_thousandth\": 0,\n        \"amount_profit_whatsapp_messages_service_in_thousandth\": 0,\n        \"amount_profit_sms_one_way_messages_in_thousandth\": 0,\n        \"amount_profit_sms_two_way_messages_in_thousandth\": 0\n      }\n    },\n    \"2025-09-17\": {\n      \"whatsapp_channel\": {\n        \"contacted_contacts_inbound\": 0,\n        \"contacted_contacts_outbound\": 0,\n        \"messages\": {\n          \"incoming\": 0,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {}\n        },\n        \"transaction_amount\": 0,\n        \"recharge_amount\": 0,\n        \"conversations\": {}\n      },\n      \"sms_channel\": {\n        \"contacted_contacts_inbound\": 0,\n        \"contacted_contacts_outbound\": 1,\n        \"messages\": {\n          \"incoming\": 0,\n          \"template\": {\n            \"otp\": {},\n            \"transaction\": {},\n            \"marketing\": {}\n          },\n          \"free\": {\n            \"no_status\": 0,\n            \"sent\": 5\n          }\n        }\n      },\n      \"partner\": {\n        \"amount_profit_in_thousandth\": 0,\n        \"amount_profit_conversations_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_marketing_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_transactional_in_thousandth\": 0,\n        \"amount_profit_whatsapp_templates_authentication_in_thousandth\": 0,\n        \"amount_profit_whatsapp_messages_service_in_thousandth\": 0,\n        \"amount_profit_sms_one_way_messages_in_thousandth\": 0,\n        \"amount_profit_sms_two_way_messages_in_thousandth\": 0\n      }\n    }\n  },\n  \"channel_contacts\": {\n    \"whatsapp\": {\n      \"inbound\": 5,\n      \"outbound\": 5\n    },\n    \"sms\": {\n      \"inbound\": 0,\n      \"outbound\": 1\n    }\n  }\n}"}],"_postman_id":"ed2792a4-2716-4fbc-b422-99d7bbf95218"},{"name":"Get account forecasts","id":"e21c31b2-da15-42c0-acff-2f2fa7bba0c5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/partners/get_account_forecasts/?account_id=1&country_code=IT","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","partners","get_account_forecasts",""],"host":["{{Base-URL}}"],"query":[{"key":"account_id","value":"1"},{"key":"country_code","value":"IT"}],"variable":[]}},"response":[{"id":"0f91f751-d28a-4001-b851-884f29a42f8a","name":"Get account forecasts","originalRequest":{"method":"GET","header":[],"url":{"raw":"{{Base-URL}}/api/1/partners/get_account_forecasts/?account_id=1&country_code=IT","host":["{{Base-URL}}"],"path":["api","1","partners","get_account_forecasts",""],"query":[{"key":"account_id","value":"1","description":"Required"},{"key":"country_code","value":"IT"}]}},"code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[{"expires":"Invalid Date","domain":"","path":""}],"responseTime":null,"body":"{\n    \"marketing_templates\": 17,\n    \"utility_templates\": 80,\n    \"authentication_templates\": 80,\n    \"service_messages\": \"unlimited\",\n    \"sms\": 29\n}"}],"_postman_id":"e21c31b2-da15-42c0-acff-2f2fa7bba0c5"}],"id":"3b2d5696-52df-4b89-a17d-77479aca88fc","_postman_id":"3b2d5696-52df-4b89-a17d-77479aca88fc","description":"","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}}},{"name":"Partner Roles","item":[{"name":"List, search, and filter roles","id":"4c353f0e-4830-4fa6-8f55-53cbcbf85998","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/partner-roles/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n","urlObject":{"path":["api","1","partner-roles",""],"host":["{{Base-URL}}"],"query":[{"disabled":true,"description":{"content":"<p>search by id, email, first_name, last_name</p>\n","type":"text/plain"},"key":"search","value":""}],"variable":[]}},"response":[{"id":"f8d1c98e-df97-4366-a80d-a8d9daaa4316","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":{"raw":"{{Base-URL}}/api/1/partner-roles/","host":["{{Base-URL}}"],"path":["api","1","partner-roles",""],"query":[{"key":"search","value":"","description":"search by id, email, first_name, last_name","disabled":true}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.27.0"},{"key":"Date","value":"Fri, 18 Oct 2024 14:16:22 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"3485"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 1,\n    \"next\": null,\n    \"previous\": null,\n    \"results\": [\n        {\n            \"id\": 1,\n            \"user\": {\n                \"id\": 1,\n                \"email\": \"email@email.com\",\n                \"uid\": \"uid\",\n                \"firstname\": \"Firstname\",\n                \"surname\": \"Surname\",\n                \"image\": \"\",\n                \"is_service\": false\n            },\n            \"role\": \"Owner\",\n            \"is_active\": true,\n            \"created_datetime\": \"2025-08-12T15:44:27.578057+02:00\",\n            \"updated_datetime\": \"2025-08-12T15:44:27.578061+02:00\"\n        }\n    ]\n}"}],"_postman_id":"4c353f0e-4830-4fa6-8f55-53cbcbf85998"},{"name":"Retrieve role","id":"c8f5720a-b5ac-4dff-aac6-a4d26701595e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/partner-roles/{{id}}/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n","urlObject":{"path":["api","1","partner-roles","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"1a09b23a-9823-4eb3-b685-bb2bc8dceb61","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/partner-roles/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.27.0"},{"key":"Date","value":"Fri, 18 Oct 2024 14:18:45 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"365"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"GET, DELETE, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 1,\n    \"user\": {\n        \"id\": 1,\n        \"email\": \"email@email.com\",\n        \"uid\": \"uid\",\n        \"firstname\": \"Firstname\",\n        \"surname\": \"Surname\",\n        \"image\": \"\",\n        \"is_service\": false\n    },\n    \"role\": \"Owner\",\n    \"is_active\": true,\n    \"created_datetime\": \"2025-08-12T15:44:27.578057+02:00\",\n    \"updated_datetime\": \"2025-08-12T15:44:27.578061+02:00\"\n}"}],"_postman_id":"c8f5720a-b5ac-4dff-aac6-a4d26701595e"},{"name":"Generate Private Key","id":"fe1e10af-59b8-4ba9-b066-1681fee0ceba","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partner-roles/{{id}}/generate_private_key/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n<p>Generate Private Key of a Service User</p>\n","urlObject":{"path":["api","1","partner-roles","{{id}}","generate_private_key",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"ab5542b4-f792-445e-bfc0-1cbefd26256a","name":"200 OK","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partner-roles/{{id}}/generate_private_key/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.27.0"},{"key":"Date","value":"Fri, 18 Oct 2024 14:22:59 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"66"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"POST, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"\"b5e0ce522de128e01d7c37d6aba8b5cac6f19c1c84e76872c469cdb1733v819d\""}],"_postman_id":"fe1e10af-59b8-4ba9-b066-1681fee0ceba"},{"name":"Has Private Key","id":"34506b29-a07f-441b-b009-4ef600f99759","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/partner-roles/{{id}}/has_private_key/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n","urlObject":{"path":["api","1","partner-roles","{{id}}","has_private_key",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"3d9a483c-71e8-4226-ac34-95812b38cf39","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/partner-roles/{{id}}/has_private_key/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.27.0"},{"key":"Date","value":"Fri, 18 Oct 2024 14:22:45 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"5"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"GET, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"false"}],"_postman_id":"34506b29-a07f-441b-b009-4ef600f99759"},{"name":"Update Role","id":"fe267e27-7df8-4817-8c7a-cfb62dc9b25b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"role\": \"Chat Operator\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partner-roles/{{id}}/update_role/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<h4 id=\"in-case-the-body-is-correct-other-error-code\">In case the body is correct, other error code:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"https://app.spoki.it/errors/spoki::3004\",\n    \"title\": \"The request body is not correct\",\n    \"code\": \"spoki::3004\",\n    \"status\": 400,\n    \"datail\": \"Invalid or no role specified.\"\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>Invalid or no role specified</td>\n</tr>\n<tr>\n<td>403</td>\n<td>spoki::403</td>\n<td>Access denied</td>\n<td>you cannot change the role of the sole admin of the account</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>The request body is not correct</td>\n<td>specify a valid role</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","partner-roles","{{id}}","update_role",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"3ee55871-e6f8-4257-8a79-3c125aa05265","name":"204 No Content","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"role\": \"Chat Operator Manager\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partner-roles/{{id}}/update_role/"},"status":"No Content","code":204,"_postman_previewlanguage":"plain","header":[{"key":"Server","value":"nginx/1.27.0"},{"key":"Date","value":"Fri, 18 Oct 2024 14:23:30 GMT"},{"key":"Content-Length","value":"0"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"POST, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"fe267e27-7df8-4817-8c7a-cfb62dc9b25b"},{"name":"Delete role","id":"e65cc202-45cd-4bae-8a76-e164bf458737","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/partner-roles/{{id}}/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n<h2 id=\"possible-error-codes\">Possible Error Codes:</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th>Datail</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>403</td>\n<td>spoki::403</td>\n<td>Access denied</td>\n<td>you cannot delete the role of the sole admin of the account</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","partner-roles","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"f84c2be4-b23c-485e-abe5-5572ba6a0687","name":"204 No Content","originalRequest":{"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/partner-roles/{{id}}/"},"status":"No Content","code":204,"_postman_previewlanguage":"plain","header":[{"key":"Server","value":"nginx/1.27.0"},{"key":"Date","value":"Fri, 18 Oct 2024 14:25:14 GMT"},{"key":"Content-Length","value":"0"},{"key":"Connection","value":"keep-alive"},{"key":"Vary","value":"Accept, origin, Accept-Language, Cookie"},{"key":"Allow","value":"GET, DELETE, HEAD, OPTIONS"},{"key":"X-Frame-Options","value":"DENY"},{"key":"Content-Language","value":"en"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"e65cc202-45cd-4bae-8a76-e164bf458737"}],"id":"357267f1-8927-4fbc-8557-ce606aa09983","_postman_id":"357267f1-8927-4fbc-8557-ce606aa09983","description":"","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}}},{"name":"Partner Invitations","item":[{"name":"List, search, and filter invitations","id":"6d4bce23-7326-4ea4-a7de-7b023bd3ade9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/partner-invitations/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n","urlObject":{"path":["api","1","partner-invitations",""],"host":["{{Base-URL}}"],"query":[{"disabled":true,"description":{"content":"<p>search by id, email, first_name, last_name</p>\n","type":"text/plain"},"key":"search","value":""}],"variable":[]}},"response":[{"id":"57c192a3-5eb8-451d-974d-d6ffe625d5eb","name":"200 OK","originalRequest":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/partner-invitations/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:17:17 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=2801.1810000000423;desc=\"User CPU time\", TimerPanel_stime;dur=593.042999999966;desc=\"System CPU time\", TimerPanel_total;dur=3394.2240000000083;desc=\"Total CPU time\", TimerPanel_total_time;dur=3741.213321685791;desc=\"Elapsed time\", SQLPanel_sql_time;dur=106.60886764526367;desc=\"SQL 33 queries\", CachePanel_total_time;dur=16.034841537475586;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"2930"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 1,\n    \"next\": null,\n    \"previous\": null,\n    \"results\": [\n        {\n            \"id\": 1,\n            \"email\": \"email@email.com\",\n            \"role\": 1,\n            \"additional_info\": null,\n            \"created_datetime\": \"2025-09-22T17:14:54.979447+02:00\",\n            \"partner_name\": \"Software Vendor\"\n        }\n    ]\n}"}],"_postman_id":"6d4bce23-7326-4ea4-a7de-7b023bd3ade9"},{"name":"Retrieve invitation","id":"6e82e47f-cc9e-4912-ae2b-d49105a0ad20","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/partner-invitations/{{id}}/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n","urlObject":{"path":["api","1","partner-invitations","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"cc5e9c50-eb21-4be0-9fc5-7d72f84d669d","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/partner-invitations/{{id}}/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Fri, 25 Aug 2023 08:24:08 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"604"},{"key":"Connection","value":"keep-alive"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Vary","value":"Origin, Cookie"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"},{"key":"Strict-Transport-Security","value":"max-age=31536000"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 1,\n    \"email\": \"email@email.com\",\n    \"role\": 1,\n    \"additional_info\": null,\n    \"created_datetime\": \"2025-09-22T17:14:54.979447+02:00\",\n    \"partner_name\": \"Software Vendor\"\n}"}],"_postman_id":"6e82e47f-cc9e-4912-ae2b-d49105a0ad20"},{"name":"Invite new user by email","id":"53d2effb-28a4-424c-82a8-244b1b6205cd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"email\": \"john.doe@domain.com\",\n    \"role\": \"Administrator\",\n    \"additional_info\": {\n        \"first_name\": \"John\",\n        \"last_name\": \"Doe\"\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partner-invitations/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n<p>Allowed roles: Owner, Administrator</p>\n<h4 id=\"possible-error-codes\"><strong>Possible Error Codes:</strong></h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th><strong>Datail</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>Invalid request body</td>\n<td>Invalid or no role specified</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>Invalid request body</td>\n<td>No email specified</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>Invalid request body</td>\n<td>No private_key specified</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3007</td>\n<td>Invalid request header</td>\n<td>Invalid or no account specified</td>\n</tr>\n<tr>\n<td>400</td>\n<td>spoki::3007</td>\n<td>Invalid request header</td>\n<td>Invitation already exists</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","partner-invitations",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"65cfaaa8-c873-4cff-a1f0-bcb91e77c6cf","name":"201 Created","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"MyCampaign\",\n    \"scheduled_datetime\": \"2024-08-28T10:00:00.000Z\",\n    \"status\": \"Scheduled\",\n    \"automation\": {{id}},\n    \"lists\": [{{id}}]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partner-invitations/"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:25:37 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1296.68700000002;desc=\"User CPU time\", TimerPanel_stime;dur=267.5800000000663;desc=\"System CPU time\", TimerPanel_total;dur=1564.2670000000862;desc=\"Total CPU time\", TimerPanel_total_time;dur=1593.4910774230957;desc=\"Elapsed time\", SQLPanel_sql_time;dur=29.886484146118164;desc=\"SQL 9 queries\", CachePanel_total_time;dur=4.533052444458008;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"184"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 1,\n    \"email\": \"email@email.com\",\n    \"role\": 1,\n    \"additional_info\": null,\n    \"created_datetime\": \"2025-09-22T17:14:54.979447+02:00\",\n    \"partner_name\": \"Software Vendor\"\n}"}],"_postman_id":"53d2effb-28a4-424c-82a8-244b1b6205cd"},{"name":"Resend invitation email","id":"81cc7514-4791-4f8a-b964-5a0c37fc1993","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partner-invitations/{{id}}/send/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n","urlObject":{"path":["api","1","partner-invitations","{{id}}","send",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"14f07ae9-24d8-4531-92b8-6c7a593b3cba","name":"201 Created","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"MyCampaign\",\n    \"scheduled_datetime\": \"2024-08-28T10:00:00.000Z\",\n    \"status\": \"Scheduled\",\n    \"automation\": {{id}},\n    \"lists\": [{{id}}]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partner-invitations/{{id}}/send/"},"status":"No Content","code":204,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:25:37 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1296.68700000002;desc=\"User CPU time\", TimerPanel_stime;dur=267.5800000000663;desc=\"System CPU time\", TimerPanel_total;dur=1564.2670000000862;desc=\"Total CPU time\", TimerPanel_total_time;dur=1593.4910774230957;desc=\"Elapsed time\", SQLPanel_sql_time;dur=29.886484146118164;desc=\"SQL 9 queries\", CachePanel_total_time;dur=4.533052444458008;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"184"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":""}],"_postman_id":"81cc7514-4791-4f8a-b964-5a0c37fc1993"},{"name":"Update role","id":"4b7edcfc-1329-496d-b03d-53d06439f54e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"role\": \"Chat Operator Manager\"\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partner-invitations/{{id}}/update_role/","description":"<p><strong>Rate Limit:</strong> 5/min</p>\n<p>Allowed roles: Owner, Administrator</p>\n<h4 id=\"possible-error-codes\"><strong>Possible Error Codes:</strong></h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th><strong>Code</strong></th>\n<th><strong>Title</strong></th>\n<th><strong>Datail</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>spoki::3004</td>\n<td>Invalid request body</td>\n<td>Invalid or no role specified</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["api","1","partner-invitations","{{id}}","update_role",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"a350e27d-0546-42b9-a41d-6b8f4ba6e162","name":"201 Created","originalRequest":{"method":"POST","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"MyCampaign\",\n    \"scheduled_datetime\": \"2024-08-28T10:00:00.000Z\",\n    \"status\": \"Scheduled\",\n    \"automation\": {{id}},\n    \"lists\": [{{id}}]\n}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/partner-invitations/{{id}}/update_role/"},"status":"No Content","code":204,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:25:37 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Content-Type","value":"application/json"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, POST, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1296.68700000002;desc=\"User CPU time\", TimerPanel_stime;dur=267.5800000000663;desc=\"System CPU time\", TimerPanel_total;dur=1564.2670000000862;desc=\"Total CPU time\", TimerPanel_total_time;dur=1593.4910774230957;desc=\"Elapsed time\", SQLPanel_sql_time;dur=29.886484146118164;desc=\"SQL 9 queries\", CachePanel_total_time;dur=4.533052444458008;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"184"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":""}],"_postman_id":"4b7edcfc-1329-496d-b03d-53d06439f54e"},{"name":"Delete invitation","id":"c2cdbfcd-7961-487e-979e-2f9d3e35343e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/partner-invitations/{{id}}/","description":"<p><strong>Rate Limit:</strong> 10/min</p>\n","urlObject":{"path":["api","1","partner-invitations","{{id}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[{"id":"4ddaebd7-bf2f-43e9-abbb-6b4fe31b07ca","name":"204 No Content","originalRequest":{"method":"DELETE","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","type":"text"}],"url":"{{Base-URL}}/api/1/partner-invitations/{{id}}/"},"status":"No Content","code":204,"_postman_previewlanguage":"plain","header":[{"key":"Date","value":"Mon, 28 Aug 2023 12:26:38 GMT"},{"key":"Server","value":"WSGIServer/0.2 CPython/3.7.9"},{"key":"Vary","value":"Accept, Origin, Cookie"},{"key":"Allow","value":"GET, PUT, PATCH, DELETE, HEAD, OPTIONS"},{"key":"Server-Timing","value":"TimerPanel_utime;dur=1070.9779999999682;desc=\"User CPU time\", TimerPanel_stime;dur=224.4150000000218;desc=\"System CPU time\", TimerPanel_total;dur=1295.39299999999;desc=\"Total CPU time\", TimerPanel_total_time;dur=1268.4416770935059;desc=\"Elapsed time\", SQLPanel_sql_time;dur=18.60809326171875;desc=\"SQL 6 queries\", CachePanel_total_time;dur=6.557226181030273;desc=\"Cache 4 Calls\""},{"key":"Content-Length","value":"0"},{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Referrer-Policy","value":"same-origin"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"c2cdbfcd-7961-487e-979e-2f9d3e35343e"}],"id":"0c5b4ca9-6311-46ab-8aca-7cc07395a6b8","_postman_id":"0c5b4ca9-6311-46ab-8aca-7cc07395a6b8","description":"","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}}}],"id":"ef07710a-b71f-4581-a7b5-99c97817ce82","_postman_id":"ef07710a-b71f-4581-a7b5-99c97817ce82","description":"","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}}},{"name":"Channels","item":[{"name":"List channels","id":"a16826e2-028d-42d7-a5a0-df28f85ff5d9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Api-Key","value":"{{Api-Key}}"}],"url":"{{Base-URL}}/api/1/channel/","description":"<p>Returns the tenant's channels, all lifecycle states included (Onboarding Started → Disconnected). Reads from replica DB.</p>\n<p><strong>Request</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /api/1/channel/\n\n</code></pre><div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Query param</th>\n<th>Type</th>\n<th>Default</th>\n<th>Notes</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>whatsapp_business_account</code></td>\n<td>string</td>\n<td>—</td>\n<td>Filter by Meta WABA id</td>\n</tr>\n<tr>\n<td><code>waba</code></td>\n<td>string</td>\n<td>—</td>\n<td>Alias for the param above</td>\n</tr>\n<tr>\n<td><code>page</code></td>\n<td>integer</td>\n<td>1</td>\n<td>1-based page number</td>\n</tr>\n<tr>\n<td><code>page_size</code></td>\n<td>integer</td>\n<td>15</td>\n<td>Max 30</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Response</strong> <strong><code>200</code></strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"count\": 13,\n  \"next\": \"https://…?page=2\",\n  \"previous\": null,\n  \"results\": [ { /* AccountChannel */ }, … ]\n}\n\n</code></pre>\n<hr />\n<h3 id=\"accountchannel-object\">AccountChannel object</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Notes</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>id</code></td>\n<td>The unique identifier of the Account Chann</td>\n</tr>\n<tr>\n<td><code>name</code></td>\n<td>Label associated with the channel</td>\n</tr>\n<tr>\n<td><code>identifier</code></td>\n<td>Platform address (phone number, SIP URI, …)</td>\n</tr>\n<tr>\n<td><code>client_id</code></td>\n<td>Meta WABA id — only set for WhatsApp channels</td>\n</tr>\n<tr>\n<td><code>platform</code></td>\n<td>See platform codes below</td>\n</tr>\n<tr>\n<td><code>is_primary</code></td>\n<td>Per-platform routing flag. Set via <code>POST /channel/{id}/set-primary/</code></td>\n</tr>\n<tr>\n<td><code>status</code></td>\n<td><code>1</code> Onboarding Started · <code>2</code> Connected · <code>3</code> Active · <code>4</code> Disconnected</td>\n</tr>\n<tr>\n<td><code>quality_score</code></td>\n<td>Meta WA quality rating: <code>0</code> Unknown · <code>1</code> Green · <code>2</code> Yellow · <code>3</code> Red</td>\n</tr>\n<tr>\n<td><code>phone_status</code></td>\n<td>Meta per-phone status (11 values, WhatsApp only)</td>\n</tr>\n<tr>\n<td><code>metadata</code></td>\n<td>Opaque provider blob — read-only</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Platform codes</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Value</th>\n<th>Label</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>1</code></td>\n<td>WhatsApp</td>\n</tr>\n<tr>\n<td><code>3</code></td>\n<td>SMS one-way</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong><code>phone_status</code></strong> <strong>codes (WhatsApp only)</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Value</th>\n<th>Label</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>0</code></td>\n<td>Unknown</td>\n</tr>\n<tr>\n<td><code>1</code></td>\n<td>Pending</td>\n</tr>\n<tr>\n<td><code>2</code></td>\n<td>Offline</td>\n</tr>\n<tr>\n<td><code>3</code></td>\n<td>Flagged</td>\n</tr>\n<tr>\n<td><code>4</code></td>\n<td>Connected</td>\n</tr>\n<tr>\n<td><code>5</code></td>\n<td>Rate Limited</td>\n</tr>\n<tr>\n<td><code>6</code></td>\n<td>Warned</td>\n</tr>\n<tr>\n<td><code>7</code></td>\n<td>Restricted</td>\n</tr>\n<tr>\n<td><code>8</code></td>\n<td>Integrity Violation</td>\n</tr>\n<tr>\n<td><code>9</code></td>\n<td>Banned</td>\n</tr>\n<tr>\n<td><code>10</code></td>\n<td>Deleted</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<p><strong>Errors</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th>Meaning</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>401</code></td>\n<td>Invalid or missing API key</td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","channel",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"a16826e2-028d-42d7-a5a0-df28f85ff5d9"},{"name":"Retrieve channel","id":"f1e12254-c9db-4d5d-9fd6-02e7875af645","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{Base-URL}}/api/1/channel/{{id_channel}}/","description":"<p>Tenant-scoped lookup by <code>id</code>. No status filter — returns the row regardless of its lifecycle state.</p>\n<p><strong>Request</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /api/1/channel/{id}/\n</code></pre><p><strong>Path parameters</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Param</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>id</code></td>\n<td>integer</td>\n<td>Channel row id. Must be numeric — non-numeric segments return <code>404</code>.</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Response <code>200</code></strong></p>\n<p>The full 10-field <code>AccountChannel</code> object. See <a href=\"#\">List channels</a> for the complete field reference.</p>\n<p><strong>Errors</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th>Body</th>\n<th>When</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>404</code></td>\n<td><code>{ \"detail\": \"No AccountChannel matches the given query.\" }</code></td>\n<td>Unknown id, cross-tenant id, or non-numeric path segment</td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","channel","{{id_channel}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"f1e12254-c9db-4d5d-9fd6-02e7875af645"},{"name":"Create channel","id":"9db33535-0929-4b14-afeb-0f127bd69a56","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","disabled":false}],"body":{"mode":"raw","raw":"{\"platform\": 6, \"name\": \"Lifecycle voice\", \"is_primary\": false, \"identifier\": \"+39...\"}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/channel/","description":"<p>Branches on the <code>platform</code> value in the body. WhatsApp and one-way SMS go through provider helpers and return provider-specific shapes; everything else is a direct insert and returns the standard 10-field <code>AccountChannel</code> payload.</p>\n<p><strong>Request</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /api/1/channel/\n\n</code></pre><p><strong>Request body — writable fields</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Default</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>platform</code></td>\n<td>integer (enum)</td>\n<td>yes</td>\n<td>—</td>\n<td>One of 1–10. Drives the branch. See platform enum in <a href=\"#\">List channels</a>.</td>\n</tr>\n<tr>\n<td><code>name</code></td>\n<td>string</td>\n<td>no</td>\n<td>null</td>\n<td>Operator label. Max 256 chars.</td>\n</tr>\n<tr>\n<td><code>is_primary</code></td>\n<td>boolean</td>\n<td>no</td>\n<td>false</td>\n<td>If <code>true</code>, demotes the current primary on (account, platform) before inserting.</td>\n</tr>\n<tr>\n<td><code>identifier</code></td>\n<td>string</td>\n<td>conditional</td>\n<td>null</td>\n<td>Required for SMS one-way (profile name, ≤ 11 chars). Ignored for WhatsApp on POST (Tyntec sets it via callback). For other platforms it's the phone number — recommended but not enforced.</td>\n</tr>\n</tbody>\n</table>\n</div><p>All other fields in the body are silently dropped (<code>status</code>, <code>client_id</code>, <code>metadata</code>, <code>quality_score</code>, <code>phone_status</code> cannot be set on POST).</p>\n<hr />\n<h3 id=\"branch-a--platform--1-whatsapp-tyntec-onboarding\">Branch A — <code>platform = 1</code> (WhatsApp): Tyntec onboarding</h3>\n<p>The row is created with status <code>Onboarding Started</code>. The response body is the Tyntec redirect, <strong>not</strong> the channel object (<code>200</code>, not <code>201</code>).</p>\n<p><strong>Response</strong> <strong><code>200</code></strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"redirect_url\": \"https://app.spoki.com/external-activation?auth_token=…&amp;lang=it\",\n  \"auth_token\": \"82a1…\",\n  \"lang\": \"it\"\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>redirect_url</code></td>\n<td>string</td>\n<td>Send the end user here to complete Tyntec consent.</td>\n</tr>\n<tr>\n<td><code>auth_token</code></td>\n<td>string</td>\n<td>One-time onboarding token; the webhook callback uses it to locate the row.</td>\n</tr>\n<tr>\n<td><code>lang</code></td>\n<td>string</td>\n<td>ISO 639-1 code resolved from user → account → <code>\"en\"</code>.</td>\n</tr>\n</tbody>\n</table>\n</div><p>After the user completes the Tyntec flow, <code>status</code>, <code>identifier</code>, <code>client_id</code>, <code>phone_status</code>, <code>quality_score</code>, and <code>metadata</code> are populated by the webhook. Poll <code>GET /channel/{id}/</code> to observe the transition.</p>\n<hr />\n<h3 id=\"branch-b--platform--3-sms-one-way-profile-name-review\">Branch B — <code>platform = 3</code> (SMS one-way): profile-name review</h3>\n<p><code>identifier</code> is used as the SMS profile name (≤ 11 chars, non-empty after trim).</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>HTTP</th>\n<th>Body</th>\n<th>Meaning</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>200 OK</code></td>\n<td><code>{ \"sms_profile_name\": \"ACMECORP\", \"approved\": true }</code></td>\n<td>Auto-approved. Row status → <code>Active</code>.</td>\n</tr>\n<tr>\n<td><code>202 Accepted</code></td>\n<td><code>{ \"message\": \"Request received. You'll be notified via email once reviewed.\", \"approved\": false }</code></td>\n<td>Submitted for manual review. Row status → <code>Connected</code>.</td>\n</tr>\n<tr>\n<td><code>400</code></td>\n<td><code>{ \"detail\": \"'sms_profile_name' is required\" }</code></td>\n<td><code>identifier</code> missing or empty.</td>\n</tr>\n<tr>\n<td><code>400</code></td>\n<td><code>{ \"detail\": \"'sms_profile_name' must be at most 11 characters\" }</code></td>\n<td><code>identifier</code> too long.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"branch-c--all-other-platforms-direct-insert\">Branch C — all other platforms: direct insert</h3>\n<p><strong>Response</strong> <strong><code>201 Created</code></strong> — the full 10-field <code>AccountChannel</code> object. The new row's <code>status</code> defaults to <code>1</code> (Onboarding Started); provider activation flips it later.</p>\n<hr />\n<p><strong>Behavior notes</strong></p>\n<ul>\n<li><p><code>is_primary: true</code> on POST runs a per-platform demote before the insert — a Voice primary is unaffected when you create an SMS two-ways primary.</p>\n</li>\n<li><p>No <code>identifier</code> uniqueness check at the API level. Duplicates across tenants and across platforms within a tenant are allowed.</p>\n</li>\n<li><p>All 10 platform values are accepted (no external whitelist).</p>\n</li>\n</ul>\n<hr />\n<p><strong>Errors</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th>Body</th>\n<th>When</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>400</code></td>\n<td><code>{ \"platform\": [\"This field is required.\"] }</code></td>\n<td>Missing <code>platform</code>.</td>\n</tr>\n<tr>\n<td><code>400</code></td>\n<td><code>{ \"platform\": [\"\\\"99\\\" is not a valid choice.\"] }</code></td>\n<td>Out-of-range <code>platform</code>.</td>\n</tr>\n<tr>\n<td><code>400</code></td>\n<td><code>{ \"detail\": \"'sms_profile_name' is required\" }</code></td>\n<td>Branch B — empty <code>identifier</code>.</td>\n</tr>\n<tr>\n<td><code>400</code></td>\n<td><code>{ \"detail\": \"'sms_profile_name' must be at most 11 characters\" }</code></td>\n<td>Branch B — <code>identifier</code> too long.</td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","channel",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"9db33535-0929-4b14-afeb-0f127bd69a56"},{"name":"Rename channel","id":"3872909c-3ced-4136-bb5c-df7dd8f7200e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"Content-Type","value":"application/json","disabled":false}],"body":{"mode":"raw","raw":"{\"name\": \"Renamed\"}","options":{"raw":{"language":"json"}}},"url":"{{Base-URL}}/api/1/channel/{{id_channel}}/","description":"<p>Renames a channel. Only <code>name</code> is writable — every other field in the body is silently dropped (no validation error, just ignored). This is enforced by the serializer contract (<code>Meta.fields = [\"name\"]</code>).</p>\n<p><strong>Request</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>PATCH /api/1/channel/{id}/\n\n</code></pre><p>PUT <code>/channel/{id}/</code> is also accepted with identical writable-field rules.</p>\n<p><strong>Example — extra fields are silently dropped</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-http\">PATCH /api/1/channel/17/\nX-Spoki-Api-Key: {{Api-Key}}\nContent-Type: application/json\n{ \"name\": \"Renamed\", \"identifier\": \"+99…\", \"status\": 4 }\n\n</code></pre>\n<p>Effective body: <code>{ \"name\": \"Renamed\" }</code>. <code>identifier</code> and <code>status</code> are dropped.</p>\n<hr />\n<p><strong>Path parameters</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Param</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>id</code></td>\n<td>integer</td>\n<td>ID of the channel to rename. Non-numeric or unknown values return <code>404</code>.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<p><strong>Request body</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>name</code></td>\n<td>string</td>\n<td>no</td>\n<td>New label for the channel. <code>null</code> and empty string are accepted. All other fields are silently ignored.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<p><strong>Response</strong> <strong><code>200 OK</code></strong></p>\n<p>Full 10-field <code>AccountChannel</code> object reflecting the post-save state. See <a href=\"#\">List channels</a> for the complete schema.</p>\n<hr />\n<p><strong>Errors</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th>Body</th>\n<th>When</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>404</code></td>\n<td><code>{ \"detail\": \"No AccountChannel matches the given query.\" }</code></td>\n<td>Unknown id, cross-tenant id, or non-numeric id.</td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","channel","{{id_channel}}",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"3872909c-3ced-4136-bb5c-df7dd8f7200e"},{"name":"Set primary channel","id":"16271644-6381-4d86-8210-22bda52e05c2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"{{Base-URL}}/api/1/channel/{{id_channel}}/set-primary/","description":"<p>Promotes this channel to <code>is_primary = true</code> for its platform, and atomically demotes every other channel that was previously primary on the same <strong>(account, platform)</strong> pair.</p>\n<p>The DB partial unique index <code>unique_primary_channel_per_account_platform</code> guarantees that after this call exactly one channel per (account, platform) has <code>is_primary = true</code>.</p>\n<hr />\n<h3 id=\"endpoint\">Endpoint</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /api/1/channel/{id}/set-primary/\n</code></pre><hr />\n<h3 id=\"path-parameters\">Path parameters</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>id</code></td>\n<td>integer</td>\n<td>Yes</td>\n<td>Primary key of the <code>AccountChannel</code> to promote. Non-numeric or unknown values return <code>404</code>.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"request-body\">Request body</h3>\n<p>No body is required. An empty JSON object <code>{}</code> or a completely empty body are both accepted.</p>\n<p><strong>Example request</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-http\">POST /api/1/channel/17/set-primary/\nX-Spoki-Api-Key: {{Api-Key}}\nContent-Type: application/json\n\n{}\n</code></pre>\n<hr />\n<h3 id=\"behavior\">Behavior</h3>\n<ol>\n<li>The target channel's <code>is_primary</code> flag is set to <code>true</code>.</li>\n<li>Every other channel belonging to the <strong>same account and same platform</strong> that currently has <code>is_primary = true</code> is demoted to <code>is_primary = false</code> (per-platform demote, mirroring the <code>wazy</code> helper).</li>\n<li>Channels on <strong>different platforms</strong> are never affected. After this call an account may legitimately have multiple primaries — one per platform (e.g. one WhatsApp primary + one SMS primary + one Voice primary).</li>\n<li>The operation is atomic; the DB partial unique index <code>unique_primary_channel_per_account_platform</code> enforces the invariant at the database level.</li>\n</ol>\n<hr />\n<h3 id=\"response--200-ok\">Response — 200 OK</h3>\n<p>Returns the full <code>AccountChannel</code> object for the promoted channel, with <code>is_primary: true</code>.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Notes</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>id</code></td>\n<td>integer</td>\n<td>Channel primary key</td>\n</tr>\n<tr>\n<td><code>name</code></td>\n<td>string</td>\n<td>Human-readable label</td>\n</tr>\n<tr>\n<td><code>phone</code></td>\n<td>string</td>\n<td>E.164 phone number</td>\n</tr>\n<tr>\n<td><code>platform</code></td>\n<td>integer</td>\n<td>Platform code (unchanged by this call)</td>\n</tr>\n<tr>\n<td><code>status</code></td>\n<td>integer</td>\n<td>Activation status (unchanged by this call)</td>\n</tr>\n<tr>\n<td><code>is_primary</code></td>\n<td>boolean</td>\n<td><code>true</code> after this call</td>\n</tr>\n<tr>\n<td><code>phone_status</code></td>\n<td>integer</td>\n<td>Provider-side phone status (unchanged)</td>\n</tr>\n<tr>\n<td><code>quality_score</code></td>\n<td>string / null</td>\n<td>WhatsApp quality score (unchanged)</td>\n</tr>\n<tr>\n<td><code>waba_id</code></td>\n<td>string / null</td>\n<td>WhatsApp Business Account ID (unchanged)</td>\n</tr>\n<tr>\n<td><code>account</code></td>\n<td>integer</td>\n<td>Owning account ID</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Example response</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"id\": 17,\n  \"name\": \"Main WhatsApp\",\n  \"phone\": \"+39012345678\",\n  \"platform\": 1,\n  \"status\": 2,\n  \"is_primary\": true,\n  \"phone_status\": 2,\n  \"quality_score\": \"GREEN\",\n  \"waba_id\": \"123456789012345\",\n  \"account\": 42\n}\n</code></pre>\n<p>Other primaries on the same (account, platform) are now <code>is_primary: false</code> but are <strong>not</strong> returned in this response.</p>\n<hr />\n<h3 id=\"errors\">Errors</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>HTTP status</th>\n<th>Body</th>\n<th>When</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>404 Not Found</code></td>\n<td><code>{ \"detail\": \"No AccountChannel matches the given query.\" }</code></td>\n<td>Unknown <code>id</code> or channel belongs to a different tenant.</td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","channel","{{id_channel}}","set-primary",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"16271644-6381-4d86-8210-22bda52e05c2"},{"name":"Refresh WhatsApp phone status","id":"aa4968ab-f535-4f3c-a34b-72fb2ed32866","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"{{Base-URL}}/api/1/channel/{{id_channel}}/refresh-wa-status/","description":"<p>Enqueues a task that re-pings Meta for the latest WhatsApp phone status and quality score. The endpoint returns immediately; the actual update happens asynchronously.</p>\n<p>Fields updated by the background task: <code>phone_status</code>, <code>quality_score</code>, and — if the derived activation state has changed — <code>status</code> and related metadata.</p>\n<hr />\n<h3 id=\"endpoint\">Endpoint</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /api/1/channel/{id}/refresh-wa-status/\n\n</code></pre><hr />\n<h3 id=\"path-parameters\">Path parameters</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>id</code></td>\n<td>integer</td>\n<td>Yes</td>\n<td>Primary key of the <code>AccountChannel</code> to refresh. Non-numeric or unknown values return <code>404</code>.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"request-body\">Request body</h3>\n<p>No body. Do not send a <code>Content-Type</code> header.</p>\n<p><strong>Example request</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-http\">POST /api/1/channel/6/refresh-wa-status/\nX-Spoki-Api-Key: {{Api-Key}}\n\n</code></pre>\n<hr />\n<h3 id=\"response--204-no-content\">Response — 204 No Content</h3>\n<p>Empty body. The task has been enqueued (or the cache window is still active — see Caching below). Either way the response is always <code>204</code>.</p>\n<p>To observe the updated values, poll the channel afterwards:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /api/1/channel/{id}/\n\n</code></pre><hr />\n<h3 id=\"errors\">Errors</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>HTTP status</th>\n<th>Body</th>\n<th>When</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>404 Not Found</code></td>\n<td><code>{ \"detail\": \"No AccountChannel matches the given query.\" }</code></td>\n<td>Unknown <code>id</code> or channel belongs to a different tenant.</td>\n</tr>\n</tbody>\n</table>\n</div>","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","channel","{{id_channel}}","refresh-wa-status",""],"host":["{{Base-URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"aa4968ab-f535-4f3c-a34b-72fb2ed32866"},{"name":"Lookup channel by phone","id":"d39f500a-7d26-465a-b8f5-20dbb5e4c9fa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"X-Spoki-Api-Key","value":"{{Api-Key}}","disabled":false}],"url":"{{Base-URL}}/api/1/channel/phone/:identifier/","description":"<p>External-only convenience endpoint. Returns the first <code>AccountChannel</code> row on the current tenant whose <code>identifier</code> matches the path segment exactly. No status filter is applied — inactive or onboarding channels are returned if they match.</p>\n<hr />\n<h3 id=\"endpoint\">Endpoint</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /api/1/channel/phone/{identifier}/\n\n</code></pre><hr />\n<h3 id=\"path-parameters\">Path parameters</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>identifier</code></td>\n<td>Yes</td>\n<td>Matched against <code>AccountChannel.identifier</code> exactly — case-sensitive, no normalization. URL-encode <code>+</code> as <code>+</code>. The URL regex limits this segment to characters other than <code>/</code> and <code>.</code>.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"request-body\">Request body</h3>\n<p>None.</p>\n<p><strong>Example request</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-http\">GET /api/1/channel/phone/+393332224444/\nX-Spoki-Api-Key: {{Api-Key}}\n\n</code></pre>\n<hr />\n<h3 id=\"response--200-ok\">Response — 200 OK</h3>\n<p>Full 10-field <code>AccountChannel</code> object.</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</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>id</code></td>\n<td>Primary key</td>\n</tr>\n<tr>\n<td><code>name</code></td>\n<td>Human-readable label</td>\n</tr>\n<tr>\n<td><code>identifier</code></td>\n<td>Phone number or channel identifier</td>\n</tr>\n<tr>\n<td><code>platform</code></td>\n<td>Platform code (see List channels for full table)</td>\n</tr>\n<tr>\n<td><code>status</code></td>\n<td>Activation status</td>\n</tr>\n<tr>\n<td><code>phone_status</code></td>\n<td>WhatsApp phone status code (see List channels for full table)</td>\n</tr>\n<tr>\n<td><code>quality_score</code></td>\n<td>WhatsApp quality score</td>\n</tr>\n<tr>\n<td><code>is_primary</code></td>\n<td>Whether this is the primary channel for its platform on this tenant</td>\n</tr>\n<tr>\n<td><code>waba</code></td>\n<td>WhatsApp Business Account ID</td>\n</tr>\n<tr>\n<td><code>auth_token</code></td>\n<td>Auth token (WhatsApp/Tyntec onboarding)</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Example response</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"id\": 6,\n  \"name\": \"Main WhatsApp\",\n  \"identifier\": \"+393332224444\",\n  \"platform\": 1,\n  \"status\": 1,\n  \"phone_status\": \"CONNECTED\",\n  \"quality_score\": \"GREEN\",\n  \"is_primary\": true,\n  \"waba\": \"123456789012345\",\n  \"auth_token\": null\n}\n\n</code></pre>\n<hr />\n<h3 id=\"errors\">Errors</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>HTTP status</th>\n<th>When</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>404 Not Found</code></td>\n<td>No row on this tenant has that exact identifier.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}},"urlObject":{"path":["api","1","channel","phone",":identifier",""],"host":["{{Base-URL}}"],"query":[],"variable":[{"description":{"content":"<p>The phone number (or other identifier) to look up. Must match AccountChannel.identifier exactly — case-sensitive, no normalization. URL-encode + as %2B. The URL segment regex excludes / and . characters.</p>\n","type":"text/plain"},"type":"any","value":"393332224444","key":"identifier"}]}},"response":[],"_postman_id":"d39f500a-7d26-465a-b8f5-20dbb5e4c9fa"}],"id":"aa2c6201-1794-43cc-97b0-4c90e082c920","description":"<p>Endpoints for managing messaging channels across all supported platforms (WhatsApp, SMS, Voice, and others).</p>\n<p>This folder covers the full channel lifecycle:</p>\n<ul>\n<li><strong>List channels</strong> – Paginated, tenant-scoped list of all channels regardless of status.</li>\n<li><strong>Retrieve channel</strong> – Fetch a single channel by ID.</li>\n<li><strong>Create channel</strong> – Platform-aware creation: delegates to Tyntec onboarding for WhatsApp, triggers a profile-name review for SMS one-way, and performs a direct insert for all other platforms.</li>\n<li><strong>Rename channel</strong> – PATCH/PUT to update the channel <code>name</code> field.</li>\n<li><strong>Set primary channel</strong> – Promotes a channel to primary for its platform, automatically demoting any existing primary on the same account/platform pair.</li>\n<li><strong>Refresh WhatsApp phone status</strong> – Asynchronously re-pings the provider to update <code>phone_status</code> and <code>quality_score</code>; cached for 5 minutes.</li>\n<li><strong>Lookup channel by phone</strong> – External-facing lookup that returns the first channel matching a given phone identifier.</li>\n</ul>\n<p>All endpoints are tenant-scoped. Cross-tenant access returns <code>404</code>.</p>\n","_postman_id":"aa2c6201-1794-43cc-97b0-4c90e082c920","auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"},"isInherited":true,"source":{"_postman_id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","id":"b0f8e61f-7a2d-488c-8c5b-2835b092a3f9","name":"Spoki API","type":"collection"}}}],"auth":{"type":"apikey","apikey":{"value":"{{Api-Key}}","key":"<key>"}},"event":[{"listen":"prerequest","script":{"id":"9b9d8765-d215-479f-bd3f-002caefa731c","type":"text/javascript","requests":{},"exec":[""]}},{"listen":"test","script":{"id":"9947b50b-a03f-4b86-91b8-ddd65ac9bf8b","type":"text/javascript","requests":{},"exec":[""]}}],"variable":[{"key":"webhook_uuid","value":"{{uuid}}"},{"key":"webhook_secret","value":"{{secret}}"},{"key":"id_account","value":"{{id}}"},{"key":"id_automation","value":"{{id}}"},{"key":"id_template","value":"{{id}}"},{"key":"id_list","value":"{{id}}"},{"key":"id_campaign","value":"{{id}}"},{"key":"id_contact","value":"{{id}}"},{"key":"id_custom_field","value":"{{id}}"},{"key":"id_ticket","value":"{{id}}"},{"key":"id_agency","value":"{{id}}"},{"key":"id_invitation","value":"{{id}}"},{"key":"id_role","value":"{{id}}"},{"key":"id_tag","value":"{{id}}"},{"key":"id_media","value":"{{id}}"},{"key":"first_name","value":"John"},{"key":"last_name","value":"Doe"},{"key":"email","value":"john.doe@domain.com"},{"key":"language","value":"en"},{"key":"list_name","value":"Newsletter"},{"key":"phone","value":"{{phone}}"},{"key":"id_webhook","value":"{{id}}"},{"key":"event_type","value":"{{event_type}}","description":"Possible values:\nchat.has_unread_messages\nmessage.outbound\nmessage.inbound\nmessage.note\ncontact.created\ncontact.updated\ncontact.deleted\ncontact_tag.created\ncontact_tag.deleted\ncontact_list.created\ncontact_list.deleted\ncontact_field.created_or_updated\ncontact_field.deleted\nform_answer.submitted\ntemplate.created\ntemplate.updated\ntemplate.deleted\nchannel.whatsapp.status\nchannel.sms_one_way.status\nchannel.sms_two_way.status"}]}