{"openapi":"3.0.0","info":{"title":"Wapiworld API","version":"1.0.0","description":"Public REST API for Wapiworld — WhatsApp API as a service. Authenticate with an API key created in the Wapiworld dashboard: send the base64-encoded key secret with HTTP Basic auth. Each key is scoped to a single project and carries per-resource scopes like `instances:read` or `instances:write`."},"servers":[{"url":"https://api.wapiworld.com"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"basic","description":"HTTP Basic auth carrying only the API key secret: `Authorization: Basic base64(<key secret>)`."},"accessToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Operator session token issued by the Wapiworld dashboard: `Authorization: Token <access token>`."}}},"paths":{"/api/instances":{"get":{"tags":["Instances"],"summary":"List WhatsApp instances","description":"Lists the WhatsApp instances of your organization. An API key is scoped to a single project and only sees that project's instances. Requires the `instances:read` scope.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"query","name":"projectId","schema":{"type":"string"}},{"in":"query","name":"fields","description":"Comma-separated projection of fields to return","schema":{"type":"string"}},{"in":"query","name":"limit","description":"Optional page size, capped at 500","schema":{"type":"integer","minimum":1,"maximum":500}},{"in":"query","name":"skip","description":"Optional zero-based page offset","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Array of instances"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"API key is missing the `instances:read` scope"},"429":{"description":"API key rate limit exceeded"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.wapiworld.com/api/instances',\n  qs: {\n    projectId: 'SOME_STRING_VALUE',\n    fields: 'SOME_STRING_VALUE',\n    limit: 'SOME_INTEGER_VALUE',\n    skip: 'SOME_INTEGER_VALUE'\n  },\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url 'https://api.wapiworld.com/api/instances?projectId=SOME_STRING_VALUE&fields=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE' \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http GET 'https://api.wapiworld.com/api/instances?projectId=SOME_STRING_VALUE&fields=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE' \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.wapiworld.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"GET\", \"/api/instances?projectId=SOME_STRING_VALUE&fields=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.wapiworld.com/api/instances?projectId=SOME_STRING_VALUE&fields=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.wapiworld.com/api/instances');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n  'projectId' => 'SOME_STRING_VALUE',\n  'fields' => 'SOME_STRING_VALUE',\n  'limit' => 'SOME_INTEGER_VALUE',\n  'skip' => 'SOME_INTEGER_VALUE'\n]);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.wapiworld.com/api/instances');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n  'projectId' => 'SOME_STRING_VALUE',\n  'fields' => 'SOME_STRING_VALUE',\n  'limit' => 'SOME_INTEGER_VALUE',\n  'skip' => 'SOME_INTEGER_VALUE'\n]));\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"post":{"tags":["Instances"],"summary":"Create a WhatsApp instance","description":"Creates a new WhatsApp instance in your project. A caller-supplied `_id`, whether in the body or `instanceId` query, requires a stable Idempotency-Key; retrying the same create (including the same write-only webhook signing secret) returns the same resource, while reusing either identity for a different intent returns 409. The first accepted command pins its runtime backend, so an exact retry resumes the same command even if a deployment gate changed meanwhile. Keyed creates reserve the resource in stopped state and must be started with the reconnect action after the caller durably stores the returned id. Unkeyed legacy creates retain their historical auto-start behavior. Requires the `instances:write` scope and emits `instance.created`.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"description":"Stable 16-128 character key. Required when the request body supplies `_id` or the query supplies `instanceId`; recommended for every automated create.\n","schema":{"type":"string","minLength":16,"maxLength":128}},{"in":"header","name":"Wapiworld-Required-Create-Backend-Protocol","required":false,"description":"Fail before reservation unless the selected create backend exactly matches this protocol","schema":{"type":"string","enum":["durable-generation-v1","legacy-direct-v1"]}},{"in":"query","name":"instanceId","required":false,"description":"Optional caller-supplied 24-character lowercase hex resource id","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}}],"responses":{"200":{"description":"The created or exactly replayed instance"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"API key is missing the `instances:write` scope"},"409":{"description":"The identity/key conflicts, a legacy effect lease is retryably busy, or runtime capacity is full"},"429":{"description":"API key rate limit exceeded"},"503":{"description":"The explicitly required create backend is not currently selected"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'POST',\n  url: 'https://api.wapiworld.com/api/instances',\n  qs: {instanceId: 'SOME_STRING_VALUE'},\n  headers: {\n    'Idempotency-Key': 'SOME_STRING_VALUE',\n    'Wapiworld-Required-Create-Backend-Protocol': 'SOME_STRING_VALUE',\n    Authorization: 'Basic REPLACE_BASIC_AUTH'\n  }\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url 'https://api.wapiworld.com/api/instances?instanceId=SOME_STRING_VALUE' \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'Idempotency-Key: SOME_STRING_VALUE' \\\n  --header 'Wapiworld-Required-Create-Backend-Protocol: SOME_STRING_VALUE'"},{"lang":"Shell + Httpie","source":"http POST 'https://api.wapiworld.com/api/instances?instanceId=SOME_STRING_VALUE' \\\n  Authorization:'Basic REPLACE_BASIC_AUTH' \\\n  Idempotency-Key:SOME_STRING_VALUE \\\n  Wapiworld-Required-Create-Backend-Protocol:SOME_STRING_VALUE"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.wapiworld.com\")\n\nheaders = {\n    'Idempotency-Key': \"SOME_STRING_VALUE\",\n    'Wapiworld-Required-Create-Backend-Protocol': \"SOME_STRING_VALUE\",\n    'Authorization': \"Basic REPLACE_BASIC_AUTH\"\n    }\n\nconn.request(\"POST\", \"/api/instances?instanceId=SOME_STRING_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.wapiworld.com/api/instances?instanceId=SOME_STRING_VALUE\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\",\n    \"Idempotency-Key: SOME_STRING_VALUE\",\n    \"Wapiworld-Required-Create-Backend-Protocol: SOME_STRING_VALUE\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.wapiworld.com/api/instances');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setQueryData([\n  'instanceId' => 'SOME_STRING_VALUE'\n]);\n\n$request->setHeaders([\n  'Idempotency-Key' => 'SOME_STRING_VALUE',\n  'Wapiworld-Required-Create-Backend-Protocol' => 'SOME_STRING_VALUE',\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.wapiworld.com/api/instances');\n$request->setRequestMethod('POST');\n$request->setQuery(new http\\QueryString([\n  'instanceId' => 'SOME_STRING_VALUE'\n]));\n\n$request->setHeaders([\n  'Idempotency-Key' => 'SOME_STRING_VALUE',\n  'Wapiworld-Required-Create-Backend-Protocol' => 'SOME_STRING_VALUE',\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/instances/{instanceId}":{"get":{"tags":["Instances"],"summary":"Get a WhatsApp instance","description":"Returns a single instance by id. Requires the `instances:read` scope. Answers 404 when the instance belongs to another organization or project.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"instanceId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The instance"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"API key is missing the `instances:read` scope"},"404":{"description":"Instance not found"},"429":{"description":"API key rate limit exceeded"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.wapiworld.com/api/instances/%7BinstanceId%7D',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url https://api.wapiworld.com/api/instances/%7BinstanceId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http GET https://api.wapiworld.com/api/instances/%7BinstanceId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.wapiworld.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"GET\", \"/api/instances/%7BinstanceId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.wapiworld.com/api/instances/%7BinstanceId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.wapiworld.com/api/instances/%7BinstanceId%7D');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.wapiworld.com/api/instances/%7BinstanceId%7D');\n$request->setRequestMethod('GET');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"put":{"tags":["Instances"],"summary":"Update a WhatsApp instance","description":"Updates an existing instance. A body containing `webhookSigningSecret` is always an atomic durable configuration command and requires a stable Idempotency-Key. Its exact public patch and write-only secret may be replayed until the returned configurationOperation reaches `completed`; changing that intent for the same key returns 409. Requires the `instances:write` scope. May emit `instance.connected` / `instance.disconnected` on a status transition.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"instanceId","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":false,"description":"Required for a body containing webhookSigningSecret; stable 16-128 character operation key","schema":{"type":"string","minLength":16,"maxLength":128}}],"responses":{"200":{"description":"The updated instance and completed configuration operation, or an ordinary synchronous update"},"202":{"description":"The atomic configuration command is accepted and awaiting exact runtime acknowledgement"},"403":{"description":"API key is missing the `instances:write` scope"},"409":{"description":"The idempotency key conflicts or the operation was superseded"},"429":{"description":"API key rate limit exceeded"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'PUT',\n  url: 'https://api.wapiworld.com/api/instances/%7BinstanceId%7D',\n  headers: {\n    'Idempotency-Key': 'SOME_STRING_VALUE',\n    Authorization: 'Basic REPLACE_BASIC_AUTH'\n  }\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request PUT \\\n  --url https://api.wapiworld.com/api/instances/%7BinstanceId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'Idempotency-Key: SOME_STRING_VALUE'"},{"lang":"Shell + Httpie","source":"http PUT https://api.wapiworld.com/api/instances/%7BinstanceId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH' \\\n  Idempotency-Key:SOME_STRING_VALUE"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.wapiworld.com\")\n\nheaders = {\n    'Idempotency-Key': \"SOME_STRING_VALUE\",\n    'Authorization': \"Basic REPLACE_BASIC_AUTH\"\n    }\n\nconn.request(\"PUT\", \"/api/instances/%7BinstanceId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.wapiworld.com/api/instances/%7BinstanceId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"PUT\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\",\n    \"Idempotency-Key: SOME_STRING_VALUE\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.wapiworld.com/api/instances/%7BinstanceId%7D');\n$request->setMethod(HTTP_METH_PUT);\n\n$request->setHeaders([\n  'Idempotency-Key' => 'SOME_STRING_VALUE',\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.wapiworld.com/api/instances/%7BinstanceId%7D');\n$request->setRequestMethod('PUT');\n$request->setHeaders([\n  'Idempotency-Key' => 'SOME_STRING_VALUE',\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"delete":{"tags":["Instances"],"summary":"Delete a WhatsApp instance","description":"Durably requests logout, provider-state purge, and deletion. Repeat the same DELETE to poll the intrinsic `delete:{instanceId}` operation; 202 is pending and 200 includes the immutable completion event. Requires the `instances:write` scope and emits `instance.deleted` exactly once. Answers 404 for an instance in another organization or project.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"instanceId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deletion completed; response includes the stable operation and event"},"202":{"description":"Deletion was durably accepted and is still pending"},"403":{"description":"API key is missing the `instances:write` scope"},"404":{"description":"Instance not found"},"409":{"description":"A transitional create external effect is still in flight; retry without changing intent"},"429":{"description":"API key rate limit exceeded"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'DELETE',\n  url: 'https://api.wapiworld.com/api/instances/%7BinstanceId%7D',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request DELETE \\\n  --url https://api.wapiworld.com/api/instances/%7BinstanceId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http DELETE https://api.wapiworld.com/api/instances/%7BinstanceId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.wapiworld.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"DELETE\", \"/api/instances/%7BinstanceId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.wapiworld.com/api/instances/%7BinstanceId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"DELETE\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.wapiworld.com/api/instances/%7BinstanceId%7D');\n$request->setMethod(HTTP_METH_DELETE);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.wapiworld.com/api/instances/%7BinstanceId%7D');\n$request->setRequestMethod('DELETE');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/instances/{instanceId}/action/send-message-idempotent":{"post":{"tags":["Instances"],"summary":"Send a WhatsApp message with a durable idempotency key","description":"Requires one stable Idempotency-Key and the `instances:write` scope. Reuse the key only for the exact same instance, normalized chat, and content. An exact retry reuses one deterministic WhatsApp message id; changed intent returns 409. The unversioned `send-message` action is legacy and rejects every Idempotency-Key.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"instanceId","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"description":"Required exactly once; retries of one command must reuse the exact value","schema":{"type":"string","minLength":16,"maxLength":128}}],"responses":{"200":{"description":"The action result from the instance","content":{"application/json":{"schema":{"type":"object","required":["key","messageTimestamp"],"properties":{"key":{"type":"object","required":["id","remoteJid","fromMe"],"properties":{"id":{"type":"string"},"remoteJid":{"type":"string"},"fromMe":{"type":"boolean"}}},"messageTimestamp":{"type":"integer","format":"int64"}}}}}},"400":{"description":"The Idempotency-Key is present but invalid"},"403":{"description":"API key is missing the `instances:write` scope"},"404":{"description":"Instance not found"},"409":{"description":"The key conflicts or the WhatsApp account is not currently connected"},"422":{"description":"WhatsApp could not address the recipient; no provider message was attempted"},"429":{"description":"API key rate limit exceeded"},"503":{"description":"The keyed-send protocol, recipient lookup, or durable outcome is unavailable; retry the exact command and key"},"504":{"description":"The send timed out with an ambiguous outcome; retry the exact command and key"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'POST',\n  url: 'https://api.wapiworld.com/api/instances/%7BinstanceId%7D/action/send-message-idempotent',\n  headers: {\n    'Idempotency-Key': 'SOME_STRING_VALUE',\n    Authorization: 'Basic REPLACE_BASIC_AUTH'\n  }\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.wapiworld.com/api/instances/%7BinstanceId%7D/action/send-message-idempotent \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH' \\\n  --header 'Idempotency-Key: SOME_STRING_VALUE'"},{"lang":"Shell + Httpie","source":"http POST https://api.wapiworld.com/api/instances/%7BinstanceId%7D/action/send-message-idempotent \\\n  Authorization:'Basic REPLACE_BASIC_AUTH' \\\n  Idempotency-Key:SOME_STRING_VALUE"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.wapiworld.com\")\n\nheaders = {\n    'Idempotency-Key': \"SOME_STRING_VALUE\",\n    'Authorization': \"Basic REPLACE_BASIC_AUTH\"\n    }\n\nconn.request(\"POST\", \"/api/instances/%7BinstanceId%7D/action/send-message-idempotent\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.wapiworld.com/api/instances/%7BinstanceId%7D/action/send-message-idempotent\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\",\n    \"Idempotency-Key: SOME_STRING_VALUE\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.wapiworld.com/api/instances/%7BinstanceId%7D/action/send-message-idempotent');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders([\n  'Idempotency-Key' => 'SOME_STRING_VALUE',\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.wapiworld.com/api/instances/%7BinstanceId%7D/action/send-message-idempotent');\n$request->setRequestMethod('POST');\n$request->setHeaders([\n  'Idempotency-Key' => 'SOME_STRING_VALUE',\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/instances/{instanceId}/action/{action}":{"post":{"tags":["Instances"],"summary":"Perform a legacy or non-send action on a WhatsApp instance","description":"Drives actions such as `logout`, `reconnect`, and the legacy unkeyed `send-message`. Every Idempotency-Key is rejected on this route. Use the exact `send-message-idempotent` path for durable keyed sends.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"instanceId","required":true,"schema":{"type":"string"}},{"in":"path","name":"action","required":true,"schema":{"type":"string","example":"send-message"}}],"responses":{"200":{"description":"The action result from the instance"},"202":{"description":"A reconnect was durably accepted for background reconciliation"},"400":{"description":"An Idempotency-Key was supplied to a legacy or non-send action"},"403":{"description":"API key is missing the `instances:write` scope"},"404":{"description":"Instance not found"},"409":{"description":"Reconnect capacity is unavailable or the WhatsApp account is not currently connected"},"422":{"description":"A legacy send could not address the recipient; no provider message was attempted"},"429":{"description":"API key rate limit exceeded"},"502":{"description":"The instance action could not be completed"},"503":{"description":"A retryable recipient lookup is unavailable before a legacy provider message attempt"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'POST',\n  url: 'https://api.wapiworld.com/api/instances/%7BinstanceId%7D/action/%7Baction%7D',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.wapiworld.com/api/instances/%7BinstanceId%7D/action/%7Baction%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http POST https://api.wapiworld.com/api/instances/%7BinstanceId%7D/action/%7Baction%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.wapiworld.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"POST\", \"/api/instances/%7BinstanceId%7D/action/%7Baction%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.wapiworld.com/api/instances/%7BinstanceId%7D/action/%7Baction%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.wapiworld.com/api/instances/%7BinstanceId%7D/action/%7Baction%7D');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.wapiworld.com/api/instances/%7BinstanceId%7D/action/%7Baction%7D');\n$request->setRequestMethod('POST');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/messages":{"get":{"tags":["Messages"],"summary":"List recorded WhatsApp messages","description":"Reads the recorded messages of one instance, optionally filtered by chat. Message recording is opt-in per instance and TTL-expired. Requires the `messages:read` scope.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"query","name":"instanceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"chatId","schema":{"type":"string"}},{"in":"query","name":"startTime","schema":{"type":"string"}},{"in":"query","name":"endTime","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"type":"integer","default":100}},{"in":"query","name":"skip","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Array of recorded messages"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"API key is missing the `messages:read` scope"},"429":{"description":"API key rate limit exceeded"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.wapiworld.com/api/messages',\n  qs: {\n    instanceId: 'SOME_STRING_VALUE',\n    chatId: 'SOME_STRING_VALUE',\n    startTime: 'SOME_STRING_VALUE',\n    endTime: 'SOME_STRING_VALUE',\n    limit: 'SOME_INTEGER_VALUE',\n    skip: 'SOME_INTEGER_VALUE'\n  },\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url 'https://api.wapiworld.com/api/messages?instanceId=SOME_STRING_VALUE&chatId=SOME_STRING_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE' \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http GET 'https://api.wapiworld.com/api/messages?instanceId=SOME_STRING_VALUE&chatId=SOME_STRING_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE' \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.wapiworld.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"GET\", \"/api/messages?instanceId=SOME_STRING_VALUE&chatId=SOME_STRING_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.wapiworld.com/api/messages?instanceId=SOME_STRING_VALUE&chatId=SOME_STRING_VALUE&startTime=SOME_STRING_VALUE&endTime=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.wapiworld.com/api/messages');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n  'instanceId' => 'SOME_STRING_VALUE',\n  'chatId' => 'SOME_STRING_VALUE',\n  'startTime' => 'SOME_STRING_VALUE',\n  'endTime' => 'SOME_STRING_VALUE',\n  'limit' => 'SOME_INTEGER_VALUE',\n  'skip' => 'SOME_INTEGER_VALUE'\n]);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.wapiworld.com/api/messages');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n  'instanceId' => 'SOME_STRING_VALUE',\n  'chatId' => 'SOME_STRING_VALUE',\n  'startTime' => 'SOME_STRING_VALUE',\n  'endTime' => 'SOME_STRING_VALUE',\n  'limit' => 'SOME_INTEGER_VALUE',\n  'skip' => 'SOME_INTEGER_VALUE'\n]));\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/projects":{"get":{"tags":["Projects"],"summary":"List projects","description":"Lists your organization's projects. An API key is scoped to a single project and returns only that one. Requires the `projects:read` scope.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"query","name":"fields","description":"Optional comma-separated top-level fields to return","schema":{"type":"string"}}],"responses":{"200":{"description":"Array of projects"},"401":{"description":"Missing or invalid credentials"},"403":{"description":"API key is missing the `projects:read` scope"},"429":{"description":"API key rate limit exceeded"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.wapiworld.com/api/projects',\n  qs: {fields: 'SOME_STRING_VALUE'},\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url 'https://api.wapiworld.com/api/projects?fields=SOME_STRING_VALUE' \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http GET 'https://api.wapiworld.com/api/projects?fields=SOME_STRING_VALUE' \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.wapiworld.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"GET\", \"/api/projects?fields=SOME_STRING_VALUE\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.wapiworld.com/api/projects?fields=SOME_STRING_VALUE\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.wapiworld.com/api/projects');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setQueryData([\n  'fields' => 'SOME_STRING_VALUE'\n]);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.wapiworld.com/api/projects');\n$request->setRequestMethod('GET');\n$request->setQuery(new http\\QueryString([\n  'fields' => 'SOME_STRING_VALUE'\n]));\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/projects/{projectId}":{"get":{"tags":["Projects"],"summary":"Get a project","description":"Returns a single project by id. Requires the `projects:read` scope. Answers 404 for a project in another organization, or for a project-scoped key asking for a different project.\n","security":[{"apiKey":[]},{"accessToken":[]}],"parameters":[{"in":"path","name":"projectId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The project"},"403":{"description":"API key is missing the `projects:read` scope"},"404":{"description":"Project not found"},"429":{"description":"API key rate limit exceeded"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.wapiworld.com/api/projects/%7BprojectId%7D',\n  headers: {Authorization: 'Basic REPLACE_BASIC_AUTH'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url https://api.wapiworld.com/api/projects/%7BprojectId%7D \\\n  --header 'Authorization: Basic REPLACE_BASIC_AUTH'"},{"lang":"Shell + Httpie","source":"http GET https://api.wapiworld.com/api/projects/%7BprojectId%7D \\\n  Authorization:'Basic REPLACE_BASIC_AUTH'"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.wapiworld.com\")\n\nheaders = { 'Authorization': \"Basic REPLACE_BASIC_AUTH\" }\n\nconn.request(\"GET\", \"/api/projects/%7BprojectId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.wapiworld.com/api/projects/%7BprojectId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Basic REPLACE_BASIC_AUTH\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.wapiworld.com/api/projects/%7BprojectId%7D');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.wapiworld.com/api/projects/%7BprojectId%7D');\n$request->setRequestMethod('GET');\n$request->setHeaders([\n  'Authorization' => 'Basic REPLACE_BASIC_AUTH'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/webhooksubscriptions":{"get":{"tags":["Webhook subscriptions"],"summary":"List webhook subscriptions","description":"Webhook subscriptions deliver `instance.created`, `instance.connected`, `instance.disconnected` and `instance.deleted` events to your server as signed POST requests (`X-Wapiworld-Signature: t=<timestamp>,v1=<hex HMAC-SHA256 of \"timestamp.body\">`). An endpoint failing 20 times in a row is disabled automatically. Subscriptions are managed with an operator access token. Responses contain only the reviewed public subscription fields; the `secret` is returned once, on create.\n","security":[{"accessToken":[]}],"responses":{"200":{"description":"Array of webhook subscriptions (without secrets)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'GET',\n  url: 'https://api.wapiworld.com/api/webhooksubscriptions',\n  headers: {Authorization: 'REPLACE_KEY_VALUE'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request GET \\\n  --url https://api.wapiworld.com/api/webhooksubscriptions \\\n  --header 'Authorization: REPLACE_KEY_VALUE'"},{"lang":"Shell + Httpie","source":"http GET https://api.wapiworld.com/api/webhooksubscriptions \\\n  Authorization:REPLACE_KEY_VALUE"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.wapiworld.com\")\n\nheaders = { 'Authorization': \"REPLACE_KEY_VALUE\" }\n\nconn.request(\"GET\", \"/api/webhooksubscriptions\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.wapiworld.com/api/webhooksubscriptions\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: REPLACE_KEY_VALUE\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.wapiworld.com/api/webhooksubscriptions');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setHeaders([\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.wapiworld.com/api/webhooksubscriptions');\n$request->setRequestMethod('GET');\n$request->setHeaders([\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"post":{"tags":["Webhook subscriptions"],"summary":"Create a webhook subscription","description":"The response includes the signing `secret` exactly once — store it; it cannot be retrieved again.\n","security":[{"accessToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["projectId","url"],"properties":{"projectId":{"type":"string"},"url":{"type":"string","example":"https://example.com/wapiworld-webhook"},"events":{"type":"array","description":"Empty array subscribes to all events","items":{"type":"string","enum":["instance.created","instance.connected","instance.disconnected","instance.deleted","instance.qrcode.available","instance.qrcode.expired","instance.updated","message.delivered","message.failed","message.read","message.received","message.sent"]}},"deliveryVersion":{"type":"integer","enum":[1,2],"description":"Version 1 is the legacy envelope; version 2 is the canonical CloudEvent"}}}}}},"responses":{"200":{"description":"The created subscription, including its secret"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'POST',\n  url: 'https://api.wapiworld.com/api/webhooksubscriptions',\n  headers: {'content-type': 'application/json', Authorization: 'REPLACE_KEY_VALUE'},\n  body: {\n    projectId: 'string',\n    url: 'https://example.com/wapiworld-webhook',\n    events: ['instance.created'],\n    deliveryVersion: 1\n  },\n  json: true\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request POST \\\n  --url https://api.wapiworld.com/api/webhooksubscriptions \\\n  --header 'Authorization: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{\"projectId\":\"string\",\"url\":\"https://example.com/wapiworld-webhook\",\"events\":[\"instance.created\"],\"deliveryVersion\":1}'"},{"lang":"Shell + Httpie","source":"echo '{\"projectId\":\"string\",\"url\":\"https://example.com/wapiworld-webhook\",\"events\":[\"instance.created\"],\"deliveryVersion\":1}' |  \\\n  http POST https://api.wapiworld.com/api/webhooksubscriptions \\\n  Authorization:REPLACE_KEY_VALUE \\\n  content-type:application/json"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.wapiworld.com\")\n\npayload = \"{\\\"projectId\\\":\\\"string\\\",\\\"url\\\":\\\"https://example.com/wapiworld-webhook\\\",\\\"events\\\":[\\\"instance.created\\\"],\\\"deliveryVersion\\\":1}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'Authorization': \"REPLACE_KEY_VALUE\"\n    }\n\nconn.request(\"POST\", \"/api/webhooksubscriptions\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.wapiworld.com/api/webhooksubscriptions\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n  CURLOPT_POSTFIELDS => \"{\\\"projectId\\\":\\\"string\\\",\\\"url\\\":\\\"https://example.com/wapiworld-webhook\\\",\\\"events\\\":[\\\"instance.created\\\"],\\\"deliveryVersion\\\":1}\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: REPLACE_KEY_VALUE\",\n    \"content-type: application/json\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.wapiworld.com/api/webhooksubscriptions');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$request->setBody('{\"projectId\":\"string\",\"url\":\"https://example.com/wapiworld-webhook\",\"events\":[\"instance.created\"],\"deliveryVersion\":1}');\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{\"projectId\":\"string\",\"url\":\"https://example.com/wapiworld-webhook\",\"events\":[\"instance.created\"],\"deliveryVersion\":1}');\n\n$request->setRequestUrl('https://api.wapiworld.com/api/webhooksubscriptions');\n$request->setRequestMethod('POST');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}},"/api/webhooksubscriptions/{webhookSubscriptionId}":{"put":{"tags":["Webhook subscriptions"],"summary":"Update a webhook subscription","description":"`url`, `events`, `deliveryVersion` and `active` are editable; the secret and project are immutable. Re-enabling an auto-disabled endpoint is done by setting `active` back to true.\n","security":[{"accessToken":[]}],"parameters":[{"in":"path","name":"webhookSubscriptionId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"The updated subscription (without secret)"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'PUT',\n  url: 'https://api.wapiworld.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D',\n  headers: {'content-type': 'application/json', Authorization: 'REPLACE_KEY_VALUE'},\n  body: {},\n  json: true\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request PUT \\\n  --url https://api.wapiworld.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D \\\n  --header 'Authorization: REPLACE_KEY_VALUE' \\\n  --header 'content-type: application/json' \\\n  --data '{}'"},{"lang":"Shell + Httpie","source":"echo '{}' |  \\\n  http PUT https://api.wapiworld.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D \\\n  Authorization:REPLACE_KEY_VALUE \\\n  content-type:application/json"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.wapiworld.com\")\n\npayload = \"{}\"\n\nheaders = {\n    'content-type': \"application/json\",\n    'Authorization': \"REPLACE_KEY_VALUE\"\n    }\n\nconn.request(\"PUT\", \"/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D\", payload, headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.wapiworld.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"PUT\",\n  CURLOPT_POSTFIELDS => \"{}\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: REPLACE_KEY_VALUE\",\n    \"content-type: application/json\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.wapiworld.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D');\n$request->setMethod(HTTP_METH_PUT);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$request->setBody('{}');\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$body = new http\\Message\\Body;\n$body->append('{}');\n\n$request->setRequestUrl('https://api.wapiworld.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D');\n$request->setRequestMethod('PUT');\n$request->setBody($body);\n\n$request->setHeaders([\n  'content-type' => 'application/json',\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]},"delete":{"tags":["Webhook subscriptions"],"summary":"Delete a webhook subscription","security":[{"accessToken":[]}],"parameters":[{"in":"path","name":"webhookSubscriptionId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted"}},"x-codeSamples":[{"lang":"Node + Request","source":"const request = require('request');\n\nconst options = {\n  method: 'DELETE',\n  url: 'https://api.wapiworld.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D',\n  headers: {Authorization: 'REPLACE_KEY_VALUE'}\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"},{"lang":"Shell + Curl","source":"curl --request DELETE \\\n  --url https://api.wapiworld.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D \\\n  --header 'Authorization: REPLACE_KEY_VALUE'"},{"lang":"Shell + Httpie","source":"http DELETE https://api.wapiworld.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D \\\n  Authorization:REPLACE_KEY_VALUE"},{"lang":"Python + Python3","source":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.wapiworld.com\")\n\nheaders = { 'Authorization': \"REPLACE_KEY_VALUE\" }\n\nconn.request(\"DELETE\", \"/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"},{"lang":"Php + Curl","source":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_URL => \"https://api.wapiworld.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => \"\",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => \"DELETE\",\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: REPLACE_KEY_VALUE\"\n  ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo \"cURL Error #:\" . $err;\n} else {\n  echo $response;\n}"},{"lang":"Php + Http1","source":"<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://api.wapiworld.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D');\n$request->setMethod(HTTP_METH_DELETE);\n\n$request->setHeaders([\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"},{"lang":"Php + Http2","source":"<?php\n\n$client = new http\\Client;\n$request = new http\\Client\\Request;\n\n$request->setRequestUrl('https://api.wapiworld.com/api/webhooksubscriptions/%7BwebhookSubscriptionId%7D');\n$request->setRequestMethod('DELETE');\n$request->setHeaders([\n  'Authorization' => 'REPLACE_KEY_VALUE'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();"}]}}},"tags":[]}