{"openapi":"3.1.0","info":{"title":"RewindRewind API","version":"1.0.0"},"servers":[{"url":"http://rewindrewind.com"}],"components":{"securitySchemes":{"bearerApiKey":{"type":"http","scheme":"bearer"},"sessionCookie":{"type":"apiKey","in":"cookie","name":"better-auth.session_token"}},"schemas":{"Error":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","enum":[false]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"Pagination":{"type":"object","required":["limit","next_cursor","has_more"],"properties":{"limit":{"type":"integer","minimum":1,"maximum":500},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}}},"Project":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":"string"},"account_name":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"role":{"type":"string","enum":["admin","member"]},"retention_days":{"type":"integer"},"uptime_enabled":{"type":"boolean"},"uptime_url":{"type":["string","null"],"format":"uri"},"disabled_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"HealthRuleSpecification":{"type":"object","required":["name","measure","window","operator","missing_data","severity","display_order","dashboard_visible","enabled"],"properties":{"name":{"type":"string","maxLength":120},"description":{"type":["string","null"]},"measure":{"type":"object","description":"Typed event, uptime, exception, or comparison measure"},"environment":{"type":["string","null"]},"source":{"type":["string","null"]},"unit":{"type":["string","null"]},"property_filters":{"type":"object","maxProperties":8},"window":{"type":"object","description":"Rolling, calendar, or instantaneous effective window"},"operator":{"type":"string","enum":[">",">=","<","<=","=","!="]},"target":{"type":"number"},"missing_data":{"type":"string","enum":["unknown","zero"]},"severity":{"type":"string","enum":["required","informational"]},"display_order":{"type":"integer","minimum":0},"dashboard_visible":{"type":"boolean"},"enabled":{"type":"boolean"}}},"Event":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"environment":{"type":"string"},"release":{"type":["string","null"]},"timestamp":{"type":"string","format":"date-time"},"received_at":{"type":"string","format":"date-time"}}},"Issue":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"title":{"type":"string"},"environment":{"type":"string"},"first_seen":{"type":"string","format":"date-time"},"last_seen":{"type":"string","format":"date-time"},"count":{"type":"integer"}}},"IssueComment":{"type":"object","properties":{"id":{"type":"string"},"issue_id":{"type":"string"},"body":{"type":"string"},"author_name":{"type":"string","description":"Display name: the signed-in user's name, or the API key's name for API/CLI comments."},"author_type":{"type":"string","enum":["user","api_key"]},"author_user_id":{"type":["string","null"]},"author_api_key_id":{"type":["string","null"]},"edited":{"type":"boolean","description":"True once the comment has been edited. The original text is retained server-side."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"edited_at":{"type":["string","null"],"format":"date-time"}}}}},"security":[{"sessionCookie":[]},{"bearerApiKey":[]}],"paths":{"/api/health":{"get":{"summary":"Health check","security":[],"responses":{"200":{"description":"Service is healthy"}}}},"/v1/events":{"post":{"summary":"Ingest one event","security":[{"bearerApiKey":[]}],"responses":{"202":{"description":"Event accepted"},"4XX":{"description":"Request error","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","enum":[false]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/v1/events/batch":{"post":{"summary":"Ingest a batch of events","security":[{"bearerApiKey":[]}],"responses":{"202":{"description":"Events accepted"}}}},"/v1/exceptions":{"post":{"summary":"Ingest an exception","security":[{"bearerApiKey":[]}],"responses":{"202":{"description":"Exception accepted"}}}},"/v1/source-maps":{"post":{"summary":"Upload a source map","security":[{"bearerApiKey":[]}],"responses":{"202":{"description":"Source map accepted"}}}},"/api/projects":{"get":{"summary":"List projects available to the signed-in user","responses":{"200":{"description":"Project list"}}},"post":{"summary":"Create a project","responses":{"201":{"description":"Project created"}}}},"/api/projects/{project_id}":{"get":{"summary":"Read a project","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Project"}}},"patch":{"summary":"Update project settings","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"uptime_enabled":{"type":"boolean"},"uptime_url":{"type":["string","null"],"format":"uri"}}}}}},"responses":{"200":{"description":"Updated project"}}},"delete":{"summary":"Disable a project","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Disabled project"}}}},"/api/projects/{project_id}/notifications":{"get":{"summary":"Read the project's notification configuration","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Notification configuration"}}},"patch":{"summary":"Update the project notification default and repeat cadence","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated notification configuration"}}}},"/api/projects/{project_id}/event-types":{"get":{"summary":"Suggest retained event types for rule builders","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","schema":{"type":"string","maxLength":120}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":25,"default":12}}],"responses":{"200":{"description":"Matching event types, usage counts, and exact-match state"}}}},"/api/projects/{project_id}/health":{"get":{"summary":"Read current project health and durable evaluation history","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"history_limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500}}],"responses":{"200":{"description":"Project health"}}}},"/api/projects/{project_id}/health/rules":{"get":{"summary":"List current health rules and their latest evaluations","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Current health rules"}}},"post":{"summary":"Create and immediately evaluate a typed health rule","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthRuleSpecification"}}}},"responses":{"201":{"description":"Created rule version"}}}},"/api/projects/{project_id}/health/rules/{rule_id}":{"get":{"summary":"Get one current health rule and its latest evaluation","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Current health rule"},"404":{"description":"Rule not found"}}},"patch":{"summary":"Create a new immutable version of a health rule","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthRuleSpecification"}}}},"responses":{"200":{"description":"Updated rule version"}}},"delete":{"summary":"Archive a health rule while preserving evaluation history","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Archived rule"}}}},"/api/projects/{project_id}/health/evaluate":{"post":{"summary":"Evaluate all current project health rules now","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"New evaluations and aggregate status"}}}},"/api/projects/{project_id}/notifications/environments":{"patch":{"summary":"Set a per-environment on/off override of the project notification default","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated notification configuration"}}}},"/api/projects/{project_id}/events":{"get":{"summary":"Query events","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"type","in":"query","schema":{"type":"string"}},{"name":"environment","in":"query","schema":{"type":"string"}},{"name":"release","in":"query","schema":{"type":"string"}},{"name":"source","in":"query","schema":{"type":"string"}},{"name":"identity_id","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated events"}}}},"/api/projects/{project_id}/events/{event_id}/raw":{"get":{"summary":"Fetch raw event payload","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"event_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Raw payload"}}}},"/api/projects/{project_id}/issues":{"get":{"summary":"Query exception issues","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"environment","in":"query","schema":{"type":"string"}},{"name":"fingerprint","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated issues"}}}},"/api/projects/{project_id}/issues/{issue_id}":{"get":{"summary":"Read an issue with occurrences and comments","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"issue_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Issue detail"}}},"patch":{"summary":"Update issue status or assignment","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"issue_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated issue"}}}},"/api/projects/{project_id}/issues/{issue_id}/comments":{"get":{"summary":"List issue comments","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"issue_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated comments"}}},"post":{"summary":"Create an issue comment","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"issue_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created comment"}}}},"/api/projects/{project_id}/issues/{issue_id}/comments/{comment_id}":{"patch":{"summary":"Update an issue comment","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"issue_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"comment_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated comment"}}},"delete":{"summary":"Delete an issue comment","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"issue_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"comment_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted comment"}}}},"/api/projects/{project_id}/export":{"get":{"summary":"Export project data","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"before","in":"query","schema":{"type":"string"}},{"name":"include_raw","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Project export"}}}},"/api/projects/{project_id}/ingestion-health":{"get":{"summary":"Read ingestion health","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Ingestion health"}}}},"/api/projects/{project_id}/retention/run":{"post":{"summary":"Run retention cleanup","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Retention result"}}}}}}