rest-api.json 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. {
  2. "openapi": "3.1.0",
  3. "info": {
  4. "title": "Embedchain REST API",
  5. "description": "This is the REST API for Embedchain.",
  6. "license": {
  7. "name": "Apache 2.0",
  8. "url": "https://github.com/embedchain/embedchain/blob/main/LICENSE"
  9. },
  10. "version": "0.0.1"
  11. },
  12. "paths": {
  13. "/ping": {
  14. "get": {
  15. "tags": ["Utility"],
  16. "summary": "Check status",
  17. "description": "Endpoint to check the status of the API",
  18. "operationId": "check_status_ping_get",
  19. "responses": {
  20. "200": {
  21. "description": "Successful Response",
  22. "content": { "application/json": { "schema": {} } }
  23. }
  24. }
  25. }
  26. },
  27. "/apps": {
  28. "get": {
  29. "tags": ["Apps"],
  30. "summary": "Get all apps",
  31. "description": "Get all applications",
  32. "operationId": "get_all_apps_apps_get",
  33. "responses": {
  34. "200": {
  35. "description": "Successful Response",
  36. "content": { "application/json": { "schema": {} } }
  37. }
  38. }
  39. }
  40. },
  41. "/create": {
  42. "post": {
  43. "tags": ["Apps"],
  44. "summary": "Create app",
  45. "description": "Create a new app using App ID",
  46. "operationId": "create_app_using_default_config_create_post",
  47. "parameters": [
  48. {
  49. "name": "app_id",
  50. "in": "query",
  51. "required": true,
  52. "schema": { "type": "string", "title": "App Id" }
  53. }
  54. ],
  55. "requestBody": {
  56. "content": {
  57. "multipart/form-data": {
  58. "schema": {
  59. "allOf": [
  60. {
  61. "$ref": "#/components/schemas/Body_create_app_using_default_config_create_post"
  62. }
  63. ],
  64. "title": "Body"
  65. }
  66. }
  67. }
  68. },
  69. "responses": {
  70. "200": {
  71. "description": "Successful Response",
  72. "content": {
  73. "application/json": {
  74. "schema": { "$ref": "#/components/schemas/DefaultResponse" }
  75. }
  76. }
  77. },
  78. "422": {
  79. "description": "Validation Error",
  80. "content": {
  81. "application/json": {
  82. "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
  83. }
  84. }
  85. }
  86. }
  87. }
  88. },
  89. "/{app_id}/data": {
  90. "get": {
  91. "tags": ["Apps"],
  92. "summary": "Get data",
  93. "description": "Get all data sources for an app",
  94. "operationId": "get_datasources_associated_with_app_id__app_id__data_get",
  95. "parameters": [
  96. {
  97. "name": "app_id",
  98. "in": "path",
  99. "required": true,
  100. "schema": { "type": "string", "title": "App Id" }
  101. }
  102. ],
  103. "responses": {
  104. "200": {
  105. "description": "Successful Response",
  106. "content": { "application/json": { "schema": {} } }
  107. },
  108. "422": {
  109. "description": "Validation Error",
  110. "content": {
  111. "application/json": {
  112. "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
  113. }
  114. }
  115. }
  116. }
  117. }
  118. },
  119. "/{app_id}/add": {
  120. "post": {
  121. "tags": ["Apps"],
  122. "summary": "Add data",
  123. "description": "Add a data source to an app.",
  124. "operationId": "add_datasource_to_an_app__app_id__add_post",
  125. "parameters": [
  126. {
  127. "name": "app_id",
  128. "in": "path",
  129. "required": true,
  130. "schema": { "type": "string", "title": "App Id" }
  131. }
  132. ],
  133. "requestBody": {
  134. "required": true,
  135. "content": {
  136. "application/json": {
  137. "schema": { "$ref": "#/components/schemas/SourceApp" }
  138. }
  139. }
  140. },
  141. "responses": {
  142. "200": {
  143. "description": "Successful Response",
  144. "content": {
  145. "application/json": {
  146. "schema": { "$ref": "#/components/schemas/DefaultResponse" }
  147. }
  148. }
  149. },
  150. "422": {
  151. "description": "Validation Error",
  152. "content": {
  153. "application/json": {
  154. "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
  155. }
  156. }
  157. }
  158. }
  159. }
  160. },
  161. "/{app_id}/query": {
  162. "post": {
  163. "tags": ["Apps"],
  164. "summary": "Query app",
  165. "description": "Query an app",
  166. "operationId": "query_an_app__app_id__query_post",
  167. "parameters": [
  168. {
  169. "name": "app_id",
  170. "in": "path",
  171. "required": true,
  172. "schema": { "type": "string", "title": "App Id" }
  173. }
  174. ],
  175. "requestBody": {
  176. "required": true,
  177. "content": {
  178. "application/json": {
  179. "schema": { "$ref": "#/components/schemas/QueryApp" }
  180. }
  181. }
  182. },
  183. "responses": {
  184. "200": {
  185. "description": "Successful Response",
  186. "content": {
  187. "application/json": {
  188. "schema": { "$ref": "#/components/schemas/DefaultResponse" }
  189. }
  190. }
  191. },
  192. "422": {
  193. "description": "Validation Error",
  194. "content": {
  195. "application/json": {
  196. "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
  197. }
  198. }
  199. }
  200. }
  201. }
  202. },
  203. "/{app_id}/chat": {
  204. "post": {
  205. "tags": ["Apps"],
  206. "summary": "Chat",
  207. "description": "Chat with an app.\n\napp_id: The ID of the app. Use \"default\" for the default app.\n\nmessage: The message that you want to send to the app.",
  208. "operationId": "chat_with_an_app__app_id__chat_post",
  209. "parameters": [
  210. {
  211. "name": "app_id",
  212. "in": "path",
  213. "required": true,
  214. "schema": { "type": "string", "title": "App Id" }
  215. }
  216. ],
  217. "requestBody": {
  218. "required": true,
  219. "content": {
  220. "application/json": {
  221. "schema": { "$ref": "#/components/schemas/MessageApp" }
  222. }
  223. }
  224. },
  225. "responses": {
  226. "200": {
  227. "description": "Successful Response",
  228. "content": {
  229. "application/json": {
  230. "schema": { "$ref": "#/components/schemas/DefaultResponse" }
  231. }
  232. }
  233. },
  234. "422": {
  235. "description": "Validation Error",
  236. "content": {
  237. "application/json": {
  238. "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
  239. }
  240. }
  241. }
  242. }
  243. }
  244. },
  245. "/{app_id}/deploy": {
  246. "post": {
  247. "tags": ["Apps"],
  248. "summary": "Deploy app",
  249. "description": "Deploy an existing app.",
  250. "operationId": "deploy_app__app_id__deploy_post",
  251. "parameters": [
  252. {
  253. "name": "app_id",
  254. "in": "path",
  255. "required": true,
  256. "schema": { "type": "string", "title": "App Id" }
  257. }
  258. ],
  259. "requestBody": {
  260. "required": true,
  261. "content": {
  262. "application/json": {
  263. "schema": { "$ref": "#/components/schemas/DeployAppRequest" }
  264. }
  265. }
  266. },
  267. "responses": {
  268. "200": {
  269. "description": "Successful Response",
  270. "content": {
  271. "application/json": {
  272. "schema": { "$ref": "#/components/schemas/DefaultResponse" }
  273. }
  274. }
  275. },
  276. "422": {
  277. "description": "Validation Error",
  278. "content": {
  279. "application/json": {
  280. "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
  281. }
  282. }
  283. }
  284. }
  285. }
  286. },
  287. "/{app_id}/delete": {
  288. "delete": {
  289. "tags": ["Apps"],
  290. "summary": "Delete app",
  291. "description": "Delete an existing app",
  292. "operationId": "delete_app__app_id__delete_delete",
  293. "parameters": [
  294. {
  295. "name": "app_id",
  296. "in": "path",
  297. "required": true,
  298. "schema": { "type": "string", "title": "App Id" }
  299. }
  300. ],
  301. "responses": {
  302. "200": {
  303. "description": "Successful Response",
  304. "content": {
  305. "application/json": {
  306. "schema": { "$ref": "#/components/schemas/DefaultResponse" }
  307. }
  308. }
  309. },
  310. "422": {
  311. "description": "Validation Error",
  312. "content": {
  313. "application/json": {
  314. "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
  315. }
  316. }
  317. }
  318. }
  319. }
  320. }
  321. },
  322. "components": {
  323. "schemas": {
  324. "Body_create_app_using_default_config_create_post": {
  325. "properties": {
  326. "config": { "type": "string", "format": "binary", "title": "Config" }
  327. },
  328. "type": "object",
  329. "title": "Body_create_app_using_default_config_create_post"
  330. },
  331. "DefaultResponse": {
  332. "properties": { "response": { "type": "string", "title": "Response" } },
  333. "type": "object",
  334. "required": ["response"],
  335. "title": "DefaultResponse"
  336. },
  337. "DeployAppRequest": {
  338. "properties": {
  339. "api_key": {
  340. "type": "string",
  341. "title": "Api Key",
  342. "description": "The Embedchain API key for app deployments. You get the api key on the Embedchain platform by visiting [https://app.embedchain.ai](https://app.embedchain.ai)",
  343. "default": ""
  344. }
  345. },
  346. "type": "object",
  347. "title": "DeployAppRequest",
  348. "example":{
  349. "api_key":"ec-xxx"
  350. }
  351. },
  352. "HTTPValidationError": {
  353. "properties": {
  354. "detail": {
  355. "items": { "$ref": "#/components/schemas/ValidationError" },
  356. "type": "array",
  357. "title": "Detail"
  358. }
  359. },
  360. "type": "object",
  361. "title": "HTTPValidationError"
  362. },
  363. "MessageApp": {
  364. "properties": {
  365. "message": {
  366. "type": "string",
  367. "title": "Message",
  368. "description": "The message that you want to send to the App.",
  369. "default": ""
  370. }
  371. },
  372. "type": "object",
  373. "title": "MessageApp"
  374. },
  375. "QueryApp": {
  376. "properties": {
  377. "query": {
  378. "type": "string",
  379. "title": "Query",
  380. "description": "The query that you want to ask the App.",
  381. "default": ""
  382. }
  383. },
  384. "type": "object",
  385. "title": "QueryApp",
  386. "example":{
  387. "query":"Who is Elon Musk?"
  388. }
  389. },
  390. "SourceApp": {
  391. "properties": {
  392. "source": {
  393. "type": "string",
  394. "title": "Source",
  395. "description": "The source that you want to add to the App.",
  396. "default": ""
  397. },
  398. "data_type": {
  399. "anyOf": [{ "type": "string" }, { "type": "null" }],
  400. "title": "Data Type",
  401. "description": "The type of data to add, remove it if you want Embedchain to detect it automatically.",
  402. "default": ""
  403. }
  404. },
  405. "type": "object",
  406. "title": "SourceApp",
  407. "example":{
  408. "source":"https://en.wikipedia.org/wiki/Elon_Musk"
  409. }
  410. },
  411. "ValidationError": {
  412. "properties": {
  413. "loc": {
  414. "items": { "anyOf": [{ "type": "string" }, { "type": "integer" }] },
  415. "type": "array",
  416. "title": "Location"
  417. },
  418. "msg": { "type": "string", "title": "Message" },
  419. "type": { "type": "string", "title": "Error Type" }
  420. },
  421. "type": "object",
  422. "required": ["loc", "msg", "type"],
  423. "title": "ValidationError"
  424. }
  425. }
  426. }
  427. }