{"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":"https://rest.sandbox.karhoo.com/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":"Get 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"}}}},"/tickets/{ticketId}/resend-last-message":{"post":{"summary":"Resend the last message in support ticket","operationId":"resendTicketLastMessage","tags":["SupportTickets"],"parameters":[{"$ref":"#/components/parameters/ticketId"}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendLastMessageResponse"}}}},"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"}}}},"/demand/trips/{partnerTripId}/tickets":{"post":{"summary":"Create a trip support ticket for demand partner trip ID","operationId":"createTripSupportTicketForDemandPartner","tags":["SupportTickets"],"parameters":[{"$ref":"#/components/parameters/partnerTripId"}],"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"}}}},"/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":"Create 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"}}}},"/trips/{tripId}/resend-last-message":{"post":{"summary":"Resend the last message in support ticket created for the trip","operationId":"resendLastMessage","tags":["SupportTickets"],"parameters":[{"$ref":"#/components/parameters/tripId"}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendLastMessageResponse"}}}},"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"}}}},"/upload-attachment":{"post":{"summary":"Upload an attachment","operationId":"uploadAttachment","tags":["SupportTickets"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"Successfully uploaded","content":{"application/json":{"schema":{"type":"object","required":["resourceToken"],"properties":{"resourceToken":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/400InvalidInput"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"500":{"$ref":"#/components/responses/500InternalServerErr"}}}}},"components":{"schemas":{"TicketStatus":{"type":"string","enum":["open","closed"]},"SupportTicketParty":{"type":"string","enum":["supply","demand"]},"SupportTicket":{"type":"object","required":["id","subject","status","tripId","createdAt","updatedAt","description","raisedBy"],"properties":{"id":{"type":"string","example":"1234"},"subject":{"type":"string","example":"Flight number update request"},"status":{"$ref":"#/components/schemas/TicketStatus"},"tripId":{"type":"string","format":"uuid","example":"48dc7a9c-2117-44c7-8b87-1864d237b086"},"createdAt":{"type":"string","format":"date-time","example":"2023-08-15T09:36:50Z"},"updatedAt":{"type":"string","format":"date-time","example":"2023-08-15T09:36:50Z"},"description":{"type":"string","example":"**Demand Org** has just raised a dispute about the trip no. **4DFD-82FB**"},"raisedBy":{"$ref":"#/components/schemas/SupportTicketParty"}}},"CreateTripSupportTicketRequest":{"type":"object","required":["subject","comment"],"properties":{"subject":{"type":"string","description":"Subject of the support ticket","example":"Driver no show for trip 4DFD-82FB"},"comment":{"type":"string","description":"Content of the ticket","example":"A penalty of 150% of total fare imposed for a driver no-show"},"supplyTicketType":{"type":"string","enum":["operational","financial"],"description":"Type of the ticket, affects the way the ticket is assigned","example":"operational"},"contactEmail":{"type":"string","format":"email","description":"By default contact e-mail is the user organisation e-mail. It can be overriden by providing different e-mail address.","example":"my-overriden-email@karhoo.com"},"attachments":{"type":"array","items":{"type":"string","description":"Zendesk resource token representing attachment","example":"eBJeFJwowD8ybbsXMpr2JbMdA"}}}},"CreateTripSupportTicketResponse":{"type":"object","required":["ticketId"],"properties":{"ticketId":{"type":"string","example":"33"}}},"AddSupportTicketCommentRequest":{"type":"object","required":["comment"],"properties":{"comment":{"type":"string","example":"An example of reply to the support ticket","description":"Content of the reply"}}},"SupportTicketListResponse":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SupportTicket"}}}},"ResendLastMessageResponse":{"type":"object","required":["ticketId"],"properties":{"ticketId":{"type":"string","example":"33"}}}},"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","format":"uuid"},"description":"Unique identifier of the trip. This is Karhoo generated Booking ID. For more details see [Booking API Reference](/v1/bookings/#book-a-trip).","example":"c791907b-8608-4761-9b10-06e641e155c5"},"partnerTripId":{"in":"path","name":"partnerTripId","required":true,"schema":{"type":"string"},"description":"Partner's identifier of the trip"},"ticketId":{"in":"path","name":"ticketId","required":true,"schema":{"type":"string"},"description":"Unique identifier of the support ticket","example":"33"},"ticketStatus":{"name":"status","in":"query","required":false,"description":"The status of the support ticket","schema":{"$ref":"#/components/schemas/TicketStatus"}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"x-readme":{"explorer-enabled":true,"proxy-enabled":true}}