{"openapi":"3.1.1","info":{"title":"Jie Ligang International Consultations","version":"1.0.0"},"servers":[{"url":"https://consult.yundongyl.cn"}],"paths":{"/v1/service":{"get":{"operationId":"discover_service","summary":"Find the clinician, currently eligible regions and published guides","parameters":[],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"type":"object","properties":{"name":{"type":"string"},"chineseName":{"type":"string"},"specialty":{"type":"string"},"description":{"type":"string"},"languages":{"type":"array","items":{"type":"string"}}},"required":["name","chineseName","specialty","description","languages"]},"regions":{"type":"array","items":{"type":"string"}},"guides":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string"},"answer":{"type":"string"}},"required":["title","url","answer"]}},"sandbox":{"type":"boolean"},"consultationFee":{"type":"number"}},"required":["profile","regions","guides","sandbox","consultationFee"]}}}},"400":{"description":"Invalid input"},"401":{"description":"Authentication required"},"403":{"description":"Region or grant does not allow this action"},"404":{"description":"Not found"},"409":{"description":"Request ID was already used with different content"},"429":{"description":"Rate limited"}}}},"/v1/consultations":{"post":{"operationId":"create_consultation","summary":"Submit the patient-approved question in their confirmed location","parameters":[],"security":[{"patientDelegation":["create"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"region":{"type":"string","pattern":"^(?:[A-Z]{2}|US-[A-Z]{2})$"},"body":{"type":"string","minLength":1,"maxLength":6000},"requestId":{"type":"string","pattern":"^[\\w.-]{8,120}$","description":"Stable unique request identifier. Reuse it when retrying."},"photo":{"description":"Optional JPEG, PNG or WebP image, base64 encoded, up to 3 MiB.","type":"string","maxLength":4194304}},"required":["region","body","requestId"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"]}}}},"400":{"description":"Invalid input"},"401":{"description":"Authentication required"},"403":{"description":"Region or grant does not allow this action"},"404":{"description":"Not found"},"409":{"description":"Request ID was already used with different content"},"429":{"description":"Rate limited"}}}},"/v1/consultations/{id}":{"get":{"operationId":"get_consultation","summary":"Read this consultation and its messages after an optional cursor","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"query","name":"after","schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"required":false}],"security":[{"patientDelegation":["read"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"region":{"type":"string"},"status":{"enum":["submitted","awaiting_doctor","needs_information","answered"]},"handoff":{"type":"boolean"},"allowTraining":{"type":"boolean"},"nextCursor":{"type":"integer"},"items":{"type":"array","items":{"type":"object","properties":{"seq":{"type":"integer"},"author":{"enum":["patient","agent","doctor"]},"body":{"type":"string"},"kind":{"type":"string"},"at":{"type":"string","format":"date-time"},"hasImage":{"type":"boolean"},"signed":{"type":"boolean"}},"required":["seq","author","body","kind","at","hasImage","signed"]}}},"required":["id","region","status","handoff","allowTraining","nextCursor","items"]}}}},"400":{"description":"Invalid input"},"401":{"description":"Authentication required"},"403":{"description":"Region or grant does not allow this action"},"404":{"description":"Not found"},"409":{"description":"Request ID was already used with different content"},"429":{"description":"Rate limited"}}}},"/v1/consultations/{id}/messages":{"post":{"operationId":"add_message","summary":"Add text or a photo, or ask for a human clinician","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true}],"security":[{"patientDelegation":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"region":{"type":"string","pattern":"^(?:[A-Z]{2}|US-[A-Z]{2})$"},"body":{"type":"string","minLength":1,"maxLength":6000},"kind":{"default":"question","type":"string","enum":["question","handoff"]},"requestId":{"type":"string","pattern":"^[\\w.-]{8,120}$","description":"Stable unique request identifier. Reuse it when retrying."},"photo":{"description":"Optional JPEG, PNG or WebP image, base64 encoded, up to 3 MiB.","type":"string","maxLength":4194304}},"required":["region","body","requestId"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"seq":{"type":"integer"}},"required":["seq"]}}}},"400":{"description":"Invalid input"},"401":{"description":"Authentication required"},"403":{"description":"Region or grant does not allow this action"},"404":{"description":"Not found"},"409":{"description":"Request ID was already used with different content"},"429":{"description":"Rate limited"}}}},"/v1/consultations/{id}/photos/{seq}":{"get":{"operationId":"get_attachment","summary":"Retrieve the authorized message photo as base64 JPEG","parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"required":true},{"in":"path","name":"seq","schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"required":true}],"security":[{"patientDelegation":["read"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"mimeType":{"const":"image/jpeg"},"data":{"type":"string","contentEncoding":"base64"}},"required":["mimeType","data"]}}}},"400":{"description":"Invalid input"},"401":{"description":"Authentication required"},"403":{"description":"Region or grant does not allow this action"},"404":{"description":"Not found"},"409":{"description":"Request ID was already used with different content"},"429":{"description":"Rate limited"}}}}},"components":{"securitySchemes":{"patientDelegation":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://consult.yundongyl.cn/oauth/authorize","tokenUrl":"https://consult.yundongyl.cn/oauth/token","scopes":{"create":"Submit the approved question","read":"Read this conversation","write":"Add messages to this conversation"}}}}}}}