{"openapi":"3.0.0","x-samples-languages":["curl","javascript","node","java","kotlin","python","php","go","swift"],"info":{"version":"v1.0","title":"Support API 1.0"},"servers":[{"url":"/v1/support"}],"paths":{"/tickets":{"get":{"summary":"List support tickets","operationId":"listSupportTickets","tags":["SupportTickets"],"parameters":[{"$ref":"#/components/parameters/ticketStatus"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Support tickets list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportTicketListResponse"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"500":{"$ref":"#/components/responses/500InternalServerErr"}}}},"/tickets/{ticketId}":{"get":{"summary":"Gets a support ticket by id","operationId":"getSupportTicket","tags":["SupportTickets"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ticketId"}],"responses":{"200":{"description":"Support ticket","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportTicket"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"500":{"$ref":"#/components/responses/500InternalServerErr"}}}},"/tickets/{ticketId}/comments":{"post":{"summary":"Add comment to a support ticket (reply to ticket)","operationId":"addSupportTicketComment","tags":["SupportTickets"],"parameters":[{"$ref":"#/components/parameters/ticketId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddSupportTicketCommentRequest"}}}},"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Successfully commented."},"400":{"$ref":"#/components/responses/400InvalidInput"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerErr"}}}},"/trips/{tripId}/tickets":{"get":{"summary":"List support tickets for the trip","operationId":"listTripSupportTickets","tags":["SupportTickets"],"parameters":[{"$ref":"#/components/parameters/tripId"},{"$ref":"#/components/parameters/ticketStatus"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Support tickets list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportTicketListResponse"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"500":{"$ref":"#/components/responses/500InternalServerErr"}}},"post":{"summary":"Creates a trip support ticket","operationId":"createTripSupportTicket","tags":["SupportTickets"],"parameters":[{"$ref":"#/components/parameters/tripId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTripSupportTicketRequest"}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTripSupportTicketResponse"}}}},"400":{"$ref":"#/components/responses/400InvalidInput"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerErr"}}}}},"components":{"schemas":{"SupportTicket":{"type":"object","required":["id","status","tripId","createdAt","updatedAt","lastUpdatedBy","description","raisedBy"],"properties":{"id":{"type":"string","example":"33"},"status":{"type":"string","enum":["open","closed"]},"tripId":{"type":"string","example":"48dc7a9c-2117-44c7-8b87-1864d237b086"},"createdAt":{"type":"string","example":"2023-08-15T09:36:50Z"},"updatedAt":{"type":"string","example":"2023-08-15T09:36:50Z"},"description":{"type":"string","example":"**Demand Org** has just raised a dispute about the trip no. **4DFD-82FB**"},"raisedBy":{"type":"string","enum":["supply","demand"]},"lastUpdatedBy":{"type":"string","enum":["supply","demand","karhoo"]}}},"CreateTripSupportTicketRequest":{"type":"object","required":["subject","comment"],"properties":{"subject":{"type":"string","example":"Driver no show for trip 4DFD-82FB"},"comment":{"type":"string","example":"A penalty of 150% of total fare imposed for a driver no-show"},"contactEmail":{"type":"string","format":"email","example":"my-overriden-email@karhoo.com"}}},"CreateTripSupportTicketResponse":{"type":"object","required":["ticketId"],"properties":{"ticketId":{"type":"string"}}},"AddSupportTicketCommentRequest":{"type":"object","required":["comment"],"properties":{"comment":{"type":"string"}}},"SupportTicketListResponse":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SupportTicket"}}}}},"responses":{"400InvalidInput":{"description":"Bad Request. The request was invalid.","content":{"application/json":{"schema":{"type":"object","required":["message","statusCode"],"properties":{"message":{"type":"string","example":"Invalid request payload","description":"Details of the error"},"statusCode":{"type":"number","example":400}}}}}},"401Unauthorized":{"description":"Unauthorized. The request requires user authentication (not logged in).","content":{"application/json":{"schema":{"type":"object","required":["message","statusCode"],"properties":{"message":{"type":"string","example":"Could not authenticate","description":"Details of the error"},"statusCode":{"type":"number","example":401}}}}}},"403Forbidden":{"description":"Forbidden. The credentials provided do not have sufficient authority for this request.","content":{"application/json":{"schema":{"type":"object","required":["message","statusCode"],"properties":{"message":{"type":"string","example":"Missing required role for this request","description":"Details of the error"},"statusCode":{"type":"number","example":403}}}}}},"404NotFound":{"description":"Not found. Requested resource could not be found.","content":{"application/json":{"schema":{"type":"object","required":["message","statusCode"],"properties":{"message":{"type":"string","example":"Not found","description":"Details of the error"},"statusCode":{"type":"number","example":404}}}}}},"500InternalServerErr":{"description":"Internal server error. Something has gone wrong on the website's server, but the server could not be more specific on what the exact problem is.","content":{"application/json":{"schema":{"type":"object","required":["message","statusCode"],"properties":{"message":{"type":"string","example":"General request error","description":"Details of the error"},"statusCode":{"type":"number","example":500}}}}}}},"parameters":{"tripId":{"in":"path","name":"tripId","required":true,"schema":{"type":"string"},"description":"Unique identifier of the trip"},"ticketId":{"in":"path","name":"ticketId","required":true,"schema":{"type":"string"},"description":"Unique identifier of the support ticket"},"ticketStatus":{"name":"status","in":"query","required":false,"description":"The status of the support ticket","schema":{"type":"string"}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"x-readme":{"explorer-enabled":true,"proxy-enabled":true}}