{"openapi":"3.1.0","info":{"title":"API blueup","version":"1.0.0","description":"Dados do monitor de tracking do blueup: sites, índice de saúde, achados, auditorias e alertas. Autenticação por chave (Bearer). Planos Empresa e Agência."},"servers":[{"url":"https://api.blueup.app/v1"}],"security":[{"bearer":[]}],"tags":[{"name":"Conta"},{"name":"Sites"},{"name":"Achados"},{"name":"Auditorias"},{"name":"Alertas"}],"paths":{"/me":{"get":{"tags":["Conta"],"summary":"Conta, plano e níveis da chave","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/sites":{"get":{"tags":["Sites"],"summary":"Sites que a chave alcança","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Site"}},"next_before":{"type":["string","null"],"format":"date-time"}}}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/sites/{id}":{"get":{"tags":["Sites"],"summary":"Detalhe do site (ferramentas, jornada, endereços, GTM)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/sites/{id}/health":{"get":{"tags":["Sites"],"summary":"Índice de saúde atual, série histórica e situação por área","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":365,"default":30}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthReport"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/sites/{id}/findings":{"get":{"tags":["Achados"],"summary":"Achados do site","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["open","in_progress","ignored","resolved"],"default":"open"}},{"name":"severity","in":"query","schema":{"type":"string","enum":["problem","attention"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"before","in":"query","description":"Data ISO 8601: devolve itens anteriores (use next_before da página anterior).","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Finding"}},"next_before":{"type":["string","null"],"format":"date-time"}}}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/sites/{id}/audits":{"get":{"tags":["Auditorias"],"summary":"Auditorias do site","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"before","in":"query","description":"Data ISO 8601: devolve itens anteriores (use next_before da página anterior).","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Audit"}},"next_before":{"type":["string","null"],"format":"date-time"}}}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/audits/{id}":{"get":{"tags":["Auditorias"],"summary":"Uma auditoria (com o relatório completo quando concluída)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Audit"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/alerts":{"get":{"tags":["Alertas"],"summary":"Alertas confirmados pelo monitor","parameters":[{"name":"site","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"before","in":"query","description":"Data ISO 8601: devolve itens anteriores (use next_before da página anterior).","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Alert"}},"next_before":{"type":["string","null"],"format":"date-time"}}}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Chave criada em Painel → API (formato bu_live_…)."}},"responses":{"Error":{"description":"Erro","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}},"schemas":{"Health":{"type":"object","properties":{"score":{"type":["integer","null"],"minimum":0,"maximum":100},"band":{"type":["string","null"],"enum":["healthy","attention","critical",null]}}},"Me":{"type":"object","properties":{"account":{"type":"object"},"key":{"type":"object"},"sites":{"type":"integer"}}},"Site":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"url":{"type":"string"},"status":{"type":"string","enum":["monitoring","pending_verification","paused"]},"client":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},"monitor":{"type":"object","properties":{"frequency":{"type":"string"},"hour":{"type":"integer"},"next_audit_at":{"type":["string","null"]}}},"health":{"$ref":"#/components/schemas/Health"},"open_findings":{"type":"object","properties":{"bad":{"type":"integer"},"warn":{"type":"integer"}}},"last_audit_at":{"type":["string","null"],"format":"date-time"}}},"HealthReport":{"type":"object","properties":{"current":{"$ref":"#/components/schemas/Health"},"series":{"type":"array","items":{"type":"object","properties":{"audit_id":{"type":"string"},"at":{"type":"string"},"score":{"type":"integer"},"band":{"type":"string"}}}},"by_area":{"type":"array","items":{"type":"object","properties":{"area":{"type":"string"},"ok":{"type":"integer"},"attention":{"type":"integer"},"problems":{"type":"integer"}}}}}},"Finding":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"check":{"type":"string","examples":["SITE-JRN-GA4"]},"area":{"type":"string"},"severity":{"type":"string","enum":["problem","attention","info"]},"title":{"type":"string"},"detail":{"type":"string"},"evidence":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["open","in_progress","ignored","resolved"]},"assignee":{"type":["object","null"]},"due_date":{"type":["string","null"],"format":"date"},"first_seen_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","format":"date-time"},"resolved_at":{"type":["string","null"],"format":"date-time"}}},"Audit":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"trigger":{"type":"string","enum":["manual","scheduled","confirmation","api"]},"status":{"type":"string","enum":["queued","running","completed","failed"]},"health":{"$ref":"#/components/schemas/Health"},"summary":{"type":["object","null"]},"finished_at":{"type":["string","null"],"format":"date-time"},"report":{"type":["object","null"],"description":"Só em GET /audits/{id} de auditoria concluída: checagens, ferramentas, consentimento, jornada, cobertura e GTM."}}},"Alert":{"type":"object","properties":{"id":{"type":"string"},"site_id":{"type":"string"},"audit_id":{"type":["string","null"]},"type":{"type":"string"},"severity":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}}}}}