{
  "openapi": "3.1.0",
  "info": {
    "title": "Mellon Connect API",
    "version": "1.0.0",
    "description": "Envio de e-mails transacionais, códigos de verificação (OTP), SMS e WhatsApp. Autenticação com credencial criada no portal (`Authorization: Bearer dck_…`). Cada resposta traz os cabeçalhos `X-RateLimit-Limit`, `X-RateLimit-Remaining` e `X-RateLimit-Reset`."
  },
  "servers": [
    {
      "url": "https://admin.mellonconnect.com"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Credencial do negócio (dck_live_… em produção, dck_test_… em testes)."
      }
    },
    "responses": {
      "Error": {
        "description": "Erro",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "ok": {
                  "type": "boolean",
                  "const": false
                },
                "error": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "example": {
              "ok": false,
              "error": {
                "code": "INSUFFICIENT_SCOPE"
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "E-mail"
    },
    {
      "name": "Modelos"
    },
    {
      "name": "Códigos de verificação"
    },
    {
      "name": "SMS"
    },
    {
      "name": "WhatsApp"
    }
  ],
  "paths": {
    "/v1/email/deliveries": {
      "post": {
        "tags": [
          "E-mail"
        ],
        "summary": "Enviar um e-mail transacional",
        "description": "Permissão: `email:send`.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Chave única por pedido (8–160 caracteres). Repetir com a mesma chave devolve o mesmo resultado sem enviar de novo.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "senderId",
                  "templateId",
                  "recipient"
                ],
                "properties": {
                  "senderId": {
                    "type": "string"
                  },
                  "templateId": {
                    "type": "string"
                  },
                  "recipient": {
                    "type": "string",
                    "format": "email"
                  },
                  "context": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              },
              "example": {
                "senderId": "ID_DO_REMETENTE",
                "templateId": "ID_DO_MODELO",
                "recipient": "cliente@exemplo.com",
                "context": {
                  "nome": "Maria"
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/email/deliveries/{id}": {
      "get": {
        "tags": [
          "E-mail"
        ],
        "summary": "Estado de um envio",
        "description": "Permissão: `email:read`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/templates": {
      "get": {
        "tags": [
          "Modelos"
        ],
        "summary": "Listar modelos",
        "description": "Permissão: `templates:read`.",
        "responses": {
          "200": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "models": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Modelos"
        ],
        "summary": "Criar um modelo de e-mail",
        "description": "Permissão: `templates:write`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "subject",
                  "content"
                ],
                "properties": {
                  "subject": {
                    "type": "string"
                  },
                  "content": {
                    "type": "string"
                  },
                  "variables": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "example": {
                "subject": "Olá {nome}",
                "content": "O seu pedido foi confirmado, {nome}.",
                "variables": [
                  "nome"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/templates/{id}/status": {
      "post": {
        "tags": [
          "Modelos"
        ],
        "summary": "Ativar ou desativar um modelo",
        "description": "Permissão: `templates:write`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "ACTIVE",
                      "INACTIVE"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/verify/verifications": {
      "post": {
        "tags": [
          "Códigos de verificação"
        ],
        "summary": "Gerar e enviar um código",
        "description": "Permissão: `verify:create`.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Chave única por pedido (8–160 caracteres). Repetir com a mesma chave devolve o mesmo resultado sem enviar de novo.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "channel",
                  "recipient",
                  "purpose"
                ],
                "properties": {
                  "channel": {
                    "type": "string",
                    "enum": [
                      "EMAIL",
                      "WHATSAPP",
                      "SMS"
                    ]
                  },
                  "recipient": {
                    "type": "string",
                    "description": "E-mail ou telefone com indicativo do país."
                  },
                  "purpose": {
                    "type": "string",
                    "description": "Finalidade, ex.: login, cadastro, pagamento."
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "FULL"
                    ],
                    "default": "FULL"
                  },
                  "ttlSeconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 3600
                  },
                  "locale": {
                    "type": "string",
                    "example": "pt-BR"
                  }
                }
              },
              "example": {
                "channel": "WHATSAPP",
                "recipient": "+5511999999999",
                "purpose": "login"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "verificationState": {
                          "type": "string",
                          "enum": [
                            "PENDING",
                            "APPROVED",
                            "REJECTED",
                            "EXPIRED",
                            "CANCELLED"
                          ]
                        },
                        "expiresAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/verify/verifications/{id}": {
      "get": {
        "tags": [
          "Códigos de verificação"
        ],
        "summary": "Estado de uma verificação",
        "description": "Permissão: `verify:read`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "verificationState": {
                          "type": "string",
                          "enum": [
                            "PENDING",
                            "APPROVED",
                            "REJECTED",
                            "EXPIRED",
                            "CANCELLED"
                          ]
                        },
                        "expiresAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/verify/verifications/{id}/check": {
      "post": {
        "tags": [
          "Códigos de verificação"
        ],
        "summary": "Validar o código digitado",
        "description": "Permissão: `verify:check`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "code": "123456"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "verified": {
                          "type": "boolean"
                        },
                        "verificationState": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/verify/verifications/{id}/resend": {
      "post": {
        "tags": [
          "Códigos de verificação"
        ],
        "summary": "Reenviar o código",
        "description": "Permissão: `verify:create`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "verificationState": {
                          "type": "string",
                          "enum": [
                            "PENDING",
                            "APPROVED",
                            "REJECTED",
                            "EXPIRED",
                            "CANCELLED"
                          ]
                        },
                        "expiresAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/verify/verifications/{id}/cancel": {
      "post": {
        "tags": [
          "Códigos de verificação"
        ],
        "summary": "Cancelar a verificação",
        "description": "Permissão: `verify:create`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "verificationState": {
                          "type": "string",
                          "enum": [
                            "PENDING",
                            "APPROVED",
                            "REJECTED",
                            "EXPIRED",
                            "CANCELLED"
                          ]
                        },
                        "expiresAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/verify/deliveries": {
      "post": {
        "tags": [
          "Códigos de verificação"
        ],
        "summary": "Enviar um código gerado pelo seu sistema",
        "description": "Permissão: `verify:create`.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Chave única por pedido (8–160 caracteres). Repetir com a mesma chave devolve o mesmo resultado sem enviar de novo.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "channel",
                  "recipient",
                  "purpose",
                  "mode"
                ],
                "properties": {
                  "channel": {
                    "type": "string",
                    "enum": [
                      "EMAIL",
                      "WHATSAPP",
                      "SMS"
                    ]
                  },
                  "recipient": {
                    "type": "string",
                    "description": "E-mail ou telefone com indicativo do país."
                  },
                  "purpose": {
                    "type": "string",
                    "description": "Finalidade, ex.: login, cadastro, pagamento."
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "SEND_ONLY",
                      "CUSTOM"
                    ]
                  },
                  "ttlSeconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 3600
                  },
                  "locale": {
                    "type": "string",
                    "example": "pt-BR"
                  },
                  "code": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "channel": "SMS",
                "recipient": "+5511999999999",
                "purpose": "login",
                "mode": "CUSTOM",
                "code": "482913"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "verificationState": {
                          "type": "string",
                          "enum": [
                            "PENDING",
                            "APPROVED",
                            "REJECTED",
                            "EXPIRED",
                            "CANCELLED"
                          ]
                        },
                        "expiresAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/sms/messages": {
      "post": {
        "tags": [
          "SMS"
        ],
        "summary": "Enviar um SMS",
        "description": "Permissão: `sms:send`.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Chave única por pedido (8–160 caracteres). Repetir com a mesma chave devolve o mesmo resultado sem enviar de novo.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "to"
                ],
                "properties": {
                  "to": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string",
                    "enum": [
                      "BR",
                      "AO",
                      "MZ"
                    ],
                    "default": "BR"
                  },
                  "template": {
                    "type": "string"
                  },
                  "variables": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "text": {
                    "type": "string"
                  },
                  "purpose": {
                    "type": "string",
                    "enum": [
                      "TRANSACTIONAL",
                      "MARKETING"
                    ],
                    "default": "TRANSACTIONAL"
                  },
                  "reference": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "to": "+5511999999999",
                "country": "BR",
                "template": "cobranca_lembrete",
                "variables": {
                  "nome": "Maria",
                  "valor": "R$ 120,00"
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "segments": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/sms/messages/{id}": {
      "get": {
        "tags": [
          "SMS"
        ],
        "summary": "Estado de um SMS",
        "description": "Permissão: `sms:read`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "QUEUED",
                            "SENDING",
                            "SENT",
                            "DELIVERED",
                            "FAILED",
                            "UNKNOWN",
                            "BLOCKED",
                            "CANCELLED"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/whatsapp/messages": {
      "post": {
        "tags": [
          "WhatsApp"
        ],
        "summary": "Enviar uma mensagem",
        "description": "Permissão: `messages:send`.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Chave única por pedido (8–160 caracteres). Repetir com a mesma chave devolve o mesmo resultado sem enviar de novo.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "to",
                  "type"
                ],
                "properties": {
                  "phoneNumberId": {
                    "type": "string",
                    "description": "Opcional; sem ele usa o número principal."
                  },
                  "to": {
                    "type": "string",
                    "description": "Só dígitos, com indicativo do país."
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "text",
                      "template"
                    ]
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 4096
                  },
                  "name": {
                    "type": "string",
                    "description": "Nome do template (type=template)."
                  },
                  "language": {
                    "type": "string"
                  },
                  "variables": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "consent": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "to": "5511999999999",
                "type": "text",
                "text": "Olá!"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "providerMessageId": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/whatsapp/templates": {
      "get": {
        "tags": [
          "WhatsApp"
        ],
        "summary": "Templates aprovados do número",
        "description": "Permissão: `templates:read`.",
        "responses": {
          "200": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "templates": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/whatsapp/events": {
      "get": {
        "tags": [
          "WhatsApp"
        ],
        "summary": "Eventos recebidos (mensagens e estados)",
        "description": "Permissão: `events:read`.",
        "responses": {
          "200": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/whatsapp/status": {
      "get": {
        "tags": [
          "WhatsApp"
        ],
        "summary": "Estado da conexão WhatsApp",
        "description": "Permissão: `connections:read`.",
        "responses": {
          "200": {
            "description": "Pedido aceite",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  }
}