{
    "openapi": "3.0.3",
    "info": {
        "title": "API PABX Atendai",
        "version": "0.24.0",
        "description": "Contratos da instalação. Guia e cURLs: /documentacao/api; documento LLM: /documentacao/llm.md. Chaves Bearer pertencem a um cliente. PUT substitui a configuração e exige versao. Respostas usam sucesso/dados ou sucesso=false/erro. Limite: 120 requisições por minuto por chave."
    },
    "servers": [
        {
            "url": "https://pabx.atendai.chat/api/v1"
        }
    ],
    "components": {
        "securitySchemes": {
            "chaveApi": {
                "type": "http",
                "scheme": "bearer"
            },
            "sessao": {
                "type": "apiKey",
                "in": "cookie",
                "name": "atendai_sessao"
            },
            "visitante": {
                "type": "apiKey",
                "in": "cookie",
                "name": "atendai_visitante",
                "description": "Cookie HttpOnly do navegador. Também exige sessao_id e segredo no corpo e Origin exata."
            }
        },
        "schemas": {
            "Destino": {
                "type": "object",
                "required": [
                    "tipo"
                ],
                "description": "id é obrigatório exceto para encerrar; audio usa o UUID de um áudio ativo, reproduz uma vez e encerra sem pedir dígitos, emitindo call.audio_played ou call.audio_failed; horario_id condiciona o destino e destino_fechado é usado fora do expediente. destino_nao_atendido é uma alternativa opcional após falha de atendimento; numa tecla substitui a alternativa geral da URA. Ausência/null herda; encerrar explícito na tecla encerra. Todas as referências pertencem à mesma empresa.",
                "properties": {
                    "tipo": {
                        "type": "string",
                        "enum": [
                            "ramal",
                            "fila",
                            "ura",
                            "horario",
                            "audio",
                            "encerrar"
                        ]
                    },
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "horario_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "destino_fechado": {
                        "$ref": "#/components/schemas/Destino"
                    },
                    "destino_nao_atendido": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/Destino"
                            },
                            {
                                "type": "object",
                                "nullable": true,
                                "enum": [
                                    null
                                ]
                            }
                        ]
                    }
                }
            },
            "FaixaHorario": {
                "type": "object",
                "required": [
                    "dias",
                    "inicio",
                    "fim"
                ],
                "properties": {
                    "dias": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 7
                        }
                    },
                    "inicio": {
                        "type": "string",
                        "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
                    },
                    "fim": {
                        "type": "string",
                        "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
                    }
                }
            },
            "dominios": {
                "type": "object",
                "required": [
                    "nome",
                    "configuracao"
                ],
                "properties": {
                    "nome": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 100
                    },
                    "versao": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Obrigatória no PUT, obtida no GET."
                    },
                    "ativo": {
                        "type": "boolean",
                        "default": true
                    },
                    "configuracao": {
                        "type": "object",
                        "properties": {
                            "dominio": {
                                "type": "string",
                                "description": " Domínio SIP"
                            },
                            "principal": {
                                "type": "boolean",
                                "description": " Usar como domínio principal"
                            }
                        }
                    }
                }
            },
            "ramais": {
                "type": "object",
                "required": [
                    "nome",
                    "configuracao"
                ],
                "properties": {
                    "nome": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 100
                    },
                    "versao": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Obrigatória no PUT, obtida no GET."
                    },
                    "ativo": {
                        "type": "boolean",
                        "default": true
                    },
                    "configuracao": {
                        "type": "object",
                        "properties": {
                            "numero": {
                                "type": "string",
                                "description": " Número do ramal"
                            },
                            "nome_identificacao": {
                                "type": "string",
                                "maxLength": 60,
                                "description": "Nome exibido ao destino interno. Vazio usa nome do ramal; omitido no PUT preserva. Não muda número nem usuário SIP."
                            },
                            "webphone": {
                                "type": "boolean",
                                "description": " Usar no navegador"
                            },
                            "sufixo_sip": {
                                "type": "string",
                                "description": "Parte editável após T{empresa_id}_. Vazio na criação usa numero; omitido no PUT preserva o login existente. Caracteres: letras ASCII, dígitos, hífen e sublinhado; primeiro alfanumérico. Login total até 40 caracteres.",
                                "maxLength": 24
                            },
                            "sip_sem_simbolos": {
                                "type": "boolean",
                                "description": "Habilita o login adicional T{empresa_id}R{numero}, com a mesma senha, sem alterar o login SIP principal nem o WebPhone. Padrão false na criação; omitido no PUT preserva a opção atual."
                            },
                            "senha": {
                                "type": "string",
                                "description": "Opcional: 5 a 128 caracteres ASCII imprimíveis sem espaços. Vazio gera na criação e mantém no PUT. Nunca retornada no cadastro.",
                                "writeOnly": true,
                                "maxLength": 128,
                                "pattern": "^(?:[!-~]{5,128})?$"
                            },
                            "externas": {
                                "type": "boolean",
                                "description": " Permitir chamadas externas"
                            },
                            "internacional": {
                                "type": "boolean",
                                "description": " Permitir chamadas internacionais"
                            },
                            "timeout": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 120,
                                "description": " Tempo para atender (segundos)"
                            },
                            "destino_nao_atendido": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Destino"
                                    }
                                ],
                                "description": "Se este ramal não atender",
                                "default": {
                                    "tipo": "encerrar"
                                }
                            },
                            "gravar_realizadas": {
                                "type": "boolean",
                                "description": " Gravar chamadas feitas por este ramal"
                            },
                            "gravar_recebidas": {
                                "type": "boolean",
                                "description": " Gravar chamadas recebidas por este ramal"
                            },
                            "chefe_secretaria": {
                                "$ref": "#/components/schemas/ChefeSecretaria"
                            },
                            "siga_me": {
                                "$ref": "#/components/schemas/SigaMe"
                            }
                        }
                    }
                }
            },
            "troncos": {
                "type": "object",
                "required": [
                    "nome",
                    "configuracao"
                ],
                "properties": {
                    "nome": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 100
                    },
                    "versao": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Obrigatória no PUT, obtida no GET."
                    },
                    "ativo": {
                        "type": "boolean",
                        "default": true
                    },
                    "configuracao": {
                        "type": "object",
                        "properties": {
                            "servidor": {
                                "type": "string",
                                "description": " Servidor SIP"
                            },
                            "porta": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 65535,
                                "description": " Porta SIP"
                            },
                            "autenticacao": {
                                "type": "string",
                                "description": " Autenticação",
                                "enum": [
                                    "senha",
                                    "ip"
                                ]
                            },
                            "usuario": {
                                "type": "string",
                                "description": " Usuário SIP"
                            },
                            "senha": {
                                "type": "string",
                                "description": " Senha SIP",
                                "writeOnly": true
                            },
                            "ip_autorizado": {
                                "type": "string",
                                "description": " IP autorizado pela operadora"
                            },
                            "caller_id": {
                                "type": "string",
                                "description": " Número principal"
                            },
                            "transporte": {
                                "type": "string",
                                "description": " Transporte",
                                "enum": [
                                    "udp",
                                    "tcp"
                                ]
                            },
                            "registrar": {
                                "type": "boolean",
                                "description": " Registrar na operadora"
                            },
                            "limite": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 65535,
                                "description": " Limite de chamadas simultâneas"
                            },
                            "recuperar_registro": {
                                "type": "boolean",
                                "description": " Tentar recuperar o registro automaticamente após falhas",
                                "default": true
                            },
                            "intervalo_recuperacao": {
                                "type": "integer",
                                "minimum": 60,
                                "maximum": 3600,
                                "description": " Intervalo após rejeição, em segundos (60 a 3600)",
                                "default": 300
                            },
                            "recuperar_ao_registrar_ramal": {
                                "type": "boolean",
                                "description": " Tentar recuperar o tronco quando um ramal desta empresa conectar",
                                "default": true
                            }
                        }
                    }
                }
            },
            "rotas_saida": {
                "type": "object",
                "required": [
                    "nome",
                    "configuracao"
                ],
                "properties": {
                    "nome": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 100
                    },
                    "versao": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Obrigatória no PUT, obtida no GET."
                    },
                    "ativo": {
                        "type": "boolean",
                        "default": true
                    },
                    "configuracao": {
                        "type": "object",
                        "properties": {
                            "prefixo": {
                                "type": "string",
                                "description": " Prefixo permitido (vazio aceita todos)"
                            },
                            "tamanho_minimo": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 65535,
                                "description": " Quantidade mínima de dígitos"
                            },
                            "tamanho_maximo": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 65535,
                                "description": " Quantidade máxima de dígitos"
                            },
                            "remover": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 65535,
                                "description": " Dígitos a remover do início"
                            },
                            "adicionar": {
                                "type": "string",
                                "description": " Prefixo a adicionar"
                            },
                            "prioridade": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 65535,
                                "description": " Prioridade (menor primeiro)"
                            },
                            "troncos": {
                                "type": "array",
                                "minItems": 1,
                                "maxItems": 100,
                                "items": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "description": " Operadoras, na ordem de preferência"
                            }
                        }
                    }
                }
            },
            "rotas_entrada": {
                "type": "object",
                "required": [
                    "nome",
                    "configuracao"
                ],
                "properties": {
                    "nome": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 100
                    },
                    "versao": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Obrigatória no PUT, obtida no GET."
                    },
                    "ativo": {
                        "type": "boolean",
                        "default": true
                    },
                    "configuracao": {
                        "type": "object",
                        "properties": {
                            "did": {
                                "type": "string",
                                "description": " Número recebido (DID)"
                            },
                            "tronco_id": {
                                "type": "string",
                                "format": "uuid",
                                "description": " Operadora"
                            },
                            "destino": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Destino"
                                    }
                                ],
                                "description": "Para onde enviar a ligação?"
                            }
                        }
                    }
                }
            },
            "uras": {
                "type": "object",
                "required": [
                    "nome",
                    "configuracao"
                ],
                "properties": {
                    "nome": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 100
                    },
                    "versao": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Obrigatória no PUT, obtida no GET."
                    },
                    "ativo": {
                        "type": "boolean",
                        "default": true
                    },
                    "configuracao": {
                        "type": "object",
                        "properties": {
                            "modo": {
                                "type": "string",
                                "description": " Tipo de URA",
                                "enum": [
                                    "teclas",
                                    "simples"
                                ],
                                "default": "teclas"
                            },
                            "audio_id": {
                                "type": "string",
                                "format": "uuid",
                                "description": " Mensagem inicial"
                            },
                            "timeout": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 120,
                                "description": " Espera pela tecla (segundos)"
                            },
                            "repeticoes": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 65535,
                                "description": " Repetições da mensagem"
                            },
                            "opcoes": {
                                "description": "Obrigatório no modo teclas. Em simples é ignorado e salvo como array vazio.",
                                "oneOf": [
                                    {
                                        "type": "object",
                                        "minProperties": 1,
                                        "maxProperties": 12,
                                        "additionalProperties": {
                                            "$ref": "#/components/schemas/Destino"
                                        },
                                        "description": " Opções do teclado"
                                    },
                                    {
                                        "type": "array",
                                        "maxItems": 0
                                    }
                                ]
                            },
                            "destino": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Destino"
                                    }
                                ],
                                "description": "Se não houver uma opção válida",
                                "default": {
                                    "tipo": "encerrar"
                                }
                            },
                            "destino_nao_atendido": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Destino"
                                    }
                                ],
                                "description": "Se o destino escolhido não atender",
                                "default": {
                                    "tipo": "encerrar"
                                }
                            }
                        },
                        "required": [
                            "audio_id"
                        ],
                        "description": "Criação sem modo usa teclas; PUT sem modo preserva o modo anterior. simples toca áudio completo uma vez e encaminha para destino ramal/fila, sem DTMF. timeout=5, repeticoes=0 e opcoes=[] são normalizados em simples; horarios_filas deve estar vazio. Falha de áudio encerra sem encaminhar. destino_nao_atendido trata falta de atendimento após alternativas do destino. Todas as referências devem estar ativas e na mesma empresa.",
                        "oneOf": [
                            {
                                "required": [
                                    "modo",
                                    "destino"
                                ],
                                "properties": {
                                    "modo": {
                                        "type": "string",
                                        "enum": [
                                            "simples"
                                        ]
                                    },
                                    "destino": {
                                        "allOf": [
                                            {
                                                "$ref": "#/components/schemas/Destino"
                                            },
                                            {
                                                "type": "object",
                                                "required": [
                                                    "tipo",
                                                    "id"
                                                ],
                                                "properties": {
                                                    "tipo": {
                                                        "type": "string",
                                                        "enum": [
                                                            "ramal",
                                                            "fila"
                                                        ]
                                                    }
                                                }
                                            }
                                        ]
                                    }
                                }
                            },
                            {
                                "required": [
                                    "opcoes"
                                ],
                                "properties": {
                                    "modo": {
                                        "type": "string",
                                        "enum": [
                                            "teclas"
                                        ]
                                    },
                                    "opcoes": {
                                        "type": "object",
                                        "minProperties": 1,
                                        "maxProperties": 12,
                                        "additionalProperties": {
                                            "$ref": "#/components/schemas/Destino"
                                        },
                                        "description": " Opções do teclado"
                                    }
                                }
                            }
                        ]
                    },
                    "horarios_filas": {
                        "type": "array",
                        "maxItems": 12,
                        "items": {
                            "type": "object",
                            "required": [
                                "fila_id",
                                "versao",
                                "horario_id",
                                "destino_fechado"
                            ],
                            "properties": {
                                "fila_id": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "versao": {
                                    "type": "integer"
                                },
                                "horario_id": {
                                    "type": "string"
                                },
                                "destino_fechado": {
                                    "$ref": "#/components/schemas/Destino"
                                }
                            }
                        }
                    }
                }
            },
            "horarios": {
                "type": "object",
                "required": [
                    "nome",
                    "configuracao"
                ],
                "properties": {
                    "nome": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 100
                    },
                    "versao": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Obrigatória no PUT, obtida no GET."
                    },
                    "ativo": {
                        "type": "boolean",
                        "default": true
                    },
                    "configuracao": {
                        "type": "object",
                        "properties": {
                            "periodos": {
                                "type": "array",
                                "maxItems": 50,
                                "items": {
                                    "$ref": "#/components/schemas/FaixaHorario"
                                },
                                "description": " Dias e faixas de atendimento"
                            },
                            "dias": {
                                "type": "array",
                                "minItems": 1,
                                "items": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 7
                                },
                                "description": " Dias da semana"
                            },
                            "inicio": {
                                "type": "string",
                                "description": " Início do expediente",
                                "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
                            },
                            "fim": {
                                "type": "string",
                                "description": " Fim do expediente",
                                "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
                            },
                            "intervalos": {
                                "type": "string",
                                "description": " Outros períodos (um HH:MM-HH:MM por linha)"
                            },
                            "feriados": {
                                "type": "string",
                                "description": " Feriados (uma data AAAA-MM-DD por linha)"
                            },
                            "destino_aberto": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Destino"
                                    }
                                ],
                                "description": "Durante o expediente (quando usada como destino)",
                                "default": {
                                    "tipo": "encerrar"
                                }
                            },
                            "destino_fechado": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Destino"
                                    }
                                ],
                                "description": "Fora do expediente",
                                "default": {
                                    "tipo": "encerrar"
                                }
                            }
                        }
                    }
                }
            },
            "filas": {
                "type": "object",
                "required": [
                    "nome",
                    "configuracao"
                ],
                "properties": {
                    "nome": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 100
                    },
                    "versao": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Obrigatória no PUT, obtida no GET."
                    },
                    "ativo": {
                        "type": "boolean",
                        "default": true
                    },
                    "configuracao": {
                        "type": "object",
                        "properties": {
                            "horario_id": {
                                "type": "string",
                                "description": "UUID de horário ou vazio para remover a regra. Horário de atendimento"
                            },
                            "destino_fechado": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Destino"
                                    }
                                ],
                                "description": "Fora do horário da fila",
                                "default": {
                                    "tipo": "encerrar"
                                }
                            },
                            "ramais": {
                                "type": "array",
                                "minItems": 1,
                                "maxItems": 100,
                                "items": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "description": " Atendentes"
                            },
                            "estrategia": {
                                "type": "string",
                                "description": " Como distribuir as chamadas?",
                                "enum": [
                                    "ringall",
                                    "rrmemory",
                                    "leastrecent",
                                    "fewestcalls",
                                    "random"
                                ]
                            },
                            "timeout": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 120,
                                "description": " Tempo para cada atendente (segundos)"
                            },
                            "espera": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 300,
                                "description": " Espera máxima (segundos)"
                            },
                            "descanso": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 65535,
                                "description": " Descanso após a chamada (segundos)"
                            },
                            "destino": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Destino"
                                    }
                                ],
                                "description": "Se ninguém atender nesta fila",
                                "default": {
                                    "tipo": "encerrar"
                                }
                            }
                        }
                    }
                }
            },
            "audios": {
                "type": "object",
                "required": [
                    "nome",
                    "configuracao"
                ],
                "properties": {
                    "nome": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 100
                    },
                    "versao": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Obrigatória no PUT, obtida no GET."
                    },
                    "ativo": {
                        "type": "boolean",
                        "default": true
                    },
                    "configuracao": {
                        "type": "object",
                        "properties": {}
                    }
                }
            },
            "campanhas": {
                "type": "object",
                "required": [
                    "nome",
                    "configuracao"
                ],
                "properties": {
                    "nome": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 100
                    },
                    "versao": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Obrigatória no PUT, obtida no GET."
                    },
                    "ativo": {
                        "type": "boolean",
                        "default": true
                    },
                    "configuracao": {
                        "type": "object",
                        "properties": {
                            "modo": {
                                "type": "string",
                                "description": " Como encaminhar o cliente?",
                                "enum": [
                                    "audio_tecla",
                                    "direto"
                                ],
                                "default": "audio_tecla"
                            },
                            "tronco_id": {
                                "type": "string",
                                "format": "uuid",
                                "description": " Operadora"
                            },
                            "audio_id": {
                                "type": "string",
                                "description": "UUID de áudio obrigatório em audio_tecla. Em direto é ignorado e salvo vazio. Mensagem"
                            },
                            "fila_id": {
                                "type": "string",
                                "format": "uuid",
                                "description": " Fila de atendimento"
                            },
                            "tecla": {
                                "type": "string",
                                "description": " Tecla para confirmar",
                                "enum": [
                                    "0",
                                    "1",
                                    "2",
                                    "3",
                                    "4",
                                    "5",
                                    "6",
                                    "7",
                                    "8",
                                    "9"
                                ]
                            },
                            "tecla_bloqueio": {
                                "type": "string",
                                "description": " Tecla para não receber novas ligações",
                                "enum": [
                                    "0",
                                    "1",
                                    "2",
                                    "3",
                                    "4",
                                    "5",
                                    "6",
                                    "7",
                                    "8",
                                    "9"
                                ]
                            },
                            "espera_tecla": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 30,
                                "description": " Espera pela tecla após a mensagem (segundos)",
                                "default": 8
                            },
                            "espera_atendente": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 120,
                                "description": " Espera máxima para conectar um atendente (segundos)",
                                "default": 30
                            },
                            "simultaneas": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 65535,
                                "description": " Máximo de chamadas simultâneas"
                            },
                            "tentativas": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 65535,
                                "description": " Máximo de tentativas por contato"
                            },
                            "intervalo": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 65535,
                                "description": " Intervalo entre tentativas (minutos)"
                            },
                            "dias": {
                                "type": "array",
                                "minItems": 1,
                                "items": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 7
                                },
                                "description": " Dias permitidos"
                            },
                            "inicio": {
                                "type": "string",
                                "description": " Horário inicial",
                                "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
                            },
                            "fim": {
                                "type": "string",
                                "description": " Horário final",
                                "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
                            },
                            "data_inicio": {
                                "type": "string",
                                "description": " Data de início (opcional)"
                            },
                            "data_fim": {
                                "type": "string",
                                "description": " Data de término (opcional)"
                            },
                            "amd": {
                                "type": "boolean",
                                "description": " Identificar caixa postal (AMD)",
                                "default": false
                            },
                            "amd_inconclusivo": {
                                "type": "string",
                                "description": " Se a detecção de caixa postal for inconclusiva",
                                "enum": [
                                    "prosseguir",
                                    "reagendar"
                                ],
                                "default": "prosseguir"
                            }
                        },
                        "required": [
                            "tronco_id",
                            "fila_id"
                        ],
                        "oneOf": [
                            {
                                "required": [
                                    "modo"
                                ],
                                "properties": {
                                    "modo": {
                                        "type": "string",
                                        "enum": [
                                            "direto"
                                        ]
                                    }
                                }
                            },
                            {
                                "required": [
                                    "audio_id"
                                ],
                                "properties": {
                                    "modo": {
                                        "type": "string",
                                        "enum": [
                                            "audio_tecla"
                                        ]
                                    },
                                    "audio_id": {
                                        "type": "string",
                                        "format": "uuid"
                                    }
                                }
                            }
                        ],
                        "description": "modo omitido usa audio_tecla. Áudio somente nesse modo. Agenda da fila e da campanha são cumulativas. Espera_atendente limita o encaminhamento sem atendente; nenhuma tecla equivale a atendimento."
                    }
                }
            },
            "webhooks": {
                "type": "object",
                "required": [
                    "nome",
                    "configuracao"
                ],
                "properties": {
                    "nome": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 100
                    },
                    "versao": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Obrigatória no PUT, obtida no GET."
                    },
                    "ativo": {
                        "type": "boolean",
                        "default": true
                    },
                    "configuracao": {
                        "type": "object",
                        "properties": {
                            "versao_payload": {
                                "type": "string",
                                "description": " Formato do webhook",
                                "enum": [
                                    "1",
                                    "2"
                                ]
                            },
                            "url": {
                                "type": "string",
                                "description": " Endereço HTTPS de destino"
                            },
                            "eventos": {
                                "type": "string",
                                "description": " Eventos (um por linha; vazio recebe todos)"
                            }
                        }
                    }
                }
            },
            "AgenteFila": {
                "type": "object",
                "properties": {
                    "ramal_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "numero": {
                        "type": "string"
                    },
                    "nome": {
                        "type": "string"
                    },
                    "estado": {
                        "type": "string",
                        "enum": [
                            "disponivel",
                            "reservado",
                            "em_ligacao",
                            "pausado",
                            "descanso",
                            "desconectado",
                            "desconhecido",
                            "desativado",
                            "fora_do_horario"
                        ]
                    },
                    "pausado": {
                        "type": "boolean"
                    },
                    "pronto": {
                        "type": "boolean"
                    },
                    "reservado": {
                        "type": "boolean"
                    },
                    "reservado_outro": {
                        "type": "boolean"
                    },
                    "disponivel": {
                        "type": "boolean"
                    },
                    "candidato_para_fila": {
                        "type": "boolean"
                    },
                    "ultimo_atendimento": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "descanso_ate": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                }
            },
            "StatusFila": {
                "type": "object",
                "properties": {
                    "nome": {
                        "type": "string"
                    },
                    "aberta": {
                        "type": "boolean"
                    },
                    "consulta_disponivel": {
                        "type": "boolean"
                    },
                    "consultado_em": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "prontos": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "disponiveis": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "reservados": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "capacidade_discagem": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "aguardando": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "aguardando_sem_reserva": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "agentes": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/AgenteFila"
                        }
                    }
                }
            },
            "StatusCampanha": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "estado": {
                        "type": "string",
                        "enum": [
                            "rascunho",
                            "executando",
                            "pausada",
                            "cancelada",
                            "concluida"
                        ]
                    },
                    "modo": {
                        "type": "string",
                        "enum": [
                            "audio_tecla",
                            "direto"
                        ]
                    },
                    "motivo": {
                        "type": "string",
                        "enum": [
                            "rascunho",
                            "pausada",
                            "cancelada",
                            "concluida",
                            "desativada",
                            "fora_do_horario",
                            "telefonia_indisponivel",
                            "fila_fechada",
                            "operadora_desativada",
                            "aguardando_atendente",
                            "limite_de_chamadas",
                            "disponivel",
                            "sem_rota",
                            "numero_invalido",
                            "aguardando_retentativa",
                            "processamento_indisponivel",
                            "sem_contatos",
                            "contatos_bloqueados",
                            "tentativas_esgotadas",
                            "em_ligacao"
                        ]
                    },
                    "mensagem": {
                        "type": "string"
                    },
                    "vagas": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Mínimo entre capacidade e contatos prontos; zero quando há espera ou bloqueio. fila.capacidade_discagem informa a capacidade da fila independentemente dos contatos."
                    },
                    "ativas": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "fila": {
                        "$ref": "#/components/schemas/StatusFila"
                    },
                    "contatos": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "estado": {
                                    "type": "string",
                                    "enum": [
                                        "pendente",
                                        "reservado",
                                        "discando",
                                        "concluido",
                                        "falhou",
                                        "bloqueado",
                                        "cancelado"
                                    ]
                                },
                                "quantidade": {
                                    "type": "integer",
                                    "minimum": 0
                                }
                            }
                        }
                    },
                    "resumo": {
                        "type": "object",
                        "properties": {
                            "ligacoes": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "clientes_atenderam": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "confirmacoes_tecla": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "atendimentos": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "historicas": {
                                "type": "integer",
                                "minimum": 0
                            }
                        }
                    },
                    "resultados": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "resultado": {
                                    "type": "string",
                                    "nullable": true,
                                    "enum": [
                                        null,
                                        "atendido",
                                        "sem_resposta",
                                        "ocupado",
                                        "caixa_postal",
                                        "amd_inconclusivo",
                                        "falha_amd",
                                        "sem_confirmacao",
                                        "tecla_invalida",
                                        "sem_atendente",
                                        "cliente_desligou",
                                        "bloqueado",
                                        "falha_operadora",
                                        "falha_fluxo",
                                        "nao_discada",
                                        "historico_anterior"
                                    ]
                                },
                                "descricao": {
                                    "type": "string"
                                },
                                "quantidade": {
                                    "type": "integer",
                                    "minimum": 0
                                }
                            }
                        }
                    },
                    "rotulo": {
                        "type": "string"
                    },
                    "orientacao": {
                        "type": "string"
                    },
                    "nivel": {
                        "type": "string",
                        "enum": [
                            "erro",
                            "aviso",
                            "sucesso"
                        ]
                    },
                    "fuso_horario": {
                        "type": "string"
                    },
                    "operadora": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string",
                                "format": "uuid"
                            },
                            "nome": {
                                "type": "string"
                            }
                        }
                    },
                    "discagem": {
                        "type": "object",
                        "description": "Prévia atual, sem originar chamadas. prontos exige rota válida, intervalo vencido, tentativas restantes e ausência de bloqueio. A capacidade da fila e os horários são verificados separadamente.",
                        "properties": {
                            "pendentes": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "prontos": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "sem_rota": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "numero_invalido": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "aguardando_retentativa": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "bloqueados": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "tentativas_esgotadas": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "proxima_tentativa_em": {
                                "type": "string",
                                "format": "date-time",
                                "nullable": true
                            }
                        }
                    },
                    "pendencias": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "motivo": {
                                    "type": "string",
                                    "enum": [
                                        "sem_rota",
                                        "numero_invalido"
                                    ]
                                },
                                "quantidade": {
                                    "type": "integer",
                                    "minimum": 0
                                },
                                "mensagem": {
                                    "type": "string"
                                },
                                "orientacao": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "processamento": {
                        "type": "object",
                        "description": "Heartbeat dos processos discador e chamadas nos últimos 30 segundos; não é garantia de entrega na operadora.",
                        "properties": {
                            "disponivel": {
                                "type": "boolean"
                            },
                            "processos": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "nome": {
                                            "type": "string",
                                            "enum": [
                                                "discador",
                                                "chamadas"
                                            ]
                                        },
                                        "atualizado_em": {
                                            "type": "string",
                                            "format": "date-time",
                                            "nullable": true
                                        },
                                        "disponivel": {
                                            "type": "boolean"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "ContatoCampanha": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "nome": {
                        "type": "string"
                    },
                    "telefone": {
                        "type": "string"
                    },
                    "estado": {
                        "type": "string",
                        "enum": [
                            "pendente",
                            "reservado",
                            "discando",
                            "concluido",
                            "falhou",
                            "bloqueado",
                            "cancelado"
                        ]
                    },
                    "tentativas": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "ultimo_resultado": {
                        "type": "string",
                        "nullable": true
                    },
                    "bloqueado": {
                        "type": "boolean"
                    },
                    "proxima_tentativa_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "chamada_id": {
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    },
                    "etapa_campanha": {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                            null,
                            "reservada",
                            "discando",
                            "cliente_atendeu",
                            "confirmado",
                            "aguardando_atendente",
                            "em_atendimento",
                            "finalizada"
                        ]
                    },
                    "resultado_campanha": {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                            null,
                            "atendido",
                            "sem_resposta",
                            "ocupado",
                            "caixa_postal",
                            "amd_inconclusivo",
                            "falha_amd",
                            "sem_confirmacao",
                            "tecla_invalida",
                            "sem_atendente",
                            "cliente_desligou",
                            "bloqueado",
                            "falha_operadora",
                            "falha_fluxo",
                            "nao_discada",
                            "historico_anterior"
                        ]
                    },
                    "cliente_atendeu_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "confirmada_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "enfileirada_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "atendente_atendeu_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "ramal_atendimento_id": {
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    },
                    "classificacao_amd": {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                            null,
                            "HUMAN",
                            "MACHINE",
                            "NOTSURE",
                            "HANGUP",
                            "INDEFINIDO"
                        ]
                    },
                    "encerrada_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "situacao_discagem": {
                        "type": "object",
                        "nullable": true,
                        "description": "Prévia recalculada de contatos pendentes. null nos demais estados. Não substitui o resultado da última chamada nem altera tentativas. pronto ainda depende do motivo global da campanha.",
                        "properties": {
                            "motivo": {
                                "type": "string",
                                "enum": [
                                    "pronto",
                                    "sem_rota",
                                    "numero_invalido",
                                    "aguardando_retentativa",
                                    "bloqueado",
                                    "tentativas_esgotadas"
                                ]
                            },
                            "mensagem": {
                                "type": "string"
                            },
                            "proxima_tentativa_em": {
                                "type": "string",
                                "format": "date-time",
                                "nullable": true
                            }
                        }
                    }
                }
            },
            "ResultadosCampanha": {
                "type": "object",
                "properties": {
                    "pagina": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "por_pagina": {
                        "type": "integer",
                        "enum": [
                            100
                        ]
                    },
                    "total": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "contatos": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ContatoCampanha"
                        }
                    }
                }
            },
            "PreviaVoz": {
                "type": "object",
                "required": [
                    "texto"
                ],
                "properties": {
                    "texto": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 1000
                    },
                    "voz": {
                        "type": "string",
                        "enum": [
                            "faber",
                            "cadu",
                            "jeff"
                        ],
                        "default": "faber"
                    },
                    "velocidade": {
                        "type": "number",
                        "minimum": 0.8,
                        "maximum": 1.2,
                        "default": 1
                    }
                }
            },
            "GerarVoz": {
                "type": "object",
                "required": [
                    "texto",
                    "nome"
                ],
                "properties": {
                    "texto": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 1000
                    },
                    "voz": {
                        "type": "string",
                        "enum": [
                            "faber",
                            "cadu",
                            "jeff"
                        ],
                        "default": "faber"
                    },
                    "velocidade": {
                        "type": "number",
                        "minimum": 0.8,
                        "maximum": 1.2,
                        "default": 1
                    },
                    "nome": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 100
                    }
                }
            },
            "VozesLocais": {
                "type": "object",
                "properties": {
                    "disponivel": {
                        "type": "boolean"
                    },
                    "motor": {
                        "type": "string"
                    },
                    "vozes": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "string"
                                },
                                "nome": {
                                    "type": "string"
                                },
                                "idioma": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "limite_caracteres": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "velocidade_minima": {
                        "type": "number"
                    },
                    "velocidade_maxima": {
                        "type": "number"
                    }
                }
            },
            "AudioSalvo": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "empresa_id": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "nome": {
                        "type": "string"
                    },
                    "ativo": {
                        "type": "boolean"
                    },
                    "versao": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "criado_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "atualizado_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "configuracao": {
                        "type": "object",
                        "properties": {
                            "arquivo": {
                                "type": "string"
                            },
                            "duracao": {
                                "type": "number"
                            },
                            "tamanho": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "origem": {
                                "type": "string",
                                "enum": [
                                    "tts",
                                    "envio"
                                ]
                            },
                            "mime_original": {
                                "type": "string"
                            },
                            "formato": {
                                "type": "string",
                                "enum": [
                                    "wav"
                                ]
                            },
                            "codec": {
                                "type": "string",
                                "enum": [
                                    "pcm_s16le"
                                ]
                            },
                            "frequencia": {
                                "type": "integer",
                                "enum": [
                                    8000
                                ]
                            },
                            "canais": {
                                "type": "integer",
                                "enum": [
                                    1
                                ]
                            },
                            "motor": {
                                "type": "string"
                            },
                            "voz": {
                                "type": "string"
                            },
                            "velocidade": {
                                "type": "number"
                            },
                            "caracteres": {
                                "type": "integer",
                                "minimum": 0
                            }
                        }
                    }
                }
            },
            "ChamadaRamal": {
                "type": "object",
                "properties": {
                    "chamada_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "origem": {
                        "type": "string"
                    },
                    "destino": {
                        "type": "string"
                    },
                    "tipo_chamada": {
                        "type": "string",
                        "enum": [
                            "interna",
                            "externa"
                        ]
                    },
                    "direcao": {
                        "type": "string",
                        "enum": [
                            "realizada",
                            "recebida"
                        ]
                    },
                    "estado": {
                        "type": "string"
                    },
                    "iniciada_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "atendida_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "encerrada_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                }
            },
            "EventoRamal": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "ocorrido_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "tipo": {
                        "type": "string",
                        "enum": [
                            "registros",
                            "chamadas",
                            "alteracoes"
                        ]
                    },
                    "evento": {
                        "type": "string"
                    },
                    "titulo": {
                        "type": "string"
                    },
                    "mensagem": {
                        "type": "string"
                    },
                    "responsavel": {
                        "type": "string"
                    },
                    "detalhes": {
                        "type": "object",
                        "description": "Por tipo: SIP dispositivo/endereco/endpoint/contato_hash/expira_em; chamadas identificador, direção, datas, dial_status, sip_status, hangup_cause e resultado_campanha; alterações entidade/ator_tipo/campos_alterados. Nunca inclui senhas ou texto TTS.",
                        "additionalProperties": true
                    }
                }
            },
            "HistoricoRamal": {
                "type": "object",
                "properties": {
                    "ramal": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string",
                                "format": "uuid"
                            },
                            "nome": {
                                "type": "string"
                            },
                            "numero": {
                                "type": "string"
                            },
                            "ativo": {
                                "type": "boolean"
                            },
                            "criado_em": {
                                "type": "string",
                                "format": "date-time",
                                "nullable": true
                            }
                        }
                    },
                    "conexao": {
                        "type": "object",
                        "nullable": true,
                        "properties": {
                            "ramal_id": {
                                "type": "string",
                                "format": "uuid"
                            },
                            "numero": {
                                "type": "string"
                            },
                            "nome": {
                                "type": "string"
                            },
                            "estado": {
                                "type": "string"
                            },
                            "dispositivos": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/DispositivoRamal"
                                }
                            }
                        }
                    },
                    "consultado_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "chamadas_ativas": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ChamadaRamal"
                        }
                    },
                    "eventos": {
                        "type": "array",
                        "maxItems": 50,
                        "items": {
                            "$ref": "#/components/schemas/EventoRamal"
                        }
                    },
                    "pagina": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "proxima_pagina": {
                        "type": "integer",
                        "nullable": true
                    },
                    "primeiro_evento_sip": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                }
            },
            "GravacaoRamal": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "chamada_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "ramal_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "numero_ramal": {
                        "type": "string"
                    },
                    "direcao": {
                        "type": "string",
                        "enum": [
                            "realizada",
                            "recebida"
                        ]
                    },
                    "estado": {
                        "type": "string",
                        "enum": [
                            "gravando",
                            "disponivel",
                            "sem_audio",
                            "falhou"
                        ]
                    },
                    "duracao": {
                        "type": "number"
                    },
                    "tamanho": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "criada_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "finalizada_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "origem": {
                        "type": "string"
                    },
                    "destino": {
                        "type": "string"
                    },
                    "iniciada_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "encerrada_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                }
            },
            "GravacoesRamal": {
                "type": "object",
                "properties": {
                    "ramal": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string",
                                "format": "uuid"
                            },
                            "nome": {
                                "type": "string"
                            },
                            "numero": {
                                "type": "string"
                            },
                            "ativo": {
                                "type": "boolean"
                            },
                            "gravar_realizadas": {
                                "type": "boolean"
                            },
                            "gravar_recebidas": {
                                "type": "boolean"
                            }
                        }
                    },
                    "gravacoes": {
                        "type": "array",
                        "maxItems": 50,
                        "items": {
                            "$ref": "#/components/schemas/GravacaoRamal"
                        }
                    },
                    "pagina": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100000
                    },
                    "proxima_pagina": {
                        "type": "integer",
                        "nullable": true
                    }
                }
            },
            "TelefoniaEmpresa": {
                "type": "object",
                "properties": {
                    "prefixo_sip": {
                        "type": "string",
                        "readOnly": true,
                        "example": "T1_"
                    },
                    "captura_chamadas": {
                        "type": "boolean",
                        "default": false
                    },
                    "codigo_captura_geral": {
                        "type": "string",
                        "pattern": "^[*#]{1,2}[0-9]{1,4}$",
                        "minLength": 2,
                        "maxLength": 6,
                        "default": "#0",
                        "description": "Código completo para captura geral. Não pode começar com o prefixo direto nem ser seu prefixo."
                    },
                    "prefixo_captura_direta": {
                        "type": "string",
                        "pattern": "^[*#]{1,2}[0-9]{1,4}$",
                        "minLength": 2,
                        "maxLength": 6,
                        "default": "#1",
                        "description": "Acrescente o número do ramal (2 a 6 dígitos). Exemplo: #11002."
                    }
                }
            },
            "SolicitacaoCorrelacaoSip": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "sip_call_id"
                ],
                "description": "ramal_id obrigatório para chave API, administrador ou supervisor sem ramal vinculado. Atendente só pode consultar seu ramal; omitido usa o vínculo da sessão. O servidor apenas consulta dados observados na telefonia.",
                "properties": {
                    "sip_call_id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512,
                        "pattern": "^[!-~]{1,512}$",
                        "description": "Call-ID exato do evento JsSIP newRTCSession, preservando maiúsculas; nunca RTCSession.id."
                    },
                    "ramal_id": {
                        "type": "string",
                        "format": "uuid"
                    }
                }
            },
            "CorrelacaoSip": {
                "type": "object",
                "required": [
                    "estado",
                    "sip_call_id",
                    "ramal_id",
                    "dialogo_id",
                    "chamadas",
                    "tentar_novamente_em_ms"
                ],
                "properties": {
                    "estado": {
                        "type": "string",
                        "enum": [
                            "pendente",
                            "correlacionada"
                        ]
                    },
                    "sip_call_id": {
                        "type": "string"
                    },
                    "ramal_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "dialogo_id": {
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    },
                    "tentar_novamente_em_ms": {
                        "type": "integer",
                        "nullable": true,
                        "enum": [
                            1000,
                            null
                        ]
                    },
                    "chamadas": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "chamada_id": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "chamada_pai_id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "nullable": true
                                },
                                "chamada_raiz_id": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "ramal_id": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "estado": {
                                    "type": "string"
                                },
                                "iniciada_em": {
                                    "type": "string",
                                    "format": "date-time",
                                    "nullable": true
                                },
                                "atendida_em": {
                                    "type": "string",
                                    "format": "date-time",
                                    "nullable": true
                                },
                                "encerrada_em": {
                                    "type": "string",
                                    "format": "date-time",
                                    "nullable": true
                                },
                                "participacao_id": {
                                    "type": "string"
                                },
                                "numero_ramal": {
                                    "type": "string"
                                },
                                "direcao": {
                                    "type": "string",
                                    "enum": [
                                        "realizada",
                                        "recebida"
                                    ]
                                },
                                "participacao_iniciada_em": {
                                    "type": "string",
                                    "format": "date-time",
                                    "nullable": true
                                },
                                "participacao_atendida_em": {
                                    "type": "string",
                                    "format": "date-time",
                                    "nullable": true
                                },
                                "participacao_encerrada_em": {
                                    "type": "string",
                                    "format": "date-time",
                                    "nullable": true
                                }
                            }
                        }
                    }
                }
            },
            "WebhookV2": {
                "type": "object",
                "description": "Habilitação explícita em configuracao.versao_payload=2 (string). Padrão 1 mantém o corpo original. Evento e assinatura HTTP existentes são preservados.",
                "properties": {
                    "versao": {
                        "type": "integer",
                        "enum": [
                            2
                        ]
                    },
                    "evento_id": {
                        "type": "string"
                    },
                    "evento": {
                        "type": "string"
                    },
                    "empresa_id": {
                        "type": "integer"
                    },
                    "chamada_id": {
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    },
                    "chamada_pai_id": {
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    },
                    "chamada_raiz_id": {
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    },
                    "gravacao_id": {
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    },
                    "criado_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "dados": {
                        "type": "object",
                        "additionalProperties": true
                    }
                }
            },
            "ConfiguracaoSip": {
                "type": "object",
                "description": "Credenciais do telefone SIP. Os usuários principal e alternativo usam a mesma senha. Não use estes usuários no WebPhone; consulte GET /webphone.",
                "properties": {
                    "ramal_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "nome": {
                        "type": "string"
                    },
                    "numero": {
                        "type": "string"
                    },
                    "ativo": {
                        "type": "boolean"
                    },
                    "servidor": {
                        "type": "string"
                    },
                    "porta": {
                        "type": "integer"
                    },
                    "transporte": {
                        "type": "string"
                    },
                    "usuario": {
                        "type": "string"
                    },
                    "autenticacao": {
                        "type": "string"
                    },
                    "sip_sem_simbolos": {
                        "type": "boolean"
                    },
                    "usuario_sip_alternativo": {
                        "type": "string",
                        "nullable": true
                    },
                    "senha": {
                        "type": "string",
                        "description": "Somente na resposta auditada de POST revelar-credencial."
                    },
                    "nome_identificacao": {
                        "type": "string",
                        "description": "Nome efetivo: personalizado ou nome cadastrado do ramal."
                    }
                }
            },
            "SolicitacaoRamaisLote": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "numero_inicial",
                    "quantidade"
                ],
                "description": "Quantidade inclui o primeiro número. Com ramal_modelo_id, omita configuracao e envie versao_modelo retornada pela prévia ao criar. Sem modelo, os campos da configuração usam os padrões do cadastro individual. Prefixo e senhas são gerados pelo servidor.",
                "properties": {
                    "numero_inicial": {
                        "type": "string",
                        "pattern": "^[0-9]{2,6}$",
                        "example": "1002"
                    },
                    "quantidade": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100,
                        "example": 83
                    },
                    "sufixo_inicial": {
                        "type": "string",
                        "maxLength": 24,
                        "description": "Omitido usa numero_inicial. Começa por alfanumérico, contém letras ASCII, números, _ e - e termina em 1 a 6 dígitos. A parte numérica é incrementada; zeros à esquerda são preservados.",
                        "example": "S_1002"
                    },
                    "nome_padrao": {
                        "type": "string",
                        "maxLength": 100,
                        "default": "Ramal {numero}",
                        "description": "Substituições: {numero} e {usuario_sip}; cada nome gerado deve ter 2 a 100 caracteres."
                    },
                    "ramal_modelo_id": {
                        "type": "string",
                        "format": "uuid",
                        "nullable": true,
                        "description": "UUID de ramal ativo desta empresa; o modelo não é criado novamente nem alterado."
                    },
                    "versao_modelo": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Obrigatória na criação com modelo, devolvida em solicitacao pela prévia."
                    },
                    "configuracao": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                            "webphone": {
                                "type": "boolean",
                                "description": " Usar no navegador"
                            },
                            "sip_sem_simbolos": {
                                "type": "boolean",
                                "description": "Habilita o login adicional T{empresa_id}R{numero}, com a mesma senha, sem alterar o login SIP principal nem o WebPhone. Padrão false na criação; omitido no PUT preserva a opção atual."
                            },
                            "externas": {
                                "type": "boolean",
                                "description": " Permitir chamadas externas"
                            },
                            "internacional": {
                                "type": "boolean",
                                "description": " Permitir chamadas internacionais"
                            },
                            "timeout": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 120,
                                "description": " Tempo para atender (segundos)"
                            },
                            "destino_nao_atendido": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Destino"
                                    }
                                ],
                                "description": "Se este ramal não atender",
                                "default": {
                                    "tipo": "encerrar"
                                }
                            },
                            "gravar_realizadas": {
                                "type": "boolean",
                                "description": " Gravar chamadas feitas por este ramal"
                            },
                            "gravar_recebidas": {
                                "type": "boolean",
                                "description": " Gravar chamadas recebidas por este ramal"
                            }
                        }
                    }
                }
            },
            "PreviaRamaisLote": {
                "type": "object",
                "properties": {
                    "prefixo_sip": {
                        "type": "string"
                    },
                    "quantidade": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "pode_criar": {
                        "type": "boolean"
                    },
                    "total_conflitos": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "configuracao": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                            "webphone": {
                                "type": "boolean",
                                "description": " Usar no navegador"
                            },
                            "sip_sem_simbolos": {
                                "type": "boolean",
                                "description": "Habilita o login adicional T{empresa_id}R{numero}, com a mesma senha, sem alterar o login SIP principal nem o WebPhone. Padrão false na criação; omitido no PUT preserva a opção atual."
                            },
                            "externas": {
                                "type": "boolean",
                                "description": " Permitir chamadas externas"
                            },
                            "internacional": {
                                "type": "boolean",
                                "description": " Permitir chamadas internacionais"
                            },
                            "timeout": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 120,
                                "description": " Tempo para atender (segundos)"
                            },
                            "destino_nao_atendido": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/Destino"
                                    }
                                ],
                                "description": "Se este ramal não atender",
                                "default": {
                                    "tipo": "encerrar"
                                }
                            },
                            "gravar_realizadas": {
                                "type": "boolean",
                                "description": " Gravar chamadas feitas por este ramal"
                            },
                            "gravar_recebidas": {
                                "type": "boolean",
                                "description": " Gravar chamadas recebidas por este ramal"
                            }
                        }
                    },
                    "modelo": {
                        "type": "object",
                        "nullable": true,
                        "properties": {
                            "id": {
                                "type": "string",
                                "format": "uuid"
                            },
                            "nome": {
                                "type": "string"
                            },
                            "versao": {
                                "type": "integer",
                                "minimum": 0
                            }
                        }
                    },
                    "solicitacao": {
                        "$ref": "#/components/schemas/SolicitacaoRamaisLote"
                    },
                    "ramais": {
                        "type": "array",
                        "maxItems": 100,
                        "items": {
                            "type": "object",
                            "properties": {
                                "nome": {
                                    "type": "string"
                                },
                                "numero": {
                                    "type": "string"
                                },
                                "sufixo_sip": {
                                    "type": "string"
                                },
                                "usuario_sip": {
                                    "type": "string"
                                },
                                "usuario_sip_alternativo": {
                                    "type": "string",
                                    "nullable": true
                                },
                                "conflitos": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "RamaisLoteCriados": {
                "type": "object",
                "description": "Não retorna senhas. O provisionamento é assíncrono; esta resposta não afirma que os aparelhos estão conectados.",
                "properties": {
                    "quantidade": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "prefixo_sip": {
                        "type": "string"
                    },
                    "provisionamento": {
                        "type": "string",
                        "enum": [
                            "pendente"
                        ]
                    },
                    "ramais": {
                        "type": "array",
                        "maxItems": 100,
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "nome": {
                                    "type": "string"
                                },
                                "numero": {
                                    "type": "string"
                                },
                                "usuario_sip": {
                                    "type": "string"
                                },
                                "usuario_sip_alternativo": {
                                    "type": "string",
                                    "nullable": true
                                }
                            }
                        }
                    }
                }
            },
            "SolicitacaoExclusaoRamal": {
                "type": "object",
                "required": [
                    "versao",
                    "confirmar"
                ],
                "properties": {
                    "versao": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "confirmar": {
                        "type": "boolean",
                        "enum": [
                            true
                        ]
                    },
                    "excluir_gravacoes": {
                        "type": "boolean",
                        "default": false,
                        "description": "Obrigatório true para excluir um ramal que tenha gravações; exige também gravacoes:escrever."
                    }
                }
            },
            "ResumoExclusaoRamal": {
                "type": "object",
                "properties": {
                    "ramal": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string",
                                "format": "uuid"
                            },
                            "nome": {
                                "type": "string"
                            },
                            "numero": {
                                "type": "string"
                            },
                            "ativo": {
                                "type": "boolean"
                            },
                            "versao": {
                                "type": "integer",
                                "minimum": 0
                            }
                        }
                    },
                    "quantidade_gravacoes": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "tamanho_gravacoes": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "em_chamada": {
                        "type": "boolean"
                    },
                    "acessos_vinculados": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "dependencias": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "nome": {
                                    "type": "string"
                                },
                                "tipo": {
                                    "type": "string"
                                },
                                "ativo": {
                                    "type": "boolean"
                                }
                            }
                        }
                    }
                }
            },
            "ResultadoRemocaoRamal": {
                "type": "object",
                "properties": {
                    "excluido": {
                        "type": "boolean"
                    },
                    "desativado": {
                        "type": "boolean"
                    },
                    "gravacoes_excluidas": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "arquivos_pendentes": {
                        "type": "integer",
                        "minimum": 0
                    }
                }
            },
            "SolicitacaoDocumentoRamais": {
                "type": "object",
                "properties": {
                    "formato": {
                        "type": "string",
                        "enum": [
                            "pdf",
                            "txt"
                        ],
                        "default": "pdf"
                    },
                    "situacao": {
                        "type": "string",
                        "enum": [
                            "ativos",
                            "desativados",
                            "todos"
                        ],
                        "default": "ativos"
                    },
                    "incluir_senhas": {
                        "type": "boolean",
                        "default": false
                    }
                }
            },
            "DocumentoRamais": {
                "type": "object",
                "description": "Documento gerado em memória; resposta private, no-store. O campo conteudo pode conter senhas se solicitado e autorizado. Nunca registrar o conteúdo em logs.",
                "properties": {
                    "nome_arquivo": {
                        "type": "string"
                    },
                    "tipo_conteudo": {
                        "type": "string"
                    },
                    "quantidade": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "inclui_senhas": {
                        "type": "boolean"
                    },
                    "formato": {
                        "type": "string",
                        "enum": [
                            "pdf",
                            "txt"
                        ]
                    },
                    "codificacao": {
                        "type": "string",
                        "enum": [
                            "base64",
                            "utf-8"
                        ]
                    },
                    "conteudo": {
                        "type": "string",
                        "description": "PDF em base64; TXT em UTF-8. Não registrar em logs."
                    }
                }
            },
            "IdentidadeDocumentos": {
                "type": "object",
                "properties": {
                    "logo": {
                        "type": "object",
                        "nullable": true,
                        "properties": {
                            "url": {
                                "type": "string"
                            },
                            "tipo_conteudo": {
                                "type": "string",
                                "enum": [
                                    "image/png",
                                    "image/jpeg"
                                ]
                            },
                            "tamanho": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "largura": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "altura": {
                                "type": "integer",
                                "minimum": 0
                            }
                        }
                    },
                    "marca_dagua": {
                        "type": "object",
                        "nullable": true,
                        "properties": {
                            "url": {
                                "type": "string"
                            },
                            "tipo_conteudo": {
                                "type": "string",
                                "enum": [
                                    "image/png",
                                    "image/jpeg"
                                ]
                            },
                            "tamanho": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "largura": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "altura": {
                                "type": "integer",
                                "minimum": 0
                            }
                        }
                    }
                }
            },
            "ConfiguracaoWebphone": {
                "type": "object",
                "description": "Credenciais temporariamente entregues ao navegador autenticado; não registrar nem persistir. contato_uri identifica a origem HTTPS, não concede autenticação.",
                "properties": {
                    "ramal_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "numero": {
                        "type": "string"
                    },
                    "usuario": {
                        "type": "string"
                    },
                    "senha": {
                        "type": "string",
                        "format": "password"
                    },
                    "dominio": {
                        "type": "string"
                    },
                    "wss": {
                        "type": "string"
                    },
                    "contato_uri": {
                        "type": "string",
                        "nullable": true,
                        "description": "Passe como contact_uri no JsSIP.UA; correlação do IP HTTPS válida por 24 horas."
                    }
                }
            },
            "DispositivoRamal": {
                "type": "object",
                "properties": {
                    "tipo": {
                        "type": "string",
                        "enum": [
                            "SIP",
                            "WebPhone"
                        ]
                    },
                    "dispositivo": {
                        "type": "string"
                    },
                    "estado": {
                        "type": "string"
                    },
                    "ip": {
                        "type": "string",
                        "nullable": true,
                        "description": "IP do contato SIP ou do acesso HTTPS autenticado do WebPhone."
                    },
                    "porta_origem": {
                        "type": "integer",
                        "nullable": true
                    },
                    "endereco": {
                        "type": "string"
                    },
                    "fonte_ip": {
                        "type": "string",
                        "enum": [
                            "contato_sip",
                            "acesso_webphone"
                        ]
                    },
                    "ip_registro": {
                        "type": "string",
                        "nullable": true,
                        "description": "IP visto pelo Asterisk; pode ser o proxy local."
                    },
                    "origem_via_proxy": {
                        "type": "boolean"
                    },
                    "latencia_ms": {
                        "type": "number",
                        "nullable": true
                    },
                    "expira_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                }
            },
            "ConexoesRamais": {
                "type": "object",
                "properties": {
                    "consultado_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "disponivel": {
                        "type": "boolean"
                    },
                    "ramais": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "ramal_id": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "numero": {
                                    "type": "string"
                                },
                                "estado": {
                                    "type": "string",
                                    "enum": [
                                        "conectado",
                                        "desconectado",
                                        "indisponivel",
                                        "verificando",
                                        "desconhecido",
                                        "desativado"
                                    ]
                                },
                                "dispositivos": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/DispositivoRamal"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "EventoTronco": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "ocorrido_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "grupo": {
                        "type": "string",
                        "enum": [
                            "registros",
                            "alteracoes"
                        ]
                    },
                    "tipo": {
                        "type": "string"
                    },
                    "estado": {
                        "type": "string",
                        "nullable": true
                    },
                    "codigo_sip": {
                        "type": "integer",
                        "nullable": true
                    },
                    "motivo": {
                        "type": "string",
                        "nullable": true
                    },
                    "nova_tentativa_segundos": {
                        "type": "integer",
                        "nullable": true
                    },
                    "origem": {
                        "type": "string"
                    },
                    "responsavel": {
                        "type": "string"
                    },
                    "titulo": {
                        "type": "string"
                    },
                    "mensagem": {
                        "type": "string"
                    },
                    "nivel": {
                        "type": "string"
                    }
                }
            },
            "HistoricoTronco": {
                "type": "object",
                "properties": {
                    "tronco": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string",
                                "format": "uuid"
                            },
                            "nome": {
                                "type": "string"
                            }
                        }
                    },
                    "eventos": {
                        "type": "array",
                        "maxItems": 50,
                        "items": {
                            "$ref": "#/components/schemas/EventoTronco"
                        }
                    },
                    "pagina": {
                        "type": "integer"
                    },
                    "proxima_pagina": {
                        "type": "integer",
                        "nullable": true
                    },
                    "fuso_horario": {
                        "type": "string"
                    },
                    "primeiro_evento_registro": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                }
            },
            "StatusTroncos": {
                "type": "object",
                "properties": {
                    "consultado_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "fuso_horario": {
                        "type": "string"
                    },
                    "monitoramento": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "nome": {
                                    "type": "string"
                                },
                                "atualizado_em": {
                                    "type": "string",
                                    "format": "date-time",
                                    "nullable": true
                                },
                                "saudavel": {
                                    "type": "boolean"
                                }
                            }
                        }
                    },
                    "troncos": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "nome": {
                                    "type": "string"
                                },
                                "servidor": {
                                    "type": "string"
                                },
                                "porta": {
                                    "type": "integer"
                                },
                                "estado": {
                                    "type": "string",
                                    "enum": [
                                        "registrado",
                                        "rejeitado",
                                        "pausado",
                                        "desativado",
                                        "sem_registro",
                                        "indisponivel",
                                        "nao_configurado",
                                        "nao_registrado"
                                    ]
                                },
                                "rotulo": {
                                    "type": "string"
                                },
                                "consulta_disponivel": {
                                    "type": "boolean"
                                },
                                "observacao": {
                                    "type": "object",
                                    "nullable": true,
                                    "properties": {
                                        "estado": {
                                            "type": "string"
                                        },
                                        "observado_em": {
                                            "type": "string",
                                            "format": "date-time",
                                            "nullable": true
                                        },
                                        "alterado_em": {
                                            "type": "string",
                                            "format": "date-time",
                                            "nullable": true
                                        }
                                    }
                                },
                                "ultima_falha": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/EventoTronco"
                                        }
                                    ],
                                    "nullable": true
                                },
                                "proxima_tentativa_estimada_em": {
                                    "type": "string",
                                    "format": "date-time",
                                    "nullable": true
                                },
                                "mensagem_operacional": {
                                    "type": "string"
                                },
                                "monitor_recuperacao_saudavel": {
                                    "type": "boolean"
                                },
                                "controle_registro": {
                                    "type": "object",
                                    "properties": {
                                        "pausado": {
                                            "type": "boolean"
                                        },
                                        "solicitacao": {
                                            "type": "string",
                                            "nullable": true,
                                            "enum": [
                                                "tentar",
                                                "pausar",
                                                "retomar",
                                                null
                                            ]
                                        },
                                        "solicitada_em": {
                                            "type": "string",
                                            "format": "date-time",
                                            "nullable": true
                                        },
                                        "ultima_tentativa_em": {
                                            "type": "string",
                                            "format": "date-time",
                                            "nullable": true
                                        },
                                        "proxima_tentativa_em": {
                                            "type": "string",
                                            "format": "date-time",
                                            "nullable": true
                                        },
                                        "resultado": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "recuperacao": {
                                    "type": "object",
                                    "properties": {
                                        "habilitada": {
                                            "type": "boolean"
                                        },
                                        "ao_registrar_ramal": {
                                            "type": "boolean"
                                        },
                                        "intervalo_configurado_segundos": {
                                            "type": "integer",
                                            "minimum": 60,
                                            "maximum": 3600,
                                            "default": 300
                                        },
                                        "aplicada": {
                                            "type": "boolean",
                                            "nullable": true
                                        },
                                        "intervalo_temporario_segundos": {
                                            "type": "integer",
                                            "nullable": true
                                        },
                                        "intervalo_rejeicao_segundos": {
                                            "type": "integer",
                                            "nullable": true
                                        },
                                        "limite_tentativas": {
                                            "type": "integer",
                                            "nullable": true
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "AcaoSegurancaRede": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "acao",
                    "ip",
                    "motivo",
                    "confirmar"
                ],
                "properties": {
                    "acao": {
                        "type": "string",
                        "enum": [
                            "desbloquear_fail2ban",
                            "bloquear_sip",
                            "remover_bloqueio_sip"
                        ]
                    },
                    "ip": {
                        "type": "string",
                        "description": "IPv4 ou IPv6 individual, sem CIDR, porta ou zona."
                    },
                    "motivo": {
                        "type": "string",
                        "minLength": 10,
                        "maxLength": 500
                    },
                    "confirmar": {
                        "type": "boolean",
                        "enum": [
                            true
                        ]
                    }
                }
            },
            "SegurancaRede": {
                "type": "object",
                "description": "Estado global. disponível=false e bloqueado=null significam consulta inconclusiva, nunca ausência comprovada de bloqueio. Até 200 logs sanitizados dos trechos recentes dos arquivos. Horários ISO 8601.",
                "properties": {
                    "consultado_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "ip": {
                        "type": "string"
                    },
                    "fail2ban": {
                        "type": "object",
                        "properties": {
                            "disponivel": {
                                "type": "boolean"
                            },
                            "jail": {
                                "type": "string"
                            },
                            "bloqueios": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "ip": {
                                            "type": "string"
                                        },
                                        "inicio": {
                                            "type": "string",
                                            "format": "date-time",
                                            "nullable": true
                                        },
                                        "fim": {
                                            "type": "string",
                                            "format": "date-time",
                                            "nullable": true
                                        },
                                        "jail": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "limite_falhas": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "janela_falhas": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "duracao_bloqueio": {
                                "type": "integer",
                                "minimum": 0
                            }
                        }
                    },
                    "firewall": {
                        "type": "object",
                        "properties": {
                            "disponivel": {
                                "type": "boolean"
                            },
                            "ativo": {
                                "type": "boolean"
                            },
                            "regras": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "additionalProperties": true
                                }
                            }
                        }
                    },
                    "diagnostico": {
                        "type": "object",
                        "properties": {
                            "bloqueado_fail2ban": {
                                "type": "boolean",
                                "nullable": true
                            },
                            "bloqueado_painel": {
                                "type": "boolean",
                                "nullable": true
                            },
                            "aviso": {
                                "type": "string"
                            }
                        }
                    },
                    "falhas": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "componente": {
                                    "type": "string"
                                },
                                "mensagem": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "contatos": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "empresa_id": {
                                    "type": "integer",
                                    "minimum": 0
                                },
                                "empresa": {
                                    "type": "string"
                                },
                                "nome": {
                                    "type": "string"
                                },
                                "numero": {
                                    "type": "string"
                                },
                                "ip": {
                                    "type": "string"
                                },
                                "porta": {
                                    "type": "integer",
                                    "nullable": true
                                },
                                "estado": {
                                    "type": "string"
                                },
                                "expira_em": {
                                    "type": "string",
                                    "format": "date-time",
                                    "nullable": true
                                }
                            }
                        }
                    },
                    "telefonia_disponivel": {
                        "type": "boolean",
                        "nullable": true
                    },
                    "logs": {
                        "type": "object",
                        "properties": {
                            "registros": {
                                "type": "array",
                                "maxItems": 200,
                                "items": {
                                    "type": "object",
                                    "additionalProperties": true
                                }
                            },
                            "mais_registros": {
                                "type": "boolean"
                            },
                            "cobertura": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "additionalProperties": true
                                }
                            },
                            "aviso": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "DiagnosticoChamada": {
                "type": "object",
                "nullable": true,
                "description": "Interpretação das evidências persistidas. null quando não há diagnóstico aplicável. Não altera o resultado histórico nem comprova a causa raiz.",
                "properties": {
                    "codigo": {
                        "type": "string"
                    },
                    "origem": {
                        "type": "string",
                        "enum": [
                            "pabx",
                            "operadora_ou_destino",
                            "indeterminada"
                        ]
                    },
                    "mensagem": {
                        "type": "string"
                    },
                    "orientacao": {
                        "type": "string"
                    }
                }
            },
            "ChamadaConsulta": {
                "type": "object",
                "additionalProperties": true,
                "description": "Registro de chamada com os campos existentes preservados e diagnóstico adicional.",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "origem": {
                        "type": "string"
                    },
                    "destino": {
                        "type": "string"
                    },
                    "numero_enviado": {
                        "type": "string",
                        "nullable": true
                    },
                    "estado": {
                        "type": "string"
                    },
                    "dial_status": {
                        "type": "string",
                        "nullable": true
                    },
                    "sip_status": {
                        "type": "integer",
                        "nullable": true
                    },
                    "hangup_cause": {
                        "type": "integer",
                        "nullable": true
                    },
                    "mensagem_resultado": {
                        "type": "string",
                        "nullable": true
                    },
                    "diagnostico": {
                        "$ref": "#/components/schemas/DiagnosticoChamada"
                    }
                }
            },
            "ListaChamadas": {
                "type": "array",
                "items": {
                    "$ref": "#/components/schemas/ChamadaConsulta"
                }
            },
            "SigaMe": {
                "type": "object",
                "additionalProperties": false,
                "description": "Ausente na criação: desativado. PUT específico substitui as regras; campos omitidos recebem os padrões. sempre prevalece. Tempos em segundos. Desativar conserva destinos quando enviados. Controle telefônico só pelo ramal autenticado; códigos não podem conflitar com captura.",
                "properties": {
                    "habilitado": {
                        "type": "boolean",
                        "default": false
                    },
                    "permitir_telefone": {
                        "type": "boolean",
                        "default": true
                    },
                    "codigo_ativar": {
                        "type": "string",
                        "pattern": "^[*#]{1,2}[0-9]{1,4}$",
                        "default": "#21"
                    },
                    "codigo_desativar": {
                        "type": "string",
                        "pattern": "^[*#]{1,2}[0-9]{1,4}$",
                        "default": "#22"
                    },
                    "tempo_toque": {
                        "type": "integer",
                        "minimum": 5,
                        "maximum": 120,
                        "default": 20
                    },
                    "tempo_externo": {
                        "type": "integer",
                        "minimum": 5,
                        "maximum": 120,
                        "default": 45
                    },
                    "sempre": {
                        "oneOf": [
                            {
                                "type": "object",
                                "nullable": true,
                                "enum": [
                                    null
                                ]
                            },
                            {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "tipo",
                                    "id"
                                ],
                                "properties": {
                                    "tipo": {
                                        "type": "string",
                                        "enum": [
                                            "ramal"
                                        ]
                                    },
                                    "id": {
                                        "type": "string",
                                        "format": "uuid"
                                    }
                                }
                            },
                            {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "tipo",
                                    "numero"
                                ],
                                "properties": {
                                    "tipo": {
                                        "type": "string",
                                        "enum": [
                                            "externo"
                                        ]
                                    },
                                    "numero": {
                                        "type": "string",
                                        "minLength": 8,
                                        "maxLength": 18
                                    }
                                }
                            }
                        ]
                    },
                    "nao_atende": {
                        "oneOf": [
                            {
                                "type": "object",
                                "nullable": true,
                                "enum": [
                                    null
                                ]
                            },
                            {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "tipo",
                                    "id"
                                ],
                                "properties": {
                                    "tipo": {
                                        "type": "string",
                                        "enum": [
                                            "ramal"
                                        ]
                                    },
                                    "id": {
                                        "type": "string",
                                        "format": "uuid"
                                    }
                                }
                            },
                            {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "tipo",
                                    "numero"
                                ],
                                "properties": {
                                    "tipo": {
                                        "type": "string",
                                        "enum": [
                                            "externo"
                                        ]
                                    },
                                    "numero": {
                                        "type": "string",
                                        "minLength": 8,
                                        "maxLength": 18
                                    }
                                }
                            }
                        ]
                    },
                    "ocupado": {
                        "oneOf": [
                            {
                                "type": "object",
                                "nullable": true,
                                "enum": [
                                    null
                                ]
                            },
                            {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "tipo",
                                    "id"
                                ],
                                "properties": {
                                    "tipo": {
                                        "type": "string",
                                        "enum": [
                                            "ramal"
                                        ]
                                    },
                                    "id": {
                                        "type": "string",
                                        "format": "uuid"
                                    }
                                }
                            },
                            {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "tipo",
                                    "numero"
                                ],
                                "properties": {
                                    "tipo": {
                                        "type": "string",
                                        "enum": [
                                            "externo"
                                        ]
                                    },
                                    "numero": {
                                        "type": "string",
                                        "minLength": 8,
                                        "maxLength": 18
                                    }
                                }
                            }
                        ]
                    },
                    "indisponivel": {
                        "oneOf": [
                            {
                                "type": "object",
                                "nullable": true,
                                "enum": [
                                    null
                                ]
                            },
                            {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "tipo",
                                    "id"
                                ],
                                "properties": {
                                    "tipo": {
                                        "type": "string",
                                        "enum": [
                                            "ramal"
                                        ]
                                    },
                                    "id": {
                                        "type": "string",
                                        "format": "uuid"
                                    }
                                }
                            },
                            {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "tipo",
                                    "numero"
                                ],
                                "properties": {
                                    "tipo": {
                                        "type": "string",
                                        "enum": [
                                            "externo"
                                        ]
                                    },
                                    "numero": {
                                        "type": "string",
                                        "minLength": 8,
                                        "maxLength": 18
                                    }
                                }
                            }
                        ]
                    }
                }
            },
            "ChefeSecretaria": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "habilitado",
                    "secretaria_id"
                ],
                "properties": {
                    "habilitado": {
                        "type": "boolean",
                        "default": false
                    },
                    "secretaria_id": {
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    }
                },
                "description": "Configuração do chefe. Quando habilitado, somente a secretária autenticada pode alcançá-lo diretamente ou transferir uma chamada; demais origens passam por ela. Referência da mesma empresa, sem ciclos. Omitir em PUT de ramal preserva o valor anterior."
            },
            "SolicitacaoChefeSecretaria": {
                "type": "object",
                "required": [
                    "versao",
                    "chefe_secretaria"
                ],
                "properties": {
                    "versao": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "chefe_secretaria": {
                        "$ref": "#/components/schemas/ChefeSecretaria"
                    }
                }
            },
            "ChefeSecretariaRamal": {
                "type": "object",
                "properties": {
                    "ramal_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "numero": {
                        "type": "string"
                    },
                    "nome": {
                        "type": "string"
                    },
                    "versao": {
                        "type": "integer"
                    },
                    "chefe_secretaria": {
                        "$ref": "#/components/schemas/ChefeSecretaria"
                    }
                }
            },
            "SolicitacaoSigaMe": {
                "type": "object",
                "required": [
                    "versao",
                    "siga_me"
                ],
                "properties": {
                    "versao": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "siga_me": {
                        "$ref": "#/components/schemas/SigaMe"
                    }
                }
            },
            "SigaMeRamal": {
                "type": "object",
                "properties": {
                    "ramal_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "numero": {
                        "type": "string"
                    },
                    "nome": {
                        "type": "string"
                    },
                    "versao": {
                        "type": "integer"
                    },
                    "siga_me": {
                        "$ref": "#/components/schemas/SigaMe"
                    }
                }
            },
            "DestinoInterfone": {
                "type": "object",
                "required": [
                    "tipo",
                    "id"
                ],
                "additionalProperties": false,
                "properties": {
                    "tipo": {
                        "type": "string",
                        "enum": [
                            "ramal",
                            "fila",
                            "ura",
                            "horario"
                        ]
                    },
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    }
                }
            },
            "InterfoneConfiguracao": {
                "type": "object",
                "required": [
                    "nome",
                    "destino"
                ],
                "properties": {
                    "nome": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 60
                    },
                    "destino": {
                        "$ref": "#/components/schemas/DestinoInterfone"
                    },
                    "ativo": {
                        "type": "boolean",
                        "default": true
                    },
                    "duracao_maxima": {
                        "type": "integer",
                        "minimum": 30,
                        "maximum": 1800,
                        "default": 300
                    },
                    "intervalo": {
                        "type": "integer",
                        "minimum": 10,
                        "maximum": 3600,
                        "default": 60
                    },
                    "simultaneas": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 10,
                        "default": 1
                    },
                    "versao": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Obrigatória na alteração."
                    }
                }
            },
            "Interfone": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/InterfoneConfiguracao"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string",
                                "format": "uuid"
                            },
                            "empresa_id": {
                                "type": "integer"
                            },
                            "url": {
                                "type": "string",
                                "format": "uri",
                                "description": "Contém a chave no fragmento. Tratar como link de acesso; não registrar em logs."
                            },
                            "criado_em": {
                                "type": "string",
                                "format": "date-time"
                            },
                            "atualizado_em": {
                                "type": "string",
                                "format": "date-time"
                            }
                        }
                    }
                ]
            },
            "CredencialVisita": {
                "type": "object",
                "required": [
                    "sessao_id",
                    "segredo"
                ],
                "properties": {
                    "sessao_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "segredo": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$",
                        "description": "Manter somente em memória; associado ao cookie HttpOnly."
                    }
                }
            },
            "VisitaAberta": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/CredencialVisita"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "nome": {
                                "type": "string"
                            },
                            "estado": {
                                "type": "string",
                                "enum": [
                                    "aguardando"
                                ]
                            },
                            "expira_em": {
                                "type": "string",
                                "format": "date-time"
                            },
                            "duracao_maxima": {
                                "type": "integer"
                            }
                        }
                    }
                ]
            },
            "SipVisita": {
                "type": "object",
                "properties": {
                    "usuario": {
                        "type": "string"
                    },
                    "senha": {
                        "type": "string",
                        "description": "Entregue uma única vez; revogada no encerramento. Não registrar."
                    },
                    "dominio": {
                        "type": "string"
                    },
                    "wss": {
                        "type": "string",
                        "format": "uri"
                    },
                    "destino": {
                        "type": "string",
                        "enum": [
                            "chamar"
                        ]
                    },
                    "expira_em": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "EstadoVisita": {
                "type": "object",
                "properties": {
                    "estado": {
                        "type": "string",
                        "enum": [
                            "aguardando",
                            "pronta",
                            "em_chamada",
                            "encerrada"
                        ]
                    },
                    "expira_em": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "motivo_fim": {
                        "type": "string",
                        "nullable": true
                    },
                    "chamada": {
                        "type": "object",
                        "nullable": true,
                        "properties": {
                            "estado": {
                                "type": "string"
                            },
                            "mensagem_resultado": {
                                "type": "string",
                                "nullable": true
                            },
                            "atendida_em": {
                                "type": "string",
                                "format": "date-time",
                                "nullable": true
                            }
                        }
                    }
                }
            },
            "HistoricoVisita": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "estado": {
                        "type": "string"
                    },
                    "ip": {
                        "type": "string"
                    },
                    "chamada_id": {
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    },
                    "criada_em": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "expira_em": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "iniciada_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "encerrada_em": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "motivo_fim": {
                        "type": "string",
                        "nullable": true
                    },
                    "mensagem_resultado": {
                        "type": "string",
                        "nullable": true
                    }
                }
            }
        },
        "responses": {
            "Http200": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {}
                            }
                        }
                    }
                }
            },
            "Http401": {
                "description": "Autenticação necessária.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        false
                                    ]
                                },
                                "erro": {
                                    "type": "object",
                                    "properties": {
                                        "codigo": {
                                            "type": "string"
                                        },
                                        "mensagem": {
                                            "type": "string"
                                        },
                                        "requisicao_id": {
                                            "type": "string",
                                            "format": "uuid"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Http403": {
                "description": "Permissão, CSRF ou troca de senha.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        false
                                    ]
                                },
                                "erro": {
                                    "type": "object",
                                    "properties": {
                                        "codigo": {
                                            "type": "string"
                                        },
                                        "mensagem": {
                                            "type": "string"
                                        },
                                        "requisicao_id": {
                                            "type": "string",
                                            "format": "uuid"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Http404": {
                "description": "Registro não encontrado nesta empresa.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        false
                                    ]
                                },
                                "erro": {
                                    "type": "object",
                                    "properties": {
                                        "codigo": {
                                            "type": "string"
                                        },
                                        "mensagem": {
                                            "type": "string"
                                        },
                                        "requisicao_id": {
                                            "type": "string",
                                            "format": "uuid"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Http409": {
                "description": "Conflito, duplicidade, dependência, CICLO_ENCAMINHAMENTO ou LINHAS_OCUPADAS.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        false
                                    ]
                                },
                                "erro": {
                                    "type": "object",
                                    "properties": {
                                        "codigo": {
                                            "type": "string"
                                        },
                                        "mensagem": {
                                            "type": "string"
                                        },
                                        "requisicao_id": {
                                            "type": "string",
                                            "format": "uuid"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Http413": {
                "description": "JSON maior que 1 MiB.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        false
                                    ]
                                },
                                "erro": {
                                    "type": "object",
                                    "properties": {
                                        "codigo": {
                                            "type": "string"
                                        },
                                        "mensagem": {
                                            "type": "string"
                                        },
                                        "requisicao_id": {
                                            "type": "string",
                                            "format": "uuid"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Http422": {
                "description": "Dados inválidos.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        false
                                    ]
                                },
                                "erro": {
                                    "type": "object",
                                    "properties": {
                                        "codigo": {
                                            "type": "string"
                                        },
                                        "mensagem": {
                                            "type": "string"
                                        },
                                        "requisicao_id": {
                                            "type": "string",
                                            "format": "uuid"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Http429": {
                "description": "Limite excedido.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        false
                                    ]
                                },
                                "erro": {
                                    "type": "object",
                                    "properties": {
                                        "codigo": {
                                            "type": "string"
                                        },
                                        "mensagem": {
                                            "type": "string"
                                        },
                                        "requisicao_id": {
                                            "type": "string",
                                            "format": "uuid"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Http500": {
                "description": "Falha interna; use requisicao_id.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        false
                                    ]
                                },
                                "erro": {
                                    "type": "object",
                                    "properties": {
                                        "codigo": {
                                            "type": "string"
                                        },
                                        "mensagem": {
                                            "type": "string"
                                        },
                                        "requisicao_id": {
                                            "type": "string",
                                            "format": "uuid"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Http503": {
                "description": "Serviço, motor local ou armazenamento indisponível.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        false
                                    ]
                                },
                                "erro": {
                                    "type": "object",
                                    "properties": {
                                        "codigo": {
                                            "type": "string"
                                        },
                                        "mensagem": {
                                            "type": "string"
                                        },
                                        "requisicao_id": {
                                            "type": "string",
                                            "format": "uuid"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Http201": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {}
                            }
                        }
                    }
                }
            },
            "Http200Interfonea38e9dec97398796e2b17d022901eb3b": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Interfone"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Http201Interfonedf2db8adba53ed9e2c73f869caad4702": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/Interfone"
                                }
                            }
                        }
                    }
                }
            },
            "Http200Interfone4e5b1f0008ee61d96db705dff132135c": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/Interfone"
                                }
                            }
                        }
                    }
                }
            },
            "Http200Interfone9705f56811ed8d9dada8731688cb44e5": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/Interfone"
                                }
                            }
                        }
                    }
                }
            },
            "Http200Interfone60f55b83136635c6d1d1ae51603be204": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/HistoricoVisita"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Http200Interfonecb4b8925d207cde80a7656928d2858f2": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/Interfone"
                                }
                            }
                        }
                    }
                }
            },
            "Http200Interfone6f53e560071e4d2d3fa84ad82aee2114": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/VisitaAberta"
                                }
                            }
                        }
                    }
                }
            },
            "Http410": {
                "description": "SESSAO_ENCERRADA: já utilizada, expirada ou desativada. Abra nova visita respeitando o intervalo."
            },
            "Http200Interfone1c6b4cab1dcb17765d0edb265e0345e7": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/SipVisita"
                                }
                            }
                        }
                    }
                }
            },
            "Http200Interfone3cf910819650d7e0dea75590bfe889df": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/EstadoVisita"
                                }
                            }
                        }
                    }
                }
            },
            "Http200Interfone2df690a2a8f2e85c08f08bf6fa9e31e7": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "type": "object",
                                    "properties": {
                                        "encerrada": {
                                            "type": "boolean",
                                            "enum": [
                                                true
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Http200VozesLocais": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/VozesLocais"
                                }
                            }
                        }
                    }
                }
            },
            "Http200Audio": {
                "description": "Áudio completo WAV.",
                "content": {
                    "audio/wav": {
                        "schema": {
                            "type": "string",
                            "format": "binary"
                        }
                    }
                }
            },
            "Http201AudioSalvo": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/AudioSalvo"
                                }
                            }
                        }
                    }
                }
            },
            "Http200PreviaRamaisLote": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/PreviaRamaisLote"
                                }
                            }
                        }
                    }
                }
            },
            "Http201RamaisLoteCriados": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/RamaisLoteCriados"
                                }
                            }
                        }
                    }
                }
            },
            "Http200ResumoExclusaoRamal": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/ResumoExclusaoRamal"
                                }
                            }
                        }
                    }
                }
            },
            "Http200ResultadoRemocaoRamal": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/ResultadoRemocaoRamal"
                                }
                            }
                        }
                    }
                }
            },
            "Http200DocumentoRamais": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/DocumentoRamais"
                                }
                            }
                        }
                    }
                }
            },
            "Http200IdentidadeDocumentos": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/IdentidadeDocumentos"
                                }
                            }
                        }
                    }
                }
            },
            "Http200TelefoniaEmpresa": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/TelefoniaEmpresa"
                                }
                            }
                        }
                    }
                }
            },
            "Http200HistoricoRamal": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/HistoricoRamal"
                                }
                            }
                        }
                    }
                }
            },
            "Http200ConexoesRamais": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/ConexoesRamais"
                                }
                            }
                        }
                    }
                }
            },
            "Http200ChefeSecretariaRamal": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/ChefeSecretariaRamal"
                                }
                            }
                        }
                    }
                }
            },
            "Http200SigaMeRamal": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/SigaMeRamal"
                                }
                            }
                        }
                    }
                }
            },
            "Http200ConfiguracaoSip": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/ConfiguracaoSip"
                                }
                            }
                        }
                    }
                }
            },
            "Http200GravacoesRamal": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/GravacoesRamal"
                                }
                            }
                        }
                    }
                }
            },
            "Http206Audio": {
                "description": "Trecho do áudio solicitado no cabeçalho Range.",
                "content": {
                    "audio/wav": {
                        "schema": {
                            "type": "string",
                            "format": "binary"
                        }
                    }
                }
            },
            "Http416": {
                "description": "Intervalo inválido; Content-Range informa o tamanho."
            },
            "Http202": {
                "description": "Solicitação aceita; consulte status/histórico. Não confirma registro SIP.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {}
                            }
                        }
                    }
                }
            },
            "Http200StatusTroncos": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/StatusTroncos"
                                }
                            }
                        }
                    }
                }
            },
            "Http200HistoricoTronco": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/HistoricoTronco"
                                }
                            }
                        }
                    }
                }
            },
            "Http200ListaChamadas": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/ListaChamadas"
                                }
                            }
                        }
                    }
                }
            },
            "Http200CorrelacaoSip": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/CorrelacaoSip"
                                }
                            }
                        }
                    }
                }
            },
            "Http409CorrelacaoSip": {
                "description": "CORRELACAO_AMBIGUA: Call-ID reutilizado em diálogos distintos; CORRELACAO_COMPLEXA: cadeia de transferências inválida ou acima de 100 etapas. Não selecionar um resultado arbitrário.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        false
                                    ]
                                },
                                "erro": {
                                    "type": "object",
                                    "properties": {
                                        "codigo": {
                                            "type": "string"
                                        },
                                        "mensagem": {
                                            "type": "string"
                                        },
                                        "requisicao_id": {
                                            "type": "string",
                                            "format": "uuid"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Http202CorrelacaoSip": {
                "description": "Vínculo ainda não observado. Não comprova que haverá uma chamada. Repita a cada segundo por até 30 segundos; não associe por aproximação.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/CorrelacaoSip"
                                }
                            }
                        }
                    }
                },
                "headers": {
                    "Retry-After": {
                        "schema": {
                            "type": "integer",
                            "enum": [
                                1
                            ]
                        }
                    }
                }
            },
            "Http200ChamadaConsulta": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/ChamadaConsulta"
                                }
                            }
                        }
                    }
                }
            },
            "Http200StatusCampanha": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/StatusCampanha"
                                }
                            }
                        }
                    }
                }
            },
            "Http200ResultadosCampanha": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/ResultadosCampanha"
                                }
                            }
                        }
                    }
                }
            },
            "Http200ConfiguracaoWebphone": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/ConfiguracaoWebphone"
                                }
                            }
                        }
                    }
                }
            },
            "Http409ProvisionamentoWebphone": {
                "description": "RAMAL_CONFIGURACAO_FALHOU: tentativas de provisionamento esgotadas. Administrador deve corrigir e reprocessar; não excluir ramal nem trocar senha.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        false
                                    ]
                                },
                                "erro": {
                                    "type": "object",
                                    "properties": {
                                        "codigo": {
                                            "type": "string"
                                        },
                                        "mensagem": {
                                            "type": "string"
                                        },
                                        "requisicao_id": {
                                            "type": "string",
                                            "format": "uuid"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Http503ProvisionamentoWebphone": {
                "description": "RAMAL_EM_CONFIGURACAO: aguarde o provisionamento e repita GET a cada 2 segundos por até 30 segundos. Não iniciar REGISTER antes de receber 200.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        false
                                    ]
                                },
                                "erro": {
                                    "type": "object",
                                    "properties": {
                                        "codigo": {
                                            "type": "string"
                                        },
                                        "mensagem": {
                                            "type": "string"
                                        },
                                        "requisicao_id": {
                                            "type": "string",
                                            "format": "uuid"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Http200SegurancaRede": {
                "description": "Operação concluída ou aceita para processamento.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "required": [
                                "sucesso",
                                "dados"
                            ],
                            "properties": {
                                "sucesso": {
                                    "type": "boolean",
                                    "enum": [
                                        true
                                    ]
                                },
                                "dados": {
                                    "$ref": "#/components/schemas/SegurancaRede"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "paths": {
        "/dominios": {
            "get": {
                "summary": "Listar Domínios SIP (até 500, mais recentes primeiro)",
                "description": "Permissão: dominios:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "dominios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Criar domínio SIP",
                "description": "Permissão: dominios:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "dominios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/dominios"
                            },
                            "example": {
                                "nome": "Exemplo de domínio SIP",
                                "configuracao": {
                                    "dominio": "empresa.exemplo.com",
                                    "principal": false
                                }
                            }
                        }
                    }
                }
            }
        },
        "/dominios/{id}": {
            "get": {
                "summary": "Consultar domínio SIP pelo UUID",
                "description": "Permissão: dominios:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "dominios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            },
            "put": {
                "summary": "Substituir configuração; enviar versão obtida no GET",
                "description": "Permissão: dominios:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "dominios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/dominios"
                            },
                            "example": {
                                "nome": "Exemplo de domínio SIP",
                                "configuracao": {
                                    "dominio": "empresa.exemplo.com",
                                    "principal": false
                                },
                                "versao": 1,
                                "ativo": true
                            }
                        }
                    }
                }
            },
            "delete": {
                "summary": "Desativar; recusa dependências ativas e preserva histórico",
                "description": "Permissão: dominios:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "dominios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/ramais": {
            "get": {
                "summary": "Listar Ramais (até 500, mais recentes primeiro)",
                "description": "Permissão: ramais:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Criar ramal",
                "description": "Permissão: ramais:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ramais"
                            },
                            "example": {
                                "nome": "Exemplo de ramal",
                                "configuracao": {
                                    "numero": "101",
                                    "sufixo_sip": "101",
                                    "sip_sem_simbolos": false,
                                    "senha": "",
                                    "webphone": true,
                                    "externas": false,
                                    "internacional": false,
                                    "timeout": 30,
                                    "destino_nao_atendido": {
                                        "tipo": "encerrar"
                                    },
                                    "gravar_realizadas": false,
                                    "gravar_recebidas": false
                                }
                            }
                        }
                    }
                }
            }
        },
        "/ramais/{id}": {
            "get": {
                "summary": "Consultar ramal pelo UUID",
                "description": "Permissão: ramais:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            },
            "put": {
                "summary": "Substituir configuração; enviar versão obtida no GET",
                "description": "Permissão: ramais:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ramais"
                            },
                            "example": {
                                "nome": "Exemplo de ramal",
                                "configuracao": {
                                    "numero": "101",
                                    "sufixo_sip": "101",
                                    "sip_sem_simbolos": false,
                                    "senha": "",
                                    "webphone": true,
                                    "externas": false,
                                    "internacional": false,
                                    "timeout": 30,
                                    "destino_nao_atendido": {
                                        "tipo": "encerrar"
                                    },
                                    "gravar_realizadas": false,
                                    "gravar_recebidas": false
                                },
                                "versao": 1,
                                "ativo": true
                            }
                        }
                    }
                }
            },
            "delete": {
                "summary": "Desativar; recusa dependências ativas e preserva histórico",
                "description": "Permissão: ramais:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/troncos": {
            "get": {
                "summary": "Listar Operadoras (até 500, mais recentes primeiro)",
                "description": "Permissão: troncos:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "troncos"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Criar operadora",
                "description": "Permissão: troncos:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "troncos"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/troncos"
                            },
                            "example": {
                                "nome": "Exemplo de operadora",
                                "configuracao": {
                                    "servidor": "sip.operadora.exemplo.com",
                                    "porta": 5060,
                                    "autenticacao": "senha",
                                    "usuario": "USUARIO_DA_OPERADORA",
                                    "senha": "SUBSTITUA_PELA_SENHA_SIP",
                                    "ip_autorizado": "",
                                    "caller_id": "551130000000",
                                    "transporte": "udp",
                                    "registrar": true,
                                    "recuperar_registro": true,
                                    "limite": 5
                                }
                            }
                        }
                    }
                }
            }
        },
        "/troncos/{id}": {
            "get": {
                "summary": "Consultar operadora pelo UUID",
                "description": "Permissão: troncos:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "troncos"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            },
            "put": {
                "summary": "Substituir configuração; enviar versão obtida no GET",
                "description": "Permissão: troncos:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "troncos"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/troncos"
                            },
                            "example": {
                                "nome": "Exemplo de operadora",
                                "configuracao": {
                                    "servidor": "sip.operadora.exemplo.com",
                                    "porta": 5060,
                                    "autenticacao": "senha",
                                    "usuario": "USUARIO_DA_OPERADORA",
                                    "senha": "",
                                    "ip_autorizado": "",
                                    "caller_id": "551130000000",
                                    "transporte": "udp",
                                    "registrar": true,
                                    "recuperar_registro": true,
                                    "limite": 5
                                },
                                "versao": 1,
                                "ativo": true
                            }
                        }
                    }
                }
            },
            "delete": {
                "summary": "Desativar operadora e interromper registro SIP, preservando rotas e vínculos",
                "description": "Permissão: troncos:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "troncos"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/rotas_saida": {
            "get": {
                "summary": "Listar Rotas de saída (até 500, mais recentes primeiro)",
                "description": "Permissão: rotas_saida:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "rotas_saida"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Criar rota de saída",
                "description": "Permissão: rotas_saida:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "rotas_saida"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/rotas_saida"
                            },
                            "example": {
                                "nome": "Exemplo de rota de saída",
                                "configuracao": {
                                    "prefixo": "",
                                    "tamanho_minimo": 10,
                                    "tamanho_maximo": 11,
                                    "remover": 0,
                                    "adicionar": "0",
                                    "prioridade": 10,
                                    "troncos": [
                                        "00000000-0000-4000-8000-000000000001"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/rotas_saida/{id}": {
            "get": {
                "summary": "Consultar rota de saída pelo UUID",
                "description": "Permissão: rotas_saida:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "rotas_saida"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            },
            "put": {
                "summary": "Substituir configuração; enviar versão obtida no GET",
                "description": "Permissão: rotas_saida:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "rotas_saida"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/rotas_saida"
                            },
                            "example": {
                                "nome": "Exemplo de rota de saída",
                                "configuracao": {
                                    "prefixo": "",
                                    "tamanho_minimo": 10,
                                    "tamanho_maximo": 11,
                                    "remover": 0,
                                    "adicionar": "0",
                                    "prioridade": 10,
                                    "troncos": [
                                        "00000000-0000-4000-8000-000000000001"
                                    ]
                                },
                                "versao": 1,
                                "ativo": true
                            }
                        }
                    }
                }
            },
            "delete": {
                "summary": "Desativar; recusa dependências ativas e preserva histórico",
                "description": "Permissão: rotas_saida:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "rotas_saida"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/rotas_entrada": {
            "get": {
                "summary": "Listar Rotas de entrada (até 500, mais recentes primeiro)",
                "description": "Permissão: rotas_entrada:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "rotas_entrada"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Criar rota de entrada",
                "description": "Permissão: rotas_entrada:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "rotas_entrada"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/rotas_entrada"
                            },
                            "example": {
                                "nome": "Exemplo de rota de entrada",
                                "configuracao": {
                                    "did": "551130000000",
                                    "tronco_id": "00000000-0000-4000-8000-000000000001",
                                    "destino": {
                                        "tipo": "ura",
                                        "id": "00000000-0000-4000-8000-000000000001"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/rotas_entrada/{id}": {
            "get": {
                "summary": "Consultar rota de entrada pelo UUID",
                "description": "Permissão: rotas_entrada:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "rotas_entrada"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            },
            "put": {
                "summary": "Substituir configuração; enviar versão obtida no GET",
                "description": "Permissão: rotas_entrada:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "rotas_entrada"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/rotas_entrada"
                            },
                            "example": {
                                "nome": "Exemplo de rota de entrada",
                                "configuracao": {
                                    "did": "551130000000",
                                    "tronco_id": "00000000-0000-4000-8000-000000000001",
                                    "destino": {
                                        "tipo": "ura",
                                        "id": "00000000-0000-4000-8000-000000000001"
                                    }
                                },
                                "versao": 1,
                                "ativo": true
                            }
                        }
                    }
                }
            },
            "delete": {
                "summary": "Desativar; recusa dependências ativas e preserva histórico",
                "description": "Permissão: rotas_entrada:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "rotas_entrada"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/uras": {
            "get": {
                "summary": "Listar URAs (até 500, mais recentes primeiro)",
                "description": "Permissão: uras:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "uras"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Criar URA",
                "description": "Permissão: uras:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "uras"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/uras"
                            },
                            "example": {
                                "nome": "Exemplo de URA",
                                "configuracao": {
                                    "modo": "teclas",
                                    "audio_id": "00000000-0000-4000-8000-000000000001",
                                    "timeout": 5,
                                    "repeticoes": 1,
                                    "opcoes": {
                                        "1": {
                                            "tipo": "fila",
                                            "id": "00000000-0000-4000-8000-000000000001"
                                        },
                                        "2": {
                                            "tipo": "ramal",
                                            "id": "00000000-0000-4000-8000-000000000001",
                                            "horario_id": "00000000-0000-4000-8000-000000000001",
                                            "destino_fechado": {
                                                "tipo": "encerrar"
                                            },
                                            "destino_nao_atendido": {
                                                "tipo": "fila",
                                                "id": "00000000-0000-4000-8000-000000000001"
                                            }
                                        }
                                    },
                                    "destino": {
                                        "tipo": "encerrar"
                                    },
                                    "destino_nao_atendido": {
                                        "tipo": "encerrar"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/uras/{id}": {
            "get": {
                "summary": "Consultar URA pelo UUID",
                "description": "Permissão: uras:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "uras"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            },
            "put": {
                "summary": "Substituir configuração; enviar versão obtida no GET",
                "description": "Permissão: uras:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "uras"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/uras"
                            },
                            "example": {
                                "nome": "Exemplo de URA",
                                "configuracao": {
                                    "modo": "teclas",
                                    "audio_id": "00000000-0000-4000-8000-000000000001",
                                    "timeout": 5,
                                    "repeticoes": 1,
                                    "opcoes": {
                                        "1": {
                                            "tipo": "fila",
                                            "id": "00000000-0000-4000-8000-000000000001"
                                        },
                                        "2": {
                                            "tipo": "ramal",
                                            "id": "00000000-0000-4000-8000-000000000001",
                                            "horario_id": "00000000-0000-4000-8000-000000000001",
                                            "destino_fechado": {
                                                "tipo": "encerrar"
                                            },
                                            "destino_nao_atendido": {
                                                "tipo": "fila",
                                                "id": "00000000-0000-4000-8000-000000000001"
                                            }
                                        }
                                    },
                                    "destino": {
                                        "tipo": "encerrar"
                                    },
                                    "destino_nao_atendido": {
                                        "tipo": "encerrar"
                                    }
                                },
                                "versao": 1,
                                "ativo": true
                            }
                        }
                    }
                }
            },
            "delete": {
                "summary": "Desativar; recusa dependências ativas e preserva histórico",
                "description": "Permissão: uras:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "uras"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/horarios": {
            "get": {
                "summary": "Listar Horários (até 500, mais recentes primeiro)",
                "description": "Permissão: horarios:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "horarios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Criar regra de horário",
                "description": "Permissão: horarios:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "horarios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/horarios"
                            },
                            "example": {
                                "nome": "Exemplo de regra de horário",
                                "configuracao": {
                                    "periodos": [
                                        {
                                            "dias": [
                                                1
                                            ],
                                            "inicio": "08:00",
                                            "fim": "12:00"
                                        },
                                        {
                                            "dias": [
                                                1
                                            ],
                                            "inicio": "13:00",
                                            "fim": "22:00"
                                        },
                                        {
                                            "dias": [
                                                2,
                                                3,
                                                4,
                                                5
                                            ],
                                            "inicio": "09:00",
                                            "fim": "18:00"
                                        }
                                    ],
                                    "feriados": "2026-12-25",
                                    "destino_aberto": {
                                        "tipo": "encerrar"
                                    },
                                    "destino_fechado": {
                                        "tipo": "audio",
                                        "id": "00000000-0000-4000-8000-000000000001"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/horarios/{id}": {
            "get": {
                "summary": "Consultar regra de horário pelo UUID",
                "description": "Permissão: horarios:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "horarios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            },
            "put": {
                "summary": "Substituir configuração; enviar versão obtida no GET",
                "description": "Permissão: horarios:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "horarios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/horarios"
                            },
                            "example": {
                                "nome": "Exemplo de regra de horário",
                                "configuracao": {
                                    "periodos": [
                                        {
                                            "dias": [
                                                1
                                            ],
                                            "inicio": "08:00",
                                            "fim": "12:00"
                                        },
                                        {
                                            "dias": [
                                                1
                                            ],
                                            "inicio": "13:00",
                                            "fim": "22:00"
                                        },
                                        {
                                            "dias": [
                                                2,
                                                3,
                                                4,
                                                5
                                            ],
                                            "inicio": "09:00",
                                            "fim": "18:00"
                                        }
                                    ],
                                    "feriados": "2026-12-25",
                                    "destino_aberto": {
                                        "tipo": "encerrar"
                                    },
                                    "destino_fechado": {
                                        "tipo": "audio",
                                        "id": "00000000-0000-4000-8000-000000000001"
                                    }
                                },
                                "versao": 1,
                                "ativo": true
                            }
                        }
                    }
                }
            },
            "delete": {
                "summary": "Desativar; recusa dependências ativas e preserva histórico",
                "description": "Permissão: horarios:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "horarios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/filas": {
            "get": {
                "summary": "Listar Filas (até 500, mais recentes primeiro)",
                "description": "Permissão: filas:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "filas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Criar fila",
                "description": "Permissão: filas:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "filas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/filas"
                            },
                            "example": {
                                "nome": "Exemplo de fila",
                                "configuracao": {
                                    "ramais": [
                                        "00000000-0000-4000-8000-000000000001"
                                    ],
                                    "estrategia": "rrmemory",
                                    "timeout": 20,
                                    "espera": 60,
                                    "descanso": 5,
                                    "destino": {
                                        "tipo": "encerrar"
                                    },
                                    "horario_id": "00000000-0000-4000-8000-000000000001",
                                    "destino_fechado": {
                                        "tipo": "encerrar"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/filas/{id}": {
            "get": {
                "summary": "Consultar fila pelo UUID",
                "description": "Permissão: filas:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "filas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            },
            "put": {
                "summary": "Substituir configuração; enviar versão obtida no GET",
                "description": "Permissão: filas:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "filas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/filas"
                            },
                            "example": {
                                "nome": "Exemplo de fila",
                                "configuracao": {
                                    "ramais": [
                                        "00000000-0000-4000-8000-000000000001"
                                    ],
                                    "estrategia": "rrmemory",
                                    "timeout": 20,
                                    "espera": 60,
                                    "descanso": 5,
                                    "destino": {
                                        "tipo": "encerrar"
                                    },
                                    "horario_id": "00000000-0000-4000-8000-000000000001",
                                    "destino_fechado": {
                                        "tipo": "encerrar"
                                    }
                                },
                                "versao": 1,
                                "ativo": true
                            }
                        }
                    }
                }
            },
            "delete": {
                "summary": "Desativar; recusa dependências ativas e preserva histórico",
                "description": "Permissão: filas:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "filas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/audios": {
            "get": {
                "summary": "Listar Áudios (até 500, mais recentes primeiro)",
                "description": "Permissão: audios:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "audios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Criar áudio",
                "description": "Permissão: audios:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "audios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "nome",
                                    "arquivo"
                                ],
                                "properties": {
                                    "nome": {
                                        "type": "string"
                                    },
                                    "arquivo": {
                                        "type": "string",
                                        "format": "binary"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/audios/{id}": {
            "get": {
                "summary": "Consultar áudio pelo UUID",
                "description": "Permissão: audios:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "audios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            },
            "put": {
                "summary": "Substituir configuração; enviar versão obtida no GET",
                "description": "Permissão: audios:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "audios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/audios"
                            },
                            "example": {
                                "nome": "Exemplo de áudio",
                                "configuracao": [],
                                "versao": 1,
                                "ativo": true
                            }
                        }
                    }
                }
            },
            "delete": {
                "summary": "Desativar; recusa dependências ativas e preserva histórico",
                "description": "Permissão: audios:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "audios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/campanhas": {
            "get": {
                "summary": "Listar Campanhas (até 500, mais recentes primeiro)",
                "description": "Permissão: campanhas:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "campanhas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Criar campanha",
                "description": "Permissão: campanhas:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "campanhas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/campanhas"
                            },
                            "example": {
                                "nome": "Exemplo de campanha",
                                "configuracao": {
                                    "modo": "audio_tecla",
                                    "espera_tecla": 8,
                                    "espera_atendente": 30,
                                    "amd_inconclusivo": "prosseguir",
                                    "tronco_id": "00000000-0000-4000-8000-000000000001",
                                    "audio_id": "00000000-0000-4000-8000-000000000001",
                                    "fila_id": "00000000-0000-4000-8000-000000000001",
                                    "tecla": "1",
                                    "tecla_bloqueio": "9",
                                    "simultaneas": 1,
                                    "tentativas": 3,
                                    "intervalo": 120,
                                    "dias": [
                                        1,
                                        2,
                                        3,
                                        4,
                                        5
                                    ],
                                    "inicio": "09:00",
                                    "fim": "17:30",
                                    "data_inicio": "",
                                    "data_fim": "",
                                    "amd": false
                                }
                            }
                        }
                    }
                }
            }
        },
        "/campanhas/{id}": {
            "get": {
                "summary": "Consultar campanha pelo UUID",
                "description": "Permissão: campanhas:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "campanhas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            },
            "put": {
                "summary": "Substituir configuração; enviar versão obtida no GET",
                "description": "Permissão: campanhas:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "campanhas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/campanhas"
                            },
                            "example": {
                                "nome": "Exemplo de campanha",
                                "configuracao": {
                                    "modo": "audio_tecla",
                                    "espera_tecla": 8,
                                    "espera_atendente": 30,
                                    "amd_inconclusivo": "prosseguir",
                                    "tronco_id": "00000000-0000-4000-8000-000000000001",
                                    "audio_id": "00000000-0000-4000-8000-000000000001",
                                    "fila_id": "00000000-0000-4000-8000-000000000001",
                                    "tecla": "1",
                                    "tecla_bloqueio": "9",
                                    "simultaneas": 1,
                                    "tentativas": 3,
                                    "intervalo": 120,
                                    "dias": [
                                        1,
                                        2,
                                        3,
                                        4,
                                        5
                                    ],
                                    "inicio": "09:00",
                                    "fim": "17:30",
                                    "data_inicio": "",
                                    "data_fim": "",
                                    "amd": false
                                },
                                "versao": 1,
                                "ativo": true
                            }
                        }
                    }
                }
            },
            "delete": {
                "summary": "Desativar; recusa dependências ativas e preserva histórico",
                "description": "Permissão: campanhas:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "campanhas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/webhooks": {
            "get": {
                "summary": "Listar Webhooks (até 500, mais recentes primeiro)",
                "description": "Permissão: webhooks:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "webhooks"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Criar webhook",
                "description": "Permissão: webhooks:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "webhooks"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/webhooks"
                            },
                            "example": {
                                "nome": "Exemplo de webhook",
                                "configuracao": {
                                    "versao_payload": "1",
                                    "url": "https://integracao.exemplo.com/eventos",
                                    "eventos": "call.created\ncall.completed\ncall.failed"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhooks/{id}": {
            "get": {
                "summary": "Consultar webhook pelo UUID",
                "description": "Permissão: webhooks:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "webhooks"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            },
            "put": {
                "summary": "Substituir configuração; enviar versão obtida no GET",
                "description": "Permissão: webhooks:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "webhooks"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/webhooks"
                            },
                            "example": {
                                "nome": "Exemplo de webhook",
                                "configuracao": {
                                    "versao_payload": "1",
                                    "url": "https://integracao.exemplo.com/eventos",
                                    "eventos": "call.created\ncall.completed\ncall.failed"
                                },
                                "versao": 1,
                                "ativo": true
                            }
                        }
                    }
                }
            },
            "delete": {
                "summary": "Desativar; recusa dependências ativas e preserva histórico",
                "description": "Permissão: webhooks:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "webhooks"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/interfones": {
            "get": {
                "summary": "Listar interfones desta empresa (até 500)",
                "description": "Permissão: interfones:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "interfones"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200Interfonea38e9dec97398796e2b17d022901eb3b"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Criar interfone com QR fixo e destino restrito",
                "description": "Permissão: interfones:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "interfones"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201Interfonedf2db8adba53ed9e2c73f869caad4702"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/InterfoneConfiguracao"
                            },
                            "example": {
                                "nome": "Portaria principal",
                                "destino": {
                                    "tipo": "ramal",
                                    "id": "00000000-0000-4000-8000-000000000001"
                                },
                                "duracao_maxima": 300,
                                "intervalo": 60,
                                "simultaneas": 1,
                                "ativo": true
                            }
                        }
                    }
                }
            }
        },
        "/interfones/{id}": {
            "get": {
                "summary": "Consultar configuração e URL do QR Code",
                "description": "Permissão: interfones:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "interfones"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200Interfone4e5b1f0008ee61d96db705dff132135c"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            },
            "put": {
                "summary": "Substituir configuração; desativar encerra as visitas abertas",
                "description": "Permissão: interfones:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "interfones"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200Interfone9705f56811ed8d9dada8731688cb44e5"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/InterfoneConfiguracao"
                                    },
                                    {
                                        "type": "object",
                                        "required": [
                                            "versao"
                                        ]
                                    }
                                ]
                            },
                            "example": {
                                "nome": "Portaria principal",
                                "destino": {
                                    "tipo": "ramal",
                                    "id": "00000000-0000-4000-8000-000000000001"
                                },
                                "duracao_maxima": 300,
                                "intervalo": 60,
                                "simultaneas": 1,
                                "ativo": true,
                                "versao": 1
                            }
                        }
                    }
                }
            }
        },
        "/interfones/{id}/sessoes": {
            "get": {
                "summary": "Últimas 50 visitas com IP, resultado e UUID da chamada",
                "description": "Permissão: interfones:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "interfones"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200Interfone60f55b83136635c6d1d1ae51603be204"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/interfones/{id}/renovar-link": {
            "post": {
                "summary": "Invalidar QR anterior e visitas abertas; retorna nova URL",
                "description": "Permissão: interfones:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "interfones"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200Interfonecb4b8925d207cde80a7656928d2858f2"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "versao": {
                                        "type": "integer"
                                    }
                                }
                            },
                            "example": {
                                "versao": 1
                            }
                        }
                    }
                }
            }
        },
        "/publico/interfone/abrir": {
            "post": {
                "summary": "Abrir visita única de até 2 minutos; define cookie HttpOnly",
                "description": "Permissão: Chave do QR e Origin da aplicação. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "publico"
                ],
                "security": [],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200Interfone6f53e560071e4d2d3fa84ad82aee2114"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    },
                    "410": {
                        "$ref": "#/components/responses/Http410"
                    }
                },
                "parameters": [
                    {
                        "name": "Origin",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Origem exata de URL_APLICACAO, sem /api/v1. Navegador na mesma origem."
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "chave": {
                                        "type": "string"
                                    }
                                }
                            },
                            "example": {
                                "chave": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                            }
                        }
                    }
                }
            }
        },
        "/publico/interfone/preparar": {
            "post": {
                "summary": "Emitir credenciais SIP efêmeras uma única vez, após permissão do microfone",
                "description": "Permissão: Cookie do visitante, sessao_id, segredo e Origin da aplicação. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "publico"
                ],
                "security": [
                    {
                        "visitante": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200Interfone1c6b4cab1dcb17765d0edb265e0345e7"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    },
                    "410": {
                        "$ref": "#/components/responses/Http410"
                    }
                },
                "parameters": [
                    {
                        "name": "Origin",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Origem exata de URL_APLICACAO, sem /api/v1. Navegador na mesma origem."
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CredencialVisita"
                            },
                            "example": {
                                "sessao_id": "00000000-0000-4000-8000-000000000001",
                                "segredo": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
                            }
                        }
                    }
                }
            }
        },
        "/publico/interfone/estado": {
            "post": {
                "summary": "Consultar apenas o estado da própria visita",
                "description": "Permissão: Cookie do visitante, sessao_id, segredo e Origin da aplicação. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "publico"
                ],
                "security": [
                    {
                        "visitante": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200Interfone3cf910819650d7e0dea75590bfe889df"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    },
                    "410": {
                        "$ref": "#/components/responses/Http410"
                    }
                },
                "parameters": [
                    {
                        "name": "Origin",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Origem exata de URL_APLICACAO, sem /api/v1. Navegador na mesma origem."
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CredencialVisita"
                            },
                            "example": {
                                "sessao_id": "00000000-0000-4000-8000-000000000001",
                                "segredo": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
                            }
                        }
                    }
                }
            }
        },
        "/publico/interfone/encerrar": {
            "post": {
                "summary": "Revogar visita e desligar sua chamada",
                "description": "Permissão: Cookie do visitante, sessao_id, segredo e Origin da aplicação. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "publico"
                ],
                "security": [
                    {
                        "visitante": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200Interfone2df690a2a8f2e85c08f08bf6fa9e31e7"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    },
                    "410": {
                        "$ref": "#/components/responses/Http410"
                    }
                },
                "parameters": [
                    {
                        "name": "Origin",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Origem exata de URL_APLICACAO, sem /api/v1. Navegador na mesma origem."
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CredencialVisita"
                            },
                            "example": {
                                "sessao_id": "00000000-0000-4000-8000-000000000001",
                                "segredo": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
                            }
                        }
                    }
                }
            }
        },
        "/audios/vozes": {
            "get": {
                "summary": "Vozes neurais locais disponíveis em português do Brasil e limites",
                "description": "Permissão: audios:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "audios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200VozesLocais"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            }
        },
        "/audios/previa-voz": {
            "post": {
                "summary": "Gerar prévia WAV temporária sem cadastrar mensagem",
                "description": "Permissão: audios:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "audios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200Audio"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PreviaVoz"
                            },
                            "example": {
                                "texto": "Olá! Você ligou para nossa empresa. Para atendimento, digite um.",
                                "voz": "faber",
                                "velocidade": 1
                            }
                        }
                    }
                }
            }
        },
        "/audios/gerar-voz": {
            "post": {
                "summary": "Gerar voz local e cadastrar mensagem WAV reutilizável",
                "description": "Permissão: audios:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "audios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201AudioSalvo"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/GerarVoz"
                            },
                            "example": {
                                "nome": "Boas-vindas",
                                "texto": "Olá! Você ligou para nossa empresa. Para atendimento, digite um.",
                                "voz": "faber",
                                "velocidade": 1
                            }
                        }
                    }
                }
            }
        },
        "/audios/{id}/arquivo": {
            "get": {
                "summary": "Ouvir ou baixar WAV autenticado; baixar=1 força download",
                "description": "Permissão: audios:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "audios"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200Audio"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "baixar",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "example": "1"
                    }
                ]
            }
        },
        "/ramais/lote/previa": {
            "post": {
                "summary": "Conferir sequência, modelo e conflitos; não cria ramais",
                "description": "Permissão: ramais:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200PreviaRamaisLote"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SolicitacaoRamaisLote"
                            },
                            "example": {
                                "numero_inicial": "1002",
                                "quantidade": 83,
                                "sufixo_inicial": "1002",
                                "nome_padrao": "Ramal {numero}"
                            }
                        }
                    }
                }
            }
        },
        "/ramais/lote": {
            "post": {
                "summary": "Criar de 1 a 100 ramais atomicamente; requer Idempotency-Key",
                "description": "Permissão: ramais:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201RamaisLoteCriados"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9_-]{12,128}$"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SolicitacaoRamaisLote"
                            },
                            "example": {
                                "numero_inicial": "1002",
                                "quantidade": 83,
                                "sufixo_inicial": "1002",
                                "nome_padrao": "Ramal {numero}"
                            }
                        }
                    }
                }
            }
        },
        "/ramais/{id}/exclusao": {
            "get": {
                "summary": "Conferir gravações, chamadas e vínculos antes de desativar ou excluir",
                "description": "Permissão: ramais:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200ResumoExclusaoRamal"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/ramais/{id}/desativar": {
            "post": {
                "summary": "Desativar preservando gravações; revoga acessos de atendentes",
                "description": "Permissão: ramais:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200ResultadoRemocaoRamal"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "versao"
                                ],
                                "properties": {
                                    "versao": {
                                        "type": "integer",
                                        "minimum": 1
                                    }
                                }
                            },
                            "example": {
                                "versao": 1
                            }
                        }
                    }
                }
            }
        },
        "/ramais/{id}/excluir": {
            "post": {
                "summary": "Excluir definitivamente; gravações exigem confirmação e escopo adicional",
                "description": "Permissão: ramais:escrever; gravacoes:escrever quando houver gravações. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200ResultadoRemocaoRamal"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SolicitacaoExclusaoRamal"
                            },
                            "example": {
                                "versao": 1,
                                "confirmar": true,
                                "excluir_gravacoes": false
                            }
                        }
                    }
                }
            }
        },
        "/ramais/documentacao": {
            "post": {
                "summary": "Gerar PDF dos ramais do cliente (TXT opcional); credenciais somente se solicitadas",
                "description": "Permissão: ramais:ler; também ramais:escrever ao incluir senhas. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200DocumentoRamais"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SolicitacaoDocumentoRamais"
                            },
                            "example": {
                                "situacao": "ativos",
                                "incluir_senhas": false,
                                "formato": "pdf"
                            }
                        }
                    }
                }
            }
        },
        "/ramais/{id}/credencial": {
            "post": {
                "summary": "Renovar senha SIP; invalida a senha anterior",
                "description": "Permissão: ramais:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            },
                            "example": {}
                        }
                    }
                }
            }
        },
        "/empresa/documentacao": {
            "get": {
                "summary": "Consultar logo e marca-d’água da empresa",
                "description": "Permissão: ramais:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "empresa"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200IdentidadeDocumentos"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            }
        },
        "/empresa/documentacao/logo": {
            "get": {
                "summary": "Consultar imagem privada do PDF",
                "description": "Permissão: ramais:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "empresa"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Enviar PNG ou JPEG de até 3 MB para o PDF",
                "description": "Permissão: ramais:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "empresa"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200IdentidadeDocumentos"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "arquivo"
                                ],
                                "properties": {
                                    "arquivo": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "PNG ou JPEG até 3 MB, lado até 4000 px e até 8 milhões de pixels."
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "summary": "Remover imagem do PDF desta empresa",
                "description": "Permissão: ramais:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "empresa"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200IdentidadeDocumentos"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            }
        },
        "/empresa/documentacao/marca_dagua": {
            "get": {
                "summary": "Consultar imagem privada do PDF",
                "description": "Permissão: ramais:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "empresa"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Enviar PNG ou JPEG de até 3 MB para o PDF",
                "description": "Permissão: ramais:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "empresa"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200IdentidadeDocumentos"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "arquivo"
                                ],
                                "properties": {
                                    "arquivo": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "PNG ou JPEG até 3 MB, lado até 4000 px e até 8 milhões de pixels."
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "summary": "Remover imagem do PDF desta empresa",
                "description": "Permissão: ramais:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "empresa"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200IdentidadeDocumentos"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            }
        },
        "/empresa/telefonia": {
            "get": {
                "summary": "Prefixo SIP fixo e preferência de captura da empresa autenticada",
                "description": "Permissão: ramais:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "empresa"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200TelefoniaEmpresa"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "put": {
                "summary": "Configurar ativação e códigos de captura desta empresa",
                "description": "Permissão: ramais:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "empresa"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200TelefoniaEmpresa"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "captura_chamadas"
                                ],
                                "description": "Códigos omitidos mantêm os valores salvos. Alteração imediata e auditada por empresa.",
                                "properties": {
                                    "captura_chamadas": {
                                        "type": "boolean",
                                        "default": false
                                    },
                                    "codigo_captura_geral": {
                                        "type": "string",
                                        "pattern": "^[*#]{1,2}[0-9]{1,4}$",
                                        "minLength": 2,
                                        "maxLength": 6,
                                        "default": "#0",
                                        "description": "Código completo para captura geral. Não pode começar com o prefixo direto nem ser seu prefixo."
                                    },
                                    "prefixo_captura_direta": {
                                        "type": "string",
                                        "pattern": "^[*#]{1,2}[0-9]{1,4}$",
                                        "minLength": 2,
                                        "maxLength": 6,
                                        "default": "#1",
                                        "description": "Acrescente o número do ramal (2 a 6 dígitos). Exemplo: #11002."
                                    }
                                }
                            },
                            "example": {
                                "captura_chamadas": true,
                                "codigo_captura_geral": "#0",
                                "prefixo_captura_direta": "#1"
                            }
                        }
                    }
                }
            }
        },
        "/ramais/{id}/historico": {
            "get": {
                "summary": "Histórico do ramal, conexão e chamadas ativas; preservado após desativação",
                "description": "Permissão: ramais:ler e chamadas:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200HistoricoRamal"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "tipo",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "example": "todos"
                    },
                    {
                        "name": "pagina",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    }
                ]
            }
        },
        "/ramais/conexoes": {
            "get": {
                "summary": "Conexões reais SIP/WebPhone com dispositivos, alcance e horário da consulta",
                "description": "Permissão: ramais:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200ConexoesRamais"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            }
        },
        "/ramais/{id}/chefe-secretaria": {
            "get": {
                "summary": "Consultar triagem Chefe / Secretária e versão do ramal",
                "description": "Permissão: ramais:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200ChefeSecretariaRamal"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            },
            "put": {
                "summary": "Configurar triagem do chefe; secretária deve ser outro ramal ativo da mesma empresa",
                "description": "Permissão: ramais:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200ChefeSecretariaRamal"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SolicitacaoChefeSecretaria"
                            },
                            "example": {
                                "versao": 1,
                                "chefe_secretaria": {
                                    "habilitado": true,
                                    "secretaria_id": "00000000-0000-4000-8000-000000000001"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/ramais/{id}/siga-me": {
            "get": {
                "summary": "Consultar regras e versão do Siga-me deste ramal",
                "description": "Permissão: ramais:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200SigaMeRamal"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            },
            "put": {
                "summary": "Substituir somente as regras do Siga-me; exige versão atual",
                "description": "Permissão: ramais:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200SigaMeRamal"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SolicitacaoSigaMe"
                            },
                            "example": {
                                "versao": 1,
                                "siga_me": {
                                    "habilitado": true,
                                    "permitir_telefone": true,
                                    "codigo_ativar": "#21",
                                    "codigo_desativar": "#22",
                                    "tempo_toque": 20,
                                    "tempo_externo": 45,
                                    "sempre": null,
                                    "nao_atende": {
                                        "tipo": "ramal",
                                        "id": "00000000-0000-4000-8000-000000000001"
                                    },
                                    "ocupado": null,
                                    "indisponivel": null
                                }
                            }
                        }
                    }
                }
            }
        },
        "/ramais/{id}/configuracao-sip": {
            "get": {
                "summary": "Dados de configuração do telefone SIP, sem senha",
                "description": "Permissão: ramais:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200ConfiguracaoSip"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/ramais/{id}/revelar-credencial": {
            "post": {
                "summary": "Consultar senha SIP existente; registra auditoria e não renova",
                "description": "Permissão: ramais:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200ConfiguracaoSip"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            },
                            "example": {}
                        }
                    }
                }
            }
        },
        "/chamadas/{id}/gravacoes": {
            "get": {
                "summary": "Gravações por ramal e sentido; somente metadados",
                "description": "Permissão: gravacoes:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "chamadas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/ramais/{id}/gravacoes": {
            "get": {
                "summary": "Gravações do ramal, inclusive desativado; 50 por página, mais recentes primeiro",
                "description": "Permissão: ramais:ler e gravacoes:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200GravacoesRamal"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "direcao",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "todas",
                                "realizada",
                                "recebida"
                            ],
                            "default": "todas"
                        },
                        "example": "todas"
                    },
                    {
                        "name": "pagina",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100000,
                            "default": 1
                        },
                        "example": 1
                    }
                ]
            }
        },
        "/gravacoes/{id}/arquivo": {
            "get": {
                "summary": "Áudio WAV autenticado; baixar=1 força download; suporta Range",
                "description": "Permissão: gravacoes:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "gravacoes"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200Audio"
                    },
                    "206": {
                        "$ref": "#/components/responses/Http206Audio"
                    },
                    "416": {
                        "$ref": "#/components/responses/Http416"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "Range",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "example": "bytes=0-1023"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "baixar",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "example": "1"
                    }
                ]
            }
        },
        "/troncos/{id}/diagnostico": {
            "get": {
                "summary": "Verificar DNS, endpoint e registro SIP",
                "description": "Permissão: troncos:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "troncos"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/troncos/{id}/registro": {
            "post": {
                "summary": "Solicitar tentativa, pausar ou retomar registro SIP; processamento assíncrono",
                "description": "Permissão: troncos:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "troncos"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    },
                    "202": {
                        "$ref": "#/components/responses/Http202"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "acao"
                                ],
                                "properties": {
                                    "acao": {
                                        "type": "string",
                                        "enum": [
                                            "tentar",
                                            "pausar",
                                            "retomar"
                                        ]
                                    }
                                }
                            },
                            "example": {
                                "acao": "tentar"
                            }
                        }
                    }
                }
            }
        },
        "/troncos/status": {
            "get": {
                "summary": "Estado atual de registro dos troncos da empresa e saúde do monitoramento",
                "description": "Permissão: troncos:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "troncos"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200StatusTroncos"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            }
        },
        "/troncos/{id}/status": {
            "get": {
                "summary": "Registro atual, última falha e política de recuperação aplicada no Asterisk",
                "description": "Permissão: troncos:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "troncos"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200StatusTroncos"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/troncos/{id}/historico": {
            "get": {
                "summary": "Registro, renovações, falhas e alterações com responsáveis; 50 eventos por página",
                "description": "Permissão: troncos:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "troncos"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200HistoricoTronco"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "tipo",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "todos",
                                "registros",
                                "alteracoes"
                            ],
                            "default": "todos"
                        },
                        "example": "todos"
                    },
                    {
                        "name": "pagina",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100000,
                            "default": 1
                        },
                        "example": 1
                    },
                    {
                        "name": "inicio",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-10-17"
                    },
                    {
                        "name": "fim",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-10-17"
                    }
                ]
            }
        },
        "/filas/{id}/status": {
            "get": {
                "summary": "Agentes, quantidade de prontos, aguardando e indicador aberta",
                "description": "Permissão: filas:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "filas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/filas/{id}/disponibilidade": {
            "post": {
                "summary": "Pausar ou disponibilizar um atendente",
                "description": "Permissão: operar_filas:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "filas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "ramal_id": {
                                        "type": "string"
                                    },
                                    "pausado": {
                                        "type": "boolean"
                                    },
                                    "motivo": {
                                        "type": "string"
                                    }
                                }
                            },
                            "example": {
                                "ramal_id": "00000000-0000-4000-8000-000000000001",
                                "pausado": true,
                                "motivo": "Intervalo"
                            }
                        }
                    }
                }
            }
        },
        "/painel": {
            "get": {
                "summary": "Indicadores da empresa e disponibilidade dos serviços",
                "description": "Permissão: painel:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "painel"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            }
        },
        "/chamadas": {
            "get": {
                "summary": "Histórico: até 100 por página; ativas=1 filtra chamadas abertas",
                "description": "Permissão: chamadas:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "chamadas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200ListaChamadas"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "pagina",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    },
                    {
                        "name": "ativas",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "example": "0"
                    }
                ]
            }
        },
        "/chamadas/correlacionar-sip": {
            "post": {
                "summary": "Resolver Call-ID SIP e ramal em UUIDs REST; 200 correlacionada ou 202 pendente",
                "description": "Permissão: chamadas:ler; sessão atendente somente no próprio ramal. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "chamadas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200CorrelacaoSip"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409CorrelacaoSip"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    },
                    "202": {
                        "$ref": "#/components/responses/Http202CorrelacaoSip"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SolicitacaoCorrelacaoSip"
                            },
                            "example": {
                                "sip_call_id": "exemplo-call-id@crm.example.invalid",
                                "ramal_id": "00000000-0000-4000-8000-000000000001"
                            }
                        }
                    }
                }
            }
        },
        "/chamadas/{id}": {
            "get": {
                "summary": "Detalhes e correlação de uma chamada",
                "description": "Permissão: chamadas:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "chamadas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200ChamadaConsulta"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/chamadas/originate": {
            "post": {
                "summary": "Tocar o ramal e, após atendimento, ligar para o destino; requer Idempotency-Key",
                "description": "Permissão: chamadas:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "chamadas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "202": {
                        "$ref": "#/components/responses/Http202"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9_-]{12,128}$"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "ramal_id": {
                                        "type": "string"
                                    },
                                    "destino": {
                                        "type": "string"
                                    }
                                }
                            },
                            "example": {
                                "ramal_id": "00000000-0000-4000-8000-000000000001",
                                "destino": "102"
                            }
                        }
                    }
                }
            }
        },
        "/chamadas/{id}/hangup": {
            "post": {
                "summary": "Encerrar uma ligação com canal ativo",
                "description": "Permissão: chamadas:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "chamadas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            },
                            "example": {}
                        }
                    }
                }
            }
        },
        "/chamadas/{id}/transfer": {
            "post": {
                "summary": "Transferir para o número de um ramal ativo da mesma empresa",
                "description": "Permissão: chamadas:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "chamadas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "destino": {
                                        "type": "string"
                                    }
                                }
                            },
                            "example": {
                                "destino": "102"
                            }
                        }
                    }
                }
            }
        },
        "/simular": {
            "post": {
                "summary": "Simular sem ligar: tipo saida, entrada, horario ou destino",
                "description": "Permissão: rotas_saida:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "simular"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "tipo": {
                                        "type": "string"
                                    },
                                    "destino": {
                                        "type": "object",
                                        "properties": {
                                            "tipo": {
                                                "type": "string"
                                            },
                                            "id": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "data": {
                                        "type": "string"
                                    }
                                }
                            },
                            "example": {
                                "tipo": "destino",
                                "destino": {
                                    "tipo": "fila",
                                    "id": "00000000-0000-4000-8000-000000000001"
                                },
                                "data": "2026-10-12T12:30:00-03:00"
                            }
                        }
                    }
                }
            }
        },
        "/campanhas/{id}/contatos": {
            "post": {
                "summary": "Validar contatos; confirmar=true importa o lote",
                "description": "Permissão: campanhas:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "campanhas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "confirmar": {
                                        "type": "boolean"
                                    },
                                    "contatos": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "nome": {
                                                    "type": "string"
                                                },
                                                "telefone": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    }
                                }
                            },
                            "example": {
                                "confirmar": false,
                                "contatos": [
                                    {
                                        "nome": "Pessoa de exemplo",
                                        "telefone": "551130000000"
                                    }
                                ]
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "arquivo"
                                ],
                                "properties": {
                                    "arquivo": {
                                        "type": "string",
                                        "format": "binary"
                                    },
                                    "confirmar": {
                                        "type": "boolean",
                                        "default": false
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/campanhas/{id}/iniciar": {
            "post": {
                "summary": "Iniciar campanha",
                "description": "Permissão: operar_campanhas:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "campanhas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            },
                            "example": {}
                        }
                    }
                }
            }
        },
        "/campanhas/{id}/pausar": {
            "post": {
                "summary": "Pausar campanha",
                "description": "Permissão: operar_campanhas:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "campanhas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            },
                            "example": {}
                        }
                    }
                }
            }
        },
        "/campanhas/{id}/encerrar": {
            "post": {
                "summary": "Encerrar campanha",
                "description": "Permissão: operar_campanhas:escrever. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "campanhas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            },
                            "example": {}
                        }
                    }
                }
            }
        },
        "/campanhas/{id}/status": {
            "get": {
                "summary": "Diagnóstico de discagem, rotas, próxima tentativa, fila e indicadores de atendimento",
                "description": "Permissão: campanhas:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "campanhas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200StatusCampanha"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/campanhas/{id}/resultados": {
            "get": {
                "summary": "Última tentativa de cada contato, 100 por página",
                "description": "Permissão: campanhas:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "campanhas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200ResultadosCampanha"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "pagina",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    }
                ]
            }
        },
        "/campanhas/{id}/metricas": {
            "get": {
                "summary": "Quantidades de contatos por estado",
                "description": "Permissão: campanhas:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "campanhas"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            }
        },
        "/eventos": {
            "get": {
                "summary": "Últimos 100 eventos da empresa; sem paginação",
                "description": "Permissão: eventos:ler. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "eventos"
                ],
                "security": [
                    {
                        "chaveApi": []
                    },
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            }
        },
        "/catalogo": {
            "get": {
                "summary": "Catálogo de campos usados no painel",
                "description": "Permissão: Administrador do cliente ou da plataforma. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "catalogo"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            }
        },
        "/usuarios": {
            "get": {
                "summary": "Usuários do cliente selecionado, sem senhas",
                "description": "Permissão: Administrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "usuarios"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Criar usuário; exige troca da senha inicial",
                "description": "Permissão: Administrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "usuarios"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "nome": {
                                        "type": "string"
                                    },
                                    "email": {
                                        "type": "string"
                                    },
                                    "perfil": {
                                        "type": "string"
                                    },
                                    "ramal_id": {
                                        "type": "string"
                                    },
                                    "senha": {
                                        "type": "string"
                                    },
                                    "conectar_automaticamente": {
                                        "type": "boolean"
                                    },
                                    "ativo": {
                                        "type": "boolean"
                                    }
                                }
                            },
                            "example": {
                                "nome": "Maria",
                                "email": "maria@exemplo.com",
                                "perfil": "atendente",
                                "ramal_id": "00000000-0000-4000-8000-000000000001",
                                "senha": "SUBSTITUA_POR_12_OU_MAIS_CARACTERES",
                                "conectar_automaticamente": true,
                                "ativo": true
                            }
                        }
                    }
                }
            }
        },
        "/usuarios/{id}": {
            "put": {
                "summary": "Editar usuário; senha vazia mantém a atual",
                "description": "Permissão: Administrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "usuarios"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "nome": {
                                        "type": "string"
                                    },
                                    "email": {
                                        "type": "string"
                                    },
                                    "perfil": {
                                        "type": "string"
                                    },
                                    "ramal_id": {
                                        "type": "string"
                                    },
                                    "senha": {
                                        "type": "string"
                                    },
                                    "conectar_automaticamente": {
                                        "type": "boolean"
                                    },
                                    "ativo": {
                                        "type": "boolean"
                                    }
                                }
                            },
                            "example": {
                                "nome": "Maria",
                                "email": "maria@exemplo.com",
                                "perfil": "atendente",
                                "ramal_id": "00000000-0000-4000-8000-000000000001",
                                "senha": "",
                                "conectar_automaticamente": true,
                                "ativo": true
                            }
                        }
                    }
                }
            }
        },
        "/ramais/{id}/acessos-webphone": {
            "get": {
                "summary": "Listar atendentes vinculados a este ramal",
                "description": "Permissão: Administrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ]
            },
            "post": {
                "summary": "Criar acesso direto e habilitar o ramal para navegador",
                "description": "Permissão: Administrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "nome": {
                                        "type": "string"
                                    },
                                    "login": {
                                        "type": "string"
                                    },
                                    "senha": {
                                        "type": "string"
                                    },
                                    "trocar_senha": {
                                        "type": "boolean"
                                    },
                                    "ativo": {
                                        "type": "boolean"
                                    }
                                }
                            },
                            "example": {
                                "nome": "Maria",
                                "login": "empresa.101",
                                "senha": "SUBSTITUA_POR_12_OU_MAIS_CARACTERES",
                                "trocar_senha": false,
                                "ativo": true
                            }
                        }
                    }
                }
            }
        },
        "/ramais/{id}/acessos-webphone/{usuario_id}": {
            "put": {
                "summary": "Editar acesso do ramal; encerra sessões anteriores",
                "description": "Permissão: Administrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "ramais"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "usuario_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "nome": {
                                        "type": "string"
                                    },
                                    "login": {
                                        "type": "string"
                                    },
                                    "senha": {
                                        "type": "string"
                                    },
                                    "trocar_senha": {
                                        "type": "boolean"
                                    },
                                    "ativo": {
                                        "type": "boolean"
                                    }
                                }
                            },
                            "example": {
                                "nome": "Maria",
                                "login": "empresa.101",
                                "senha": "",
                                "trocar_senha": false,
                                "ativo": true
                            }
                        }
                    }
                }
            }
        },
        "/minha-senha": {
            "post": {
                "summary": "Alterar a própria senha; invalida outras sessões",
                "description": "Permissão: Usuário autenticado. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "minha-senha"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "atual": {
                                        "type": "string"
                                    },
                                    "nova": {
                                        "type": "string"
                                    }
                                }
                            },
                            "example": {
                                "atual": "SENHA_ATUAL",
                                "nova": "NOVA_SENHA_COM_12_CARACTERES"
                            }
                        }
                    }
                }
            }
        },
        "/chaves-api": {
            "get": {
                "summary": "Listar metadados e escopos das chaves; não retorna tokens",
                "description": "Permissão: Administrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "chaves-api"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Criar chave da empresa atual; token só nesta resposta",
                "description": "Permissão: Administrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "chaves-api"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "nome": {
                                        "type": "string"
                                    },
                                    "escopos": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "example": {
                                "nome": "CRM",
                                "escopos": [
                                    "ramais:ler",
                                    "chamadas:ler",
                                    "chamadas:escrever"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/chaves-api/{id}": {
            "delete": {
                "summary": "Revogar chave de integração",
                "description": "Permissão: Administrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "chaves-api"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/entregas-webhook": {
            "get": {
                "summary": "Últimas 100 entregas, tentativas, estado e HTTP",
                "description": "Permissão: Administrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "entregas-webhook"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            }
        },
        "/webphone": {
            "get": {
                "summary": "Credencial SIP do próprio ramal; administrador pode selecionar ramal_id",
                "description": "Permissão: Sessão com permissão de WebPhone. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "webphone"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200ConfiguracaoWebphone"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409ProvisionamentoWebphone"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503ProvisionamentoWebphone"
                    }
                },
                "parameters": [
                    {
                        "name": "ramal_id",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "example": "00000000-0000-4000-8000-000000000001"
                    }
                ]
            }
        },
        "/webphone/preparar": {
            "post": {
                "summary": "Validar número, captura ou Siga-me antes da chamada WebRTC",
                "description": "Permissão: Sessão com permissão de WebPhone. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "webphone"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "numero": {
                                        "type": "string"
                                    },
                                    "ramal_id": {
                                        "type": "string"
                                    }
                                }
                            },
                            "example": {
                                "numero": "102",
                                "ramal_id": "00000000-0000-4000-8000-000000000001"
                            }
                        }
                    }
                }
            }
        },
        "/webphone/filas": {
            "get": {
                "summary": "Consultar filas e pausa do ramal",
                "description": "Permissão: Sessão com permissão de WebPhone. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "webphone"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "ramal_id",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "example": "00000000-0000-4000-8000-000000000001"
                    }
                ]
            }
        },
        "/websocket-ticket": {
            "post": {
                "summary": "Ticket de eventos com uso único, válido por 30 segundos",
                "description": "Permissão: Administrador ou supervisor. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "websocket-ticket"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {}
                            },
                            "example": {}
                        }
                    }
                }
            }
        },
        "/auditoria": {
            "get": {
                "summary": "Auditoria paginada: 50 registros, cursor antes_de",
                "description": "Permissão: Administrador do cliente. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "auditoria"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "acao",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "example": "alterar"
                    },
                    {
                        "name": "inicio",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "example": "2026-10-01"
                    },
                    {
                        "name": "fim",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "example": "2026-10-31"
                    },
                    {
                        "name": "usuario_id",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "antes_de",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/auditoria/filtros": {
            "get": {
                "summary": "Responsáveis e ações disponíveis nos filtros",
                "description": "Permissão: Administrador do cliente. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "auditoria"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            }
        },
        "/auditoria/{registro_id}": {
            "get": {
                "summary": "Detalhes, identidade histórica e antes/depois protegidos",
                "description": "Permissão: Administrador do cliente. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "auditoria"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "registro_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ]
            }
        },
        "/administracao/auditoria": {
            "get": {
                "summary": "Auditoria paginada: 50 registros, cursor antes_de",
                "description": "Permissão: Superadministrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "administracao"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "acao",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "example": "alterar"
                    },
                    {
                        "name": "inicio",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "example": "2026-10-01"
                    },
                    {
                        "name": "fim",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "example": "2026-10-31"
                    },
                    {
                        "name": "usuario_id",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "antes_de",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "empresa_id",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/administracao/auditoria/filtros": {
            "get": {
                "summary": "Responsáveis e ações disponíveis nos filtros",
                "description": "Permissão: Superadministrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "administracao"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            }
        },
        "/administracao/auditoria/{registro_id}": {
            "get": {
                "summary": "Detalhes, identidade histórica e antes/depois protegidos",
                "description": "Permissão: Superadministrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "administracao"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "registro_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ]
            }
        },
        "/administracao/empresas": {
            "get": {
                "summary": "Listar clientes da plataforma por situação",
                "description": "Permissão: Superadministrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "administracao"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "situacao",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "todas",
                                "ativas",
                                "desativadas"
                            ],
                            "default": "todas"
                        },
                        "example": "ativas"
                    }
                ]
            },
            "post": {
                "summary": "Criar cliente isolado",
                "description": "Permissão: Superadministrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "administracao"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "nome": {
                                        "type": "string"
                                    },
                                    "slug": {
                                        "type": "string"
                                    },
                                    "razao_social": {
                                        "type": "string"
                                    },
                                    "cnpj": {
                                        "type": "string"
                                    },
                                    "ddd": {
                                        "type": "string"
                                    },
                                    "dominio_sip": {
                                        "type": "string"
                                    },
                                    "fuso_horario": {
                                        "type": "string"
                                    }
                                }
                            },
                            "example": {
                                "nome": "Empresa exemplo",
                                "slug": "empresa-exemplo",
                                "razao_social": "Empresa Exemplo Ltda",
                                "cnpj": "",
                                "ddd": "11",
                                "dominio_sip": "empresa.pabx.atendai.chat",
                                "fuso_horario": "America/Sao_Paulo"
                            }
                        }
                    }
                }
            }
        },
        "/administracao/empresas/{empresa_id}": {
            "put": {
                "summary": "Editar cliente; suspensão bloqueia sua operação",
                "description": "Permissão: Superadministrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "administracao"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "empresa_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "nome": {
                                        "type": "string"
                                    },
                                    "razao_social": {
                                        "type": "string"
                                    },
                                    "cnpj": {
                                        "type": "string"
                                    },
                                    "ddd": {
                                        "type": "string"
                                    },
                                    "ativo": {
                                        "type": "boolean"
                                    },
                                    "limite_chamadas": {
                                        "type": "integer"
                                    }
                                }
                            },
                            "example": {
                                "nome": "Empresa exemplo",
                                "razao_social": "Empresa Exemplo Ltda",
                                "cnpj": "",
                                "ddd": "11",
                                "ativo": true,
                                "limite_chamadas": 10
                            }
                        }
                    }
                }
            }
        },
        "/administracao/seguranca-rede": {
            "get": {
                "summary": "Consultar Fail2Ban SIP, regras UFW, contatos e logs sanitizados",
                "description": "Permissão: Superadministrador; somente sessão. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "administracao"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200SegurancaRede"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "ip",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "example": "198.51.100.24"
                    },
                    {
                        "name": "fonte",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "todas",
                                "sip",
                                "asterisk",
                                "fail2ban",
                                "firewall"
                            ],
                            "default": "todas"
                        },
                        "example": "todas"
                    },
                    {
                        "name": "nivel",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "todos",
                                "problemas"
                            ],
                            "default": "problemas"
                        },
                        "example": "problemas"
                    }
                ]
            }
        },
        "/administracao/seguranca-rede/acoes": {
            "post": {
                "summary": "Bloquear ou liberar SIP por IP, com motivo e auditoria",
                "description": "Permissão: Superadministrador; somente sessão. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "administracao"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AcaoSegurancaRede"
                            },
                            "example": {
                                "acao": "desbloquear_fail2ban",
                                "ip": "198.51.100.24",
                                "motivo": "Configuração do aparelho corrigida e validada.",
                                "confirmar": true
                            }
                        }
                    }
                }
            }
        },
        "/administracao/administradores": {
            "get": {
                "summary": "Listar administradores globais",
                "description": "Permissão: Superadministrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "administracao"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                }
            },
            "post": {
                "summary": "Criar administrador global com troca obrigatória de senha",
                "description": "Permissão: Superadministrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "administracao"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "201": {
                        "$ref": "#/components/responses/Http201"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "nome": {
                                        "type": "string"
                                    },
                                    "email": {
                                        "type": "string"
                                    },
                                    "senha": {
                                        "type": "string"
                                    }
                                }
                            },
                            "example": {
                                "nome": "Administrador exemplo",
                                "email": "admin@exemplo.com",
                                "senha": "SUBSTITUA_POR_12_OU_MAIS_CARACTERES"
                            }
                        }
                    }
                }
            }
        },
        "/administracao/administradores/{id}": {
            "put": {
                "summary": "Editar ou desativar administrador; senha vazia mantém a atual",
                "description": "Permissão: Superadministrador. Consulte o guia para campos e semântica de execução.",
                "tags": [
                    "administracao"
                ],
                "security": [
                    {
                        "sessao": []
                    }
                ],
                "responses": {
                    "200": {
                        "$ref": "#/components/responses/Http200"
                    },
                    "401": {
                        "$ref": "#/components/responses/Http401"
                    },
                    "403": {
                        "$ref": "#/components/responses/Http403"
                    },
                    "404": {
                        "$ref": "#/components/responses/Http404"
                    },
                    "409": {
                        "$ref": "#/components/responses/Http409"
                    },
                    "413": {
                        "$ref": "#/components/responses/Http413"
                    },
                    "422": {
                        "$ref": "#/components/responses/Http422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Http429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Http500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Http503"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "X-CSRF-Token",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "nome": {
                                        "type": "string"
                                    },
                                    "email": {
                                        "type": "string"
                                    },
                                    "senha": {
                                        "type": "string"
                                    },
                                    "ativo": {
                                        "type": "boolean"
                                    }
                                }
                            },
                            "example": {
                                "nome": "Administrador exemplo",
                                "email": "admin@exemplo.com",
                                "senha": "",
                                "ativo": true
                            }
                        }
                    }
                }
            }
        }
    }
}
