{
  "openapi": "3.0.3",
  "info": {
    "title": "Belvitur Eventos API",
    "version": "5.13.0",
    "description": "API de integração para gerenciamento de eventos, convidados, vouchers, agenda, acompanhantes, notificações e webhooks do Belvitur Eventos — aplicativo completo para gestão de eventos corporativos.",
    "contact": {
      "email": "eventos@belvitur.com.br"
    }
  },
  "servers": [
    {
      "url": "https://api-eventosapp.beflytech.com.br/api/v1/backoffice-api",
      "description": "Production"
    }
  ],
  "security": [
    { "bearerAuth": [] }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "OAuth 2.0 Client Credentials token"
      }
    }
  },
  "paths": {
    "/events": {
      "get": {
        "tags": ["Events"],
        "summary": "Listar Eventos",
        "operationId": "listEvents",
        "responses": { "200": { "description": "Lista de eventos" } }
      },
      "post": {
        "tags": ["Events"],
        "summary": "Criar Evento",
        "operationId": "createEvent",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object" } } } },
        "responses": { "201": { "description": "Evento criado" } }
      }
    },
    "/events/{id}": {
      "get": {
        "tags": ["Events"],
        "summary": "Obter Evento",
        "operationId": "getEvent",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Evento encontrado" } }
      },
      "put": {
        "tags": ["Events"],
        "summary": "Atualizar Evento",
        "operationId": "updateEvent",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object" } } } },
        "responses": { "200": { "description": "Evento atualizado" } }
      },
      "delete": {
        "tags": ["Events"],
        "summary": "Deletar Evento",
        "operationId": "deleteEvent",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Evento deletado" } }
      }
    },
    "/guests": {
      "get": {
        "tags": ["Guests"],
        "summary": "Listar Convidados",
        "operationId": "listGuests",
        "parameters": [{ "name": "event_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Lista de convidados" } }
      },
      "post": {
        "tags": ["Guests"],
        "summary": "Criar Convidado",
        "operationId": "createGuest",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object" } } } },
        "responses": { "201": { "description": "Convidado criado" } }
      }
    },
    "/guests/{id}": {
      "put": {
        "tags": ["Guests"],
        "summary": "Atualizar Convidado",
        "operationId": "updateGuest",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Convidado atualizado" } }
      },
      "delete": {
        "tags": ["Guests"],
        "summary": "Deletar Convidado",
        "operationId": "deleteGuest",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Convidado removido" } }
      }
    },
    "/pending-guests": {
      "get": {
        "tags": ["Guests"],
        "summary": "Listar Convidados Pendentes",
        "operationId": "listPendingGuests",
        "parameters": [{ "name": "event_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Lista de convidados pendentes" } }
      }
    },
    "/profiles/{user_id}": {
      "get": {
        "tags": ["Profiles"],
        "summary": "Obter Perfil",
        "operationId": "getProfile",
        "parameters": [{ "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Perfil do usuário" } }
      },
      "put": {
        "tags": ["Profiles"],
        "summary": "Atualizar Perfil",
        "operationId": "updateProfile",
        "parameters": [{ "name": "user_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Perfil atualizado" } }
      }
    },
    "/vouchers": {
      "get": {
        "tags": ["Vouchers"],
        "summary": "Listar Vouchers",
        "operationId": "listVouchers",
        "parameters": [{ "name": "event_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Lista de vouchers" } }
      },
      "post": {
        "tags": ["Vouchers"],
        "summary": "Criar Voucher",
        "operationId": "createVoucher",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object" } } } },
        "responses": { "201": { "description": "Voucher criado" } }
      }
    },
    "/vouchers/{id}": {
      "get": {
        "tags": ["Vouchers"],
        "summary": "Obter Voucher",
        "operationId": "getVoucher",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Voucher encontrado" } }
      },
      "put": {
        "tags": ["Vouchers"],
        "summary": "Atualizar Voucher",
        "operationId": "updateVoucher",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Voucher atualizado" } }
      },
      "delete": {
        "tags": ["Vouchers"],
        "summary": "Deletar Voucher",
        "operationId": "deleteVoucher",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Voucher deletado" } }
      }
    },
    "/vouchers/bulk": {
      "post": {
        "tags": ["Vouchers"],
        "summary": "Criar Vouchers em Lote",
        "operationId": "createVouchersBulk",
        "responses": { "201": { "description": "Vouchers criados" } }
      }
    },
    "/vouchers/{id}/guests": {
      "post": {
        "tags": ["Vouchers"],
        "summary": "Adicionar Convidados ao Voucher",
        "operationId": "addVoucherGuests",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "201": { "description": "Convidados adicionados" } }
      }
    },
    "/vouchers/{id}/attachments": {
      "get": {
        "tags": ["Vouchers"],
        "summary": "Listar Anexos do Voucher",
        "operationId": "listVoucherAttachments",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Lista de anexos" } }
      },
      "post": {
        "tags": ["Vouchers"],
        "summary": "Registrar Anexo",
        "operationId": "createVoucherAttachment",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "201": { "description": "Anexo registrado" } }
      }
    },
    "/vouchers/changes": {
      "get": {
        "tags": ["Vouchers"],
        "summary": "Feed de Alterações",
        "operationId": "listVoucherChanges",
        "parameters": [{ "name": "event_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Lista de alterações" } }
      }
    },
    "/hotel-reservations": {
      "get": {
        "tags": ["Hotel Reservations"],
        "summary": "Listar Reservas de Hotel",
        "operationId": "listHotelReservations",
        "parameters": [{ "name": "event_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Lista de reservas" } }
      },
      "post": {
        "tags": ["Hotel Reservations"],
        "summary": "Criar Reserva de Hotel",
        "operationId": "createHotelReservation",
        "responses": { "201": { "description": "Reserva criada" } }
      }
    },
    "/hotel-reservations/{id}": {
      "get": {
        "tags": ["Hotel Reservations"],
        "summary": "Obter Reserva",
        "operationId": "getHotelReservation",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Reserva encontrada" } }
      },
      "put": {
        "tags": ["Hotel Reservations"],
        "summary": "Atualizar Reserva",
        "operationId": "updateHotelReservation",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Reserva atualizada" } }
      },
      "delete": {
        "tags": ["Hotel Reservations"],
        "summary": "Deletar Reserva",
        "operationId": "deleteHotelReservation",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Reserva deletada" } }
      }
    },
    "/hotel-reservations/{id}/rooming-preferences": {
      "get": {
        "tags": ["Hotel Reservations"],
        "summary": "Listar Preferências de Rooming",
        "operationId": "listRoomingPreferences",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Preferências listadas" } }
      }
    },
    "/hotel-reservations/{id}/rooming-suggest": {
      "post": {
        "tags": ["Hotel Reservations"],
        "summary": "Gerar Sugestões de Rooming",
        "operationId": "suggestRooming",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Sugestões geradas" } }
      }
    },
    "/hotel-reservations/{id}/rooming-confirm": {
      "post": {
        "tags": ["Hotel Reservations"],
        "summary": "Confirmar Alocações",
        "operationId": "confirmRooming",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Alocações confirmadas" } }
      }
    },
    "/hotel-reservations/{id}/rooming-list": {
      "get": {
        "tags": ["Hotel Reservations"],
        "summary": "Consultar Rooming List",
        "operationId": "getRoomingList",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Rooming list" } }
      }
    },
    "/agenda": {
      "get": {
        "tags": ["Agenda"],
        "summary": "Listar Itens da Agenda",
        "operationId": "listAgenda",
        "parameters": [{ "name": "event_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Lista de itens" } }
      },
      "post": {
        "tags": ["Agenda"],
        "summary": "Criar Item da Agenda",
        "operationId": "createAgendaItem",
        "responses": { "201": { "description": "Item criado" } }
      }
    },
    "/agenda/bulk": {
      "post": {
        "tags": ["Agenda"],
        "summary": "Criar Itens em Lote",
        "operationId": "createAgendaBulk",
        "responses": { "201": { "description": "Itens criados" } }
      }
    },
    "/agenda/{id}": {
      "put": {
        "tags": ["Agenda"],
        "summary": "Atualizar Item",
        "operationId": "updateAgendaItem",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Item atualizado" } }
      },
      "delete": {
        "tags": ["Agenda"],
        "summary": "Deletar Item",
        "operationId": "deleteAgendaItem",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Item deletado" } }
      }
    },
    "/companions": {
      "get": {
        "tags": ["Companions"],
        "summary": "Listar Acompanhantes",
        "operationId": "listCompanions",
        "parameters": [{ "name": "event_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Lista de acompanhantes" } }
      },
      "post": {
        "tags": ["Companions"],
        "summary": "Criar Vínculo de Acompanhante",
        "operationId": "createCompanion",
        "responses": { "201": { "description": "Vínculo criado" } }
      },
      "delete": {
        "tags": ["Companions"],
        "summary": "Deletar Vínculo por Pending Guest ID",
        "operationId": "deleteCompanionByPendingId",
        "parameters": [
          { "name": "companion_pending_guest_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" } },
          { "name": "event_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" } }
        ],
        "responses": { "200": { "description": "Vínculo deletado" } }
      }
    },
    "/companions/{id}": {
      "get": {
        "tags": ["Companions"],
        "summary": "Obter Acompanhante",
        "operationId": "getCompanion",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Acompanhante encontrado" } }
      },
      "delete": {
        "tags": ["Companions"],
        "summary": "Deletar Vínculo",
        "operationId": "deleteCompanion",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Vínculo deletado" } }
      }
    },
    "/notifications": {
      "get": {
        "tags": ["Notifications"],
        "summary": "Listar Notificações",
        "operationId": "listNotifications",
        "parameters": [{ "name": "event_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Lista de notificações" } }
      },
      "post": {
        "tags": ["Notifications"],
        "summary": "Enviar Notificação",
        "operationId": "sendNotification",
        "responses": { "201": { "description": "Notificação enviada" } }
      }
    },
    "/health": {
      "get": {
        "tags": ["Health"],
        "summary": "Health Check",
        "operationId": "healthCheck",
        "security": [],
        "responses": { "200": { "description": "API online" } }
      }
    },
    "/webhooks": {
      "get": {
        "tags": ["Webhooks"],
        "summary": "Listar Webhooks",
        "operationId": "listWebhooks",
        "responses": { "200": { "description": "Lista de endpoints" } }
      },
      "post": {
        "tags": ["Webhooks"],
        "summary": "Criar Webhook",
        "operationId": "createWebhook",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object" } } } },
        "responses": { "201": { "description": "Webhook criado (retorna `secret` apenas nesta resposta)" } }
      }
    },
    "/webhooks/{id}": {
      "get": {
        "tags": ["Webhooks"],
        "summary": "Obter Webhook",
        "operationId": "getWebhook",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Detalhes do webhook" } }
      },
      "patch": {
        "tags": ["Webhooks"],
        "summary": "Atualizar Webhook",
        "operationId": "updateWebhook",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object" } } } },
        "responses": { "200": { "description": "Webhook atualizado" } }
      },
      "delete": {
        "tags": ["Webhooks"],
        "summary": "Deletar Webhook",
        "operationId": "deleteWebhook",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Webhook removido" } }
      }
    },
    "/webhooks/{id}/deliveries": {
      "get": {
        "tags": ["Webhooks"],
        "summary": "Histórico de Entregas",
        "operationId": "listWebhookDeliveries",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Últimas 100 entregas" } }
      }
    },
    "/webhooks/{id}/redeliver/{deliveryId}": {
      "post": {
        "tags": ["Webhooks"],
        "summary": "Reenviar Entrega",
        "operationId": "redeliverWebhook",
        "parameters": [
          { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } },
          { "name": "deliveryId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }
        ],
        "responses": { "200": { "description": "Reenvio enfileirado" } }
      }
    },
    "/webhooks/{id}/test": {
      "post": {
        "tags": ["Webhooks"],
        "summary": "Disparar Evento de Teste",
        "operationId": "testWebhook",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": { "200": { "description": "Evento webhook.test disparado" } }
      }
    }
  }
}
