{"openapi":"3.0.3","info":{"title":"Notificamos API","version":"1.1.0","description":"Envie notifica\u00e7\u00f5es, consulte status e eventos, baixe laudos, exporte evid\u00eancias e receba webhooks."},"servers":[{"url":"https:\/\/notificamos.com.br","description":"Ambiente atual"}],"paths":{"\/api\/v1\/notifications\/{code}\/events":{"get":{"summary":"Consulta o hist\u00f3rico cronol\u00f3gico da notifica\u00e7\u00e3o","security":[{"bearerAuth":[]}],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Valor de next_cursor da p\u00e1gina anterior."}],"responses":{"200":{"description":"Consulta o hist\u00f3rico cronol\u00f3gico da notifica\u00e7\u00e3o","content":{"application\/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message_id":{"type":"string","nullable":true},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"type":{"type":"string"},"status":{"type":"string","nullable":true},"occurred_at":{"type":"string","format":"date-time"},"provider_status":{"type":"string","nullable":true}}}},"next_cursor":{"type":"string","nullable":true}}}}}},"401":{"description":"Chave inv\u00e1lida","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"403":{"description":"Chave sem permiss\u00e3o de API e Relat\u00f3rios","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"404":{"description":"Notifica\u00e7\u00e3o ou artefato indispon\u00edvel","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"422":{"description":"Par\u00e2metro inv\u00e1lido","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"429":{"description":"Limite de consulta atingido","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}},"headers":{"Retry-After":{"description":"Segundos at\u00e9 a pr\u00f3xima tentativa.","schema":{"type":"integer"}}}}}}},"\/api\/v1\/notifications\/{code}\/report":{"get":{"summary":"Baixa o PDF do laudo","security":[{"bearerAuth":[]}],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}},{"name":"revision","in":"query","schema":{"type":"integer","minimum":1},"description":"Sem o par\u00e2metro, baixa a revis\u00e3o mais recente. Para clientes habilitados, a assinatura integra o PDF."}],"responses":{"200":{"description":"Baixa o PDF do laudo","content":{"application\/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Chave inv\u00e1lida","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"403":{"description":"Chave sem permiss\u00e3o de API e Relat\u00f3rios","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"404":{"description":"Notifica\u00e7\u00e3o ou artefato indispon\u00edvel","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"422":{"description":"Par\u00e2metro inv\u00e1lido","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"429":{"description":"Limite de consulta atingido","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}},"headers":{"Retry-After":{"description":"Segundos at\u00e9 a pr\u00f3xima tentativa.","schema":{"type":"integer"}}}},"503":{"description":"Artefato sendo preparado ou temporariamente indispon\u00edvel","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}},"headers":{"Retry-After":{"description":"Segundos at\u00e9 a pr\u00f3xima tentativa.","schema":{"type":"integer"}}}}}}},"\/api\/v1\/notifications\/{code}\/evidence":{"get":{"summary":"Consulta evid\u00eancias verific\u00e1veis e metadados do laudo","security":[{"bearerAuth":[]}],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Consulta evid\u00eancias verific\u00e1veis e metadados do laudo","content":{"application\/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"notification_sha256":{"type":"string","nullable":true},"events_url":{"type":"string","format":"uri"},"report":{"type":"object","properties":{"revision":{"type":"integer","nullable":true},"status":{"type":"string","enum":["available","pending_signature","unavailable"]},"sha256":{"type":"string","nullable":true},"artifact":{"type":"string","nullable":true,"enum":["signed","original",null]},"url":{"type":"string","nullable":true,"format":"uri"}}},"official_timestamp":{"type":"object","nullable":true,"properties":{"event_type":{"type":"string"},"stamped_at":{"type":"string","nullable":true,"format":"date-time"},"message_imprint_sha256":{"type":"string"},"token_der_sha256":{"type":"string"},"token_base64":{"type":"string","format":"byte"}}},"official_evidence_files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"content_type":{"type":"string"},"data":{"type":"string","format":"byte","description":"Base64 dos bytes originais do JSON ou do token RFC 3161."}}}}}}}}},"401":{"description":"Chave inv\u00e1lida","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"403":{"description":"Chave sem permiss\u00e3o de API e Relat\u00f3rios","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"404":{"description":"Notifica\u00e7\u00e3o ou artefato indispon\u00edvel","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"422":{"description":"Par\u00e2metro inv\u00e1lido","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"429":{"description":"Limite de consulta atingido","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}},"headers":{"Retry-After":{"description":"Segundos at\u00e9 a pr\u00f3xima tentativa.","schema":{"type":"integer"}}}},"503":{"description":"Artefato sendo preparado ou temporariamente indispon\u00edvel","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}},"headers":{"Retry-After":{"description":"Segundos at\u00e9 a pr\u00f3xima tentativa.","schema":{"type":"integer"}}}}}}},"\/api\/v1\/notifications\/send":{"post":{"summary":"Cria e enfileira uma notifica\u00e7\u00e3o","description":"Consome cr\u00e9ditos do cliente autenticado e cria uma notifica\u00e7\u00e3o por e-mail, SMS ou WhatsApp.","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":120},"description":"Use uma chave \u00fanica por tentativa para evitar duplicidade em retentativas."}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/NotificationSendRequest"},"examples":{"email":{"summary":"E-mail registrado","value":{"channel":"email","recipient":"cliente@example.com","recipient_name":"Cliente Exemplo","subject":"Notifica\u00e7\u00e3o extrajudicial","message":"Mensagem completa da notifica\u00e7\u00e3o."}},"sms":{"summary":"SMS com link de verifica\u00e7\u00e3o","value":{"channel":"sms","recipient_phone":"11999999999","recipient_name":"Cliente Exemplo","message":"Aviso importante. Acesse o link para confirmar."}},"whatsapp":{"summary":"WhatsApp com rastreio","value":{"channel":"whatsapp","recipient_phone":"11999999999","recipient_name":"Cliente Exemplo","message":"Ol\u00e1, existe uma notifica\u00e7\u00e3o dispon\u00edvel para confer\u00eancia."}}}}}},"responses":{"202":{"description":"Notifica\u00e7\u00e3o aceita para processamento","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/NotificationAcceptedResponse"}}}},"401":{"description":"Chave inv\u00e1lida","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"403":{"description":"API indispon\u00edvel ou canal desabilitado para o cliente","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"409":{"description":"Idempotency-Key reutilizada com payload diferente","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"422":{"description":"Payload inv\u00e1lido","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"429":{"description":"Limite tempor\u00e1rio atingido","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}}}}},"\/api\/v1\/notifications\/{code}":{"get":{"summary":"Consulta uma notifica\u00e7\u00e3o por c\u00f3digo","security":[{"bearerAuth":[]}],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"},"description":"C\u00f3digo p\u00fablico retornado no envio."}],"responses":{"200":{"description":"Status da notifica\u00e7\u00e3o","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/NotificationStatusResponse"}}}},"401":{"description":"Chave inv\u00e1lida","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}},"404":{"description":"Notifica\u00e7\u00e3o n\u00e3o encontrada","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ApiError"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"NotificationSendRequest":{"type":"object","required":["channel","message"],"properties":{"channel":{"type":"string","enum":["email","sms","whatsapp"]},"recipient":{"type":"string","format":"email","description":"Obrigat\u00f3rio para channel=email."},"recipient_phone":{"type":"string","description":"Obrigat\u00f3rio para channel=sms ou channel=whatsapp. Informe celular brasileiro com DDD."},"recipient_name":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true},"message":{"type":"string","maxLength":10000},"requires_report":{"type":"boolean","default":true},"requires_timestamp":{"type":"boolean","default":true}}},"NotificationAcceptedResponse":{"type":"object","properties":{"id":{"type":"integer"},"code":{"type":"string"},"public_uuid":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string","example":"queued"},"verification_url":{"type":"string","format":"uri"}}},"NotificationStatusResponse":{"type":"object","properties":{"code":{"type":"string"},"public_uuid":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"},"provider_status":{"type":"string","nullable":true},"hash":{"type":"string"},"sent_at":{"type":"string","nullable":true},"delivered_at":{"type":"string","nullable":true},"opened_at":{"type":"string","nullable":true}}},"WebhookEvent":{"type":"object","properties":{"event":{"type":"string","enum":["notification.sent","notification.delivered","notification.opened","notification.failed"]},"notification":{"type":"object","properties":{"id":{"type":"integer"},"code":{"type":"string"},"public_uuid":{"type":"string"},"status":{"type":"string"},"channel":{"type":"string"},"recipient":{"type":"string"},"message_id":{"type":"string","nullable":true},"sent_at":{"type":"string","nullable":true},"delivered_at":{"type":"string","nullable":true},"opened_at":{"type":"string","nullable":true}}},"sent_at":{"type":"string"}}},"ApiError":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string","nullable":true},"channel":{"type":"string","nullable":true},"errors":{"type":"object","nullable":true},"retry_after":{"type":"integer","nullable":true}}}}},"x-webhook-events":["notification.sent","notification.delivered","notification.opened","notification.failed"],"x-webhook-signature":{"header":"X-HUAR-Signature","algorithm":"HMAC-SHA256","input":"Corpo JSON bruto recebido no POST"},"x-webhook-payload-example":{"event":"notification.sent","notification":{"id":123,"code":"AR-HUABC123","public_uuid":"550e8400-e29b-41d4-a716-446655440000","status":"sent","channel":"email","recipient":"cliente@example.com","message_id":"provider-message-id","sent_at":"2026-12-06T06:57:35-03:00","delivered_at":null,"opened_at":null},"sent_at":"2026-12-06T06:57:35-03:00"}}