{
  "info": {
    "name": "WhatsGo API",
    "description": "Generated from the OpenAPI file. Set the collection variables baseUrl and token (Dashboard → Device → API). The WhatsApp connection is unofficial and may be restricted by WhatsApp.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{token}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://whatsgo.business"
    },
    {
      "key": "token",
      "value": "wg_your_token_here"
    }
  ],
  "item": [
    {
      "name": "device",
      "item": [
        {
          "name": "List devices",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/instances",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "instances"
              ],
              "variable": [],
              "query": []
            },
            "description": "Returns your devices with their ids. Use an id as instanceId when sending with an account token. A device token returns only its own device."
          }
        },
        {
          "name": "Get a device",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/instances/:instanceId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "instances",
                ":instanceId"
              ],
              "variable": [
                {
                  "key": "instanceId",
                  "value": "",
                  "description": "Device id (UUID) from GET /v1/instances."
                }
              ],
              "query": []
            },
            "description": "One device by id."
          }
        },
        {
          "name": "Connection status",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "status"
              ],
              "variable": [],
              "query": []
            },
            "description": "Returns the device’s WhatsApp connection state and the linked number. Use it before sending or for monitoring.\n\nStates: starting, connecting, awaiting_qr, connected, reconnecting, stopped, logged_out, needs_attention."
          }
        },
        {
          "name": "Connection status",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/instances/:instanceId/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "instances",
                ":instanceId",
                "status"
              ],
              "variable": [
                {
                  "key": "instanceId",
                  "value": ""
                }
              ],
              "query": []
            },
            "description": "Same as /v1/status with the device named in the path (account tokens)."
          }
        },
        {
          "name": "Link code (QR)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/qr",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "qr"
              ],
              "variable": [],
              "query": []
            },
            "description": "Returns the link code image (PNG data URL) while the device is in awaiting_qr. The code rotates automatically, so poll every few seconds."
          }
        },
        {
          "name": "Link code (QR)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/instances/:instanceId/qr",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "instances",
                ":instanceId",
                "qr"
              ],
              "variable": [
                {
                  "key": "instanceId",
                  "value": ""
                }
              ],
              "query": []
            },
            "description": "Same as /v1/qr with the device named in the path (account tokens)."
          }
        }
      ]
    },
    {
      "name": "messages",
      "item": [
        {
          "name": "Send a message",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "order-123-shipped",
                "description": "1–128 chars of A-Z a-z 0-9 _ . : - . If omitted we generate one and you get no duplicate protection.",
                "disabled": true
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "messages"
              ],
              "variable": [],
              "query": []
            },
            "description": "Adds a message to the send queue. A 202 means it was stored and will go out at the device’s configured pace, not that it was delivered. Track it with GET /v1/messages/{id} or webhooks. Supports text, a file from your media library, or an interactive menu.\n\nSend a unique Idempotency-Key per real event (e.g. order-123-shipped) and reuse it when retrying after a network failure: the same key and content returns the same result with replayed:true and is not sent again. The same key with different content = 409.\n\nSending counts toward your plan’s daily limit. Phone: country code then number, digits only, 8–15 digits (e.g. 201012345678).",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phone\": \"201012345678\",\n  \"message\": \"Hello from WhatsGo\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "List messages",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "messages"
              ],
              "variable": [],
              "query": [
                {
                  "key": "limit",
                  "value": "",
                  "description": "1–100, default 50.",
                  "disabled": true
                },
                {
                  "key": "before",
                  "value": "",
                  "description": "Cursor: the nextBefore value from the previous response.",
                  "disabled": true
                },
                {
                  "key": "state",
                  "value": "",
                  "description": "Filter by state (queued, sent, delivered, read, unknown…).",
                  "disabled": true
                }
              ]
            },
            "description": "Latest outbound messages, newest first, with cursor pagination."
          }
        },
        {
          "name": "Send a message",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "order-123-shipped",
                "description": "1–128 chars of A-Z a-z 0-9 _ . : - . If omitted we generate one and you get no duplicate protection.",
                "disabled": true
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/instances/:instanceId/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "instances",
                ":instanceId",
                "messages"
              ],
              "variable": [
                {
                  "key": "instanceId",
                  "value": ""
                }
              ],
              "query": []
            },
            "description": "Same as /v1/messages with the device named in the path (account tokens).",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phone\": \"201012345678\",\n  \"message\": \"Hello from WhatsGo\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "List messages",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/instances/:instanceId/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "instances",
                ":instanceId",
                "messages"
              ],
              "variable": [
                {
                  "key": "instanceId",
                  "value": ""
                }
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "",
                  "description": "1–100, default 50.",
                  "disabled": true
                },
                {
                  "key": "before",
                  "value": "",
                  "description": "Cursor: the nextBefore value from the previous response.",
                  "disabled": true
                },
                {
                  "key": "state",
                  "value": "",
                  "description": "Filter by state (queued, sent, delivered, read, unknown…).",
                  "disabled": true
                }
              ]
            },
            "description": "Same as /v1/messages with the device named in the path (account tokens)."
          }
        },
        {
          "name": "Get a message",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/messages/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "messages",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "",
                  "description": "Message id (UUID) or Idempotency-Key."
                }
              ],
              "query": []
            },
            "description": "Returns a message by its id or by the Idempotency-Key you used.\n\nLifecycle: queued → sending → sent → delivered → read. unknown means the outcome is unconfirmed (it may have arrived) and is never retried automatically to avoid duplicates. cancelled = cancelled before sending."
          }
        },
        {
          "name": "Get a message",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/instances/:instanceId/messages/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "instances",
                ":instanceId",
                "messages",
                ":id"
              ],
              "variable": [
                {
                  "key": "instanceId",
                  "value": ""
                },
                {
                  "key": "id",
                  "value": "",
                  "description": "Message id (UUID) or Idempotency-Key."
                }
              ],
              "query": []
            },
            "description": "Same as /v1/messages/{id} with the device named in the path (account tokens)."
          }
        }
      ]
    },
    {
      "name": "events",
      "item": [
        {
          "name": "Events (polling)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/events",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "events"
              ],
              "variable": [],
              "query": [
                {
                  "key": "after",
                  "value": "",
                  "description": "Last id you processed (default 0).",
                  "disabled": true
                }
              ]
            },
            "description": "An alternative to webhooks: pull events with a cursor. Store nextCursor after you process a page and send it on the next call. If 100 events come back, fetch the next page right away. Events are kept for 7 days."
          }
        },
        {
          "name": "Events (polling)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/instances/:instanceId/events",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "instances",
                ":instanceId",
                "events"
              ],
              "variable": [
                {
                  "key": "instanceId",
                  "value": ""
                }
              ],
              "query": [
                {
                  "key": "after",
                  "value": "",
                  "description": "Last id you processed (default 0).",
                  "disabled": true
                }
              ]
            },
            "description": "Same as /v1/events with the device named in the path (account tokens)."
          }
        }
      ]
    }
  ]
}