{
  "info": {
    "name": "AllyOneCRM API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Preencha email e password nas variáveis da coleção e rode \"Login com e-mail e senha\": o token é guardado sozinho. Para chave de API, troque a autenticação da coleção por API Key (header X-API-Key)."
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{accessToken}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.allyone.com.br"
    },
    {
      "key": "email",
      "value": ""
    },
    {
      "key": "password",
      "value": ""
    },
    {
      "key": "accessToken",
      "value": ""
    },
    {
      "key": "refreshToken",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Autenticação",
      "item": [
        {
          "name": "Cria conta e tenant",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/auth/register",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "auth",
                "register"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Login com e-mail e senha",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/auth/login",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "auth",
                "login"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"voce@empresa.com\",\n  \"password\": \"{{password}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const b = pm.response.json();",
                  "if (b.accessToken) { pm.collectionVariables.set(\"accessToken\", b.accessToken); if (b.refreshToken) pm.collectionVariables.set(\"refreshToken\", b.refreshToken); }"
                ]
              }
            }
          ]
        },
        {
          "name": "Segundo passo do login com 2FA",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/auth/2fa-verify",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "auth",
                "2fa-verify"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const b = pm.response.json();",
                  "if (b.accessToken) { pm.collectionVariables.set(\"accessToken\", b.accessToken); if (b.refreshToken) pm.collectionVariables.set(\"refreshToken\", b.refreshToken); }"
                ]
              }
            }
          ]
        },
        {
          "name": "Renova o par de tokens",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/auth/refresh",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "auth",
                "refresh"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"refreshToken\": \"{{refreshToken}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const b = pm.response.json();",
                  "if (b.accessToken) { pm.collectionVariables.set(\"accessToken\", b.accessToken); if (b.refreshToken) pm.collectionVariables.set(\"refreshToken\", b.refreshToken); }"
                ]
              }
            }
          ]
        },
        {
          "name": "Revoga o refresh token",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/auth/logout",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "auth",
                "logout"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Pede o link de redefinição de senha",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/auth/forgot-password",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "auth",
                "forgot-password"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Redefine a senha com o token recebido",
          "request": {
            "method": "POST",
            "auth": {
              "type": "noauth"
            },
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/auth/reset-password",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "auth",
                "reset-password"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Chaves de API",
      "item": [
        {
          "name": "Lista chaves (sem o valor)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/api-keys",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "api-keys"
              ]
            }
          }
        },
        {
          "name": "Cria chave — só o owner; o valor aparece apenas aqui",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/api-keys",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "api-keys"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"ERP\",\n  \"permissions\": [\n    \"contacts.read\",\n    \"contacts.*\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Ajusta permissões sem invalidar a chave — só o owner",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/api-keys/:id/permissions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "api-keys",
                ":id",
                "permissions"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Revoga a chave",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/api-keys/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "api-keys",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Contatos",
      "item": [
        {
          "name": "Lista contatos",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/contacts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "contacts"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "",
                  "disabled": true,
                  "description": "A partir de 1"
                },
                {
                  "key": "pageSize",
                  "value": "",
                  "disabled": true,
                  "description": "Padrão 50, máximo 100"
                },
                {
                  "key": "q",
                  "value": "",
                  "disabled": true,
                  "description": "Busca em e-mail, nome e sobrenome"
                },
                {
                  "key": "email",
                  "value": "",
                  "disabled": true,
                  "description": "Contém"
                },
                {
                  "key": "tag",
                  "value": "",
                  "disabled": true,
                  "description": "Tag exata"
                }
              ]
            }
          }
        },
        {
          "name": "Busca rápida (seletores)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/contacts/search",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "contacts",
                "search"
              ],
              "query": [
                {
                  "key": "q",
                  "value": "",
                  "disabled": true,
                  "description": "Termo"
                },
                {
                  "key": "limit",
                  "value": "",
                  "disabled": true,
                  "description": "Máximo de resultados"
                }
              ]
            }
          }
        },
        {
          "name": "Um contato",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/contacts/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "contacts",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Linha do tempo de eventos",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/contacts/:id/events",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "contacts",
                ":id",
                "events"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Listas a que o contato pertence",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/contacts/:id/lists",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "contacts",
                ":id",
                "lists"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Cria contato (e-mail ou telefone E.164 obrigatório)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/contacts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "contacts"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"maria@empresa.com\",\n  \"firstName\": \"Maria\",\n  \"phone\": \"+5511999998888\",\n  \"tags\": [\n    \"cliente\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Atualiza contato (campos ausentes não mudam; null apaga)",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/contacts/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "contacts",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"tags\": [\n    \"vip\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Remove contato",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/contacts/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "contacts",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Importa CSV (multipart) — processa em fila",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/contacts/import",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "contacts",
                "import"
              ]
            },
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": ""
                }
              ]
            }
          }
        },
        {
          "name": "Andamento de uma importação",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/contacts/import/:jobId/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "contacts",
                "import",
                ":jobId",
                "status"
              ],
              "variable": [
                {
                  "key": "jobId",
                  "value": ""
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Listas",
      "item": [
        {
          "name": "Lista listas",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/lists",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "lists"
              ]
            }
          }
        },
        {
          "name": "Uma lista",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/lists/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "lists",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Cria lista",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/lists",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "lists"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Altera lista",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/lists/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "lists",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Apaga lista",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/lists/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "lists",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Contatos da lista",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/lists/:id/contacts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "lists",
                ":id",
                "contacts"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ],
              "query": [
                {
                  "key": "page",
                  "value": "",
                  "disabled": true,
                  "description": "A partir de 1"
                },
                {
                  "key": "pageSize",
                  "value": "",
                  "disabled": true,
                  "description": "Padrão 50, máximo 100"
                }
              ]
            }
          }
        },
        {
          "name": "Adiciona contatos à lista",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/lists/:id/contacts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "lists",
                ":id",
                "contacts"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Tira um contato da lista",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/lists/:id/contacts/:contactId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "lists",
                ":id",
                "contacts",
                ":contactId"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                },
                {
                  "key": "contactId",
                  "value": ""
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Segmentos",
      "item": [
        {
          "name": "Lista segmentos",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/segments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "segments"
              ]
            }
          }
        },
        {
          "name": "Um segmento",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/segments/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "segments",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Contatos do segmento agora",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/segments/:id/contacts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "segments",
                ":id",
                "contacts"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ],
              "query": [
                {
                  "key": "page",
                  "value": "",
                  "disabled": true,
                  "description": "A partir de 1"
                },
                {
                  "key": "pageSize",
                  "value": "",
                  "disabled": true,
                  "description": "Padrão 50, máximo 100"
                }
              ]
            }
          }
        },
        {
          "name": "Cria segmento",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/segments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "segments"
              ]
            }
          }
        },
        {
          "name": "Altera segmento",
          "request": {
            "method": "PATCH",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/segments/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "segments",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Apaga segmento",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/segments/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "segments",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Conta contatos de um filtro sem salvar",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/segments/preview",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "segments",
                "preview"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Templates",
      "item": [
        {
          "name": "Lista templates de e-mail",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates"
              ]
            }
          }
        },
        {
          "name": "Um template",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/templates/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Cria template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Altera template",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/templates/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Apaga template",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/templates/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "templates",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Campanhas",
      "item": [
        {
          "name": "Lista campanhas",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns"
              ]
            }
          }
        },
        {
          "name": "Uma campanha",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Métricas da campanha",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/stats",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "stats"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Cria campanha em rascunho",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Edita campanha",
          "request": {
            "method": "PATCH",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Agenda o envio",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/schedule",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "schedule"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Dispara agora (processa em fila)",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/send",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "send"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Pausa",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/pause",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "pause"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Retoma",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id/resume",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id",
                "resume"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Apaga campanha",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/campaigns/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "campaigns",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Formulários",
      "item": [
        {
          "name": "Lista formulários",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/forms",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "forms"
              ]
            }
          }
        },
        {
          "name": "Cria formulário",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/forms",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "forms"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Altera formulário",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/forms/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "forms",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Apaga formulário",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/forms/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "forms",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Respostas recebidas",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/forms/:id/submissions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "forms",
                ":id",
                "submissions"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ],
              "query": [
                {
                  "key": "page",
                  "value": "",
                  "disabled": true,
                  "description": "A partir de 1"
                },
                {
                  "key": "pageSize",
                  "value": "",
                  "disabled": true,
                  "description": "Padrão 50, máximo 100"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Vendas",
      "item": [
        {
          "name": "Funis",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/sales/pipelines",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sales",
                "pipelines"
              ]
            }
          }
        },
        {
          "name": "Lista negócios",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/sales/deals",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sales",
                "deals"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "",
                  "disabled": true,
                  "description": "A partir de 1"
                },
                {
                  "key": "pageSize",
                  "value": "",
                  "disabled": true,
                  "description": "Padrão 50, máximo 100"
                }
              ]
            }
          }
        },
        {
          "name": "Um negócio",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/sales/deals/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sales",
                "deals",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Cria negócio",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/sales/deals",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sales",
                "deals"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Altera negócio (inclui mover de etapa)",
          "request": {
            "method": "PATCH",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/sales/deals/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sales",
                "deals",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Apaga negócio",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/sales/deals/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sales",
                "deals",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Registra atividade no negócio",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/sales/deals/:id/activities",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sales",
                "deals",
                ":id",
                "activities"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Conversas",
      "item": [
        {
          "name": "Lista conversas",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/chat/conversations",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "chat",
                "conversations"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "",
                  "disabled": true,
                  "description": "Filtra por status"
                },
                {
                  "key": "priority",
                  "value": "",
                  "disabled": true,
                  "description": "Filtra por prioridade"
                },
                {
                  "key": "page",
                  "value": "",
                  "disabled": true,
                  "description": "A partir de 1"
                },
                {
                  "key": "limit",
                  "value": "",
                  "disabled": true,
                  "description": "Padrão 30, máximo 100"
                }
              ]
            }
          }
        },
        {
          "name": "Uma conversa com mensagens",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/chat/conversations/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "chat",
                "conversations",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Envia mensagem",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/chat/conversations/:id/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "chat",
                "conversations",
                ":id",
                "messages"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"content\": \"Olá! Posso ajudar?\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "WhatsApp",
      "item": [
        {
          "name": "Contas WABA",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/waba-accounts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "waba-accounts"
              ]
            }
          }
        },
        {
          "name": "appId e configId do Embedded Signup",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/waba-accounts/embedded-signup/config",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "waba-accounts",
                "embedded-signup",
                "config"
              ]
            }
          }
        },
        {
          "name": "Troca o code do Embedded Signup",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/waba-accounts/embedded-signup/exchange",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "waba-accounts",
                "embedded-signup",
                "exchange"
              ]
            }
          }
        },
        {
          "name": "Cadastra conta (token manual ou BSP)",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/waba-accounts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "waba-accounts"
              ]
            }
          }
        },
        {
          "name": "Atualiza conta / credenciais",
          "request": {
            "method": "PATCH",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/waba-accounts/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "waba-accounts",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Remove conta",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/waba-accounts/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "waba-accounts",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Testa a credencial",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/waba-accounts/:id/test-connection",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "waba-accounts",
                ":id",
                "test-connection"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "URL de webhook do BSP",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/waba-accounts/:id/webhook-url",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "waba-accounts",
                ":id",
                "webhook-url"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Cadastra número",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/waba-accounts/:id/phone-numbers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "waba-accounts",
                ":id",
                "phone-numbers"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "Eventos assináveis",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/events",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                "events"
              ]
            }
          }
        },
        {
          "name": "Lista endpoints (secret mascarado)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks"
              ]
            }
          }
        },
        {
          "name": "Cadastra endpoint (secret aparece só aqui)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"ERP\",\n  \"url\": \"https://erp.exemplo.com/hooks/allyone\",\n  \"events\": [\n    \"contact.created\",\n    \"deal.won\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Altera URL, eventos ou reativa",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Gera secret novo",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/:id/rotate-secret",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                ":id",
                "rotate-secret"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Remove endpoint",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Últimas entregas",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/:id/deliveries",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                ":id",
                "deliveries"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ]
    }
  ]
}
