{"openapi":"3.0.3","info":{"title":"OpsDesk API","version":"1.0.0","description":"OpsDesk REST API v1. Web UI and API write operations share the same incident service layer."},"servers":[{"url":"https://jakka.alwaysdata.net/api/v1"}],"paths":{"/incidents/":{"get":{"summary":"List incidents","parameters":[{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Search incident number, title, and description","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Filter by status","schema":{"type":"string"}},{"name":"priority","in":"query","required":false,"description":"Filter by priority","schema":{"type":"string"}},{"name":"application","in":"query","required":false,"description":"Filter by application id","schema":{"type":"string"}},{"name":"environment","in":"query","required":false,"description":"Filter by environment","schema":{"type":"string"}},{"name":"ordering","in":"query","required":false,"description":"detected_at, priority, or status with optional '-' prefix","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated incident list"}}},"post":{"summary":"Create incident","description":"Requires Operator or Administrator.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentCreate"}}}},"responses":{"201":{"description":"Incident created"},"403":{"description":"Permission denied"}}}},"/incidents/{id}/":{"get":{"summary":"Get incident","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Incident detail"},"404":{"description":"Not found"}}},"patch":{"summary":"Update incident","description":"Requires Operator or Administrator.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentUpdate"}}}},"responses":{"200":{"description":"Incident updated"},"403":{"description":"Permission denied"}}}},"/incidents/{id}/comments/":{"post":{"summary":"Add comment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comment"}}}},"responses":{"201":{"description":"Comment added"}}}},"/incidents/{id}/assign/":{"post":{"summary":"Assign incident","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assignment"}}}},"responses":{"200":{"description":"Assignment updated"}}}},"/incidents/{id}/status/":{"post":{"summary":"Change incident status","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusChange"}}}},"responses":{"200":{"description":"Status changed"}}}},"/incidents/{id}/audit/":{"get":{"summary":"Incident audit history","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Audit records"}}}},"/applications/":{"get":{"summary":"List applications","responses":{"200":{"description":"Application list"}}}},"/statistics/":{"get":{"summary":"Operational statistics","parameters":[{"name":"period","in":"query","required":false,"description":"7, 30, 90, or all","schema":{"type":"string"}}],"responses":{"200":{"description":"Statistics"}}}}},"components":{"schemas":{"IncidentCreate":{"type":"object","required":["title","description","application_id","priority","environment"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"application_id":{"type":"integer"},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH","CRITICAL"]},"environment":{"type":"string","enum":["PRODUCTION","TEST","DEVELOPMENT"]}}},"IncidentUpdate":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"application_id":{"type":"integer"},"priority":{"type":"string"},"environment":{"type":"string"},"status":{"type":"string"}}},"Comment":{"type":"object","required":["comment"],"properties":{"comment":{"type":"string","maxLength":2000}}},"Assignment":{"type":"object","required":["user_id"],"properties":{"user_id":{"type":"integer"}}},"StatusChange":{"type":"object","description":"Valid lifecycle changes: NEW to INVESTIGATING/WAITING/RESOLVED; INVESTIGATING to WAITING/RESOLVED; WAITING to INVESTIGATING/RESOLVED; RESOLVED to CLOSED.","required":["status"],"properties":{"status":{"type":"string","enum":["NEW","INVESTIGATING","WAITING","RESOLVED","CLOSED"]}}},"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"fields":{"type":"object"}}}}}}