{"openapi":"3.1.0","info":{"title":"RewindRewind API","version":"1.0.0"},"servers":[{"url":"https://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":["owner","admin","developer","viewer"]},"retention_days":{"type":"integer"},"disabled_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"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"},"author_user_id":{"type":["string","null"]},"author_email":{"type":["string","null"]},"body":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}},"security":[{"sessionCookie":[]},{"bearerApiKey":[]}],"paths":{"/api/health":{"get":{"summary":"Health check","security":[],"responses":{"200":{"description":"D1 is reachable"}}}},"/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"}}],"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}/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":"distinct_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"}}}}}}