service-hook-details.json 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. {
  2. "get": {
  3. "tags": ["Projects"],
  4. "description": "Return a service hook bound to a project.",
  5. "operationId": "Retrieve a Service Hook",
  6. "parameters": [
  7. {
  8. "name": "organization_slug",
  9. "in": "path",
  10. "description": "The slug of the organization the client keys belong to.",
  11. "required": true,
  12. "schema": {
  13. "type": "string"
  14. }
  15. },
  16. {
  17. "name": "project_slug",
  18. "in": "path",
  19. "description": "The slug of the project the client keys belong to.",
  20. "required": true,
  21. "schema": {
  22. "type": "string"
  23. }
  24. },
  25. {
  26. "name": "hook_id",
  27. "in": "path",
  28. "description": "The GUID of the service hook.",
  29. "required": true,
  30. "schema": {
  31. "type": "string"
  32. }
  33. }
  34. ],
  35. "responses": {
  36. "200": {
  37. "description": "Success",
  38. "content": {
  39. "application/json": {
  40. "schema": {
  41. "$ref": "../../components/schemas/service-hook.json#/ServiceHook"
  42. },
  43. "example": {
  44. "dateCreated": "2018-11-06T21:20:08.143Z",
  45. "events": ["event.alert", "event.created"],
  46. "id": "4f9d73e63b7144ecb8944c41620a090b",
  47. "secret": "8fcac28aaa4c4f5fa572b61d40a8e084364db25fd37449c299e5a41c0504cbc2",
  48. "status": "active",
  49. "url": "https://empowerplant.io/sentry-hook"
  50. }
  51. }
  52. }
  53. },
  54. "403": {
  55. "description": "Forbidden"
  56. },
  57. "404": {
  58. "description": "The requested resource does not exist"
  59. }
  60. },
  61. "security": [
  62. {
  63. "auth_token": ["project:read"]
  64. }
  65. ]
  66. },
  67. "put": {
  68. "tags": ["Projects"],
  69. "description": "Update a service hook.",
  70. "operationId": "Update a Service Hook",
  71. "parameters": [
  72. {
  73. "name": "organization_slug",
  74. "in": "path",
  75. "description": "The slug of the organization the client keys belong to.",
  76. "required": true,
  77. "schema": {
  78. "type": "string"
  79. }
  80. },
  81. {
  82. "name": "project_slug",
  83. "in": "path",
  84. "description": "The slug of the project the client keys belong to.",
  85. "required": true,
  86. "schema": {
  87. "type": "string"
  88. }
  89. },
  90. {
  91. "name": "hook_id",
  92. "in": "path",
  93. "description": "The GUID of the service hook.",
  94. "required": true,
  95. "schema": {
  96. "type": "string"
  97. }
  98. }
  99. ],
  100. "requestBody": {
  101. "content": {
  102. "application/json": {
  103. "schema": {
  104. "required": ["url", "events"],
  105. "type": "object",
  106. "properties": {
  107. "url": {
  108. "type": "string",
  109. "description": "The URL for the webhook."
  110. },
  111. "events": {
  112. "type": "array",
  113. "description": "The events to subscribe to.",
  114. "items": {
  115. "type": "string"
  116. }
  117. }
  118. }
  119. },
  120. "example": {
  121. "url": "https://empowerplant.io/sentry-hook",
  122. "events": ["event.alert", "event.created"]
  123. }
  124. }
  125. },
  126. "required": false
  127. },
  128. "responses": {
  129. "200": {
  130. "description": "Success",
  131. "content": {
  132. "application/json": {
  133. "schema": {
  134. "$ref": "../../components/schemas/service-hook.json#/ServiceHook"
  135. },
  136. "example": {
  137. "dateCreated": "2018-11-06T21:20:08.143Z",
  138. "events": ["event.alert", "event.created"],
  139. "id": "4f9d73e63b7144ecb8944c41620a090b",
  140. "secret": "8fcac28aaa4c4f5fa572b61d40a8e084364db25fd37449c299e5a41c0504cbc2",
  141. "status": "active",
  142. "url": "https://empowerplant.io/sentry-hook"
  143. }
  144. }
  145. }
  146. },
  147. "400": {
  148. "description": "Bad Input"
  149. },
  150. "403": {
  151. "description": "Forbidden"
  152. },
  153. "404": {
  154. "description": "The requested resource does not exist"
  155. }
  156. },
  157. "security": [
  158. {
  159. "auth_token": ["project:write"]
  160. }
  161. ]
  162. },
  163. "delete": {
  164. "tags": ["Projects"],
  165. "description": "Remove a service hook.",
  166. "operationId": "Remove a Service Hook",
  167. "parameters": [
  168. {
  169. "name": "organization_slug",
  170. "in": "path",
  171. "description": "The slug of the organization the client keys belong to.",
  172. "required": true,
  173. "schema": {
  174. "type": "string"
  175. }
  176. },
  177. {
  178. "name": "project_slug",
  179. "in": "path",
  180. "description": "The slug of the project the client keys belong to.",
  181. "required": true,
  182. "schema": {
  183. "type": "string"
  184. }
  185. },
  186. {
  187. "name": "hook_id",
  188. "in": "path",
  189. "description": "The GUID of the service hook.",
  190. "required": true,
  191. "schema": {
  192. "type": "string"
  193. }
  194. }
  195. ],
  196. "responses": {
  197. "204": {
  198. "description": "Success"
  199. },
  200. "403": {
  201. "description": "Forbidden"
  202. },
  203. "404": {
  204. "description": "The requested resource does not exist"
  205. }
  206. },
  207. "security": [
  208. {
  209. "auth_token": ["project:admin"]
  210. }
  211. ]
  212. }
  213. }