{
    "variable": [
        {
            "id": "baseUrl",
            "key": "baseUrl",
            "type": "string",
            "name": "string",
            "value": "https:\/\/api.brenvio.com.br"
        }
    ],
    "info": {
        "name": "Br Envio API v1 (public)",
        "_postman_id": "3afb4e22-9d6d-484c-af0c-51a65a4776ad",
        "description": "API p\u00fablica de integra\u00e7\u00e3o do Br Envio: cadastrar e atualizar contatos (e tags) via Bearer API token.",
        "schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.1.0\/collection.json"
    },
    "item": [
        {
            "name": "Contact Integration",
            "description": "\nUpsert de contatos para CRM e sistemas externos.\nAutentica\u00e7\u00e3o: `Authorization: Bearer <api_token>` (token gerado em Conta \u2192 Tokens de API).\nRate limit: 60 req\/min por token. Envelope `{ success, data }` \/ `{ success: false, error }`.",
            "item": [
                {
                    "name": "Upsert contact",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/integration\/contacts",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/integration\/contacts"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"email\":\"helena@crm.test\",\"name\":\"Helena\",\"country_code\":\"55\",\"phone_number\":\"11988887777\",\"phone\":\"+55 11 98888-7777\",\"tags\":[\"Lead CRM\",\"VIP\"],\"tag_match\":\"append\",\"fields\":{\"empresa\":\"Acme\"}}"
                        },
                        "description": "Cria ou atualiza um contato pelo e-mail. Tags s\u00e3o anexadas por nome (criadas se n\u00e3o existirem).\nCampos tipados (`fields`) s\u00e3o upsert parcial \u2014 s\u00f3 os slugs enviados. N\u00e3o reativa contatos\n`unsubscribed` ou `suppressed`. Respeita blocklist do cliente e suppress\u00e3o global."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"success\": true,\n  \"message\": \"Contato atualizado via integra\u00e7\u00e3o.\",\n  \"data\": {\"id\": 1, \"email\": \"helena@crm.test\", \"created\": false}\n}",
                            "name": "updated"
                        },
                        {
                            "header": [],
                            "code": 201,
                            "body": "{\n  \"success\": true,\n  \"message\": \"Contato criado via integra\u00e7\u00e3o.\",\n  \"data\": {\n    \"id\": 1,\n    \"email\": \"helena@crm.test\",\n    \"name\": \"Helena\",\n    \"status\": \"active\",\n    \"tags\": [{\"id\": 1, \"name\": \"VIP\"}],\n    \"fields\": {\"empresa\": \"Acme\"},\n    \"created\": true\n  }\n}",
                            "name": "created"
                        },
                        {
                            "header": [],
                            "code": 401,
                            "body": "{\n  \"success\": false,\n  \"error\": {\"code\": \"UNAUTHORIZED\", \"message\": \"Autentica\u00e7\u00e3o necess\u00e1ria.\"}\n}",
                            "name": "unauthorized"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n  \"success\": false,\n  \"error\": {\"code\": \"CONTACT_BLOCKLISTED\", \"message\": \"Este e-mail ou dom\u00ednio est\u00e1 na lista de bloqueio e n\u00e3o pode ser cadastrado.\"}\n}",
                            "name": "blocklisted"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n  \"success\": false,\n  \"error\": {\"code\": \"CONTACT_SUPPRESSED\", \"message\": \"Este e-mail ou dom\u00ednio est\u00e1 na lista de supress\u00e3o e n\u00e3o pode ser cadastrado.\"}\n}",
                            "name": "suppressed"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n  \"success\": false,\n  \"error\": {\"code\": \"UNKNOWN_FIELD_SLUG\", \"message\": \"Slug de campo desconhecido.\"}\n}",
                            "name": "unknown_field"
                        },
                        {
                            "header": [],
                            "code": 429,
                            "body": "{\n  \"success\": false,\n  \"error\": {\"code\": \"RATE_LIMIT_EXCEEDED\", \"message\": \"Limite de requisi\u00e7\u00f5es excedido.\"}\n}",
                            "name": "rate_limited"
                        }
                    ]
                }
            ]
        },
        {
            "name": "Tags",
            "description": "\nCat\u00e1logo de marcadores (tags) da conta.\nAutentica\u00e7\u00e3o neste portal: `Authorization: Bearer <api_token>` nas rotas `\/api\/v1\/integration\/tags*`.\nRate limit: 60 req\/min por token. Envelope `{ success, data }` \/ `{ success: false, error }`.",
            "item": [
                {
                    "name": "List tags",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/integration\/tags",
                            "query": [
                                {
                                    "key": "search",
                                    "value": "vip",
                                    "description": "Filtro parcial no nome (case-insensitive).",
                                    "disabled": false
                                },
                                {
                                    "key": "per_page",
                                    "value": "15",
                                    "description": "Itens por p\u00e1gina (1\u2013100, default 15).",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/v1\/integration\/tags?search=vip&per_page=15"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Lista paginada de tags. Busca opcional por nome (`search`)."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"success\": true,\n  \"data\": [{\"id\": 1, \"name\": \"VIP\"}],\n  \"meta\": {\"current_page\": 1, \"per_page\": 15, \"total\": 1, \"last_page\": 1}\n}",
                            "name": "ok"
                        }
                    ]
                },
                {
                    "name": "Create tag",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/integration\/tags",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/integration\/tags"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"name\":\"Lead CRM\"}"
                        },
                        "description": "Cria uma tag pelo nome. Nome duplicado (case-insensitive) \u2192 valida\u00e7\u00e3o 422."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 201,
                            "body": "{\n  \"success\": true,\n  \"message\": \"Tag criada.\",\n  \"data\": {\"id\": 1, \"name\": \"Lead CRM\"}\n}",
                            "name": "created"
                        }
                    ]
                },
                {
                    "name": "Get tag",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/integration\/tags\/:tag",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/integration\/tags\/:tag",
                            "variable": [
                                {
                                    "id": "tag",
                                    "key": "tag",
                                    "value": 1,
                                    "description": "ID da tag."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"success\": true,\n  \"data\": {\"id\": 1, \"name\": \"VIP\"}\n}",
                            "name": "ok"
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\n  \"success\": false,\n  \"error\": {\"code\": \"NOT_FOUND\", \"message\": \"\u2026\"}\n}",
                            "name": "missing"
                        }
                    ]
                },
                {
                    "name": "Update tag",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/integration\/tags\/:tag",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/integration\/tags\/:tag",
                            "variable": [
                                {
                                    "id": "tag",
                                    "key": "tag",
                                    "value": 1,
                                    "description": "ID da tag."
                                }
                            ]
                        },
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"name\":\"VIP 2026\"}"
                        },
                        "description": "Renomeia a tag. N\u00e3o altera v\u00ednculos com contatos (s\u00f3 o nome)."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"success\": true,\n  \"message\": \"Tag atualizada.\",\n  \"data\": {\"id\": 1, \"name\": \"VIP 2026\"}\n}",
                            "name": "ok"
                        }
                    ]
                },
                {
                    "name": "Delete tag",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/integration\/tags\/:tag",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/integration\/tags\/:tag",
                            "variable": [
                                {
                                    "id": "tag",
                                    "key": "tag",
                                    "value": 1,
                                    "description": "ID da tag."
                                }
                            ]
                        },
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Remove a tag e os v\u00ednculos com contatos (cascade). Os contatos permanecem."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"success\": true,\n  \"message\": \"Tag exclu\u00edda.\",\n  \"data\": null\n}",
                            "name": "ok"
                        }
                    ]
                }
            ]
        }
    ],
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "Authorization",
                "type": "string"
            }
        ]
    }
}