openapi.yaml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. openapi: 3.1.0
  2. info:
  3. title: yuban-server business capability API
  4. version: 1.0.0
  5. servers:
  6. - url: https://business-api.yuban.co
  7. paths:
  8. /health:
  9. get:
  10. operationId: health
  11. responses:
  12. '200':
  13. description: Service is healthy
  14. /recording-transcription/jobs:
  15. post:
  16. operationId: createRecordingTranscriptionJob
  17. security:
  18. - bearerAuth: []
  19. parameters:
  20. - in: header
  21. name: Idempotency-Key
  22. schema:
  23. type: string
  24. requestBody:
  25. required: true
  26. content:
  27. application/json:
  28. schema:
  29. $ref: '#/components/schemas/CreateRecordingTranscriptionJob'
  30. responses:
  31. '202':
  32. description: Job accepted
  33. content:
  34. application/json:
  35. schema:
  36. $ref: '#/components/schemas/JobResponse'
  37. /recording-transcription/jobs/{jobId}:
  38. parameters:
  39. - $ref: '#/components/parameters/JobId'
  40. get:
  41. operationId: getRecordingTranscriptionJob
  42. security:
  43. - bearerAuth: []
  44. responses:
  45. '200':
  46. description: Current job state
  47. content:
  48. application/json:
  49. schema:
  50. $ref: '#/components/schemas/JobResponse'
  51. /recording-transcription/jobs/{jobId}/cancel:
  52. parameters:
  53. - $ref: '#/components/parameters/JobId'
  54. post:
  55. operationId: cancelRecordingTranscriptionJob
  56. security:
  57. - bearerAuth: []
  58. responses:
  59. '200':
  60. description: Job cancelled or already terminal
  61. content:
  62. application/json:
  63. schema:
  64. $ref: '#/components/schemas/JobResponse'
  65. components:
  66. securitySchemes:
  67. bearerAuth:
  68. type: http
  69. scheme: bearer
  70. parameters:
  71. JobId:
  72. in: path
  73. name: jobId
  74. required: true
  75. schema:
  76. type: string
  77. format: uuid
  78. schemas:
  79. CreateRecordingTranscriptionJob:
  80. type: object
  81. required: [audioUrl]
  82. additionalProperties: false
  83. properties:
  84. audioUrl:
  85. type: string
  86. format: uri
  87. durationMs:
  88. type: integer
  89. minimum: 1
  90. roleType:
  91. type: integer
  92. enum: [0, 1]
  93. default: 1
  94. roleNum:
  95. type: integer
  96. minimum: 0
  97. maximum: 10
  98. default: 0
  99. requestId:
  100. type: string
  101. maxLength: 200
  102. JobResponse:
  103. type: object
  104. required: [success, job]
  105. properties:
  106. success:
  107. type: boolean
  108. const: true
  109. reused:
  110. type: boolean
  111. job:
  112. $ref: '#/components/schemas/Job'
  113. Job:
  114. type: object
  115. required: [id, status, stage, progress, createdAt, updatedAt, expiresAt]
  116. properties:
  117. id:
  118. type: string
  119. format: uuid
  120. status:
  121. type: string
  122. enum: [queued, running, completed, failed, cancelled]
  123. stage:
  124. type: string
  125. progress:
  126. type: integer
  127. minimum: 0
  128. maximum: 100
  129. createdAt:
  130. type: string
  131. format: date-time
  132. updatedAt:
  133. type: string
  134. format: date-time
  135. heartbeatAt:
  136. type: [string, 'null']
  137. format: date-time
  138. expiresAt:
  139. type: string
  140. format: date-time
  141. result:
  142. $ref: '#/components/schemas/TranscriptionResult'
  143. error:
  144. $ref: '#/components/schemas/Error'
  145. TranscriptionResult:
  146. type: object
  147. required: [text, segments, charCount, sha256]
  148. properties:
  149. text:
  150. type: string
  151. segments:
  152. type: array
  153. items:
  154. $ref: '#/components/schemas/Segment'
  155. charCount:
  156. type: integer
  157. sha256:
  158. type: string
  159. pattern: '^[0-9a-f]{64}$'
  160. Segment:
  161. type: object
  162. required: [text]
  163. properties:
  164. text:
  165. type: string
  166. startMs:
  167. type: [integer, 'null']
  168. endMs:
  169. type: [integer, 'null']
  170. speakerId:
  171. type: [string, 'null']
  172. Error:
  173. type: object
  174. required: [code, message, retryable]
  175. properties:
  176. code:
  177. type: string
  178. message:
  179. type: string
  180. retryable:
  181. type: boolean