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.

992 lines
43 KiB

  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "spreed-bots",
  5. "version": "0.0.1",
  6. "description": "Chat, video & audio-conferencing using WebRTC",
  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. "Capabilities": {
  24. "type": "object",
  25. "required": [
  26. "features",
  27. "features-local",
  28. "config",
  29. "config-local",
  30. "version"
  31. ],
  32. "properties": {
  33. "features": {
  34. "type": "array",
  35. "items": {
  36. "type": "string"
  37. },
  38. "minItems": 1
  39. },
  40. "features-local": {
  41. "type": "array",
  42. "items": {
  43. "type": "string"
  44. },
  45. "minItems": 1
  46. },
  47. "config": {
  48. "type": "object",
  49. "required": [
  50. "attachments",
  51. "call",
  52. "chat",
  53. "conversations",
  54. "federation",
  55. "previews",
  56. "signaling",
  57. "experiments"
  58. ],
  59. "properties": {
  60. "attachments": {
  61. "type": "object",
  62. "required": [
  63. "allowed"
  64. ],
  65. "properties": {
  66. "allowed": {
  67. "type": "boolean"
  68. },
  69. "folder": {
  70. "type": "string"
  71. }
  72. }
  73. },
  74. "call": {
  75. "type": "object",
  76. "required": [
  77. "enabled",
  78. "breakout-rooms",
  79. "recording",
  80. "recording-consent",
  81. "supported-reactions",
  82. "predefined-backgrounds",
  83. "predefined-backgrounds-v2",
  84. "can-upload-background",
  85. "sip-enabled",
  86. "sip-dialout-enabled",
  87. "can-enable-sip",
  88. "start-without-media",
  89. "max-duration",
  90. "blur-virtual-background",
  91. "end-to-end-encryption",
  92. "live-transcription"
  93. ],
  94. "properties": {
  95. "enabled": {
  96. "type": "boolean"
  97. },
  98. "breakout-rooms": {
  99. "type": "boolean"
  100. },
  101. "recording": {
  102. "type": "boolean"
  103. },
  104. "recording-consent": {
  105. "type": "integer",
  106. "format": "int64"
  107. },
  108. "supported-reactions": {
  109. "type": "array",
  110. "items": {
  111. "type": "string"
  112. }
  113. },
  114. "predefined-backgrounds": {
  115. "type": "array",
  116. "description": "List of file names relative to the spreed/img/backgrounds/ web path, e.g. `2_home.jpg`",
  117. "items": {
  118. "type": "string"
  119. }
  120. },
  121. "predefined-backgrounds-v2": {
  122. "type": "array",
  123. "description": "List of file paths relative to the server web root with leading slash, e.g. `/apps/spreed/img/backgrounds/2_home.jpg`",
  124. "items": {
  125. "type": "string"
  126. }
  127. },
  128. "can-upload-background": {
  129. "type": "boolean"
  130. },
  131. "sip-enabled": {
  132. "type": "boolean"
  133. },
  134. "sip-dialout-enabled": {
  135. "type": "boolean"
  136. },
  137. "can-enable-sip": {
  138. "type": "boolean"
  139. },
  140. "start-without-media": {
  141. "type": "boolean"
  142. },
  143. "max-duration": {
  144. "type": "integer",
  145. "format": "int64"
  146. },
  147. "blur-virtual-background": {
  148. "type": "boolean"
  149. },
  150. "end-to-end-encryption": {
  151. "type": "boolean"
  152. },
  153. "live-transcription": {
  154. "type": "boolean"
  155. }
  156. }
  157. },
  158. "chat": {
  159. "type": "object",
  160. "required": [
  161. "max-length",
  162. "read-privacy",
  163. "has-translation-providers",
  164. "has-translation-task-providers",
  165. "typing-privacy",
  166. "summary-threshold"
  167. ],
  168. "properties": {
  169. "max-length": {
  170. "type": "integer",
  171. "format": "int64"
  172. },
  173. "read-privacy": {
  174. "type": "integer",
  175. "format": "int64"
  176. },
  177. "has-translation-providers": {
  178. "type": "boolean"
  179. },
  180. "has-translation-task-providers": {
  181. "type": "boolean"
  182. },
  183. "typing-privacy": {
  184. "type": "integer",
  185. "format": "int64"
  186. },
  187. "summary-threshold": {
  188. "type": "integer",
  189. "format": "int64",
  190. "minimum": 1
  191. }
  192. }
  193. },
  194. "conversations": {
  195. "type": "object",
  196. "required": [
  197. "can-create",
  198. "force-passwords",
  199. "list-style",
  200. "description-length",
  201. "retention-event",
  202. "retention-phone",
  203. "retention-instant-meetings"
  204. ],
  205. "properties": {
  206. "can-create": {
  207. "type": "boolean"
  208. },
  209. "force-passwords": {
  210. "type": "boolean"
  211. },
  212. "list-style": {
  213. "type": "string",
  214. "enum": [
  215. "two-lines",
  216. "compact"
  217. ]
  218. },
  219. "description-length": {
  220. "type": "integer",
  221. "format": "int64",
  222. "minimum": 1
  223. },
  224. "retention-event": {
  225. "type": "integer",
  226. "format": "int64",
  227. "minimum": 0
  228. },
  229. "retention-phone": {
  230. "type": "integer",
  231. "format": "int64",
  232. "minimum": 0
  233. },
  234. "retention-instant-meetings": {
  235. "type": "integer",
  236. "format": "int64",
  237. "minimum": 0
  238. }
  239. }
  240. },
  241. "federation": {
  242. "type": "object",
  243. "required": [
  244. "enabled",
  245. "incoming-enabled",
  246. "outgoing-enabled",
  247. "only-trusted-servers"
  248. ],
  249. "properties": {
  250. "enabled": {
  251. "type": "boolean"
  252. },
  253. "incoming-enabled": {
  254. "type": "boolean"
  255. },
  256. "outgoing-enabled": {
  257. "type": "boolean"
  258. },
  259. "only-trusted-servers": {
  260. "type": "boolean"
  261. }
  262. }
  263. },
  264. "previews": {
  265. "type": "object",
  266. "required": [
  267. "max-gif-size"
  268. ],
  269. "properties": {
  270. "max-gif-size": {
  271. "type": "integer",
  272. "format": "int64"
  273. }
  274. }
  275. },
  276. "signaling": {
  277. "type": "object",
  278. "required": [
  279. "session-ping-limit"
  280. ],
  281. "properties": {
  282. "session-ping-limit": {
  283. "type": "integer",
  284. "format": "int64"
  285. },
  286. "hello-v2-token-key": {
  287. "type": "string"
  288. }
  289. }
  290. },
  291. "experiments": {
  292. "type": "object",
  293. "required": [
  294. "enabled"
  295. ],
  296. "properties": {
  297. "enabled": {
  298. "type": "integer",
  299. "format": "int64",
  300. "minimum": 0
  301. }
  302. }
  303. }
  304. }
  305. },
  306. "config-local": {
  307. "type": "object",
  308. "additionalProperties": {
  309. "type": "array",
  310. "items": {
  311. "type": "string"
  312. },
  313. "minItems": 1
  314. }
  315. },
  316. "version": {
  317. "type": "string"
  318. }
  319. }
  320. },
  321. "OCSMeta": {
  322. "type": "object",
  323. "required": [
  324. "status",
  325. "statuscode"
  326. ],
  327. "properties": {
  328. "status": {
  329. "type": "string"
  330. },
  331. "statuscode": {
  332. "type": "integer"
  333. },
  334. "message": {
  335. "type": "string"
  336. },
  337. "totalitems": {
  338. "type": "string"
  339. },
  340. "itemsperpage": {
  341. "type": "string"
  342. }
  343. }
  344. },
  345. "PublicCapabilities": {
  346. "type": "object",
  347. "properties": {
  348. "spreed": {
  349. "$ref": "#/components/schemas/Capabilities"
  350. }
  351. }
  352. }
  353. }
  354. },
  355. "paths": {
  356. "/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}/message": {
  357. "post": {
  358. "operationId": "bot-send-message",
  359. "summary": "Sends a new chat message to the given room",
  360. "description": "The author and timestamp are automatically set to the current user/guest and time.",
  361. "tags": [
  362. "bot"
  363. ],
  364. "security": [
  365. {},
  366. {
  367. "bearer_auth": []
  368. },
  369. {
  370. "basic_auth": []
  371. }
  372. ],
  373. "requestBody": {
  374. "required": true,
  375. "content": {
  376. "application/json": {
  377. "schema": {
  378. "type": "object",
  379. "required": [
  380. "message"
  381. ],
  382. "properties": {
  383. "message": {
  384. "type": "string",
  385. "description": "The message to send"
  386. },
  387. "referenceId": {
  388. "type": "string",
  389. "default": "",
  390. "description": "For the message to be able to later identify it again"
  391. },
  392. "replyTo": {
  393. "type": "integer",
  394. "format": "int64",
  395. "default": 0,
  396. "description": "Parent id which this message is a reply to"
  397. },
  398. "silent": {
  399. "type": "boolean",
  400. "default": false,
  401. "description": "If sent silent the chat message will not create any notifications"
  402. }
  403. }
  404. }
  405. }
  406. }
  407. },
  408. "parameters": [
  409. {
  410. "name": "apiVersion",
  411. "in": "path",
  412. "required": true,
  413. "schema": {
  414. "type": "string",
  415. "enum": [
  416. "v1"
  417. ],
  418. "default": "v1"
  419. }
  420. },
  421. {
  422. "name": "token",
  423. "in": "path",
  424. "description": "Conversation token",
  425. "required": true,
  426. "schema": {
  427. "type": "string",
  428. "pattern": "^[a-z0-9]{4,30}$"
  429. }
  430. },
  431. {
  432. "name": "OCS-APIRequest",
  433. "in": "header",
  434. "description": "Required to be true for the API request to pass",
  435. "required": true,
  436. "schema": {
  437. "type": "boolean",
  438. "default": true
  439. }
  440. }
  441. ],
  442. "responses": {
  443. "201": {
  444. "description": "Message sent successfully",
  445. "content": {
  446. "application/json": {
  447. "schema": {
  448. "type": "object",
  449. "required": [
  450. "ocs"
  451. ],
  452. "properties": {
  453. "ocs": {
  454. "type": "object",
  455. "required": [
  456. "meta",
  457. "data"
  458. ],
  459. "properties": {
  460. "meta": {
  461. "$ref": "#/components/schemas/OCSMeta"
  462. },
  463. "data": {
  464. "nullable": true
  465. }
  466. }
  467. }
  468. }
  469. }
  470. }
  471. }
  472. },
  473. "400": {
  474. "description": "When the replyTo is invalid or message is empty",
  475. "content": {
  476. "application/json": {
  477. "schema": {
  478. "type": "object",
  479. "required": [
  480. "ocs"
  481. ],
  482. "properties": {
  483. "ocs": {
  484. "type": "object",
  485. "required": [
  486. "meta",
  487. "data"
  488. ],
  489. "properties": {
  490. "meta": {
  491. "$ref": "#/components/schemas/OCSMeta"
  492. },
  493. "data": {
  494. "nullable": true
  495. }
  496. }
  497. }
  498. }
  499. }
  500. }
  501. }
  502. },
  503. "401": {
  504. "description": "Sending message is not allowed",
  505. "content": {
  506. "application/json": {
  507. "schema": {
  508. "type": "object",
  509. "required": [
  510. "ocs"
  511. ],
  512. "properties": {
  513. "ocs": {
  514. "type": "object",
  515. "required": [
  516. "meta",
  517. "data"
  518. ],
  519. "properties": {
  520. "meta": {
  521. "$ref": "#/components/schemas/OCSMeta"
  522. },
  523. "data": {
  524. "nullable": true
  525. }
  526. }
  527. }
  528. }
  529. }
  530. }
  531. }
  532. },
  533. "413": {
  534. "description": "Message too long",
  535. "content": {
  536. "application/json": {
  537. "schema": {
  538. "type": "object",
  539. "required": [
  540. "ocs"
  541. ],
  542. "properties": {
  543. "ocs": {
  544. "type": "object",
  545. "required": [
  546. "meta",
  547. "data"
  548. ],
  549. "properties": {
  550. "meta": {
  551. "$ref": "#/components/schemas/OCSMeta"
  552. },
  553. "data": {
  554. "nullable": true
  555. }
  556. }
  557. }
  558. }
  559. }
  560. }
  561. }
  562. }
  563. }
  564. }
  565. },
  566. "/ocs/v2.php/apps/spreed/api/{apiVersion}/bot/{token}/reaction/{messageId}": {
  567. "post": {
  568. "operationId": "bot-react",
  569. "summary": "Adds a reaction to a chat message",
  570. "tags": [
  571. "bot"
  572. ],
  573. "security": [
  574. {},
  575. {
  576. "bearer_auth": []
  577. },
  578. {
  579. "basic_auth": []
  580. }
  581. ],
  582. "requestBody": {
  583. "required": true,
  584. "content": {
  585. "application/json": {
  586. "schema": {
  587. "type": "object",
  588. "required": [
  589. "reaction"
  590. ],
  591. "properties": {
  592. "reaction": {
  593. "type": "string",
  594. "description": "Reaction to add"
  595. }
  596. }
  597. }
  598. }
  599. }
  600. },
  601. "parameters": [
  602. {
  603. "name": "apiVersion",
  604. "in": "path",
  605. "required": true,
  606. "schema": {
  607. "type": "string",
  608. "enum": [
  609. "v1"
  610. ],
  611. "default": "v1"
  612. }
  613. },
  614. {
  615. "name": "token",
  616. "in": "path",
  617. "description": "Conversation token",
  618. "required": true,
  619. "schema": {
  620. "type": "string",
  621. "pattern": "^[a-z0-9]{4,30}$"
  622. }
  623. },
  624. {
  625. "name": "messageId",
  626. "in": "path",
  627. "description": "ID of the message",
  628. "required": true,
  629. "schema": {
  630. "type": "integer",
  631. "format": "int64"
  632. }
  633. },
  634. {
  635. "name": "OCS-APIRequest",
  636. "in": "header",
  637. "description": "Required to be true for the API request to pass",
  638. "required": true,
  639. "schema": {
  640. "type": "boolean",
  641. "default": true
  642. }
  643. }
  644. ],
  645. "responses": {
  646. "200": {
  647. "description": "Reaction already exists",
  648. "content": {
  649. "application/json": {
  650. "schema": {
  651. "type": "object",
  652. "required": [
  653. "ocs"
  654. ],
  655. "properties": {
  656. "ocs": {
  657. "type": "object",
  658. "required": [
  659. "meta",
  660. "data"
  661. ],
  662. "properties": {
  663. "meta": {
  664. "$ref": "#/components/schemas/OCSMeta"
  665. },
  666. "data": {
  667. "nullable": true
  668. }
  669. }
  670. }
  671. }
  672. }
  673. }
  674. }
  675. },
  676. "201": {
  677. "description": "Reacted successfully",
  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. "nullable": true
  698. }
  699. }
  700. }
  701. }
  702. }
  703. }
  704. }
  705. },
  706. "400": {
  707. "description": "Reacting is not possible",
  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. "nullable": true
  728. }
  729. }
  730. }
  731. }
  732. }
  733. }
  734. }
  735. },
  736. "401": {
  737. "description": "Reacting is not allowed",
  738. "content": {
  739. "application/json": {
  740. "schema": {
  741. "type": "object",
  742. "required": [
  743. "ocs"
  744. ],
  745. "properties": {
  746. "ocs": {
  747. "type": "object",
  748. "required": [
  749. "meta",
  750. "data"
  751. ],
  752. "properties": {
  753. "meta": {
  754. "$ref": "#/components/schemas/OCSMeta"
  755. },
  756. "data": {
  757. "nullable": true
  758. }
  759. }
  760. }
  761. }
  762. }
  763. }
  764. }
  765. },
  766. "404": {
  767. "description": "Reaction not found",
  768. "content": {
  769. "application/json": {
  770. "schema": {
  771. "type": "object",
  772. "required": [
  773. "ocs"
  774. ],
  775. "properties": {
  776. "ocs": {
  777. "type": "object",
  778. "required": [
  779. "meta",
  780. "data"
  781. ],
  782. "properties": {
  783. "meta": {
  784. "$ref": "#/components/schemas/OCSMeta"
  785. },
  786. "data": {
  787. "nullable": true
  788. }
  789. }
  790. }
  791. }
  792. }
  793. }
  794. }
  795. }
  796. }
  797. },
  798. "delete": {
  799. "operationId": "bot-delete-reaction",
  800. "summary": "Deletes a reaction from a chat message",
  801. "tags": [
  802. "bot"
  803. ],
  804. "security": [
  805. {},
  806. {
  807. "bearer_auth": []
  808. },
  809. {
  810. "basic_auth": []
  811. }
  812. ],
  813. "parameters": [
  814. {
  815. "name": "apiVersion",
  816. "in": "path",
  817. "required": true,
  818. "schema": {
  819. "type": "string",
  820. "enum": [
  821. "v1"
  822. ],
  823. "default": "v1"
  824. }
  825. },
  826. {
  827. "name": "token",
  828. "in": "path",
  829. "description": "Conversation token",
  830. "required": true,
  831. "schema": {
  832. "type": "string",
  833. "pattern": "^[a-z0-9]{4,30}$"
  834. }
  835. },
  836. {
  837. "name": "messageId",
  838. "in": "path",
  839. "description": "ID of the message",
  840. "required": true,
  841. "schema": {
  842. "type": "integer",
  843. "format": "int64"
  844. }
  845. },
  846. {
  847. "name": "reaction",
  848. "in": "query",
  849. "description": "Reaction to delete",
  850. "required": true,
  851. "schema": {
  852. "type": "string"
  853. }
  854. },
  855. {
  856. "name": "OCS-APIRequest",
  857. "in": "header",
  858. "description": "Required to be true for the API request to pass",
  859. "required": true,
  860. "schema": {
  861. "type": "boolean",
  862. "default": true
  863. }
  864. }
  865. ],
  866. "responses": {
  867. "200": {
  868. "description": "Reaction deleted successfully",
  869. "content": {
  870. "application/json": {
  871. "schema": {
  872. "type": "object",
  873. "required": [
  874. "ocs"
  875. ],
  876. "properties": {
  877. "ocs": {
  878. "type": "object",
  879. "required": [
  880. "meta",
  881. "data"
  882. ],
  883. "properties": {
  884. "meta": {
  885. "$ref": "#/components/schemas/OCSMeta"
  886. },
  887. "data": {
  888. "nullable": true
  889. }
  890. }
  891. }
  892. }
  893. }
  894. }
  895. }
  896. },
  897. "400": {
  898. "description": "Reacting is not possible",
  899. "content": {
  900. "application/json": {
  901. "schema": {
  902. "type": "object",
  903. "required": [
  904. "ocs"
  905. ],
  906. "properties": {
  907. "ocs": {
  908. "type": "object",
  909. "required": [
  910. "meta",
  911. "data"
  912. ],
  913. "properties": {
  914. "meta": {
  915. "$ref": "#/components/schemas/OCSMeta"
  916. },
  917. "data": {
  918. "nullable": true
  919. }
  920. }
  921. }
  922. }
  923. }
  924. }
  925. }
  926. },
  927. "404": {
  928. "description": "Reaction not found",
  929. "content": {
  930. "application/json": {
  931. "schema": {
  932. "type": "object",
  933. "required": [
  934. "ocs"
  935. ],
  936. "properties": {
  937. "ocs": {
  938. "type": "object",
  939. "required": [
  940. "meta",
  941. "data"
  942. ],
  943. "properties": {
  944. "meta": {
  945. "$ref": "#/components/schemas/OCSMeta"
  946. },
  947. "data": {
  948. "nullable": true
  949. }
  950. }
  951. }
  952. }
  953. }
  954. }
  955. }
  956. },
  957. "401": {
  958. "description": "Reacting is not allowed",
  959. "content": {
  960. "application/json": {
  961. "schema": {
  962. "type": "object",
  963. "required": [
  964. "ocs"
  965. ],
  966. "properties": {
  967. "ocs": {
  968. "type": "object",
  969. "required": [
  970. "meta",
  971. "data"
  972. ],
  973. "properties": {
  974. "meta": {
  975. "$ref": "#/components/schemas/OCSMeta"
  976. },
  977. "data": {
  978. "nullable": true
  979. }
  980. }
  981. }
  982. }
  983. }
  984. }
  985. }
  986. }
  987. }
  988. }
  989. }
  990. },
  991. "tags": []
  992. }