{"openapi":"3.0.3","info":{"title":"Partiu Formatura - API Gateway","description":"API para consultas externas ao sistema Partiu Formatura.\n\n## Autenticação\n\nUtilize o fluxo **OAuth2 Client Credentials** para obter um token de acesso:\n\n1. Faça um `POST` em `/oauth/{tenantId}/token` com suas credenciais\n2. Use o `access_token` retornado no header `Authorization: Bearer <token>`\n\n## Scopes disponíveis\n\n| Scope | Descrição |\n|-------|-----------|\n| `read` | Leitura de dados gerais |\n| `read:classes` | Leitura de turmas, subturmas e configurações |\n| `read:students` | Leitura de formandos e planos |\n| `read:financeiro` | Leitura de parcelas e dados financeiros |\n| `write:financeiro` | Escrita financeira (receber eventos inbound de parcelas) |\n| `read:eventos` | Leitura de eventos, ingressos e agenda |\n| `read:atendimento` | Leitura de tickets de suporte e histórico de atendimentos |\n| `read:webhooks` | Leitura de endpoints, entregas e histórico de eventos |\n| `write:webhooks` | Cadastrar endpoints, rotacionar segredos e reenviar entregas |\n| `write` | Escrita de dados gerais |\n\n## Versionamento\n\nAs rotas de negócio vivem sob **`/v1`**. As mesmas rotas continuam atendendo\nsem o prefixo, como alias permanente, para não quebrar integrações anteriores.\nRotas novas nascem só em `/v1`. Toda resposta traz o header `X-API-Version`.\n\n## Sincronização incremental\n\nAs listagens aceitam `updated_since` (ISO 8601) para trazer só o que mudou, e\ndevolvem `pagination.next_cursor` para você continuar de onde parou passando\n`cursor`. Nesse modo a ordenação é por `updated_at, id`, então nenhum\nregistro é pulado nem repetido entre páginas.\n\n## Webhooks\n\n**Inbound** (parceiro escreve no sistema): `POST /v1/webhooks/inbound`, com\n**OAuth2 Bearer** (scope `write:financeiro`) **e** assinatura **HMAC-SHA256**\nno header `X-Signature` (`t=<unix>,v1=<hmac>`), calculada com o segredo\ngerado em `POST /v1/webhooks/inbound/secret`. Idempotente pelo `id` do corpo.\n\n**Outbound** (o gateway avisa o parceiro): cadastre uma URL em\n`POST /v1/webhooks/endpoints` e receba os eventos assinados com o mesmo\nalgoritmo, na direção contrária. Retentativa com espera crescente até 24h.\nO catálogo de eventos está em `GET /v1/webhooks/event-types`.\n\n## Rate Limiting\n\n- Endpoints gerais: **100 requisições/minuto** por client autenticado\n- Endpoint de token: **20 requisições/minuto**\n\nHeaders de rate limit retornados: `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`\n","version":"1.0.0","contact":{"name":"Partiu Formatura - Suporte API","email":"suporte@partiuformatura.com.br"}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Token JWT obtido via /oauth/{tenantId}/token"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição do erro"}},"required":["error","message"]},"TokenRequest":{"type":"object","required":["grant_type","client_id","client_secret"],"properties":{"grant_type":{"type":"string","enum":["client_credentials"],"description":"Tipo de concessão OAuth2","example":"client_credentials"},"client_id":{"type":"string","description":"Identificador do client","example":"pf_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4"},"client_secret":{"type":"string","description":"Segredo do client","example":"seu_client_secret_aqui"},"scope":{"type":"string","description":"Scopes solicitados separados por espaço","example":"read read:turmas"}}},"TokenResponse":{"type":"object","properties":{"access_token":{"type":"string","description":"Token JWT de acesso","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"token_type":{"type":"string","enum":["Bearer"],"description":"Tipo do token","example":"Bearer"},"expires_in":{"type":"number","description":"Tempo de expiração em segundos","example":3600},"scope":{"type":"string","description":"Scopes concedidos","example":"read read:turmas"}}},"HealthResponse":{"type":"object","properties":{"status":{"type":"string","example":"ok"},"timestamp":{"type":"string","format":"date-time","example":"2026-04-07T12:00:00.000Z"},"version":{"type":"string","example":"1.0.0"}}}}},"paths":{"/health":{"get":{"summary":"Health check","tags":["Sistema"],"description":"Status do gateway e versão.","security":[],"responses":{"200":{"description":"Sistema operacional","content":{"application/json":{"schema":{"description":"Sistema operacional","type":"object","properties":{"status":{"type":"string","description":"ok"},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}}}}}}}}},"/health/live":{"get":{"summary":"Liveness probe","tags":["Sistema"],"description":"Responde 200 enquanto o processo estiver vivo.","security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}}}}}}}}},"/health/ready":{"get":{"summary":"Readiness probe","tags":["Sistema"],"description":"Retorna 503 quando o gateway não está apto a atender requisições.","security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}}}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}}}}}}}}},"/v1/oauth/{tenantId}/token":{"post":{"summary":"Obter token de acesso","tags":["Autenticação"],"description":"Gera um token de acesso OAuth2 via **client_credentials**.\n\nO `tenantId` na URL é o UUID público da empresa (diferente do ID interno).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["grant_type","client_id","client_secret"],"properties":{"grant_type":{"type":"string","enum":["client_credentials"],"description":"Tipo de concessão OAuth2","example":"client_credentials"},"client_id":{"type":"string","description":"Identificador do client","example":"pf_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4"},"client_secret":{"type":"string","description":"Segredo do client","example":"seu_client_secret_aqui"},"scope":{"type":"string","description":"Scopes solicitados separados por espaço","example":"read read:turmas"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"tenantId","required":true,"description":"UUID público da empresa"}],"security":[],"responses":{"200":{"description":"Token gerado com sucesso","content":{"application/json":{"schema":{"description":"Token gerado com sucesso","type":"object","properties":{"access_token":{"type":"string","description":"Token JWT de acesso"},"token_type":{"type":"string","enum":["Bearer"],"description":"Tipo do token"},"expires_in":{"type":"number","description":"Tempo de expiração em segundos"},"scope":{"type":"string","description":"Scopes concedidos"}}}}}},"400":{"description":"Requisição inválida (grant_type ou scope inválido)","content":{"application/json":{"schema":{"description":"Requisição inválida (grant_type ou scope inválido)","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"401":{"description":"Credenciais inválidas","content":{"application/json":{"schema":{"description":"Credenciais inválidas","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"429":{"description":"Rate limit excedido","content":{"application/json":{"schema":{"description":"Rate limit excedido","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes":{"get":{"summary":"List classes","tags":["Classes"],"description":"Returns a paginated list of classes (turmas) for the authenticated tenant.\n\n### Filters\n- `active` - filter by active/inactive status\n- `graduation_year` - filter by graduation year\n- `search` - search by name, course, or institution","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false,"description":"Número da página"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false,"description":"Itens por página"},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"updated_since","required":false,"description":"Retorna apenas registros alterados a partir desta data (ISO 8601). Use para sincronização incremental."},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false,"description":"Cursor opaco devolvido em `pagination.next_cursor`. Quando informado, `page` é ignorado."},{"schema":{"type":"boolean"},"in":"query","name":"active","required":false,"description":"Filter by active status"},{"schema":{"type":"integer"},"in":"query","name":"graduation_year","required":false,"description":"Filter by graduation year"},{"schema":{"type":"string"},"in":"query","name":"search","required":false,"description":"Search by name, course, or institution"}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"List of classes","content":{"application/json":{"schema":{"description":"List of classes","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"code":{"type":"string"},"name":{"type":"string"},"course":{"type":"string"},"institution":{"type":"string"},"graduation_year":{"type":"integer"},"is_active":{"type":"boolean"},"max_users":{"type":"integer"},"registered_users":{"type":"integer"},"description":{"type":"string","nullable":true},"graduation_date":{"type":"string","format":"date","nullable":true},"ceremony_date":{"type":"string","format":"date","nullable":true},"ceremony_time":{"type":"string","nullable":true},"party_date":{"type":"string","format":"date","nullable":true},"city":{"type":"string","nullable":true},"state":{"type":"string","nullable":true},"ceremony_location":{"type":"string","nullable":true},"party_location":{"type":"string","nullable":true},"primary_color":{"type":"string","nullable":true},"secondary_color":{"type":"string","nullable":true},"logo_url":{"type":"string","nullable":true},"cover_image_url":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{id}/summary":{"get":{"summary":"Get class summary","tags":["Classes"],"description":"Returns aggregated statistics for a class: total students, counts by status, active users, overdue installments, and linked plans.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"id","required":true,"description":"Class ID"}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"Class summary","content":{"application/json":{"schema":{"description":"Class summary","type":"object","properties":{"class_id":{"type":"integer"},"class_name":{"type":"string"},"total_students":{"type":"integer"},"active_students":{"type":"integer"},"students_by_status":{"type":"object","properties":{"pendente":{"type":"integer"},"aprovado":{"type":"integer"},"rejeitado":{"type":"integer"},"cancelado":{"type":"integer"}}},"max_users":{"type":"integer"},"total_subgroups":{"type":"integer"},"total_plans":{"type":"integer"},"total_with_overdue":{"type":"integer"},"total_with_contract":{"type":"integer"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Class not found","content":{"application/json":{"schema":{"description":"Class not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{id}/financial-summary":{"get":{"summary":"Get class financial summary","tags":["Classes"],"description":"Returns financial aggregation for a class: totals expected, received, overdue, pending, and installment counts by status.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"id","required":true,"description":"Class ID"}],"security":[{"bearerAuth":["read:financeiro"]}],"responses":{"200":{"description":"Financial summary","content":{"application/json":{"schema":{"description":"Financial summary","type":"object","properties":{"class_id":{"type":"integer"},"paying_students":{"type":"integer"},"total_installments":{"type":"integer"},"installments_paid":{"type":"integer"},"installments_courtesy":{"type":"integer"},"installments_pending":{"type":"integer"},"installments_overdue":{"type":"integer"},"total_expected":{"type":"number"},"total_received":{"type":"number"},"total_received_real":{"type":"number"},"total_courtesy":{"type":"number"},"total_pending":{"type":"number"},"total_overdue":{"type":"number"},"total_upcoming":{"type":"number"},"total_interest":{"type":"number"},"total_fines":{"type":"number"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Class not found","content":{"application/json":{"schema":{"description":"Class not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{id}/settings":{"get":{"summary":"Get class settings","tags":["Classes"],"description":"Returns configuration and settings for a class: contract requirements, payment configuration, registration limits, custom fields, and committee contacts.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"id","required":true,"description":"Class ID"}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"Class settings","content":{"application/json":{"schema":{"description":"Class settings","type":"object","properties":{"class_id":{"type":"integer"},"registration":{"type":"object","properties":{"requires_contract":{"type":"boolean"},"allows_pre_registration":{"type":"boolean"},"auto_approve":{"type":"boolean"},"max_users":{"type":"integer"},"requires_profile_photo":{"type":"boolean"},"simple_registration":{"type":"boolean"},"simple_registration_plan_id":{"type":"integer","nullable":true},"code_usage_deadline":{"type":"string","format":"date-time","nullable":true},"contract_signing_deadline":{"type":"string","format":"date-time","nullable":true}}},"payment":{"type":"object","properties":{"accept_payment":{"type":"boolean"},"accepted_methods":{"type":"string","nullable":true},"billing_start_days":{"type":"integer","nullable":true},"payment_deadline":{"type":"string","format":"date-time","nullable":true}}},"contract_text":{"type":"string","nullable":true},"custom_fields":{"type":"object","nullable":true},"committee":{"type":"object","properties":{"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"whatsapp":{"type":"string","nullable":true},"instagram":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Class not found","content":{"application/json":{"schema":{"description":"Class not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{id}":{"get":{"summary":"Get class by ID","tags":["Classes"],"description":"Returns a single class (turma) by its ID.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"id","required":true,"description":"Class ID"}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"Class details","content":{"application/json":{"schema":{"description":"Class details","type":"object","properties":{"id":{"type":"integer"},"code":{"type":"string"},"name":{"type":"string"},"course":{"type":"string"},"institution":{"type":"string"},"graduation_year":{"type":"integer"},"is_active":{"type":"boolean"},"max_users":{"type":"integer"},"registered_users":{"type":"integer"},"description":{"type":"string","nullable":true},"graduation_date":{"type":"string","format":"date","nullable":true},"ceremony_date":{"type":"string","format":"date","nullable":true},"ceremony_time":{"type":"string","nullable":true},"party_date":{"type":"string","format":"date","nullable":true},"city":{"type":"string","nullable":true},"state":{"type":"string","nullable":true},"ceremony_location":{"type":"string","nullable":true},"party_location":{"type":"string","nullable":true},"primary_color":{"type":"string","nullable":true},"secondary_color":{"type":"string","nullable":true},"logo_url":{"type":"string","nullable":true},"cover_image_url":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Class not found","content":{"application/json":{"schema":{"description":"Class not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/students":{"get":{"summary":"List students","tags":["Students"],"description":"Returns a paginated list of students (pre-registered graduates) for the authenticated tenant.\n\n### Filters\n- `class_id` - filter by class (turma)\n- `status` - filter by registration status (pendente, aprovado, reprovado)\n- `student_type` - filter by type (formando, convidado)\n- `search` - search by name, email, or CPF\n\n### Sincronização incremental\nInforme `updated_since` (ISO 8601) para receber apenas o que mudou desde a\núltima carga. A resposta traz `pagination.next_cursor`: repasse em `cursor`\npara buscar o restante. Nesse modo a ordenação é por `updated_at, id`, então\nnenhum registro é pulado nem repetido entre páginas.","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false,"description":"Número da página"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false,"description":"Itens por página"},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"updated_since","required":false,"description":"Retorna apenas registros alterados a partir desta data (ISO 8601). Use para sincronização incremental."},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false,"description":"Cursor opaco devolvido em `pagination.next_cursor`. Quando informado, `page` é ignorado."},{"schema":{"type":"integer"},"in":"query","name":"class_id","required":false,"description":"Filter by class ID"},{"schema":{"type":"string"},"in":"query","name":"status","required":false,"description":"Filter by status (pendente, aprovado, reprovado)"},{"schema":{"type":"string"},"in":"query","name":"student_type","required":false,"description":"Filter by type (formando, convidado)"},{"schema":{"type":"string"},"in":"query","name":"search","required":false,"description":"Search by name, email, or CPF"}],"security":[{"bearerAuth":["read:students"]}],"responses":{"200":{"description":"List of students","content":{"application/json":{"schema":{"description":"List of students","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"class_id":{"type":"integer"},"class_name":{"type":"string","nullable":true},"course":{"type":"string","nullable":true},"full_name":{"type":"string"},"social_name":{"type":"string","nullable":true},"email":{"type":"string"},"cpf":{"type":"string"},"phone":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"status":{"type":"string"},"student_type":{"type":"string"},"contract_accepted":{"type":"boolean","nullable":true},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/students/{id}":{"get":{"summary":"Get student by ID","tags":["Students"],"description":"Returns full details of a student (pre-registered graduate) by ID.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"id","required":true,"description":"Student ID"}],"security":[{"bearerAuth":["read:students"]}],"responses":{"200":{"description":"Student details","content":{"application/json":{"schema":{"description":"Student details","type":"object","properties":{"id":{"type":"integer"},"class_id":{"type":"integer"},"class_name":{"type":"string","nullable":true},"course":{"type":"string","nullable":true},"institution":{"type":"string","nullable":true},"full_name":{"type":"string"},"social_name":{"type":"string","nullable":true},"email":{"type":"string"},"cpf":{"type":"string"},"phone":{"type":"string","nullable":true},"mobile_phone":{"type":"string","nullable":true},"birth_date":{"type":"string","format":"date","nullable":true},"enrollment_number":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"status":{"type":"string"},"student_type":{"type":"string"},"registration_type":{"type":"string","nullable":true},"contract_accepted":{"type":"boolean","nullable":true},"contract_accepted_at":{"type":"string","format":"date-time","nullable":true},"gender":{"type":"string","nullable":true},"sex":{"type":"string","nullable":true},"marital_status":{"type":"string","nullable":true},"nationality":{"type":"string","nullable":true},"address":{"type":"object","nullable":true,"properties":{"street":{"type":"string","nullable":true},"number":{"type":"string","nullable":true},"complement":{"type":"string","nullable":true},"neighborhood":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"state":{"type":"string","nullable":true},"zip_code":{"type":"string","nullable":true}}},"parents":{"type":"object","nullable":true,"properties":{"father_name":{"type":"string","nullable":true},"father_status":{"type":"string","nullable":true},"mother_name":{"type":"string","nullable":true},"mother_status":{"type":"string","nullable":true}}},"financial_responsible":{"type":"object","nullable":true,"properties":{"name":{"type":"string","nullable":true},"cpf":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}}},"notes":{"type":"string","nullable":true},"instagram":{"type":"string","nullable":true},"shirt_size":{"type":"string","nullable":true},"gown_size":{"type":"string","nullable":true},"blood_type":{"type":"string","nullable":true},"allergies":{"type":"string","nullable":true},"dietary_restrictions":{"type":"string","nullable":true},"special_needs":{"type":"string","nullable":true},"approved_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Student not found","content":{"application/json":{"schema":{"description":"Student not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/students/{id}/plan":{"get":{"summary":"Get student graduation plan","tags":["Students"],"description":"Returns the graduation plan linked to a student, if any.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"id","required":true,"description":"Student (pre_cadastro) ID"}],"security":[{"bearerAuth":["read:students"]}],"responses":{"200":{"description":"Student plan","content":{"application/json":{"schema":{"description":"Student plan","type":"object","properties":{"student_id":{"type":"integer"},"has_plan":{"type":"boolean"},"plan":{"type":"object","nullable":true,"properties":{"id":{"type":"integer"},"name":{"type":"string"},"status":{"type":"string"},"assigned_at":{"type":"string","format":"date-time","nullable":true}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Student not found","content":{"application/json":{"schema":{"description":"Student not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{classId}/students/summary":{"get":{"summary":"Get students summary by class","tags":["Students"],"description":"Returns aggregated student counts for a class, grouped by status and type.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"classId","required":true,"description":"Class ID"}],"security":[{"bearerAuth":["read:students"]}],"responses":{"200":{"description":"Students summary","content":{"application/json":{"schema":{"description":"Students summary","type":"object","properties":{"class_id":{"type":"integer"},"total":{"type":"integer"},"by_status":{"type":"object","properties":{"pendente":{"type":"integer"},"aprovado":{"type":"integer"},"rejeitado":{"type":"integer"},"cancelado":{"type":"integer"}}},"by_type":{"type":"object","properties":{"formando":{"type":"integer"},"convidado":{"type":"integer"},"other":{"type":"integer"}}},"with_contract":{"type":"integer"},"without_contract":{"type":"integer"},"with_plan":{"type":"integer"},"without_plan":{"type":"integer"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{classId}/students":{"get":{"summary":"List students by class","tags":["Students"],"description":"Returns all students enrolled in a specific class.","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false,"description":"Page number"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false,"description":"Items per page"},{"schema":{"type":"string"},"in":"query","name":"status","required":false,"description":"Filter by status (pendente, aprovado, reprovado)"},{"schema":{"type":"string"},"in":"query","name":"student_type","required":false,"description":"Filter by type (formando, convidado)"},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true,"description":"Class ID"}],"security":[{"bearerAuth":["read:students"]}],"responses":{"200":{"description":"List of students in the class","content":{"application/json":{"schema":{"description":"List of students in the class","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"class_id":{"type":"integer"},"class_name":{"type":"string","nullable":true},"course":{"type":"string","nullable":true},"full_name":{"type":"string"},"social_name":{"type":"string","nullable":true},"email":{"type":"string"},"cpf":{"type":"string"},"phone":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"status":{"type":"string"},"student_type":{"type":"string"},"contract_accepted":{"type":"boolean","nullable":true},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{classId}/subgroups":{"get":{"summary":"List subgroups by class","tags":["Subgroups"],"description":"Returns all subgroups (subturmas) for a specific class, with student counts.","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false,"description":"Page number"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false,"description":"Items per page"},{"schema":{"type":"boolean"},"in":"query","name":"active","required":false,"description":"Filter by active status"},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true,"description":"Class ID"}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"List of subgroups","content":{"application/json":{"schema":{"description":"List of subgroups","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"class_id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"color":{"type":"string","nullable":true},"order":{"type":"integer"},"max_students":{"type":"integer","nullable":true},"is_active":{"type":"boolean"},"student_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{classId}/subgroups/{id}":{"get":{"summary":"Get subgroup by ID","tags":["Subgroups"],"description":"Returns a single subgroup (subturma) with its student count.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"classId","required":true,"description":"Class ID"},{"schema":{"type":"integer"},"in":"path","name":"id","required":true,"description":"Subgroup ID"}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"Subgroup details","content":{"application/json":{"schema":{"description":"Subgroup details","type":"object","properties":{"id":{"type":"integer"},"class_id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"color":{"type":"string","nullable":true},"order":{"type":"integer"},"max_students":{"type":"integer","nullable":true},"is_active":{"type":"boolean"},"student_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Subgroup not found","content":{"application/json":{"schema":{"description":"Subgroup not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{classId}/subgroups/{subgroupId}/students":{"get":{"summary":"List students by subgroup","tags":["Subgroups"],"description":"Returns all students enrolled in a specific subgroup within a class.","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false,"description":"Page number"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false,"description":"Items per page"},{"schema":{"type":"string"},"in":"query","name":"status","required":false,"description":"Filter by status (pendente, aprovado, reprovado)"},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true,"description":"Class ID"},{"schema":{"type":"integer"},"in":"path","name":"subgroupId","required":true,"description":"Subgroup ID"}],"security":[{"bearerAuth":["read:students"]}],"responses":{"200":{"description":"List of students in the subgroup","content":{"application/json":{"schema":{"description":"List of students in the subgroup","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"class_id":{"type":"integer"},"subgroup_id":{"type":"integer"},"subgroup_name":{"type":"string","nullable":true},"full_name":{"type":"string"},"social_name":{"type":"string","nullable":true},"email":{"type":"string"},"cpf":{"type":"string"},"phone":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"status":{"type":"string"},"student_type":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/students/{studentId}/installments":{"get":{"summary":"List student installments","tags":["Installments"],"description":"Returns all payment installments for a specific student (formando).\n\n### Filters\n- `status` - filter by payment status (pending, paid, PAGO, overdue, cortesia)","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false,"description":"Page number"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"in":"query","name":"per_page","required":false,"description":"Items per page"},{"schema":{"type":"string"},"in":"query","name":"status","required":false,"description":"Filter by status (pending, paid, overdue, cortesia)"},{"schema":{"type":"integer"},"in":"path","name":"studentId","required":true,"description":"Student (pre_cadastro) ID"}],"security":[{"bearerAuth":["read:financeiro"]}],"responses":{"200":{"description":"List of installments","content":{"application/json":{"schema":{"description":"List of installments","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"user_id":{"type":"integer"},"installment_number":{"type":"integer"},"amount":{"type":"number"},"due_date":{"type":"string","format":"date","nullable":true},"payment_date":{"type":"string","format":"date","nullable":true},"status":{"type":"string"},"interest_amount":{"type":"number","nullable":true},"fine_amount":{"type":"number","nullable":true},"created_at":{"type":"string","format":"date-time"}}}},"summary":{"type":"object","properties":{"total_amount":{"type":"number"},"paid_amount":{"type":"number"},"pending_amount":{"type":"number"},"overdue_amount":{"type":"number"},"total_installments":{"type":"integer"},"paid_installments":{"type":"integer"},"pending_installments":{"type":"integer"},"overdue_installments":{"type":"integer"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Student not found","content":{"application/json":{"schema":{"description":"Student not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/students/{studentId}/installments/{id}":{"get":{"summary":"Get installment by ID","tags":["Installments"],"description":"Returns full details of a specific payment installment including boleto URL, PIX QR code, and receipt.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"studentId","required":true,"description":"Student (pre_cadastro) ID"},{"schema":{"type":"integer"},"in":"path","name":"id","required":true,"description":"Installment ID"}],"security":[{"bearerAuth":["read:financeiro"]}],"responses":{"200":{"description":"Installment details","content":{"application/json":{"schema":{"description":"Installment details","type":"object","properties":{"id":{"type":"integer"},"user_id":{"type":"integer"},"installment_number":{"type":"integer"},"amount":{"type":"number"},"due_date":{"type":"string","format":"date","nullable":true},"payment_date":{"type":"string","format":"date","nullable":true},"status":{"type":"string"},"interest_amount":{"type":"number","nullable":true},"fine_amount":{"type":"number","nullable":true},"boleto_url":{"type":"string","nullable":true},"pix_qr_code":{"type":"string","nullable":true},"pix_qr_code_image":{"type":"string","nullable":true},"receipt_url":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Installment not found","content":{"application/json":{"schema":{"description":"Installment not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{classId}/installments":{"get":{"summary":"List installments by class","tags":["Installments"],"description":"Returns all payment installments for students in a specific class, with student names.\n\n### Filters\n- `status` - filter by payment status (pending, paid, PAGO, overdue, cortesia)\n- `due_from` / ` - due_to`filter by due date range","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false,"description":"Page number"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false,"description":"Items per page"},{"schema":{"type":"string"},"in":"query","name":"status","required":false,"description":"Filter by status (pending, paid, overdue, cortesia)"},{"schema":{"type":"string","format":"date"},"in":"query","name":"due_from","required":false,"description":"Filter due date from (YYYY-MM-DD)"},{"schema":{"type":"string","format":"date"},"in":"query","name":"due_to","required":false,"description":"Filter due date to (YYYY-MM-DD)"},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true,"description":"Class ID"}],"security":[{"bearerAuth":["read:financeiro"]}],"responses":{"200":{"description":"List of installments for the class","content":{"application/json":{"schema":{"description":"List of installments for the class","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"user_id":{"type":"integer"},"student_name":{"type":"string"},"student_email":{"type":"string"},"installment_number":{"type":"integer"},"amount":{"type":"number"},"due_date":{"type":"string","format":"date","nullable":true},"payment_date":{"type":"string","format":"date","nullable":true},"status":{"type":"string"},"interest_amount":{"type":"number","nullable":true},"fine_amount":{"type":"number","nullable":true},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{classId}/contracts":{"get":{"summary":"List contracts by class","tags":["Contracts"],"description":"Returns all contracts for a specific class.\n\n### Filters\n- `status` - filter by contract status (rascunho, ativo, assinado, cancelado, expirado)\n- `search` - search by title, contractor, or contracted name","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false,"description":"Filter by status"},{"schema":{"type":"string"},"in":"query","name":"search","required":false,"description":"Search by title or names"},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true,"description":"Class ID"}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"List of contracts","content":{"application/json":{"schema":{"description":"List of contracts","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"contract_number":{"type":"string"},"title":{"type":"string"},"contractor":{"type":"string"},"contractor_document":{"type":"string","nullable":true},"contracted":{"type":"string"},"contracted_document":{"type":"string","nullable":true},"contracted_user_id":{"type":"integer","nullable":true},"total_value":{"type":"number"},"status":{"type":"string"},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date","nullable":true},"signing_date":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{classId}/contracts/{id}":{"get":{"summary":"Get contract by ID","tags":["Contracts"],"description":"Returns full details of a contract, including signature information.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"classId","required":true,"description":"Class ID"},{"schema":{"type":"integer"},"in":"path","name":"id","required":true,"description":"Contract ID"}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"Contract details","content":{"application/json":{"schema":{"description":"Contract details","type":"object","properties":{"id":{"type":"integer"},"contract_number":{"type":"string"},"title":{"type":"string"},"contractor":{"type":"string"},"contractor_document":{"type":"string","nullable":true},"contracted":{"type":"string"},"contracted_document":{"type":"string","nullable":true},"contracted_user_id":{"type":"integer","nullable":true},"description":{"type":"string","nullable":true},"total_value":{"type":"number"},"payment_method":{"type":"string","nullable":true},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date","nullable":true},"signing_date":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string"},"contract_file_url":{"type":"string","nullable":true},"signed_file_url":{"type":"string","nullable":true},"signing_deadline_days":{"type":"integer","nullable":true},"signing_channel":{"type":"string","nullable":true},"signing_sent_at":{"type":"string","format":"date-time","nullable":true},"signatures":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"signer_type":{"type":"string","nullable":true},"signer_name":{"type":"string","nullable":true},"signer_email":{"type":"string","nullable":true},"status":{"type":"string"},"signed_at":{"type":"string","format":"date-time","nullable":true}}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Contract not found","content":{"application/json":{"schema":{"description":"Contract not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/students/{studentId}/contracts":{"get":{"summary":"List contracts by student","tags":["Contracts"],"description":"Returns all contracts associated with a specific student.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"studentId","required":true,"description":"Student (pre_cadastro) ID"}],"security":[{"bearerAuth":["read:students"]}],"responses":{"200":{"description":"List of contracts","content":{"application/json":{"schema":{"description":"List of contracts","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"contract_number":{"type":"string"},"title":{"type":"string"},"contractor":{"type":"string"},"contractor_document":{"type":"string","nullable":true},"contracted":{"type":"string"},"contracted_document":{"type":"string","nullable":true},"contracted_user_id":{"type":"integer","nullable":true},"total_value":{"type":"number"},"status":{"type":"string"},"start_date":{"type":"string","format":"date"},"end_date":{"type":"string","format":"date","nullable":true},"signing_date":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"}}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Student not found","content":{"application/json":{"schema":{"description":"Student not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/events":{"get":{"summary":"List events (tenant-wide)","tags":["Events"],"description":"Returns events across the whole tenant, regardless of class.\n\n### Filters\n- `status` - filter by status (ativo, cancelado, finalizado)\n- `type` - filter by event type\n- `class_id` - filter by class\n- `from` / ` - to`filter by date range","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false,"description":"Filter by status"},{"schema":{"type":"string"},"in":"query","name":"type","required":false,"description":"Filter by event type"},{"schema":{"type":"integer"},"in":"query","name":"class_id","required":false,"description":"Filter by class"},{"schema":{"type":"string","format":"date"},"in":"query","name":"from","required":false,"description":"Start date filter (YYYY-MM-DD)"},{"schema":{"type":"string","format":"date"},"in":"query","name":"to","required":false,"description":"End date filter (YYYY-MM-DD)"}],"security":[{"bearerAuth":["read:eventos"]}],"responses":{"200":{"description":"List of events","content":{"application/json":{"schema":{"description":"List of events","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string"},"start_date":{"type":"string","format":"date-time"},"end_date":{"type":"string","format":"date-time","nullable":true},"venue_name":{"type":"string","nullable":true},"venue_address":{"type":"string","nullable":true},"venue_city":{"type":"string","nullable":true},"requires_registration":{"type":"boolean"},"max_participants":{"type":"integer","nullable":true},"registered_participants":{"type":"integer"},"registration_fee":{"type":"number"},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{classId}/events":{"get":{"summary":"List events by class","tags":["Events"],"description":"Returns all events for a specific class.\n\n### Filters\n- `status` - filter by status (ativo, cancelado, finalizado)\n- `type` - filter by event type\n- `from` / ` - to`filter by date range","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false,"description":"Filter by status"},{"schema":{"type":"string"},"in":"query","name":"type","required":false,"description":"Filter by event type"},{"schema":{"type":"string","format":"date"},"in":"query","name":"from","required":false,"description":"Start date filter (YYYY-MM-DD)"},{"schema":{"type":"string","format":"date"},"in":"query","name":"to","required":false,"description":"End date filter (YYYY-MM-DD)"},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true,"description":"Class ID"}],"security":[{"bearerAuth":["read:eventos"]}],"responses":{"200":{"description":"List of events","content":{"application/json":{"schema":{"description":"List of events","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string"},"start_date":{"type":"string","format":"date-time"},"end_date":{"type":"string","format":"date-time","nullable":true},"venue_name":{"type":"string","nullable":true},"venue_address":{"type":"string","nullable":true},"venue_city":{"type":"string","nullable":true},"requires_registration":{"type":"boolean"},"max_participants":{"type":"integer","nullable":true},"registered_participants":{"type":"integer"},"registration_fee":{"type":"number"},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{classId}/events/{id}":{"get":{"summary":"Get event by ID","tags":["Events"],"description":"Returns full details of an event.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"classId","required":true},{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":["read:eventos"]}],"responses":{"200":{"description":"Event details","content":{"application/json":{"schema":{"description":"Event details","type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string"},"start_date":{"type":"string","format":"date-time"},"end_date":{"type":"string","format":"date-time","nullable":true},"venue_name":{"type":"string","nullable":true},"venue_address":{"type":"string","nullable":true},"venue_city":{"type":"string","nullable":true},"requires_registration":{"type":"boolean"},"max_participants":{"type":"integer","nullable":true},"registered_participants":{"type":"integer"},"registration_fee":{"type":"number"},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}}}},"404":{"description":"Event not found","content":{"application/json":{"schema":{"description":"Event not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{classId}/event-tickets":{"get":{"summary":"List event tickets by class","tags":["Events"],"description":"Returns all event tickets (ingressos) for students in a class.\n\n### Filters\n- `status` - filter by status (ativo, usado, cancelado)\n- `validated` - filter validated/not validated\n- `type` - filter by ticket type","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"boolean"},"in":"query","name":"validated","required":false},{"schema":{"type":"string"},"in":"query","name":"type","required":false},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true}],"security":[{"bearerAuth":["read:eventos"]}],"responses":{"200":{"description":"List of event tickets","content":{"application/json":{"schema":{"description":"List of event tickets","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"user_id":{"type":"integer"},"student_name":{"type":"string","nullable":true},"code":{"type":"string"},"title":{"type":"string"},"type":{"type":"string"},"category":{"type":"string","nullable":true},"amount":{"type":"number"},"issue_date":{"type":"string","format":"date-time"},"expiry_date":{"type":"string","format":"date-time","nullable":true},"validated":{"type":"boolean"},"validated_at":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string"},"human_code":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}}}}},"/v1/classes/{classId}/schedule":{"get":{"summary":"List schedule entries by class","tags":["Events"],"description":"Returns calendar/schedule entries (agenda) for a class.\n\n### Filters\n- `from` / ` - to`date range\n- `type` - filter by type (compromisso, reuniao, ensaio, etc.)","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"in":"query","name":"per_page","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"from","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"to","required":false},{"schema":{"type":"string"},"in":"query","name":"type","required":false},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true}],"security":[{"bearerAuth":["read:eventos"]}],"responses":{"200":{"description":"Schedule entries","content":{"application/json":{"schema":{"description":"Schedule entries","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"start_date":{"type":"string","format":"date-time"},"end_date":{"type":"string","format":"date-time","nullable":true},"type":{"type":"string"},"category":{"type":"string","nullable":true},"all_day":{"type":"boolean"},"recurring":{"type":"boolean"},"status":{"type":"string"},"priority":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}}}}},"/v1/students/{studentId}/events":{"get":{"summary":"List events for a student","tags":["Events"],"description":"Returns events for the class the student belongs to.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"studentId","required":true}],"security":[{"bearerAuth":["read:eventos"]}],"responses":{"200":{"description":"List of events","content":{"application/json":{"schema":{"description":"List of events","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string"},"start_date":{"type":"string","format":"date-time"},"end_date":{"type":"string","format":"date-time","nullable":true},"venue_name":{"type":"string","nullable":true},"venue_address":{"type":"string","nullable":true},"venue_city":{"type":"string","nullable":true},"requires_registration":{"type":"boolean"},"max_participants":{"type":"integer","nullable":true},"registered_participants":{"type":"integer"},"registration_fee":{"type":"number"},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}}}}}}},"404":{"description":"Student not found","content":{"application/json":{"schema":{"description":"Student not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/events/{eventId}/ticket-types":{"get":{"summary":"List ticket types of an event","tags":["Tickets"],"description":"Returns the ticket types (eventos_ingressos) configured for an event, including pricing modalities.\n\n### Filters\n- `active` - filter by active/inactive ticket types","parameters":[{"schema":{"type":"boolean"},"in":"query","name":"active","required":false},{"schema":{"type":"integer"},"in":"path","name":"eventId","required":true}],"security":[{"bearerAuth":["read:eventos"]}],"responses":{"200":{"description":"List of ticket types","content":{"application/json":{"schema":{"description":"List of ticket types","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"event_id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"price":{"type":"number"},"total_quantity":{"type":"integer"},"sold_quantity":{"type":"integer"},"sale_start":{"type":"string","format":"date-time","nullable":true},"sale_end":{"type":"string","format":"date-time","nullable":true},"per_order_limit":{"type":"integer"},"per_person_limit":{"type":"integer"},"public_sale":{"type":"boolean"},"graduate_only":{"type":"boolean"},"featured":{"type":"boolean"},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"modalities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"discount_type":{"type":"string"},"value":{"type":"number"},"requires_document":{"type":"boolean"},"document_description":{"type":"string","nullable":true},"total_quantity":{"type":"integer","nullable":true},"sold_quantity":{"type":"integer"},"order":{"type":"integer"},"active":{"type":"boolean"}}}}}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/ticket-types/{id}":{"get":{"summary":"Get ticket type by ID","tags":["Tickets"],"description":"Returns a single ticket type with its pricing modalities.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":["read:eventos"]}],"responses":{"200":{"description":"Ticket type details","content":{"application/json":{"schema":{"description":"Ticket type details","type":"object","properties":{"id":{"type":"integer"},"event_id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"price":{"type":"number"},"total_quantity":{"type":"integer"},"sold_quantity":{"type":"integer"},"sale_start":{"type":"string","format":"date-time","nullable":true},"sale_end":{"type":"string","format":"date-time","nullable":true},"per_order_limit":{"type":"integer"},"per_person_limit":{"type":"integer"},"public_sale":{"type":"boolean"},"graduate_only":{"type":"boolean"},"featured":{"type":"boolean"},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"modalities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"discount_type":{"type":"string"},"value":{"type":"number"},"requires_document":{"type":"boolean"},"document_description":{"type":"string","nullable":true},"total_quantity":{"type":"integer","nullable":true},"sold_quantity":{"type":"integer"},"order":{"type":"integer"},"active":{"type":"boolean"}}}}}}}}},"404":{"description":"Ticket type not found","content":{"application/json":{"schema":{"description":"Ticket type not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/ticket-orders":{"get":{"summary":"List ticket orders","tags":["Tickets"],"description":"Returns ticket purchase orders (ticket_orders) for the tenant.\n\n### Filters\n- `status` - filter by status (pending, paid, expired, cancelled, refunded)\n- `student_id` - only orders of a given student (pre_cadastro ID)\n- `from` / ` - to`filter by creation date range","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"integer"},"in":"query","name":"student_id","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"from","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"to","required":false}],"security":[{"bearerAuth":["read:eventos"]}],"responses":{"200":{"description":"List of ticket orders","content":{"application/json":{"schema":{"description":"List of ticket orders","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"order_id":{"type":"string"},"user_id":{"type":"integer"},"ticket_type_id":{"type":"integer"},"ticket_type_name":{"type":"string","nullable":true},"event_id":{"type":"integer","nullable":true},"event_title":{"type":"string","nullable":true},"quantity":{"type":"integer"},"total_amount":{"type":"number"},"holder_name":{"type":"string","nullable":true},"holder_email":{"type":"string","nullable":true},"holder_phone":{"type":"string","nullable":true},"payment_method":{"type":"string","nullable":true},"transaction_id":{"type":"string","nullable":true},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"paid_at":{"type":"string","format":"date-time","nullable":true}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/ticket-orders/{orderId}":{"get":{"summary":"Get ticket order by order_id","tags":["Tickets"],"description":"Returns a single ticket order with its issued tickets.","parameters":[{"schema":{"type":"string"},"in":"path","name":"orderId","required":true}],"security":[{"bearerAuth":["read:eventos"]}],"responses":{"200":{"description":"Ticket order details","content":{"application/json":{"schema":{"description":"Ticket order details","type":"object","properties":{"order_id":{"type":"string"},"user_id":{"type":"integer"},"ticket_type_id":{"type":"integer"},"ticket_type_name":{"type":"string","nullable":true},"event_id":{"type":"integer","nullable":true},"event_title":{"type":"string","nullable":true},"quantity":{"type":"integer"},"total_amount":{"type":"number"},"holder_name":{"type":"string","nullable":true},"holder_email":{"type":"string","nullable":true},"holder_phone":{"type":"string","nullable":true},"payment_method":{"type":"string","nullable":true},"transaction_id":{"type":"string","nullable":true},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"paid_at":{"type":"string","format":"date-time","nullable":true},"tickets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"code":{"type":"string","nullable":true},"holder_name":{"type":"string","nullable":true},"seat_number":{"type":"string","nullable":true},"status":{"type":"string"},"validated":{"type":"boolean"},"validated_at":{"type":"string","format":"date-time","nullable":true}}}}}}}}},"404":{"description":"Order not found","content":{"application/json":{"schema":{"description":"Order not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/support-categories":{"get":{"summary":"List support categories","tags":["Atendimento"],"description":"Returns the support ticket categories available for the tenant.","security":[{"bearerAuth":["read:atendimento"]}],"responses":{"200":{"description":"List of support categories","content":{"application/json":{"schema":{"description":"List of support categories","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true},"order":{"type":"integer"},"active":{"type":"boolean"}}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/support-tickets":{"get":{"summary":"List support tickets","tags":["Atendimento"],"description":"Returns support tickets across the whole tenant.\n\n### Filters\n- `status` - filter by status (aberto, em_andamento, fechado)\n- `priority` - filter by priority (baixa, media, alta, urgente)\n- `category_id` - filter by category\n- `class_id` - only tickets from students of a given class\n- `student_id` - only tickets of a given student (pre_cadastro ID)","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"priority","required":false},{"schema":{"type":"integer"},"in":"query","name":"category_id","required":false},{"schema":{"type":"integer"},"in":"query","name":"class_id","required":false},{"schema":{"type":"integer"},"in":"query","name":"student_id","required":false}],"security":[{"bearerAuth":["read:atendimento"]}],"responses":{"200":{"description":"List of support tickets","content":{"application/json":{"schema":{"description":"List of support tickets","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"student_id":{"type":"integer","nullable":true},"student_name":{"type":"string","nullable":true},"category_id":{"type":"integer","nullable":true},"title":{"type":"string"},"description":{"type":"string","nullable":true},"priority":{"type":"string","nullable":true},"status":{"type":"string"},"opened_at":{"type":"string","format":"date-time"},"first_response_at":{"type":"string","format":"date-time","nullable":true},"closed_at":{"type":"string","format":"date-time","nullable":true},"rating":{"type":"integer","nullable":true},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/support-tickets/{id}":{"get":{"summary":"Get support ticket with messages","tags":["Atendimento"],"description":"Returns full ticket details with conversation messages.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":["read:atendimento"]}],"responses":{"200":{"description":"Ticket details with messages","content":{"application/json":{"schema":{"description":"Ticket details with messages","type":"object","properties":{"id":{"type":"integer"},"student_id":{"type":"integer","nullable":true},"student_name":{"type":"string","nullable":true},"category_id":{"type":"integer","nullable":true},"title":{"type":"string"},"description":{"type":"string","nullable":true},"priority":{"type":"string","nullable":true},"status":{"type":"string"},"opened_at":{"type":"string","format":"date-time"},"closed_at":{"type":"string","format":"date-time","nullable":true},"rating":{"type":"integer","nullable":true},"rating_comment":{"type":"string","nullable":true},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"sender_name":{"type":"string","nullable":true},"sender_type":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"attachments":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}}}}}}}}},"404":{"description":"Ticket not found","content":{"application/json":{"schema":{"description":"Ticket not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/students/{studentId}/service-history":{"get":{"summary":"List student service history","tags":["Atendimento"],"description":"Returns the service history (phone / whatsapp / email contacts) registered for a student.\n\n### Filters\n- `type` - filter by service type (telefone, whatsapp, email, presencial, videochamada, sms, outro)\n- `reason` - filter by reason (cobranca, duvida, suporte, negociacao, comercial, evento, outro)","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false},{"schema":{"type":"string"},"in":"query","name":"type","required":false},{"schema":{"type":"string"},"in":"query","name":"reason","required":false},{"schema":{"type":"integer"},"in":"path","name":"studentId","required":true}],"security":[{"bearerAuth":["read:atendimento"]}],"responses":{"200":{"description":"Service history","content":{"application/json":{"schema":{"description":"Service history","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"type":{"type":"string"},"channel":{"type":"string","nullable":true},"reason":{"type":"string","nullable":true},"subject":{"type":"string"},"description":{"type":"string","nullable":true},"result":{"type":"string","nullable":true},"next_contact":{"type":"string","format":"date-time","nullable":true},"duration_minutes":{"type":"integer","nullable":true},"contact_number":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"attachment_url":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"404":{"description":"Student not found","content":{"application/json":{"schema":{"description":"Student not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{classId}/plans":{"get":{"summary":"List graduation plans by class","tags":["Plans"],"description":"Returns all graduation plans linked to a specific class, with subscriber counts.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"classId","required":true,"description":"Class ID"}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"List of plans","content":{"application/json":{"schema":{"description":"List of plans","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"base_price":{"type":"number"},"category":{"type":"string","nullable":true},"max_installments":{"type":"integer","nullable":true},"is_active":{"type":"boolean"},"subscriber_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"}}}}}}}}}}}},"/v1/classes/{classId}/plans/{id}":{"get":{"summary":"Get graduation plan by ID","tags":["Plans"],"description":"Returns details of a graduation plan with subscriber list.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"classId","required":true},{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"Plan details","content":{"application/json":{"schema":{"description":"Plan details","type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"base_price":{"type":"number"},"category":{"type":"string","nullable":true},"max_installments":{"type":"integer","nullable":true},"is_active":{"type":"boolean"},"subscriber_count":{"type":"integer"},"subscribers":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"integer"},"student_name":{"type":"string"},"status":{"type":"string"},"total_amount":{"type":"number"},"paid_amount":{"type":"number"},"assigned_at":{"type":"string","format":"date-time"}}}},"created_at":{"type":"string","format":"date-time"}}}}}},"404":{"description":"Plan not found","content":{"application/json":{"schema":{"description":"Plan not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{classId}/extras":{"get":{"summary":"List graduation extras by class","tags":["Plans"],"description":"Returns all graduation extras (add-ons) linked to a class.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"classId","required":true}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"List of extras","content":{"application/json":{"schema":{"description":"List of extras","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"price":{"type":"number"},"category":{"type":"string","nullable":true},"is_active":{"type":"boolean"},"subscriber_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"}}}}}}}}}}}},"/v1/students/{studentId}/extras":{"get":{"summary":"List extras for a student","tags":["Plans"],"description":"Returns all graduation extras contracted by a student.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"studentId","required":true}],"security":[{"bearerAuth":["read:students"]}],"responses":{"200":{"description":"List of student extras","content":{"application/json":{"schema":{"description":"List of student extras","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"extra_id":{"type":"integer"},"extra_name":{"type":"string"},"quantity":{"type":"integer"},"unit_price":{"type":"number"},"total_price":{"type":"number"},"installments":{"type":"integer","nullable":true},"status":{"type":"string"},"contracted_at":{"type":"string","format":"date-time"}}}}}}}}},"404":{"description":"Student not found","content":{"application/json":{"schema":{"description":"Student not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{classId}/surveys":{"get":{"summary":"List surveys by class","tags":["Community"],"description":"Returns all surveys (enquetes) for a class with vote counts.\n\n### Filters\n- `status` - filter by status (ativa, encerrada)","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"List of surveys","content":{"application/json":{"schema":{"description":"List of surveys","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"allows_multiple_choice":{"type":"boolean"},"allows_add_options":{"type":"boolean"},"show_results_before":{"type":"boolean"},"start_date":{"type":"string","format":"date-time"},"end_date":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string"},"total_votes":{"type":"integer"},"total_participants":{"type":"integer"},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}}}}},"/v1/classes/{classId}/surveys/{id}/results":{"get":{"summary":"Get survey results","tags":["Community"],"description":"Returns detailed results for a survey including options and vote counts.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"classId","required":true},{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"Survey results","content":{"application/json":{"schema":{"description":"Survey results","type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"status":{"type":"string"},"total_votes":{"type":"integer"},"total_participants":{"type":"integer"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"text":{"type":"string"},"description":{"type":"string","nullable":true},"image_url":{"type":"string","nullable":true},"vote_count":{"type":"integer"},"percentage":{"type":"number"}}}}}}}}},"404":{"description":"Survey not found","content":{"application/json":{"schema":{"description":"Survey not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{classId}/announcements":{"get":{"summary":"List announcements by class","tags":["Community"],"description":"Returns all announcements (avisos) for a class.","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false},{"schema":{"type":"string"},"in":"query","name":"type","required":false,"description":"Filter by type"},{"schema":{"type":"string"},"in":"query","name":"priority","required":false,"description":"Filter by priority"},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"List of announcements","content":{"application/json":{"schema":{"description":"List of announcements","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"content":{"type":"string"},"summary":{"type":"string","nullable":true},"type":{"type":"string"},"priority":{"type":"string"},"pinned":{"type":"boolean"},"highlighted":{"type":"boolean"},"highlight_color":{"type":"string","nullable":true},"published_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string"},"views":{"type":"integer"},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}}}}},"/v1/classes/{classId}/diary":{"get":{"summary":"List diary entries by class","tags":["Community"],"description":"Returns diary posts from students in a class.","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"List of diary entries","content":{"application/json":{"schema":{"description":"List of diary entries","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"user_id":{"type":"integer"},"author_name":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"content":{"type":"string"},"image_url":{"type":"string","nullable":true},"mood":{"type":"string","nullable":true},"location":{"type":"string","nullable":true},"pinned":{"type":"boolean"},"visibility":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}}}}},"/v1/classes/{classId}/forum":{"get":{"summary":"List forum topics by class","tags":["Community"],"description":"Returns all forum topics for a class.\n\n### Filters\n- `category` - filter by category","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false},{"schema":{"type":"string"},"in":"query","name":"category","required":false},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"List of forum topics","content":{"application/json":{"schema":{"description":"List of forum topics","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"category":{"type":"string"},"pinned":{"type":"boolean"},"closed":{"type":"boolean"},"views":{"type":"integer"},"total_replies":{"type":"integer"},"last_reply_at":{"type":"string","format":"date-time","nullable":true},"author_name":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}}}}},"/v1/classes/{classId}/forum/{topicId}/comments":{"get":{"summary":"List forum topic comments","tags":["Community"],"description":"Returns all comments/messages for a forum topic.","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"in":"query","name":"per_page","required":false},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true},{"schema":{"type":"integer"},"in":"path","name":"topicId","required":true}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"List of comments","content":{"application/json":{"schema":{"description":"List of comments","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"author_name":{"type":"string","nullable":true},"content":{"type":"string"},"is_main_reply":{"type":"boolean"},"likes":{"type":"integer"},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}}}}},"/v1/classes/{classId}/raffles":{"get":{"summary":"List raffles by class","tags":["Community"],"description":"Returns all raffles (rifas) for a class.\n\n### Filters\n- `status` - filter by status (ativa, encerrada, cancelada)","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"List of raffles","content":{"application/json":{"schema":{"description":"List of raffles","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"number_price":{"type":"number"},"total_numbers":{"type":"integer"},"sold_numbers":{"type":"integer"},"max_per_person":{"type":"integer"},"prize_description":{"type":"string"},"prize_value":{"type":"number","nullable":true},"prize_image_url":{"type":"string","nullable":true},"start_date":{"type":"string","format":"date-time"},"end_date":{"type":"string","format":"date-time"},"draw_date":{"type":"string","format":"date-time"},"drawn_number":{"type":"integer","nullable":true},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}}}}},"/v1/classes/{classId}/satisfaction-surveys":{"get":{"summary":"List satisfaction surveys by class","tags":["Community"],"description":"Returns satisfaction surveys (NPS/pesquisa de satisfação) for a class with response stats.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"classId","required":true}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"List of satisfaction surveys","content":{"application/json":{"schema":{"description":"List of satisfaction surveys","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"survey_type":{"type":"string"},"status":{"type":"string"},"total_sent":{"type":"integer"},"total_responses":{"type":"integer"},"nps_score":{"type":"number","nullable":true},"promoters":{"type":"integer"},"neutrals":{"type":"integer"},"detractors":{"type":"integer"},"sent_at":{"type":"string","format":"date-time","nullable":true},"deadline":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"}}}}}}}}}}}},"/v1/students/{studentId}/documents":{"get":{"summary":"List student documents","tags":["Student Resources"],"description":"Returns all documents uploaded by or for a student.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"studentId","required":true}],"security":[{"bearerAuth":["read:students"]}],"responses":{"200":{"description":"List of documents","content":{"application/json":{"schema":{"description":"List of documents","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"file_url":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"origin":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}}}}}}}}},"404":{"description":"Student not found","content":{"application/json":{"schema":{"description":"Student not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/students/{studentId}/appointments":{"get":{"summary":"List student appointments","tags":["Student Resources"],"description":"Returns photo session appointments and schedules for a student.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"studentId","required":true}],"security":[{"bearerAuth":["read:students"]}],"responses":{"200":{"description":"List of appointments","content":{"application/json":{"schema":{"description":"List of appointments","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"service_name":{"type":"string","nullable":true},"session_date":{"type":"string","format":"date-time","nullable":true},"start_time":{"type":"string","nullable":true},"end_time":{"type":"string","nullable":true},"photographer_name":{"type":"string","nullable":true},"location":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}}}}}}}}},"404":{"description":"Student not found","content":{"application/json":{"schema":{"description":"Student not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/students/{studentId}/orders":{"get":{"summary":"List student orders","tags":["Student Resources"],"description":"Returns all product orders for a student.","parameters":[{"schema":{"type":"string"},"in":"query","name":"status","required":false,"description":"Filter by order status"},{"schema":{"type":"integer"},"in":"path","name":"studentId","required":true}],"security":[{"bearerAuth":["read:students"]}],"responses":{"200":{"description":"List of orders","content":{"application/json":{"schema":{"description":"List of orders","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"order_number":{"type":"string"},"subtotal":{"type":"number"},"discount":{"type":"number"},"shipping":{"type":"number"},"total":{"type":"number"},"status":{"type":"string"},"payment_status":{"type":"string"},"payment_method":{"type":"string","nullable":true},"tracking_code":{"type":"string","nullable":true},"confirmed_at":{"type":"string","format":"date-time","nullable":true},"shipped_at":{"type":"string","format":"date-time","nullable":true},"delivered_at":{"type":"string","format":"date-time","nullable":true},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"product_name":{"type":"string"},"quantity":{"type":"integer"},"unit_price":{"type":"number"},"total_price":{"type":"number"}}}},"created_at":{"type":"string","format":"date-time"}}}}}}}}},"404":{"description":"Student not found","content":{"application/json":{"schema":{"description":"Student not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/students/{studentId}/selections":{"get":{"summary":"List student photo selections","tags":["Student Resources"],"description":"Returns completed photo selections for a student.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"studentId","required":true}],"security":[{"bearerAuth":["read:students"]}],"responses":{"200":{"description":"List of photo selections","content":{"application/json":{"schema":{"description":"List of photo selections","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"service_name":{"type":"string","nullable":true},"session_date":{"type":"string","format":"date-time","nullable":true},"selected_photos":{"type":"integer"},"total_photos":{"type":"integer"},"extra_photos":{"type":"integer"},"total_value":{"type":"number"},"payment_status":{"type":"string","nullable":true},"payment_method":{"type":"string","nullable":true},"installments":{"type":"integer","nullable":true},"completed_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"}}}}}}}}},"404":{"description":"Student not found","content":{"application/json":{"schema":{"description":"Student not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/students/{studentId}/support-tickets":{"get":{"summary":"List student support tickets","tags":["Student Resources"],"description":"Returns all support tickets for a student.\n\n### Filters\n- `status` - filter by ticket status (aberto, em_andamento, fechado, cancelado)\n- `priority` - filter by priority (baixa, media, alta, urgente)","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"priority","required":false},{"schema":{"type":"integer"},"in":"path","name":"studentId","required":true}],"security":[{"bearerAuth":["read:students"]}],"responses":{"200":{"description":"List of support tickets","content":{"application/json":{"schema":{"description":"List of support tickets","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string"},"priority":{"type":"string"},"status":{"type":"string"},"opened_at":{"type":"string","format":"date-time"},"first_response_at":{"type":"string","format":"date-time","nullable":true},"closed_at":{"type":"string","format":"date-time","nullable":true},"rating":{"type":"integer","nullable":true},"created_at":{"type":"string","format":"date-time"}}}},"summary":{"type":"object","properties":{"open":{"type":"integer"},"in_progress":{"type":"integer"},"closed":{"type":"integer"},"total":{"type":"integer"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"404":{"description":"Student not found","content":{"application/json":{"schema":{"description":"Student not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/students/{studentId}/support-tickets/{ticketId}":{"get":{"summary":"Get support ticket with messages","tags":["Student Resources"],"description":"Returns full ticket details with conversation messages.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"studentId","required":true},{"schema":{"type":"integer"},"in":"path","name":"ticketId","required":true}],"security":[{"bearerAuth":["read:students"]}],"responses":{"200":{"description":"Ticket details with messages","content":{"application/json":{"schema":{"description":"Ticket details with messages","type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string"},"priority":{"type":"string"},"status":{"type":"string"},"opened_at":{"type":"string","format":"date-time"},"closed_at":{"type":"string","format":"date-time","nullable":true},"rating":{"type":"integer","nullable":true},"rating_comment":{"type":"string","nullable":true},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"sender_name":{"type":"string","nullable":true},"sender_type":{"type":"string","nullable":true},"content":{"type":"string"},"attachments":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}}}}}}}}},"404":{"description":"Ticket not found","content":{"application/json":{"schema":{"description":"Ticket not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/students/{studentId}/access-logs":{"get":{"summary":"List student access logs","tags":["Student Resources"],"description":"Returns login/access history for a student.","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"in":"query","name":"per_page","required":false},{"schema":{"type":"integer"},"in":"path","name":"studentId","required":true}],"security":[{"bearerAuth":["read:students"]}],"responses":{"200":{"description":"Access logs","content":{"application/json":{"schema":{"description":"Access logs","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"access_type":{"type":"string"},"device_name":{"type":"string","nullable":true},"device_type":{"type":"string","nullable":true},"os":{"type":"string","nullable":true},"browser":{"type":"string","nullable":true},"ip_address":{"type":"string"},"country":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"success":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"404":{"description":"Student not found","content":{"application/json":{"schema":{"description":"Student not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/students/{studentId}/financial-history":{"get":{"summary":"List student financial history","tags":["Student Resources"],"description":"Returns financial operation history for a student (plan changes, payment method changes, etc.).","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"in":"query","name":"per_page","required":false},{"schema":{"type":"integer"},"in":"path","name":"studentId","required":true}],"security":[{"bearerAuth":["read:financeiro"]}],"responses":{"200":{"description":"Financial history","content":{"application/json":{"schema":{"description":"Financial history","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"operation_type":{"type":"string"},"previous_payment_method":{"type":"string","nullable":true},"new_payment_method":{"type":"string","nullable":true},"previous_installments":{"type":"integer","nullable":true},"new_installments":{"type":"integer","nullable":true},"previous_total":{"type":"number","nullable":true},"new_total":{"type":"number","nullable":true},"plan_name":{"type":"string","nullable":true},"origin":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"404":{"description":"Student not found","content":{"application/json":{"schema":{"description":"Student not found","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/classes/{classId}/email-automations":{"get":{"summary":"List email automations by class","tags":["Class Resources"],"description":"Returns all email automations configured for a class.\n\n### Filters\n- `status` - filter by status (agendado, enviado, cancelado)","parameters":[{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"List of email automations","content":{"application/json":{"schema":{"description":"List of email automations","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"subject":{"type":"string"},"scheduled_at":{"type":"string","format":"date-time"},"status":{"type":"string"},"recipients":{"type":"string"},"total_sent":{"type":"integer"},"total_errors":{"type":"integer"},"created_at":{"type":"string","format":"date-time"}}}}}}}}}}}},"/v1/classes/{classId}/mobile-features":{"get":{"summary":"List mobile feature flags by class","tags":["Class Resources"],"description":"Returns all mobile app feature toggles for a class.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"classId","required":true}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"List of mobile features","content":{"application/json":{"schema":{"description":"List of mobile features","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"feature_key":{"type":"string"},"is_enabled":{"type":"boolean"},"settings":{"type":"object","nullable":true},"updated_at":{"type":"string","format":"date-time"}}}}}}}}}}}},"/v1/classes/{classId}/material-submissions":{"get":{"summary":"List material submission configs by class","tags":["Class Resources"],"description":"Returns all material submission configurations for a class.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"classId","required":true}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"List of material submission configs","content":{"application/json":{"schema":{"description":"List of material submission configs","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"view_profile":{"type":"string"},"is_active":{"type":"boolean"},"deadline":{"type":"string","format":"date-time","nullable":true},"order":{"type":"integer"},"response_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"}}}}}}}}}}}},"/v1/classes/{classId}/material-submissions/{configId}/responses":{"get":{"summary":"List material submission responses","tags":["Class Resources"],"description":"Returns all student responses for a material submission config.\n\n### Filters\n- `status` - filter by response status (enviado, aprovado, rejeitado)","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true},{"schema":{"type":"integer"},"in":"path","name":"configId","required":true}],"security":[{"bearerAuth":["read:classes"]}],"responses":{"200":{"description":"List of responses","content":{"application/json":{"schema":{"description":"List of responses","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"user_id":{"type":"integer"},"student_name":{"type":"string","nullable":true},"status":{"type":"string"},"admin_notes":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time","nullable":true}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}}}}},"/v1/classes/{classId}/costs":{"get":{"summary":"List costs/expenses by class","tags":["Class Resources"],"description":"Returns all costs and expenses (contas a pagar) for a class.\n\n### Filters\n- `status` - filter by status (pendente, pago, vencido, cancelado)","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"integer"},"in":"path","name":"classId","required":true}],"security":[{"bearerAuth":["read:financeiro"]}],"responses":{"200":{"description":"List of costs","content":{"application/json":{"schema":{"description":"List of costs","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"description":{"type":"string"},"category":{"type":"string","nullable":true},"supplier":{"type":"string","nullable":true},"amount":{"type":"number"},"due_date":{"type":"string","format":"date","nullable":true},"payment_date":{"type":"string","format":"date","nullable":true},"payment_method":{"type":"string","nullable":true},"status":{"type":"string"},"notes":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}}}},"summary":{"type":"object","properties":{"total_amount":{"type":"number"},"paid_amount":{"type":"number"},"pending_amount":{"type":"number"},"overdue_amount":{"type":"number"}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}}}}},"/v1/webhooks/inbound/secret":{"post":{"summary":"Gerar/rotacionar segredo de assinatura inbound","tags":["Webhooks"],"description":"Gera um novo segredo HMAC para assinar os eventos inbound. Retornado **apenas** nesta resposta; invalida o anterior.","security":[{"bearerAuth":["write:webhooks"]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"secret":{"type":"string","description":"Segredo HMACguarde com segurança"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/webhooks/inbound/events":{"get":{"summary":"Listar eventos inbound recebidos","tags":["Webhooks"],"description":"Histórico dos eventos recebidos do parceiro (auditoria/idempotência).","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"in":"query","name":"limit","required":false}],"security":[{"bearerAuth":["read:webhooks"]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"external_event_id":{"type":"string"},"event_type":{"type":"string"},"status":{"type":"string"},"erro":{"type":"string","nullable":true},"recebido_em":{"type":"string","format":"date-time"},"processado_em":{"type":"string","format":"date-time","nullable":true}}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"description":"Unauthorized","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/webhooks/inbound":{"post":{"summary":"Receber evento inbound do parceiro","tags":["Webhooks"],"description":"Recebe um evento de um sistema parceiro e aplica a mudança no banco.\n\n### Eventos aceitos\n- `installment.paid`Parceiro confirma o pagamento de uma parcela\n- `installment.canceled`Parceiro cancela uma parcela\n\n### Autenticação\n1. **OAuth2 Bearer** (`Authorization: Bearer <token>`) com scope ` - write:financeiro`.\n2. **Assinatura HMAC** no header `X-Signature: t=<unix>,v1=<hmac>`, onde\n   `<hmac>` = HMAC-SHA256(`<t>.<corpo-bruto>`) usando o segredo do client\n   (gerado em `POST /webhooks/inbound/secret`). Janela de tolerância padrão: 5 min.\n\n### Idempotência\nO campo `id` do corpo é o identificador do evento no parceiro. Reenvios com o\nmesmo `id` retornam o resultado anterior sem reaplicar a mudança.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type","data"],"properties":{"id":{"type":"string","description":"ID do evento no parceiro (idempotência)","example":"evt_abc123"},"type":{"type":"string","enum":["installment.paid","installment.canceled"],"description":"Tipo do evento","example":"installment.paid"},"data":{"type":"object","additionalProperties":true,"description":"Dados do evento. Para installment.paid: { installment_id, amount, payment_method, paid_at }","example":{"installment_id":123,"amount":250,"payment_method":"pix","paid_at":"2026-06-19T12:00:00Z"}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"header","name":"x-signature","required":true,"description":"Assinatura HMAC: t=<unix>,v1=<hmac>"}],"security":[{"bearerAuth":["write:financeiro"]}],"responses":{"200":{"description":"Evento processado (ou duplicado/idempotente)","content":{"application/json":{"schema":{"description":"Evento processado (ou duplicado/idempotente)","type":"object","properties":{"status":{"type":"string","description":"processed | duplicate"},"duplicate":{"type":"boolean"},"result":{"type":"object","additionalProperties":true,"nullable":true}}}}}},"400":{"description":"Payload inválido ou erro de processamento","content":{"application/json":{"schema":{"description":"Payload inválido ou erro de processamento","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"401":{"description":"Unauthorized / assinatura inválida","content":{"application/json":{"schema":{"description":"Unauthorized / assinatura inválida","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"description":"Insufficient scope","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/webhooks/event-types":{"get":{"summary":"Listar tipos de evento que podem ser assinados","tags":["Webhooks"],"description":"Catálogo dos eventos entregues pelo gateway. Use o `type` em `event_types` ao cadastrar um endpoint.","security":[{"bearerAuth":["read:webhooks","write:webhooks"]}],"responses":{"200":{"description":"Catálogo de eventos","content":{"application/json":{"schema":{"description":"Catálogo de eventos","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"description":{"type":"string"}}}}}}}}},"401":{"description":"Token ausente, inválido ou expirado","content":{"application/json":{"schema":{"description":"Token ausente, inválido ou expirado","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"description":"Scope insuficiente","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/webhooks/endpoints":{"get":{"summary":"Listar endpoints de webhook","tags":["Webhooks"],"description":"Endpoints cadastrados pelo tenant. O segredo não é retornado aqui: ele só aparece na criação e na rotação.","security":[{"bearerAuth":["read:webhooks"]}],"responses":{"200":{"description":"Endpoints cadastrados","content":{"application/json":{"schema":{"description":"Endpoints cadastrados","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"url":{"type":"string"},"description":{"type":"string","nullable":true},"event_types":{"type":"string","description":"Tipos assinados, separados por vírgula. `*` assina todos."},"active":{"type":"boolean"},"consecutive_failures":{"type":"integer"},"last_delivery_at":{"type":"string","format":"date-time","nullable":true},"last_status":{"type":"integer","nullable":true},"disabled_at":{"type":"string","format":"date-time","nullable":true},"disabled_reason":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}}}}}},"401":{"description":"Token ausente, inválido ou expirado","content":{"application/json":{"schema":{"description":"Token ausente, inválido ou expirado","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"description":"Scope insuficiente","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"post":{"summary":"Cadastrar endpoint de webhook","tags":["Webhooks"],"description":"Inscreve uma URL para receber eventos.\n\n### Como a entrega funciona\nO gateway envia `POST` para a sua URL com o corpo do evento e o header\n`X-Signature: t=<unix>,v1=<hmac>`, onde `<hmac>` é\nHMAC-SHA256(`<t>.<corpo-bruto>`) com o segredo desta inscrição. É o mesmo\nalgoritmo usado no inbound, na direção contrária.\n\nResponda **2xx** para confirmar. Qualquer outra resposta, timeout (10s) ou erro\nde conexão agenda uma nova tentativa com espera crescente:\n1min, 5min, 30min, 2h, 6h e 24h. Depois disso a entrega fica `exhausted`.\n\nUm endpoint que falhar 15 vezes seguidas é\ndesativado automaticamente; reative com `PATCH` passando `active: true`.\n\n### Garantias\n- O mesmo evento nunca é entregue duas vezes ao mesmo endpoint, salvo reenvio manual.\n- O corpo assinado é exatamente o corpo enviado, byte a byte.\n- A ordem de entrega não é garantida: use `created_at` do evento para ordenar.\n\n### Segredo\nO `secret` volta **apenas nesta resposta**. Guarde: é com ele que você valida a\nassinatura de cada entrega.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"URL HTTPS que receberá os eventos. Endereço de rede interna é recusado.","example":"https://parceiro.exemplo.com/webhooks/partiu"},"description":{"type":"string","description":"Identificação livre desta inscrição"},"event_types":{"type":"string","default":"*","description":"Tipos assinados, separados por vírgula. `*` assina todos.","example":"installment.paid,contract.signed"}}}}}},"security":[{"bearerAuth":["write:webhooks"]}],"responses":{"201":{"description":"Endpoint criado","content":{"application/json":{"schema":{"description":"Endpoint criado","type":"object","properties":{"id":{"type":"integer"},"url":{"type":"string"},"event_types":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"secret":{"type":"string","description":"Retornado apenas nesta resposta"}}}}}},"400":{"description":"Parâmetros inválidos","content":{"application/json":{"schema":{"description":"Parâmetros inválidos","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"401":{"description":"Token ausente, inválido ou expirado","content":{"application/json":{"schema":{"description":"Token ausente, inválido ou expirado","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"description":"Scope insuficiente","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/webhooks/endpoints/{id}":{"patch":{"summary":"Atualizar endpoint de webhook","tags":["Webhooks"],"description":"Altera URL, descrição, eventos assinados ou reativa um endpoint desativado. Reativar zera o contador de falhas.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"description":{"type":"string"},"event_types":{"type":"string"},"active":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":["write:webhooks"]}],"responses":{"200":{"description":"Endpoint atualizado","content":{"application/json":{"schema":{"description":"Endpoint atualizado","type":"object","properties":{"id":{"type":"integer"},"url":{"type":"string"},"description":{"type":"string","nullable":true},"event_types":{"type":"string"},"active":{"type":"boolean"}}}}}},"400":{"description":"Parâmetros inválidos","content":{"application/json":{"schema":{"description":"Parâmetros inválidos","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"401":{"description":"Token ausente, inválido ou expirado","content":{"application/json":{"schema":{"description":"Token ausente, inválido ou expirado","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"description":"Scope insuficiente","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Recurso não encontrado","content":{"application/json":{"schema":{"description":"Recurso não encontrado","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"delete":{"summary":"Remover endpoint de webhook","tags":["Webhooks"],"description":"Desativa o endpoint e para as entregas. O histórico de entregas é preservado para auditoria.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":["write:webhooks"]}],"responses":{"200":{"description":"Endpoint removido","content":{"application/json":{"schema":{"description":"Endpoint removido","type":"object","properties":{"id":{"type":"integer"},"deleted":{"type":"boolean"}}}}}},"401":{"description":"Token ausente, inválido ou expirado","content":{"application/json":{"schema":{"description":"Token ausente, inválido ou expirado","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"description":"Scope insuficiente","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Recurso não encontrado","content":{"application/json":{"schema":{"description":"Recurso não encontrado","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/webhooks/endpoints/{id}/secret":{"post":{"summary":"Rotacionar o segredo do endpoint","tags":["Webhooks"],"description":"Gera um segredo novo. O anterior continua registrado para você\ntrocar sem perder entrega no meio da janela. Retornado apenas nesta resposta.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":["write:webhooks"]}],"responses":{"200":{"description":"Segredo rotacionado","content":{"application/json":{"schema":{"description":"Segredo rotacionado","type":"object","properties":{"id":{"type":"integer"},"secret":{"type":"string"}}}}}},"401":{"description":"Token ausente, inválido ou expirado","content":{"application/json":{"schema":{"description":"Token ausente, inválido ou expirado","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"description":"Scope insuficiente","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Recurso não encontrado","content":{"application/json":{"schema":{"description":"Recurso não encontrado","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/webhooks/endpoints/{id}/test":{"post":{"summary":"Enviar um evento de teste","tags":["Webhooks"],"description":"Entrega um evento `webhook.test` imediatamente, sem passar pela\nfila, e devolve o que a sua URL respondeu. Use para validar assinatura e\nconectividade antes de depender do webhook.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":["write:webhooks"]}],"responses":{"200":{"description":"Resultado da entrega de teste","content":{"application/json":{"schema":{"description":"Resultado da entrega de teste","type":"object","properties":{"delivered":{"type":"boolean"},"http_status":{"type":"integer","nullable":true},"duration_ms":{"type":"integer"},"response":{"type":"string","nullable":true},"error":{"type":"string","nullable":true}}}}}},"401":{"description":"Token ausente, inválido ou expirado","content":{"application/json":{"schema":{"description":"Token ausente, inválido ou expirado","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"description":"Scope insuficiente","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Recurso não encontrado","content":{"application/json":{"schema":{"description":"Recurso não encontrado","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/webhooks/deliveries":{"get":{"summary":"Listar entregas de webhook","tags":["Webhooks"],"description":"Histórico das entregas, com o status de cada tentativa.\n\n### Filtros\n- `endpoint_id` - entregas de um endpoint\n- `event_type` - entregas de um tipo de evento\n- `status` - pending, delivered, failed ou exhausted","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"in":"query","name":"page","required":false,"description":"Número da página"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"in":"query","name":"per_page","required":false,"description":"Itens por página"},{"schema":{"type":"integer"},"in":"query","name":"endpoint_id","required":false,"description":"Filtrar por endpoint"},{"schema":{"type":"string"},"in":"query","name":"event_type","required":false,"description":"Filtrar por tipo de evento"},{"schema":{"type":"string","enum":["pending","delivered","failed","exhausted"]},"in":"query","name":"status","required":false,"description":"Filtrar por status"}],"security":[{"bearerAuth":["read:webhooks"]}],"responses":{"200":{"description":"Entregas","content":{"application/json":{"schema":{"description":"Entregas","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"endpoint_id":{"type":"integer"},"endpoint_url":{"type":"string","nullable":true},"event_id":{"type":"string"},"event_type":{"type":"string"},"status":{"type":"string","description":"pending | delivered | failed | exhausted"},"attempts":{"type":"integer"},"http_status":{"type":"integer","nullable":true},"error":{"type":"string","nullable":true},"duration_ms":{"type":"integer","nullable":true},"next_attempt_at":{"type":"string","format":"date-time","nullable":true},"delivered_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"}}}},"pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Página atual"},"per_page":{"type":"integer","description":"Itens por página"},"total":{"type":"integer","description":"Total de itens"},"total_pages":{"type":"integer","description":"Total de páginas"},"next_cursor":{"type":"string","nullable":true,"description":"Cursor da próxima página. Passe em `cursor` para continuar a partir daqui."},"has_more":{"type":"boolean","description":"Indica se existem mais itens"}}}}}}}},"401":{"description":"Token ausente, inválido ou expirado","content":{"application/json":{"schema":{"description":"Token ausente, inválido ou expirado","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"description":"Scope insuficiente","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/v1/webhooks/deliveries/{id}/replay":{"post":{"summary":"Reenviar uma entrega","tags":["Webhooks"],"description":"Recria a entrega para o mesmo endpoint com um `event_id` novo e\na coloca no início da fila. Use quando o seu lado ficou fora do ar e a entrega\noriginal esgotou as tentativas.","parameters":[{"schema":{"type":"integer"},"in":"path","name":"id","required":true}],"security":[{"bearerAuth":["write:webhooks"]}],"responses":{"202":{"description":"Reenvio agendado","content":{"application/json":{"schema":{"description":"Reenvio agendado","type":"object","properties":{"id":{"type":"integer","description":"Id da nova entrega"},"replay_of":{"type":"integer","description":"Id da entrega original"},"status":{"type":"string"}}}}}},"401":{"description":"Token ausente, inválido ou expirado","content":{"application/json":{"schema":{"description":"Token ausente, inválido ou expirado","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"403":{"description":"Scope insuficiente","content":{"application/json":{"schema":{"description":"Scope insuficiente","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"Recurso não encontrado","content":{"application/json":{"schema":{"description":"Recurso não encontrado","type":"object","properties":{"error":{"type":"string","description":"Código do erro"},"message":{"type":"string","description":"Descrição legível do erro"},"request_id":{"type":"string","description":"Id de correlação, informe ao suporte"},"details":{"type":"array","description":"Campos que falharam na validação (quando aplicável)","items":{"type":"object","properties":{"field":{"type":"string"},"rule":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/openapi.json":{"get":{"summary":"Spec OpenAPI (JSON)","tags":["Sistema"],"description":"Documento OpenAPI 3.0 completo do gateway. Use para gerar clients (openapi-generator, Kiota, NSwag) ou importar no Postman/Insomnia.","security":[],"responses":{"200":{"description":"Default Response"}}}}},"servers":[{"url":"https://gateway.partiuformatura.app","description":"Produção"},{"url":"http://localhost:8989","description":"Local"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Autenticação","description":"Endpoints de autenticação OAuth2"},{"name":"Sistema","description":"Health check e status do sistema"},{"name":"Classes","description":"Turmas de formatura - listagem, detalhes, resumo e configurações"},{"name":"Students","description":"Formandos - listagem, detalhes, planos e resumo"},{"name":"Subgroups","description":"Subturmas - divisões dentro de uma turma"},{"name":"Installments","description":"Parcelas de pagamento - por aluno ou por turma"},{"name":"Contracts","description":"Contratos - por turma ou por formando"},{"name":"Events","description":"Eventos, ingressos e agenda/calendário"},{"name":"Tickets","description":"Tipos de ingresso (eventos_ingressos) e pedidos de ingressos"},{"name":"Atendimento","description":"Tickets de suporte, categorias e histórico de atendimentos (telefone/whatsapp)"},{"name":"Plans","description":"Planos de formatura e extras/adicionais"},{"name":"Community","description":"Enquetes, avisos, diário, fórum, rifas e pesquisa de satisfação"},{"name":"Student Resources","description":"Documentos, agendamentos, pedidos, seleções, tickets de suporte e histórico"},{"name":"Class Resources","description":"Email automations, mobile features, envio de material e custos"},{"name":"Webhooks","description":"Inbound (parceiro envia eventos, OAuth + HMAC) e outbound (o gateway entrega eventos assinados na URL do parceiro, com retentativa)"}]}