You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

openapi.json 31KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "webhook_listeners",
  5. "version": "0.0.1",
  6. "description": "Nextcloud webhook support",
  7. "license": {
  8. "name": "agpl"
  9. }
  10. },
  11. "components": {
  12. "securitySchemes": {
  13. "basic_auth": {
  14. "type": "http",
  15. "scheme": "basic"
  16. },
  17. "bearer_auth": {
  18. "type": "http",
  19. "scheme": "bearer"
  20. }
  21. },
  22. "schemas": {
  23. "OCSMeta": {
  24. "type": "object",
  25. "required": [
  26. "status",
  27. "statuscode"
  28. ],
  29. "properties": {
  30. "status": {
  31. "type": "string"
  32. },
  33. "statuscode": {
  34. "type": "integer"
  35. },
  36. "message": {
  37. "type": "string"
  38. },
  39. "totalitems": {
  40. "type": "string"
  41. },
  42. "itemsperpage": {
  43. "type": "string"
  44. }
  45. }
  46. },
  47. "WebhookInfo": {
  48. "type": "object",
  49. "required": [
  50. "id",
  51. "userId",
  52. "httpMethod",
  53. "uri",
  54. "authMethod"
  55. ],
  56. "properties": {
  57. "id": {
  58. "type": "string"
  59. },
  60. "userId": {
  61. "type": "string"
  62. },
  63. "httpMethod": {
  64. "type": "string"
  65. },
  66. "uri": {
  67. "type": "string"
  68. },
  69. "event": {
  70. "type": "string"
  71. },
  72. "eventFilter": {
  73. "type": "object",
  74. "additionalProperties": {
  75. "type": "object"
  76. }
  77. },
  78. "headers": {
  79. "type": "object",
  80. "additionalProperties": {
  81. "type": "string"
  82. }
  83. },
  84. "authMethod": {
  85. "type": "string"
  86. },
  87. "authData": {
  88. "type": "object",
  89. "additionalProperties": {
  90. "type": "object"
  91. }
  92. }
  93. }
  94. }
  95. }
  96. },
  97. "paths": {
  98. "/ocs/v2.php/apps/webhook_listeners/api/v1/webhooks": {
  99. "get": {
  100. "operationId": "webhooks-index",
  101. "summary": "List registered webhooks",
  102. "description": "This endpoint requires admin access",
  103. "tags": [
  104. "webhooks"
  105. ],
  106. "security": [
  107. {
  108. "bearer_auth": []
  109. },
  110. {
  111. "basic_auth": []
  112. }
  113. ],
  114. "parameters": [
  115. {
  116. "name": "OCS-APIRequest",
  117. "in": "header",
  118. "description": "Required to be true for the API request to pass",
  119. "required": true,
  120. "schema": {
  121. "type": "boolean",
  122. "default": true
  123. }
  124. }
  125. ],
  126. "responses": {
  127. "200": {
  128. "description": "Webhook registrations returned",
  129. "content": {
  130. "application/json": {
  131. "schema": {
  132. "type": "object",
  133. "required": [
  134. "ocs"
  135. ],
  136. "properties": {
  137. "ocs": {
  138. "type": "object",
  139. "required": [
  140. "meta",
  141. "data"
  142. ],
  143. "properties": {
  144. "meta": {
  145. "$ref": "#/components/schemas/OCSMeta"
  146. },
  147. "data": {
  148. "type": "array",
  149. "items": {
  150. "$ref": "#/components/schemas/WebhookInfo"
  151. }
  152. }
  153. }
  154. }
  155. }
  156. }
  157. }
  158. }
  159. }
  160. }
  161. },
  162. "post": {
  163. "operationId": "webhooks-create",
  164. "summary": "Register a new webhook",
  165. "description": "This endpoint requires admin access",
  166. "tags": [
  167. "webhooks"
  168. ],
  169. "security": [
  170. {
  171. "bearer_auth": []
  172. },
  173. {
  174. "basic_auth": []
  175. }
  176. ],
  177. "parameters": [
  178. {
  179. "name": "httpMethod",
  180. "in": "query",
  181. "description": "HTTP method to use to contact the webhook",
  182. "required": true,
  183. "schema": {
  184. "type": "string"
  185. }
  186. },
  187. {
  188. "name": "uri",
  189. "in": "query",
  190. "description": "Webhook URI endpoint",
  191. "required": true,
  192. "schema": {
  193. "type": "string"
  194. }
  195. },
  196. {
  197. "name": "event",
  198. "in": "query",
  199. "description": "Event class name to listen to",
  200. "required": true,
  201. "schema": {
  202. "type": "string"
  203. }
  204. },
  205. {
  206. "name": "eventFilter",
  207. "in": "query",
  208. "description": "Mongo filter to apply to the serialized data to decide if firing",
  209. "schema": {
  210. "type": "string",
  211. "nullable": true
  212. }
  213. },
  214. {
  215. "name": "headers",
  216. "in": "query",
  217. "description": "Array of headers to send",
  218. "schema": {
  219. "type": "string",
  220. "nullable": true
  221. }
  222. },
  223. {
  224. "name": "authMethod",
  225. "in": "query",
  226. "description": "Authentication method to use",
  227. "schema": {
  228. "type": "string",
  229. "nullable": true,
  230. "enum": [
  231. "none",
  232. "headers"
  233. ]
  234. }
  235. },
  236. {
  237. "name": "authData",
  238. "in": "query",
  239. "description": "Array of data for authentication",
  240. "schema": {
  241. "type": "string",
  242. "nullable": true
  243. }
  244. },
  245. {
  246. "name": "OCS-APIRequest",
  247. "in": "header",
  248. "description": "Required to be true for the API request to pass",
  249. "required": true,
  250. "schema": {
  251. "type": "boolean",
  252. "default": true
  253. }
  254. }
  255. ],
  256. "responses": {
  257. "200": {
  258. "description": "Webhook registration returned",
  259. "content": {
  260. "application/json": {
  261. "schema": {
  262. "type": "object",
  263. "required": [
  264. "ocs"
  265. ],
  266. "properties": {
  267. "ocs": {
  268. "type": "object",
  269. "required": [
  270. "meta",
  271. "data"
  272. ],
  273. "properties": {
  274. "meta": {
  275. "$ref": "#/components/schemas/OCSMeta"
  276. },
  277. "data": {
  278. "$ref": "#/components/schemas/WebhookInfo"
  279. }
  280. }
  281. }
  282. }
  283. }
  284. }
  285. }
  286. },
  287. "400": {
  288. "description": "Bad request",
  289. "content": {
  290. "application/json": {
  291. "schema": {
  292. "type": "object",
  293. "required": [
  294. "ocs"
  295. ],
  296. "properties": {
  297. "ocs": {
  298. "type": "object",
  299. "required": [
  300. "meta",
  301. "data"
  302. ],
  303. "properties": {
  304. "meta": {
  305. "$ref": "#/components/schemas/OCSMeta"
  306. },
  307. "data": {}
  308. }
  309. }
  310. }
  311. }
  312. }
  313. }
  314. },
  315. "403": {
  316. "description": "Insufficient permissions",
  317. "content": {
  318. "application/json": {
  319. "schema": {
  320. "type": "object",
  321. "required": [
  322. "ocs"
  323. ],
  324. "properties": {
  325. "ocs": {
  326. "type": "object",
  327. "required": [
  328. "meta",
  329. "data"
  330. ],
  331. "properties": {
  332. "meta": {
  333. "$ref": "#/components/schemas/OCSMeta"
  334. },
  335. "data": {}
  336. }
  337. }
  338. }
  339. }
  340. }
  341. }
  342. }
  343. }
  344. }
  345. },
  346. "/ocs/v2.php/apps/webhook_listeners/api/v1/webhooks/{id}": {
  347. "get": {
  348. "operationId": "webhooks-show",
  349. "summary": "Get details on a registered webhook",
  350. "description": "This endpoint requires admin access",
  351. "tags": [
  352. "webhooks"
  353. ],
  354. "security": [
  355. {
  356. "bearer_auth": []
  357. },
  358. {
  359. "basic_auth": []
  360. }
  361. ],
  362. "parameters": [
  363. {
  364. "name": "id",
  365. "in": "path",
  366. "description": "id of the webhook",
  367. "required": true,
  368. "schema": {
  369. "type": "integer",
  370. "format": "int64"
  371. }
  372. },
  373. {
  374. "name": "OCS-APIRequest",
  375. "in": "header",
  376. "description": "Required to be true for the API request to pass",
  377. "required": true,
  378. "schema": {
  379. "type": "boolean",
  380. "default": true
  381. }
  382. }
  383. ],
  384. "responses": {
  385. "200": {
  386. "description": "Webhook registration returned",
  387. "content": {
  388. "application/json": {
  389. "schema": {
  390. "type": "object",
  391. "required": [
  392. "ocs"
  393. ],
  394. "properties": {
  395. "ocs": {
  396. "type": "object",
  397. "required": [
  398. "meta",
  399. "data"
  400. ],
  401. "properties": {
  402. "meta": {
  403. "$ref": "#/components/schemas/OCSMeta"
  404. },
  405. "data": {
  406. "$ref": "#/components/schemas/WebhookInfo"
  407. }
  408. }
  409. }
  410. }
  411. }
  412. }
  413. }
  414. },
  415. "404": {
  416. "description": "Webhook not found",
  417. "content": {
  418. "application/json": {
  419. "schema": {
  420. "type": "object",
  421. "required": [
  422. "ocs"
  423. ],
  424. "properties": {
  425. "ocs": {
  426. "type": "object",
  427. "required": [
  428. "meta",
  429. "data"
  430. ],
  431. "properties": {
  432. "meta": {
  433. "$ref": "#/components/schemas/OCSMeta"
  434. },
  435. "data": {}
  436. }
  437. }
  438. }
  439. }
  440. }
  441. }
  442. }
  443. }
  444. },
  445. "post": {
  446. "operationId": "webhooks-update",
  447. "summary": "Update an existing webhook registration",
  448. "description": "This endpoint requires admin access",
  449. "tags": [
  450. "webhooks"
  451. ],
  452. "security": [
  453. {
  454. "bearer_auth": []
  455. },
  456. {
  457. "basic_auth": []
  458. }
  459. ],
  460. "parameters": [
  461. {
  462. "name": "httpMethod",
  463. "in": "query",
  464. "description": "HTTP method to use to contact the webhook",
  465. "required": true,
  466. "schema": {
  467. "type": "string"
  468. }
  469. },
  470. {
  471. "name": "uri",
  472. "in": "query",
  473. "description": "Webhook URI endpoint",
  474. "required": true,
  475. "schema": {
  476. "type": "string"
  477. }
  478. },
  479. {
  480. "name": "event",
  481. "in": "query",
  482. "description": "Event class name to listen to",
  483. "required": true,
  484. "schema": {
  485. "type": "string"
  486. }
  487. },
  488. {
  489. "name": "eventFilter",
  490. "in": "query",
  491. "description": "Mongo filter to apply to the serialized data to decide if firing",
  492. "schema": {
  493. "type": "string",
  494. "nullable": true
  495. }
  496. },
  497. {
  498. "name": "headers",
  499. "in": "query",
  500. "description": "Array of headers to send",
  501. "schema": {
  502. "type": "string",
  503. "nullable": true
  504. }
  505. },
  506. {
  507. "name": "authMethod",
  508. "in": "query",
  509. "description": "Authentication method to use",
  510. "schema": {
  511. "type": "string",
  512. "nullable": true,
  513. "enum": [
  514. "none",
  515. "headers"
  516. ]
  517. }
  518. },
  519. {
  520. "name": "authData",
  521. "in": "query",
  522. "description": "Array of data for authentication",
  523. "schema": {
  524. "type": "string",
  525. "nullable": true
  526. }
  527. },
  528. {
  529. "name": "id",
  530. "in": "path",
  531. "description": "id of the webhook",
  532. "required": true,
  533. "schema": {
  534. "type": "integer",
  535. "format": "int64"
  536. }
  537. },
  538. {
  539. "name": "OCS-APIRequest",
  540. "in": "header",
  541. "description": "Required to be true for the API request to pass",
  542. "required": true,
  543. "schema": {
  544. "type": "boolean",
  545. "default": true
  546. }
  547. }
  548. ],
  549. "responses": {
  550. "200": {
  551. "description": "Webhook registration returned",
  552. "content": {
  553. "application/json": {
  554. "schema": {
  555. "type": "object",
  556. "required": [
  557. "ocs"
  558. ],
  559. "properties": {
  560. "ocs": {
  561. "type": "object",
  562. "required": [
  563. "meta",
  564. "data"
  565. ],
  566. "properties": {
  567. "meta": {
  568. "$ref": "#/components/schemas/OCSMeta"
  569. },
  570. "data": {
  571. "$ref": "#/components/schemas/WebhookInfo"
  572. }
  573. }
  574. }
  575. }
  576. }
  577. }
  578. }
  579. },
  580. "400": {
  581. "description": "Bad request",
  582. "content": {
  583. "application/json": {
  584. "schema": {
  585. "type": "object",
  586. "required": [
  587. "ocs"
  588. ],
  589. "properties": {
  590. "ocs": {
  591. "type": "object",
  592. "required": [
  593. "meta",
  594. "data"
  595. ],
  596. "properties": {
  597. "meta": {
  598. "$ref": "#/components/schemas/OCSMeta"
  599. },
  600. "data": {}
  601. }
  602. }
  603. }
  604. }
  605. }
  606. }
  607. },
  608. "403": {
  609. "description": "Insufficient permissions",
  610. "content": {
  611. "application/json": {
  612. "schema": {
  613. "type": "object",
  614. "required": [
  615. "ocs"
  616. ],
  617. "properties": {
  618. "ocs": {
  619. "type": "object",
  620. "required": [
  621. "meta",
  622. "data"
  623. ],
  624. "properties": {
  625. "meta": {
  626. "$ref": "#/components/schemas/OCSMeta"
  627. },
  628. "data": {}
  629. }
  630. }
  631. }
  632. }
  633. }
  634. }
  635. }
  636. }
  637. },
  638. "delete": {
  639. "operationId": "webhooks-destroy",
  640. "summary": "Remove an existing webhook registration",
  641. "description": "This endpoint requires admin access",
  642. "tags": [
  643. "webhooks"
  644. ],
  645. "security": [
  646. {
  647. "bearer_auth": []
  648. },
  649. {
  650. "basic_auth": []
  651. }
  652. ],
  653. "parameters": [
  654. {
  655. "name": "id",
  656. "in": "path",
  657. "description": "id of the webhook",
  658. "required": true,
  659. "schema": {
  660. "type": "integer",
  661. "format": "int64"
  662. }
  663. },
  664. {
  665. "name": "OCS-APIRequest",
  666. "in": "header",
  667. "description": "Required to be true for the API request to pass",
  668. "required": true,
  669. "schema": {
  670. "type": "boolean",
  671. "default": true
  672. }
  673. }
  674. ],
  675. "responses": {
  676. "200": {
  677. "description": "Boolean returned whether something was deleted FIXME",
  678. "content": {
  679. "application/json": {
  680. "schema": {
  681. "type": "object",
  682. "required": [
  683. "ocs"
  684. ],
  685. "properties": {
  686. "ocs": {
  687. "type": "object",
  688. "required": [
  689. "meta",
  690. "data"
  691. ],
  692. "properties": {
  693. "meta": {
  694. "$ref": "#/components/schemas/OCSMeta"
  695. },
  696. "data": {
  697. "type": "boolean"
  698. }
  699. }
  700. }
  701. }
  702. }
  703. }
  704. }
  705. },
  706. "400": {
  707. "description": "Bad request",
  708. "content": {
  709. "application/json": {
  710. "schema": {
  711. "type": "object",
  712. "required": [
  713. "ocs"
  714. ],
  715. "properties": {
  716. "ocs": {
  717. "type": "object",
  718. "required": [
  719. "meta",
  720. "data"
  721. ],
  722. "properties": {
  723. "meta": {
  724. "$ref": "#/components/schemas/OCSMeta"
  725. },
  726. "data": {}
  727. }
  728. }
  729. }
  730. }
  731. }
  732. }
  733. },
  734. "403": {
  735. "description": "Insufficient permissions",
  736. "content": {
  737. "application/json": {
  738. "schema": {
  739. "type": "object",
  740. "required": [
  741. "ocs"
  742. ],
  743. "properties": {
  744. "ocs": {
  745. "type": "object",
  746. "required": [
  747. "meta",
  748. "data"
  749. ],
  750. "properties": {
  751. "meta": {
  752. "$ref": "#/components/schemas/OCSMeta"
  753. },
  754. "data": {}
  755. }
  756. }
  757. }
  758. }
  759. }
  760. }
  761. }
  762. }
  763. }
  764. }
  765. },
  766. "tags": []
  767. }