{
  "info": {
    "name": "Amivu API v1",
    "description": "A API pública da Amivu. Preencha `amivu_api_key` com uma chave de sandbox (`amivu_test_…`) antes de disparar qualquer coisa: com uma chave de produção, toda mensagem enviada daqui chega a um cliente de verdade.\n\nDocumentação: https://developers.amivu.com.br",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://api.amivu.com.br/v1",
      "type": "string"
    },
    {
      "key": "amivu_api_key",
      "value": "",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Contatos",
      "item": [
        {
          "name": "GET /contacts",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/contacts",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "contacts"
              ]
            },
            "description": "Returns the organization's contacts, newest first. Filter by `email`, `phone` or `external_id` to find a specific person without paging through the whole base.\n\nAlcance necessário: `contacts:read` — Ler contatos, incluindo etiquetas e campos personalizados."
          }
        },
        {
          "name": "POST /contacts",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/contacts",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "contacts"
              ]
            },
            "description": "Creates a contact. When `external_id` is provided and already exists, the existing contact is returned unchanged — which makes CRM synchronisation safe to re-run.\n\nAlcance necessário: `contacts:write` — Criar, atualizar e remover contatos.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"João Silva\",\n  \"first_name\": \"João\",\n  \"last_name\": \"Silva\",\n  \"email\": \"joao.silva@exemplo.com.br\",\n  \"phone\": \"+5511999999999\",\n  \"external_id\": \"customer_8291\",\n  \"avatar_url\": \"https://exemplo.com.br/avatares/joao.png\",\n  \"tags\": [\n    \"tag_01K7ZFA5X8Q2M4N6P8R0T2V4W6\"\n  ],\n  \"custom_fields\": {\n    \"chave\": \"valor\"\n  },\n  \"metadata\": {\n    \"chave\": \"valor\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "GET /contacts/{contact_id}",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/contacts/{contact_id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "contacts",
                ":contact_id"
              ]
            },
            "description": "Returns a single contact, with its tags and custom fields.\n\nAlcance necessário: `contacts:read` — Ler contatos, incluindo etiquetas e campos personalizados."
          }
        },
        {
          "name": "PATCH /contacts/{contact_id}",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/contacts/{contact_id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "contacts",
                ":contact_id"
              ]
            },
            "description": "Updates the given fields. Sending `tags` REPLACES the contact's tags; sending `null` in a custom field clears it.\n\nAlcance necessário: `contacts:write` — Criar, atualizar e remover contatos.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"João Silva\",\n  \"first_name\": \"João\",\n  \"last_name\": \"Silva\",\n  \"email\": \"joao.silva@exemplo.com.br\",\n  \"phone\": \"+5511999999999\",\n  \"external_id\": \"customer_8291\",\n  \"avatar_url\": \"https://exemplo.com.br/avatares/joao.png\",\n  \"tags\": [\n    \"tag_01K7ZFA5X8Q2M4N6P8R0T2V4W6\"\n  ],\n  \"custom_fields\": {\n    \"chave\": \"valor\"\n  },\n  \"metadata\": {\n    \"chave\": \"valor\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "DELETE /contacts/{contact_id}",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/contacts/{contact_id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "contacts",
                ":contact_id"
              ]
            },
            "description": "Deletes the contact and, in cascade, the conversations and messages exchanged with that person. This cannot be undone.\n\nAlcance necessário: `contacts:write` — Criar, atualizar e remover contatos."
          }
        }
      ]
    },
    {
      "name": "Conversas",
      "item": [
        {
          "name": "GET /conversations",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/conversations",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "conversations"
              ]
            },
            "description": "Returns conversations, newest first, filterable by status, channel and assignee.\n\nAlcance necessário: `conversations:read` — Ler conversas e seus metadados."
          }
        },
        {
          "name": "POST /conversations",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/conversations",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "conversations"
              ]
            },
            "description": "Opens a conversation with a contact. When `external_id` is provided and already exists, the existing conversation is returned — so a retry does not split the history in two.\n\nAlcance necessário: `conversations:write` — Abrir conversas, atribuir, encerrar e reabrir.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"contact_id\": \"cnt_01K7ZFA5X8Q2M4N6P8R0T2V4W6\",\n  \"channel_id\": \"chn_01K7ZFA5X8Q2M4N6P8R0T2V4W6\",\n  \"external_id\": \"pedido-8291\",\n  \"metadata\": {\n    \"chave\": \"valor\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "GET /conversations/{conversation_id}",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/conversations/{conversation_id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "conversations",
                ":conversation_id"
              ]
            },
            "description": "Returns a single conversation.\n\nAlcance necessário: `conversations:read` — Ler conversas e seus metadados."
          }
        },
        {
          "name": "PATCH /conversations/{conversation_id}",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/conversations/{conversation_id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "conversations",
                ":conversation_id"
              ]
            },
            "description": "Updates status, `external_id` or `metadata`.\n\nAlcance necessário: `conversations:write` — Abrir conversas, atribuir, encerrar e reabrir.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": \"open\",\n  \"external_id\": \"pedido-8291\",\n  \"metadata\": {\n    \"chave\": \"valor\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "POST /conversations/{conversation_id}/close",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/conversations/{conversation_id}/close",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "conversations",
                ":conversation_id",
                "close"
              ]
            },
            "description": "Marks the conversation as resolved and stamps the time it happened.\n\nAlcance necessário: `conversations:write` — Abrir conversas, atribuir, encerrar e reabrir.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "POST /conversations/{conversation_id}/reopen",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/conversations/{conversation_id}/reopen",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "conversations",
                ":conversation_id",
                "reopen"
              ]
            },
            "description": "Brings a closed conversation back to `open`.\n\nAlcance necessário: `conversations:write` — Abrir conversas, atribuir, encerrar e reabrir.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "POST /conversations/{conversation_id}/assign",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/conversations/{conversation_id}/assign",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "conversations",
                ":conversation_id",
                "assign"
              ]
            },
            "description": "Assigns the conversation to an agent or a team. The agent must belong to this organization — assigning across organizations is refused.\n\nAlcance necessário: `conversations:write` — Abrir conversas, atribuir, encerrar e reabrir.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"user_id\": \"usr_01K7ZFA5X8Q2M4N6P8R0T2V4W6\",\n  \"team_id\": \"team_01K7ZFA5X8Q2M4N6P8R0T2V4W6\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "POST /conversations/{conversation_id}/unassign",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/conversations/{conversation_id}/unassign",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "conversations",
                ":conversation_id",
                "unassign"
              ]
            },
            "description": "Removes the current assignee.\n\nAlcance necessário: `conversations:write` — Abrir conversas, atribuir, encerrar e reabrir.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "GET /conversations/{conversation_id}/messages",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/conversations/{conversation_id}/messages",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "conversations",
                ":conversation_id",
                "messages"
              ]
            },
            "description": "Returns the conversation's messages, newest first.\n\nAlcance necessário: `messages:read` — Ler mensagens e o estado de entrega delas."
          }
        },
        {
          "name": "GET /conversations/{conversation_id}/notes",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/conversations/{conversation_id}/notes",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "conversations",
                ":conversation_id",
                "notes"
              ]
            },
            "description": "Returns the conversation's internal notes. Notes are never delivered to the contact — they are a different entity from messages, with no send path at all.\n\nAlcance necessário: `notes:read` — Ler notas internas de uma conversa."
          }
        },
        {
          "name": "POST /conversations/{conversation_id}/notes",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/conversations/{conversation_id}/notes",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "conversations",
                ":conversation_id",
                "notes"
              ]
            },
            "description": "Adds an internal note. It stays inside Amivu.\n\nAlcance necessário: `notes:write` — Escrever notas internas.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"body\": \"Cliente pediu segunda via da nota fiscal.\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "POST /conversations/{conversation_id}/tags",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/conversations/{conversation_id}/tags",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "conversations",
                ":conversation_id",
                "tags"
              ]
            },
            "description": "Applies a tag to the conversation's CONTACT — the only tag link the domain has. The tag follows the person across every conversation, filter and broadcast.\n\nAlcance necessário: `tags:write` — Criar, atualizar e remover etiquetas; aplicá-las a conversas.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"tag_id\": \"tag_01K7ZFA5X8Q2M4N6P8R0T2V4W6\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "DELETE /conversations/{conversation_id}/tags/{tag_id}",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/conversations/{conversation_id}/tags/{tag_id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "conversations",
                ":conversation_id",
                "tags",
                ":tag_id"
              ]
            },
            "description": "Removes the tag from the conversation's contact.\n\nAlcance necessário: `tags:write` — Criar, atualizar e remover etiquetas; aplicá-las a conversas."
          }
        }
      ]
    },
    {
      "name": "Mensagens",
      "item": [
        {
          "name": "POST /messages",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/messages",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "messages"
              ]
            },
            "description": "Sends a message through the conversation's channel. The channel is derived from the conversation — there is no per-channel endpoint. Capabilities are checked before anything is written: a channel that does not support the type refuses with `unsupported_message_type` and nothing is recorded. Text and media are sent: for `image`, `video`, `audio` and `document`, upload the file first with `POST /uploads` and pass its `attachment_id`. `template` is part of the schema but is not sent yet — it is refused with `unsupported_message_type` on every channel.\n\nAlcance necessário: `messages:write` — Enviar mensagens de texto e mídia nas conversas, e subir os anexos delas. Modelo aprovado ainda não sai pela API.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"conversation_id\": \"conv_01K7ZFA5X8Q2M4N6P8R0T2V4W6\",\n  \"type\": \"text\",\n  \"text\": \"Olá! Seu pedido saiu para entrega.\",\n  \"metadata\": {\n    \"chave\": \"valor\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "GET /messages/{message_id}",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/messages/{message_id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "messages",
                ":message_id"
              ]
            },
            "description": "Returns a message and its delivery state. `status` may be `null` — that is information, not absence of it: the channel does not report receipts.\n\nAlcance necessário: `messages:read` — Ler mensagens e o estado de entrega delas."
          }
        }
      ]
    },
    {
      "name": "Anexos",
      "item": [
        {
          "name": "POST /uploads",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/uploads",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "uploads"
              ]
            },
            "description": "Uploads a file to be sent as media with `POST /messages`. The body is `multipart/form-data` with the file in `file`; the returned `att_…` id is valid for the organization and environment of the key that uploaded it, until `expires_at`, and can be sent to as many conversations as you like within that window. The same media types and size limit apply as when an agent attaches a file in the inbox. `Idempotency-Key` is ignored here: uploading twice only creates a second attachment that expires unused.\n\nAlcance necessário: `messages:write` — Enviar mensagens de texto e mídia nas conversas, e subir os anexos delas. Modelo aprovado ainda não sai pela API.",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": "",
                  "description": "The file, up to 16 MB. Accepted types — image (image/jpeg, image/png, image/webp); audio (audio/aac, audio/mp4, audio/mpeg, audio/amr, audio/ogg); document (application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/plain); video (video/mp4, video/3gpp)."
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Anexos",
      "item": [
        {
          "name": "GET /attachments/{attachment_id}/content",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/attachments/{attachment_id}/content",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "attachments",
                ":attachment_id",
                "content"
              ]
            },
            "description": "Returns the file behind an attachment — the one in `attachment.url` of a message, including media RECEIVED from the contact (what `message.received` carries), or a file uploaded with `POST /uploads` while it is valid. The body is the raw bytes, with `Content-Type`, `Content-Disposition` (the original file name) and `Cache-Control: private`. Only attachments of the key's organization and environment are reachable; anything else is `attachment_not_found`.\n\nAlcance necessário: `messages:read` — Ler mensagens e o estado de entrega delas."
          }
        }
      ]
    },
    {
      "name": "Canais",
      "item": [
        {
          "name": "GET /channels",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/channels",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "channels"
              ]
            },
            "description": "Returns the connected channels and what each one can do. Read `capabilities` before sending — it is generated from the implementation, not from the provider's brochure.\n\nAlcance necessário: `channels:read` — Listar canais conectados e as capacidades de cada um."
          }
        },
        {
          "name": "GET /channels/{channel_id}",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/channels/{channel_id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "channels",
                ":channel_id"
              ]
            },
            "description": "Returns one channel, with its capability matrix.\n\nAlcance necessário: `channels:read` — Listar canais conectados e as capacidades de cada um."
          }
        }
      ]
    },
    {
      "name": "Atendentes",
      "item": [
        {
          "name": "GET /users",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/users",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "users"
              ]
            },
            "description": "Returns the organization's agents.\n\nAlcance necessário: `users:read` — Listar os atendentes da organização."
          }
        },
        {
          "name": "GET /users/{user_id}",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/users/{user_id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "users",
                ":user_id"
              ]
            },
            "description": "Returns one agent.\n\nAlcance necessário: `users:read` — Listar os atendentes da organização."
          }
        }
      ]
    },
    {
      "name": "Times",
      "item": [
        {
          "name": "GET /teams",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/teams",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "teams"
              ]
            },
            "description": "Returns the organization's teams.\n\nAlcance necessário: `teams:read` — Listar times e seus integrantes."
          }
        },
        {
          "name": "POST /teams",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/teams",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "teams"
              ]
            },
            "description": "Creates a team.\n\nAlcance necessário: `teams:write` — Criar e atualizar times.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Suporte\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "GET /teams/{team_id}",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/teams/{team_id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "teams",
                ":team_id"
              ]
            },
            "description": "Returns one team.\n\nAlcance necessário: `teams:read` — Listar times e seus integrantes."
          }
        },
        {
          "name": "GET /teams/{team_id}/users",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/teams/{team_id}/users",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "teams",
                ":team_id",
                "users"
              ]
            },
            "description": "Returns the agents that belong to the team.\n\nAlcance necessário: `teams:read` — Listar times e seus integrantes."
          }
        }
      ]
    },
    {
      "name": "Etiquetas",
      "item": [
        {
          "name": "GET /tags",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/tags",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tags"
              ]
            },
            "description": "Returns the organization's tags.\n\nAlcance necessário: `tags:read` — Listar etiquetas."
          }
        },
        {
          "name": "POST /tags",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/tags",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tags"
              ]
            },
            "description": "Creates a tag.\n\nAlcance necessário: `tags:write` — Criar, atualizar e remover etiquetas; aplicá-las a conversas.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"VIP\",\n  \"color\": \"#0e5946\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "PATCH /tags/{tag_id}",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/tags/{tag_id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tags",
                ":tag_id"
              ]
            },
            "description": "Renames the tag or changes its colour.\n\nAlcance necessário: `tags:write` — Criar, atualizar e remover etiquetas; aplicá-las a conversas.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"VIP\",\n  \"color\": \"#0e5946\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "DELETE /tags/{tag_id}",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/tags/{tag_id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "tags",
                ":tag_id"
              ]
            },
            "description": "Deletes the tag; it disappears from every contact that had it.\n\nAlcance necessário: `tags:write` — Criar, atualizar e remover etiquetas; aplicá-las a conversas."
          }
        }
      ]
    },
    {
      "name": "Campos personalizados",
      "item": [
        {
          "name": "GET /custom-fields",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/custom-fields",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "custom-fields"
              ]
            },
            "description": "Returns the custom field catalogue. The `key` of each field is what appears in `contact.custom_fields`, and it never changes after creation.\n\nAlcance necessário: `custom_fields:read` — Ler o catálogo de campos personalizados."
          }
        },
        {
          "name": "POST /custom-fields",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/custom-fields",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "custom-fields"
              ]
            },
            "description": "Creates a custom field definition.\n\nAlcance necessário: `custom_fields:write` — Criar e atualizar campos personalizados.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Plano\",\n  \"key\": \"plano\",\n  \"scope\": \"contact\",\n  \"value\": \"Enterprise\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "GET /webhooks",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks"
              ]
            },
            "description": "Returns the endpoints registered for THIS key's environment. Secrets come masked.\n\nAlcance necessário: `webhooks:read` — Listar endpoints de webhook e as entregas deles."
          }
        },
        {
          "name": "POST /webhooks",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks"
              ]
            },
            "description": "Registers an endpoint. The signing secret comes in full in this response and never again — store it before you move on. The endpoint's environment is taken from the API key, not from the body.\n\nAlcance necessário: `webhooks:write` — Criar, atualizar e remover endpoints de webhook.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://seu-sistema.com.br/webhooks/amivu\",\n  \"description\": \"Sincronização com o ERP\",\n  \"events\": [\n    \"message.received\"\n  ],\n  \"environment\": \"live\",\n  \"enabled\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "GET /webhooks/{webhook_id}",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks/{webhook_id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                ":webhook_id"
              ]
            },
            "description": "Returns one endpoint, with the secret masked.\n\nAlcance necessário: `webhooks:read` — Listar endpoints de webhook e as entregas deles."
          }
        },
        {
          "name": "PATCH /webhooks/{webhook_id}",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks/{webhook_id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                ":webhook_id"
              ]
            },
            "description": "Updates the URL, description, subscribed events or enabled state. Re-enabling clears the failure counter.\n\nAlcance necessário: `webhooks:write` — Criar, atualizar e remover endpoints de webhook.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://seu-sistema.com.br/webhooks/amivu\",\n  \"description\": \"Sincronização com o ERP\",\n  \"events\": [\n    \"message.received\"\n  ],\n  \"enabled\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "DELETE /webhooks/{webhook_id}",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks/{webhook_id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                ":webhook_id"
              ]
            },
            "description": "Deletes the endpoint and its delivery history.\n\nAlcance necessário: `webhooks:write` — Criar, atualizar e remover endpoints de webhook."
          }
        },
        {
          "name": "GET /webhooks/{webhook_id}/deliveries",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{amivu_api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/webhooks/{webhook_id}/deliveries",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "webhooks",
                ":webhook_id",
                "deliveries"
              ]
            },
            "description": "Returns one row per ATTEMPT, newest first. Attempts of the same event share `event_id` — which is also what you should deduplicate on when receiving.\n\nAlcance necessário: `webhooks:read` — Listar endpoints de webhook e as entregas deles."
          }
        }
      ]
    }
  ]
}