{"openapi":"3.0.0","paths":{"/inspection-provider/v1/oauth/token":{"post":{"operationId":"InsurerApiController_issueToken","summary":"Obter access token","description":"Troca client_id + client_secret por um access token de curta duração (grant_type client_credentials).","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequestDto"}}}},"responses":{"200":{"description":"Token emitido.","content":{"application/json":{"schema":{"example":{"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...","token_type":"Bearer","expires_in":900}}}}},"401":{"description":"client_id ou client_secret inválidos, ou seguradora/parceiro inativo.","content":{"application/json":{"schema":{"example":{"success":false,"error":"client_id ou client_secret inválidos"}}}}}},"tags":["Vistorias"]}},"/inspection-provider/v1/inspections":{"post":{"operationId":"InsurerApiController_create","summary":"Criar solicitação de vistoria","description":"Cria uma nova vistoria. Se externalId já existir, não cria de novo — retorna created: false.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInsurerApiInspectionDto"}}}},"responses":{"201":{"description":"created: true quando a vistoria foi criada nesta chamada; created: false quando o externalId já existia na base — nenhuma vistoria nova foi criada.","content":{"application/json":{"examples":{"Vistoria nova":{"value":{"success":true,"data":{"created":true},"message":"Vistoria recebida com sucesso"}},"externalId já existente":{"value":{"success":true,"data":{"created":false},"message":"Vistoria já existente na base"}}}}}},"400":{"description":"Campo obrigatório ausente ou campo fora do tamanho/formato esperado — ver details para a lista de mensagens.","content":{"application/json":{"schema":{"example":{"success":false,"error":"Validation error","details":["externalId should not be empty"]}}}}},"401":{"description":"Token de acesso ausente (cabeçalho Authorization: Bearer não enviado), inválido ou expirado (após expires_in segundos, ou assinatura inválida), ou inválido por ter sido emitido para outra finalidade.","content":{"application/json":{"schema":{"example":{"success":false,"error":"Token de acesso ausente"}}}}}},"tags":["Vistorias"],"security":[{"access_token":[]}]}},"/inspection-provider/v1/inspections/{externalId}":{"get":{"operationId":"InsurerApiController_getStatus","summary":"Consultar vistoria","description":"Retorna o estado atual de uma vistoria, identificada pelo externalId informado na criação.","parameters":[{"name":"externalId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Vistoria encontrada. laudo é null até a vistoria ter um laudo.","content":{"application/json":{"schema":{"example":{"success":true,"data":{"externalId":"PARC-0001","reason":"Vistoria prévia - novo seguro","brokerName":"Corretora Exemplo","brokerPhone":"11999998888","brokerEmail":"contato@corretora-exemplo.com.br","insuredName":"João da Silva","whatsappPhone":"11988887777","secondaryPhone":"11977776666","manufacturer":"VOLKSWAGEN","model":"GOL 1.0","licensePlate":"ABC1D23","chassi":"9BWZZZ377VT004251","createdAt":"2026-09-03T12:32:46.747Z","executionDate":null,"executionPeriod":null,"inspectionType":{"code":"AUTO_VISTORIA","name":"Auto Vistoria"},"status":{"code":"LINK_GERADO","name":"Link Gerado — Aguardando Cliente"},"laudo":{"reportNumber":"L26000123","executionDate":"2026-09-05T14:30:00Z","executionLocation":"Rua Exemplo, 123 - Centro, Belo Horizonte/MG","mileageAtExecution":45213,"finalAssessment":"Veículo em bom estado geral","recommendation":[],"notes":null,"items":[{"category":"AVARIA","quantity":1,"note":"risco na porta dianteira","code":null,"damageTypeCode":null}],"photos":[{"url":"https://storage.realizavistorias.com.br/laudos/.../foto1.jpg","photoType":"PAINEL","stepCode":"painel","note":null}]}},"message":"Vistoria consultada com sucesso"}}}}},"401":{"description":"Token de acesso ausente (cabeçalho Authorization: Bearer não enviado), inválido ou expirado (após expires_in segundos, ou assinatura inválida), ou inválido por ter sido emitido para outra finalidade.","content":{"application/json":{"schema":{"example":{"success":false,"error":"Token de acesso ausente"}}}}},"404":{"description":"externalId inexistente, ou pertencente a outro prestador.","content":{"application/json":{"schema":{"example":{"success":false,"error":"Vistoria não encontrada"}}}}}},"tags":["Vistorias"],"security":[{"access_token":[]}]}}},"info":{"title":"Realiza Vistorias — API de Integração","description":"Procurando o painel administrativo (Dashboard, Solicitações, Laudos, Usuários) em vez da API? Veja o [Guia do Parceiro](https://claude.ai/artifact/SjskbUQCpn3i3uqdisMTj9).\n\nServiço para seguradoras e parceiros solicitarem e acompanharem vistorias. Autenticação via OAuth 2.0 Client Credentials — obtenha um token em POST /oauth/token e use-o como Bearer nas demais chamadas.","version":"1.0","contact":{}},"tags":[],"servers":[{"url":"https://api.qa.realizavistorias.com.br","description":"Homologação"},{"url":"https://api.realizavistorias.com.br","description":"Produção"}],"components":{"securitySchemes":{"access_token":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"TokenRequestDto":{"type":"object","properties":{"grant_type":{"type":"string","enum":["client_credentials"],"description":"Fixo: client_credentials"},"client_id":{"type":"string","description":"Identificador do prestador, fornecido na habilitação","example":"RLZPXXXXXXXXXXXXXXXX"},"client_secret":{"type":"string","description":"Chave secreta do prestador, fornecida na habilitação"}},"required":["grant_type","client_id","client_secret"]},"CreateInsurerApiInspectionDto":{"type":"object","properties":{"licensePlate":{"type":"string","description":"Placa","maxLength":20,"example":"ABC1D23"},"chassi":{"type":"string","description":"Chassi","maxLength":30,"example":"9BWZZZ377VT004251"},"externalId":{"type":"string","description":"Identificador único da vistoria no sistema do prestador. Usado para deduplicação.","maxLength":120,"example":"PARC-0001"},"reason":{"type":"string","description":"Motivo da solicitação","maxLength":255,"example":"Vistoria prévia - novo seguro"},"brokerName":{"type":"string","description":"Nome da corretora","maxLength":150},"brokerPhone":{"type":"string","description":"Telefone de contato da corretora","maxLength":20},"brokerEmail":{"type":"string","description":"E-mail de contato da corretora","maxLength":150},"insuredName":{"type":"string","description":"Nome do segurado/proponente","maxLength":150},"whatsappPhone":{"type":"string","description":"WhatsApp do proponente — usado para envio do link de vistoria","maxLength":20},"secondaryPhone":{"type":"string","description":"Contato alternativo do proponente","maxLength":20},"manufacturer":{"type":"string","description":"Fabricante do veículo","maxLength":120,"example":"VOLKSWAGEN"},"model":{"type":"string","description":"Modelo do veículo","maxLength":120,"example":"GOL 1.0"},"observations":{"type":"string","description":"Observações"}},"required":["licensePlate","chassi","externalId","reason","brokerName","brokerPhone","brokerEmail","insuredName","whatsappPhone","manufacturer","model"]}}}}