{
  "info": {
    "name": "EvoConnect Cloud API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Set the baseUrl, apiKey, instanceId and messageId variables."
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.example.com"
    },
    {
      "key": "apiKey",
      "value": ""
    },
    {
      "key": "instanceId",
      "value": ""
    },
    {
      "key": "messageId",
      "value": ""
    },
    {
      "key": "webhookId",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Instances",
      "item": [
        {
          "name": "List instances",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/instances",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "instances"
              ]
            },
            "description": "Required scope: instances:read"
          }
        },
        {
          "name": "Create instance",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/instances",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "instances"
              ]
            },
            "description": "Required scope: instances:write",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Sales\"\n}"
            }
          }
        },
        {
          "name": "Get instance",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/instances/{{instanceId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "instances",
                "{{instanceId}}"
              ]
            },
            "description": "Required scope: instances:read"
          }
        },
        {
          "name": "Get status",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/instances/{{instanceId}}/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "instances",
                "{{instanceId}}",
                "status"
              ]
            },
            "description": "Required scope: instances:read"
          }
        },
        {
          "name": "Get QR code",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/instances/{{instanceId}}/qr",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "instances",
                "{{instanceId}}",
                "qr"
              ]
            },
            "description": "Required scope: instances:write"
          }
        },
        {
          "name": "Delete instance",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/instances/{{instanceId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "instances",
                "{{instanceId}}"
              ]
            },
            "description": "Required scope: instances:write"
          }
        }
      ]
    },
    {
      "name": "Messages",
      "item": [
        {
          "name": "Send text",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/messages/text",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "messages",
                "text"
              ]
            },
            "description": "Required scope: messages:send",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"instanceId\": \"{{instanceId}}\",\n  \"to\": \"971501234567\",\n  \"message\": \"Your order has been confirmed.\"\n}"
            }
          }
        },
        {
          "name": "Send media",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/messages/media",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "messages",
                "media"
              ]
            },
            "description": "Required scope: messages:send",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"instanceId\": \"{{instanceId}}\",\n  \"to\": \"971501234567\",\n  \"mediaType\": \"image\",\n  \"mediaUrl\": \"https://example.com/image.png\",\n  \"caption\": \"Your receipt\"\n}"
            }
          }
        },
        {
          "name": "Get message",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/messages/{{messageId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "messages",
                "{{messageId}}"
              ]
            },
            "description": "Required scope: messages:read"
          }
        }
      ]
    },
    {
      "name": "Usage",
      "item": [
        {
          "name": "Get usage",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/usage",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "usage"
              ]
            },
            "description": "Required scope: usage:read"
          }
        }
      ]
    },
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "List webhooks",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks"
              ]
            },
            "description": "Required scope: webhooks:read"
          }
        },
        {
          "name": "Create webhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks"
              ]
            },
            "description": "Required scope: webhooks:write",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://example.com/webhooks/whatsapp\",\n  \"events\": [\n    \"message.received\",\n    \"message.delivered\"\n  ]\n}"
            }
          }
        },
        {
          "name": "Delete webhook",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/{{webhookId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "{{webhookId}}"
              ]
            },
            "description": "Required scope: webhooks:write"
          }
        }
      ]
    }
  ]
}