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.

711 lines
44 KiB

  1. <h1>API Reference</h1>
  2. <p>SITE_NAME REST API supports listing, creating, updating, pausing and deleting
  3. checks in user's account.</p>
  4. <h2>API Endpoints</h2>
  5. <table>
  6. <thead>
  7. <tr>
  8. <th>Endpoint Name</th>
  9. <th>Endpoint Address</th>
  10. </tr>
  11. </thead>
  12. <tbody>
  13. <tr>
  14. <td><a href="#list-checks">Get a list of existing checks</a></td>
  15. <td><code>GET SITE_ROOT/api/v1/checks/</code></td>
  16. </tr>
  17. <tr>
  18. <td><a href="#get-check">Get a single check</a></td>
  19. <td><code>GET SITE_ROOT/api/v1/checks/&lt;uuid&gt;</code></td>
  20. </tr>
  21. <tr>
  22. <td><a href="#get-check">Get a check by its unique_key</a></td>
  23. <td><code>GET SITE_ROOT/api/v1/checks/&lt;unique_key&gt;</code></td>
  24. </tr>
  25. <tr>
  26. <td><a href="#create-check">Create a new check</a></td>
  27. <td><code>POST SITE_ROOT/api/v1/checks/</code></td>
  28. </tr>
  29. <tr>
  30. <td><a href="#update-check">Update an existing check</a></td>
  31. <td><code>POST SITE_ROOT/api/v1/checks/&lt;uuid&gt;</code></td>
  32. </tr>
  33. <tr>
  34. <td><a href="#pause-check">Pause monitoring of a check</a></td>
  35. <td><code>POST SITE_ROOT/api/v1/checks/&lt;uuid&gt;/pause</code></td>
  36. </tr>
  37. <tr>
  38. <td><a href="#delete-check">Delete check</a></td>
  39. <td><code>DELETE SITE_ROOT/api/v1/checks/&lt;uuid&gt;</code></td>
  40. </tr>
  41. <tr>
  42. <td><a href="#list-pings">Get a list of checks's logged pings</a></td>
  43. <td><code>GET SITE_ROOT/api/v1/checks/&lt;uuid&gt;/pings/</code></td>
  44. </tr>
  45. <tr>
  46. <td><a href="#list-channels">Get a list of existing integrations</a></td>
  47. <td><code>GET SITE_ROOT/api/v1/channels/</code></td>
  48. </tr>
  49. </tbody>
  50. </table>
  51. <h2>Authentication</h2>
  52. <p>Your requests to SITE_NAME REST API must authenticate using an
  53. API key. Each project in your SITE_NAME account has separate API keys.
  54. There are no account-wide API keys. By default, a project on SITE_NAME doesn't have
  55. an API key. You can create read-write and read-only API keys in the
  56. <strong>Project Settings</strong> page.</p>
  57. <table>
  58. <thead>
  59. <tr>
  60. <th>Key Type</th>
  61. <th>Description</th>
  62. </tr>
  63. </thead>
  64. <tbody>
  65. <tr>
  66. <td>Regular API key</td>
  67. <td>Has full access to all documented API endpoints.</td>
  68. </tr>
  69. <tr>
  70. <td>Read-only API key</td>
  71. <td>Only works with the <a href="#list-checks">Get a list of existing checks</a> and <a href="#get-check">Get a single check</a> endpoints. Some fields are omitted from the API responses.</td>
  72. </tr>
  73. </tbody>
  74. </table>
  75. <p>The client can authenticate itself by sending an appropriate HTTP
  76. request header. The header's name should be <code>X-Api-Key</code> and
  77. its value should be your API key.</p>
  78. <p>Alternatively, for POST requests with a JSON request body,
  79. the client can include an <code>api_key</code> field in the JSON document.
  80. See below the "Create a check" section for an example.</p>
  81. <h2>API Requests</h2>
  82. <p>For POST requests, the SITE_NAME API expects request body to be
  83. a JSON document (<em>not</em> a <code>multipart/form-data</code> encoded form data).</p>
  84. <h2>API Responses</h2>
  85. <p>SITE_NAME uses HTTP status codes wherever possible.
  86. In general, 2xx class indicates success, 4xx indicates an client error,
  87. and 5xx indicates a server error.</p>
  88. <p>The response may contain a JSON document with additional data.</p>
  89. <h2 class="rule" id="list-checks">Get a List of Existing Checks</h2>
  90. <p><code>GET SITE_ROOT/api/v1/checks/</code></p>
  91. <p>Returns a list of checks belonging to the user, optionally filtered by
  92. one or more tags.</p>
  93. <h3>Query String Parameters</h3>
  94. <dl>
  95. <dt>tag=&lt;value&gt;</dt>
  96. <dd>
  97. <p>Filters the checks, and returns only the checks that are tagged with the
  98. specified value.</p>
  99. <p>This parameter can be repeated multiple times.</p>
  100. <p>Example:</p>
  101. <p><code>SITE_ROOT/api/v1/checks/?tag=foo&amp;tag=bar</code></p>
  102. </dd>
  103. </dl>
  104. <h3>Response Codes</h3>
  105. <dl>
  106. <dt>200 OK</dt>
  107. <dd>The request succeeded.</dd>
  108. <dt>401 Unauthorized</dt>
  109. <dd>The API key is either missing or invalid.</dd>
  110. </dl>
  111. <h3>Example Request</h3>
  112. <div class="highlight"><pre><span></span><code>curl --header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span> SITE_ROOT/api/v1/checks/
  113. </code></pre></div>
  114. <h3>Example Response</h3>
  115. <div class="highlight"><pre><span></span><code><span class="p">{</span>
  116. <span class="nt">&quot;checks&quot;</span><span class="p">:</span> <span class="p">[</span>
  117. <span class="p">{</span>
  118. <span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Filesystem Backup&quot;</span><span class="p">,</span>
  119. <span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;backup fs&quot;</span><span class="p">,</span>
  120. <span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;Runs incremental backup every hour&quot;</span><span class="p">,</span>
  121. <span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">600</span><span class="p">,</span>
  122. <span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
  123. <span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;up&quot;</span><span class="p">,</span>
  124. <span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="s2">&quot;2020-03-24T14:02:03+00:00&quot;</span><span class="p">,</span>
  125. <span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="s2">&quot;2020-03-24T15:02:03+00:00&quot;</span><span class="p">,</span>
  126. <span class="nt">&quot;manual_resume&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
  127. <span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;PING_ENDPOINT31365bce-8da9-4729-8ff3-aaa71d56b712&quot;</span><span class="p">,</span>
  128. <span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/31365bce-8da9-4729-8ff3-aaa71d56b712&quot;</span><span class="p">,</span>
  129. <span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/31365bce-8da9-4729-8ff3-aaa71d56b712/pause&quot;</span><span class="p">,</span>
  130. <span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;1bdea468-03bf-47b8-ab27-29a9dd0e4b94,51c6eb2b-2ae1-456b-99fe-6f1e0a36cd3c&quot;</span><span class="p">,</span>
  131. <span class="nt">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">3600</span>
  132. <span class="p">},</span>
  133. <span class="p">{</span>
  134. <span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Database Backup&quot;</span><span class="p">,</span>
  135. <span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;production db&quot;</span><span class="p">,</span>
  136. <span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;Runs ~/db-backup.sh&quot;</span><span class="p">,</span>
  137. <span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">1200</span><span class="p">,</span>
  138. <span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">7</span><span class="p">,</span>
  139. <span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;down&quot;</span><span class="p">,</span>
  140. <span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="s2">&quot;2020-03-23T10:19:32+00:00&quot;</span><span class="p">,</span>
  141. <span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
  142. <span class="nt">&quot;manual_resume&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
  143. <span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;PING_ENDPOINT803f680d-e89b-492b-82ef-2be7b774a92d&quot;</span><span class="p">,</span>
  144. <span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/803f680d-e89b-492b-82ef-2be7b774a92d&quot;</span><span class="p">,</span>
  145. <span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/803f680d-e89b-492b-82ef-2be7b774a92d/pause&quot;</span><span class="p">,</span>
  146. <span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;1bdea468-03bf-47b8-ab27-29a9dd0e4b94,51c6eb2b-2ae1-456b-99fe-6f1e0a36cd3c&quot;</span><span class="p">,</span>
  147. <span class="nt">&quot;schedule&quot;</span><span class="p">:</span> <span class="s2">&quot;15 5 * * *&quot;</span><span class="p">,</span>
  148. <span class="nt">&quot;tz&quot;</span><span class="p">:</span> <span class="s2">&quot;UTC&quot;</span>
  149. <span class="p">}</span>
  150. <span class="p">]</span>
  151. <span class="p">}</span>
  152. </code></pre></div>
  153. <p>When using the read-only API key, the following fields are omitted:
  154. <code>ping_url</code>, <code>update_url</code>, <code>pause_url</code>, <code>channels</code>. An extra <code>unique_key</code> field
  155. is added which can be used <a href="#get-check">to <code>GET</code> a check</a> in place of the <code>UUID</code>. The <code>unique_key</code> identifier is stable across API calls. Example:</p>
  156. <div class="highlight"><pre><span></span><code><span class="p">{</span>
  157. <span class="nt">&quot;checks&quot;</span><span class="p">:</span> <span class="p">[</span>
  158. <span class="p">{</span>
  159. <span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Filesystem Backup&quot;</span><span class="p">,</span>
  160. <span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;backup fs&quot;</span><span class="p">,</span>
  161. <span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;Runs incremental backup every hour&quot;</span><span class="p">,</span>
  162. <span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">600</span><span class="p">,</span>
  163. <span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
  164. <span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;up&quot;</span><span class="p">,</span>
  165. <span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="s2">&quot;2020-03-24T14:02:03+00:00&quot;</span><span class="p">,</span>
  166. <span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="s2">&quot;2020-03-24T15:02:03+00:00&quot;</span><span class="p">,</span>
  167. <span class="nt">&quot;manual_resume&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
  168. <span class="nt">&quot;unique_key&quot;</span><span class="p">:</span> <span class="s2">&quot;a6c7b0a8a66bed0df66abfdab3c77736861703ee&quot;</span><span class="p">,</span>
  169. <span class="nt">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">3600</span>
  170. <span class="p">},</span>
  171. <span class="p">{</span>
  172. <span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Database Backup&quot;</span><span class="p">,</span>
  173. <span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;production db&quot;</span><span class="p">,</span>
  174. <span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;Runs ~/db-backup.sh&quot;</span><span class="p">,</span>
  175. <span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">1200</span><span class="p">,</span>
  176. <span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">7</span><span class="p">,</span>
  177. <span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;down&quot;</span><span class="p">,</span>
  178. <span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="s2">&quot;2020-03-23T10:19:32+00:00&quot;</span><span class="p">,</span>
  179. <span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
  180. <span class="nt">&quot;manual_resume&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
  181. <span class="nt">&quot;unique_key&quot;</span><span class="p">:</span> <span class="s2">&quot;124f983e0e3dcaeba921cfcef46efd084576e783&quot;</span><span class="p">,</span>
  182. <span class="nt">&quot;schedule&quot;</span><span class="p">:</span> <span class="s2">&quot;15 5 * * *&quot;</span><span class="p">,</span>
  183. <span class="nt">&quot;tz&quot;</span><span class="p">:</span> <span class="s2">&quot;UTC&quot;</span>
  184. <span class="p">}</span>
  185. <span class="p">]</span>
  186. <span class="p">}</span>
  187. </code></pre></div>
  188. <h2 class="rule" id="get-check">Get a Single Check</h2>
  189. <p><code>GET SITE_ROOT/api/v1/checks/&lt;uuid&gt;</code><br>
  190. <code>GET SITE_ROOT/api/v1/checks/&lt;unique_key&gt;</code></p>
  191. <p>Returns a JSON representation of a single check. Accepts either check's UUID or
  192. the <code>unique_key</code> (a field derived from UUID, and returned by API responses when
  193. using the read-only API key) as an identifier.</p>
  194. <h3>Response Codes</h3>
  195. <dl>
  196. <dt>200 OK</dt>
  197. <dd>The request succeeded.</dd>
  198. <dt>401 Unauthorized</dt>
  199. <dd>The API key is either missing or invalid.</dd>
  200. <dt>403 Forbidden</dt>
  201. <dd>Access denied, wrong API key.</dd>
  202. <dt>404 Not Found</dt>
  203. <dd>The specified check does not exist.</dd>
  204. </dl>
  205. <h3>Example Request</h3>
  206. <div class="highlight"><pre><span></span><code>curl --header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span> SITE_ROOT/api/v1/checks/&lt;uuid&gt;
  207. </code></pre></div>
  208. <h3>Example Response</h3>
  209. <div class="highlight"><pre><span></span><code><span class="p">{</span>
  210. <span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Database Backup&quot;</span><span class="p">,</span>
  211. <span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;production db&quot;</span><span class="p">,</span>
  212. <span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;Runs ~/db-backup.sh&quot;</span><span class="p">,</span>
  213. <span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">1200</span><span class="p">,</span>
  214. <span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">7</span><span class="p">,</span>
  215. <span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;down&quot;</span><span class="p">,</span>
  216. <span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="s2">&quot;2020-03-23T10:19:32+00:00&quot;</span><span class="p">,</span>
  217. <span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
  218. <span class="nt">&quot;manual_resume&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
  219. <span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;PING_ENDPOINT803f680d-e89b-492b-82ef-2be7b774a92d&quot;</span><span class="p">,</span>
  220. <span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/803f680d-e89b-492b-82ef-2be7b774a92d&quot;</span><span class="p">,</span>
  221. <span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/803f680d-e89b-492b-82ef-2be7b774a92d/pause&quot;</span><span class="p">,</span>
  222. <span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;1bdea468-03bf-47b8-ab27-29a9dd0e4b94,51c6eb2b-2ae1-456b-99fe-6f1e0a36cd3c&quot;</span><span class="p">,</span>
  223. <span class="nt">&quot;schedule&quot;</span><span class="p">:</span> <span class="s2">&quot;15 5 * * *&quot;</span><span class="p">,</span>
  224. <span class="nt">&quot;tz&quot;</span><span class="p">:</span> <span class="s2">&quot;UTC&quot;</span>
  225. <span class="p">}</span>
  226. </code></pre></div>
  227. <h3>Example Read-Only Response</h3>
  228. <p>When using the read-only API key, the following fields are omitted:
  229. <code>ping_url</code>, <code>update_url</code>, <code>pause_url</code>, <code>channels</code>. An extra <code>unique_key</code> field is
  230. added. This identifier is stable across API calls.</p>
  231. <p>Note: the <code>ping_url</code>, <code>update_url</code> and <code>pause_url</code> fields, although omitted, are not
  232. really secret. The client already knows the check's unique UUID and so can easily
  233. construct these URLs by itself.</p>
  234. <div class="highlight"><pre><span></span><code><span class="p">{</span>
  235. <span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Database Backup&quot;</span><span class="p">,</span>
  236. <span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;production db&quot;</span><span class="p">,</span>
  237. <span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;Runs ~/db-backup.sh&quot;</span><span class="p">,</span>
  238. <span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">1200</span><span class="p">,</span>
  239. <span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">7</span><span class="p">,</span>
  240. <span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;down&quot;</span><span class="p">,</span>
  241. <span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="s2">&quot;2020-03-23T10:19:32+00:00&quot;</span><span class="p">,</span>
  242. <span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
  243. <span class="nt">&quot;manual_resume&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
  244. <span class="nt">&quot;unique_key&quot;</span><span class="p">:</span> <span class="s2">&quot;124f983e0e3dcaeba921cfcef46efd084576e783&quot;</span><span class="p">,</span>
  245. <span class="nt">&quot;schedule&quot;</span><span class="p">:</span> <span class="s2">&quot;15 5 * * *&quot;</span><span class="p">,</span>
  246. <span class="nt">&quot;tz&quot;</span><span class="p">:</span> <span class="s2">&quot;UTC&quot;</span>
  247. <span class="p">}</span>
  248. </code></pre></div>
  249. <h2 class="rule" id="create-check">Create a Check</h2>
  250. <p><code>POST SITE_ROOT/api/v1/checks/</code></p>
  251. <p>Creates a new check and returns its ping URL.
  252. All request parameters are optional and will use their default
  253. values if omitted.</p>
  254. <p>This API call can be used to create both "simple" and "cron" checks.
  255. To create a "simple" check, specify the "timeout" parameter.
  256. To create a "cron" check, specify the "schedule" and "tz" parameters.</p>
  257. <h3>Request Parameters</h3>
  258. <dl>
  259. <dt>name</dt>
  260. <dd>
  261. <p>string, optional, default value: ""</p>
  262. <p>Name for the new check.</p>
  263. </dd>
  264. <dt>tags</dt>
  265. <dd>
  266. <p>string, optional, default value: ""</p>
  267. <p>A space-delimited list of tags for the new check.
  268. Example:</p>
  269. <p><pre>{"tags": "reports staging"}</pre></p>
  270. </dd>
  271. <dt>desc</dt>
  272. <dd>
  273. <p>string, optional.</p>
  274. <p>Description for the check.</p>
  275. </dd>
  276. <dt>timeout</dt>
  277. <dd>
  278. <p>number, optional, default value: {{ default_timeout }}.</p>
  279. <p>A number of seconds, the expected period of this check.</p>
  280. <p>Minimum: 60 (one minute), maximum: 2592000 (30 days).</p>
  281. <p>Example for 5 minute timeout:</p>
  282. <p><pre>{"kind": "simple", "timeout": 300}</pre></p>
  283. </dd>
  284. <dt>grace</dt>
  285. <dd>
  286. <p>number, optional, default value: {{ default_grace }}.</p>
  287. <p>A number of seconds, the grace period for this check.</p>
  288. <p>Minimum: 60 (one minute), maximum: 2592000 (30 days).</p>
  289. </dd>
  290. <dt>schedule</dt>
  291. <dd>
  292. <p>string, optional, default value: "<em> * </em> * *".</p>
  293. <p>A cron expression defining this check's schedule.</p>
  294. <p>If you specify both "timeout" and "schedule" parameters, "timeout" will be
  295. ignored and "schedule" will be used.</p>
  296. <p>Example for a check running every half-hour:</p>
  297. <p><pre>{"schedule": "0,30 * <em> * </em>"}</pre></p>
  298. </dd>
  299. <dt>tz</dt>
  300. <dd>
  301. <p>string, optional, default value: "UTC".</p>
  302. <p>Server's timezone. This setting only has effect in combination with the
  303. "schedule" parameter.</p>
  304. <p>Example:</p>
  305. <p><pre>{"tz": "Europe/Riga"}</pre></p>
  306. </dd>
  307. <dt>manual_resume</dt>
  308. <dd>
  309. <p>boolean, optional, default value: false.</p>
  310. <p>Controls whether a paused ping resumes automatically when pinged (the default),
  311. or not. If set to false, a paused check will leave the paused state when it receives
  312. a ping. If set to true, a paused check will ignore pings and stay paused until it is
  313. either manually resumed from the web dashboard or the <code>manual_resume</code> flag is
  314. changed.</p>
  315. </dd>
  316. <dt>channels</dt>
  317. <dd>
  318. <p>string, optional</p>
  319. <p>By default, if a check is created through API, no notification channels
  320. (integrations) are assigned to it. So, when the check goes up or down, no
  321. notifications will get sent.</p>
  322. <p>Set this field to a special value "*" to automatically assign all existing
  323. integrations.</p>
  324. <p>To assign specific integrations, use a comma-separated list of integration
  325. identifiers. Use the <a href="#list-channels">Get a List of Existing Integrations</a> call to
  326. look up integration identifiers.</p>
  327. </dd>
  328. <dt>unique</dt>
  329. <dd>
  330. <p>array of string values, optional, default value: [].</p>
  331. <p>Before creating a check, look for existing checks, filtered by fields listed
  332. in <code>unique</code>. If a matching check is found, return it with HTTP status code 200.
  333. If no matching check is found, proceed as normal: create a check and return it
  334. with HTTP status code 201.</p>
  335. <p>The accepted values are: <code>name</code>, <code>tags</code>, <code>timeout</code> and <code>grace</code>.</p>
  336. <p>Example:</p>
  337. <p><pre>{"name": "Backups", unique: ["name"]}</pre></p>
  338. <p>In this example, if a check named "Backups" exists, it will be returned.
  339. Otherwise, a new check will be created and returned.</p>
  340. </dd>
  341. </dl>
  342. <h3>Response Codes</h3>
  343. <dl>
  344. <dt>201 Created</dt>
  345. <dd>The check was successfully created.</dd>
  346. <dt>200 OK</dt>
  347. <dd>The <code>unique</code> parameter was used and an existing check was matched.</dd>
  348. <dt>400 Bad Request</dt>
  349. <dd>The request is not well-formed, violates schema, or uses invalid
  350. field values.</dd>
  351. <dt>401 Unauthorized</dt>
  352. <dd>The API key is either missing or invalid.</dd>
  353. <dt>403 Forbidden</dt>
  354. <dd>The account's check limit has been reached. For free accounts,
  355. the limit is 20 checks per account.</dd>
  356. </dl>
  357. <h3>Example Request</h3>
  358. <div class="highlight"><pre><span></span><code>curl SITE_ROOT/api/v1/checks/ <span class="se">\</span>
  359. --header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span> <span class="se">\</span>
  360. --data <span class="s1">&#39;{&quot;name&quot;: &quot;Backups&quot;, &quot;tags&quot;: &quot;prod www&quot;, &quot;timeout&quot;: 3600, &quot;grace&quot;: 60}&#39;</span>
  361. </code></pre></div>
  362. <p>Or, alternatively:</p>
  363. <div class="highlight"><pre><span></span><code>curl SITE_ROOT/api/v1/checks/ <span class="se">\</span>
  364. --data <span class="s1">&#39;{&quot;api_key&quot;: &quot;your-api-key&quot;, &quot;name&quot;: &quot;Backups&quot;, &quot;tags&quot;: &quot;prod www&quot;, &quot;timeout&quot;: 3600, &quot;grace&quot;: 60}&#39;</span>
  365. </code></pre></div>
  366. <h3>Example Response</h3>
  367. <div class="highlight"><pre><span></span><code><span class="p">{</span>
  368. <span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
  369. <span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
  370. <span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">60</span><span class="p">,</span>
  371. <span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
  372. <span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
  373. <span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Backups&quot;</span><span class="p">,</span>
  374. <span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
  375. <span class="nt">&quot;manual_resume&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
  376. <span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause&quot;</span><span class="p">,</span>
  377. <span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;PING_ENDPOINTf618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
  378. <span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;new&quot;</span><span class="p">,</span>
  379. <span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;prod www&quot;</span><span class="p">,</span>
  380. <span class="nt">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
  381. <span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
  382. <span class="p">}</span>
  383. </code></pre></div>
  384. <h2 class="rule" id="update-check">Update an Existing Check</h2>
  385. <p><code>POST SITE_ROOT/api/v1/checks/&lt;uuid&gt;</code></p>
  386. <p>Updates an existing check. All request parameters are optional. The check is
  387. updated only with the supplied request parameters. If any parameter is omitted,
  388. its value is left unchanged.</p>
  389. <h3>Request Parameters</h3>
  390. <dl>
  391. <dt>name</dt>
  392. <dd>
  393. <p>string, optional.</p>
  394. <p>Name for the check.</p>
  395. </dd>
  396. <dt>tags</dt>
  397. <dd>
  398. <p>string, optional.</p>
  399. <p>A space-delimited list of tags for the check.</p>
  400. <p>Example:</p>
  401. <p><pre>{"tags": "reports staging"}</pre></p>
  402. </dd>
  403. <dt>desc</dt>
  404. <dd>
  405. <p>string, optional.</p>
  406. <p>Description for the check.</p>
  407. </dd>
  408. <dt>timeout</dt>
  409. <dd>
  410. <p>number, optional.</p>
  411. <p>A number of seconds, the expected period of this check.</p>
  412. <p>Minimum: 60 (one minute), maximum: 2592000 (30 days).</p>
  413. <p>Example for 5 minute timeout:</p>
  414. <p><pre>{"kind": "simple", "timeout": 300}</pre></p>
  415. </dd>
  416. <dt>grace</dt>
  417. <dd>
  418. <p>number, optional.</p>
  419. <p>A number of seconds, the grace period for this check.</p>
  420. <p>Minimum: 60 (one minute), maximum: 2592000 (30 days).</p>
  421. </dd>
  422. <dt>schedule</dt>
  423. <dd>
  424. <p>string, optional.</p>
  425. <p>A cron expression defining this check's schedule.</p>
  426. <p>If you specify both "timeout" and "schedule" parameters, "timeout" will be
  427. ignored and "schedule" will be used.</p>
  428. <p>Example for a check running every half-hour:</p>
  429. <p><pre>{"schedule": "0,30 * <em> * </em>"}</pre></p>
  430. </dd>
  431. <dt>tz</dt>
  432. <dd>
  433. <p>string, optional.</p>
  434. <p>Server's timezone. This setting only has effect in combination with the
  435. "schedule" parameter.</p>
  436. <p>Example:</p>
  437. <p><pre>{"tz": "Europe/Riga"}</pre></p>
  438. </dd>
  439. <dt>manual_resume</dt>
  440. <dd>
  441. <p>boolean, optional, default value: false.</p>
  442. <p>Controls whether a paused ping resumes automatically when pinged (the default),
  443. or not. If set to false, a paused check will leave the paused state when it receives
  444. a ping. If set to true, a paused check will ignore pings and stay paused until it is
  445. either manually resumed from the web dashboard or the <code>manual_resume</code> flag is
  446. changed.</p>
  447. </dd>
  448. <dt>channels</dt>
  449. <dd>
  450. <p>string, optional.</p>
  451. <p>Set this field to a special value "*" to automatically assign all existing
  452. notification channels.</p>
  453. <p>Set this field to a special value "" (empty string) to automatically <em>unassign</em>
  454. all notification channels.</p>
  455. <p>Set this field to a comma-separated list of channel identifiers to assign
  456. specific notification channels.</p>
  457. <p>Example:</p>
  458. <p><pre>{"channels": "4ec5a071-2d08-4baa-898a-eb4eb3cd6941,746a083e-f542-4554-be1a-707ce16d3acc"}</pre></p>
  459. </dd>
  460. </dl>
  461. <h3>Response Codes</h3>
  462. <dl>
  463. <dt>200 OK</dt>
  464. <dd>The check was successfully updated.</dd>
  465. <dt>400 Bad Request</dt>
  466. <dd>The request is not well-formed, violates schema, or uses invalid
  467. field values.</dd>
  468. <dt>401 Unauthorized</dt>
  469. <dd>The API key is either missing or invalid.</dd>
  470. <dt>403 Forbidden</dt>
  471. <dd>Access denied, wrong API key.</dd>
  472. <dt>404 Not Found</dt>
  473. <dd>The specified check does not exist.</dd>
  474. </dl>
  475. <h3>Example Request</h3>
  476. <div class="highlight"><pre><span></span><code>curl SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc <span class="se">\</span>
  477. --header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span> <span class="se">\</span>
  478. --data <span class="s1">&#39;{&quot;name&quot;: &quot;Backups&quot;, &quot;tags&quot;: &quot;prod www&quot;, &quot;timeout&quot;: 3600, &quot;grace&quot;: 60}&#39;</span>
  479. </code></pre></div>
  480. <p>Or, alternatively:</p>
  481. <div class="highlight"><pre><span></span><code>curl SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc <span class="se">\</span>
  482. --data <span class="s1">&#39;{&quot;api_key&quot;: &quot;your-api-key&quot;, &quot;name&quot;: &quot;Backups&quot;, &quot;tags&quot;: &quot;prod www&quot;, &quot;timeout&quot;: 3600, &quot;grace&quot;: 60}&#39;</span>
  483. </code></pre></div>
  484. <h3>Example Response</h3>
  485. <div class="highlight"><pre><span></span><code><span class="p">{</span>
  486. <span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
  487. <span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
  488. <span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">60</span><span class="p">,</span>
  489. <span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
  490. <span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
  491. <span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Backups&quot;</span><span class="p">,</span>
  492. <span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
  493. <span class="nt">&quot;manual_resume&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
  494. <span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause&quot;</span><span class="p">,</span>
  495. <span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;PING_ENDPOINTf618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
  496. <span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;new&quot;</span><span class="p">,</span>
  497. <span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;prod www&quot;</span><span class="p">,</span>
  498. <span class="nt">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
  499. <span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
  500. <span class="p">}</span>
  501. </code></pre></div>
  502. <h2 class="rule" id="pause-check">Pause Monitoring of a Check</h2>
  503. <p><code>POST SITE_ROOT/api/v1/checks/&lt;uuid&gt;/pause</code></p>
  504. <p>Disables monitoring for a check, without removing it. The check goes into a "paused"
  505. state. You can resume monitoring of the check by pinging it.</p>
  506. <p>This API call has no request parameters.</p>
  507. <h3>Response Codes</h3>
  508. <dl>
  509. <dt>200 OK</dt>
  510. <dd>The check was successfully paused.</dd>
  511. <dt>401 Unauthorized</dt>
  512. <dd>The API key is either missing or invalid.</dd>
  513. <dt>403 Forbidden</dt>
  514. <dd>Access denied, wrong API key.</dd>
  515. <dt>404 Not Found</dt>
  516. <dd>The specified check does not exist.</dd>
  517. </dl>
  518. <h3>Example Request</h3>
  519. <div class="highlight"><pre><span></span><code>curl SITE_ROOT/api/v1/checks/0c8983c9-9d73-446f-adb5-0641fdacc9d4/pause <span class="se">\</span>
  520. --request POST --header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span> --data <span class="s2">&quot;&quot;</span>
  521. </code></pre></div>
  522. <p>Note: the <code>--data ""</code> argument forces curl to send a <code>Content-Length</code> request header
  523. even though the request body is empty. For HTTP POST requests, the <code>Content-Length</code>
  524. header is sometimes required by some network proxies and web servers.</p>
  525. <h3>Example Response</h3>
  526. <div class="highlight"><pre><span></span><code><span class="p">{</span>
  527. <span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
  528. <span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
  529. <span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">60</span><span class="p">,</span>
  530. <span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
  531. <span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
  532. <span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Backups&quot;</span><span class="p">,</span>
  533. <span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
  534. <span class="nt">&quot;manual_resume&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
  535. <span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause&quot;</span><span class="p">,</span>
  536. <span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;PING_ENDPOINTf618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
  537. <span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;paused&quot;</span><span class="p">,</span>
  538. <span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;prod www&quot;</span><span class="p">,</span>
  539. <span class="nt">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
  540. <span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc&quot;</span>
  541. <span class="p">}</span>
  542. </code></pre></div>
  543. <h2 class="rule" id="delete-check">Delete Check</h2>
  544. <p><code>DELETE SITE_ROOT/api/v1/checks/&lt;uuid&gt;</code></p>
  545. <p>Permanently deletes the check from user's account. Returns JSON representation of the
  546. check that was just deleted.</p>
  547. <p>This API call has no request parameters.</p>
  548. <h3>Response Codes</h3>
  549. <dl>
  550. <dt>200 OK</dt>
  551. <dd>The check was successfully deleted.</dd>
  552. <dt>401 Unauthorized</dt>
  553. <dd>The API key is either missing or invalid.</dd>
  554. <dt>403 Forbidden</dt>
  555. <dd>Access denied, wrong API key.</dd>
  556. <dt>404 Not Found</dt>
  557. <dd>The specified check does not exist.</dd>
  558. </dl>
  559. <h3>Example Request</h3>
  560. <div class="highlight"><pre><span></span><code>curl SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc <span class="se">\</span>
  561. --request DELETE --header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span>
  562. </code></pre></div>
  563. <h3>Example Response</h3>
  564. <div class="highlight"><pre><span></span><code><span class="p">{</span>
  565. <span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
  566. <span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
  567. <span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">60</span><span class="p">,</span>
  568. <span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
  569. <span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
  570. <span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Backups&quot;</span><span class="p">,</span>
  571. <span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
  572. <span class="nt">&quot;manual_resume&quot;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
  573. <span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause&quot;</span><span class="p">,</span>
  574. <span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;PING_ENDPOINTf618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
  575. <span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;new&quot;</span><span class="p">,</span>
  576. <span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;prod www&quot;</span><span class="p">,</span>
  577. <span class="nt">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
  578. <span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
  579. <span class="p">}</span>
  580. </code></pre></div>
  581. <h2 class="rule" id="list-pings">Get a list of checks's logged pings</h2>
  582. <p><code>GET SITE_ROOT/api/v1/checks/&lt;uuid&gt;/pings/</code></p>
  583. <p>Returns a list of pings this check has received.</p>
  584. <p>This endpoint returns pings in reverse order (most recent first), and the total
  585. number of returned pings depends on account's billing plan: 100 for free accounts,
  586. 1000 for paid accounts.</p>
  587. <h3>Response Codes</h3>
  588. <dl>
  589. <dt>200 OK</dt>
  590. <dd>The request succeeded.</dd>
  591. <dt>401 Unauthorized</dt>
  592. <dd>The API key is either missing or invalid.</dd>
  593. <dt>403 Forbidden</dt>
  594. <dd>Access denied, wrong API key.</dd>
  595. <dt>404 Not Found</dt>
  596. <dd>The specified check does not exist.</dd>
  597. </dl>
  598. <h3>Example Request</h3>
  599. <div class="highlight"><pre><span></span><code>curl SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pings/ <span class="se">\</span>
  600. --header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span>
  601. </code></pre></div>
  602. <h3>Example Response</h3>
  603. <div class="highlight"><pre><span></span><code><span class="p">{</span>
  604. <span class="nt">&quot;pings&quot;</span><span class="p">:</span> <span class="p">[</span>
  605. <span class="p">{</span>
  606. <span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;success&quot;</span><span class="p">,</span>
  607. <span class="nt">&quot;date&quot;</span><span class="p">:</span> <span class="s2">&quot;2020-06-09T14:51:06.113073+00:00&quot;</span><span class="p">,</span>
  608. <span class="nt">&quot;n&quot;</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span>
  609. <span class="nt">&quot;scheme&quot;</span><span class="p">:</span> <span class="s2">&quot;http&quot;</span><span class="p">,</span>
  610. <span class="nt">&quot;remote_addr&quot;</span><span class="p">:</span> <span class="s2">&quot;192.0.2.0&quot;</span><span class="p">,</span>
  611. <span class="nt">&quot;method&quot;</span><span class="p">:</span> <span class="s2">&quot;GET&quot;</span><span class="p">,</span>
  612. <span class="nt">&quot;ua&quot;</span><span class="p">:</span> <span class="s2">&quot;curl/7.68.0&quot;</span><span class="p">,</span>
  613. <span class="nt">&quot;duration&quot;</span><span class="p">:</span> <span class="mf">2.896736</span>
  614. <span class="p">},</span>
  615. <span class="p">{</span>
  616. <span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;start&quot;</span><span class="p">,</span>
  617. <span class="nt">&quot;date&quot;</span><span class="p">:</span> <span class="s2">&quot;2020-06-09T14:51:03.216337+00:00&quot;</span><span class="p">,</span>
  618. <span class="nt">&quot;n&quot;</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span>
  619. <span class="nt">&quot;scheme&quot;</span><span class="p">:</span> <span class="s2">&quot;http&quot;</span><span class="p">,</span>
  620. <span class="nt">&quot;remote_addr&quot;</span><span class="p">:</span> <span class="s2">&quot;192.0.2.0&quot;</span><span class="p">,</span>
  621. <span class="nt">&quot;method&quot;</span><span class="p">:</span> <span class="s2">&quot;GET&quot;</span><span class="p">,</span>
  622. <span class="nt">&quot;ua&quot;</span><span class="p">:</span> <span class="s2">&quot;curl/7.68.0&quot;</span>
  623. <span class="p">},</span>
  624. <span class="p">{</span>
  625. <span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;success&quot;</span><span class="p">,</span>
  626. <span class="nt">&quot;date&quot;</span><span class="p">:</span> <span class="s2">&quot;2020-06-09T14:50:59.633577+00:00&quot;</span><span class="p">,</span>
  627. <span class="nt">&quot;n&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
  628. <span class="nt">&quot;scheme&quot;</span><span class="p">:</span> <span class="s2">&quot;http&quot;</span><span class="p">,</span>
  629. <span class="nt">&quot;remote_addr&quot;</span><span class="p">:</span> <span class="s2">&quot;192.0.2.0&quot;</span><span class="p">,</span>
  630. <span class="nt">&quot;method&quot;</span><span class="p">:</span> <span class="s2">&quot;GET&quot;</span><span class="p">,</span>
  631. <span class="nt">&quot;ua&quot;</span><span class="p">:</span> <span class="s2">&quot;curl/7.68.0&quot;</span><span class="p">,</span>
  632. <span class="nt">&quot;duration&quot;</span><span class="p">:</span> <span class="mf">2.997976</span>
  633. <span class="p">},</span>
  634. <span class="p">{</span>
  635. <span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;start&quot;</span><span class="p">,</span>
  636. <span class="nt">&quot;date&quot;</span><span class="p">:</span> <span class="s2">&quot;2020-06-09T14:50:56.635601+00:00&quot;</span><span class="p">,</span>
  637. <span class="nt">&quot;n&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
  638. <span class="nt">&quot;scheme&quot;</span><span class="p">:</span> <span class="s2">&quot;http&quot;</span><span class="p">,</span>
  639. <span class="nt">&quot;remote_addr&quot;</span><span class="p">:</span> <span class="s2">&quot;192.0.2.0&quot;</span><span class="p">,</span>
  640. <span class="nt">&quot;method&quot;</span><span class="p">:</span> <span class="s2">&quot;GET&quot;</span><span class="p">,</span>
  641. <span class="nt">&quot;ua&quot;</span><span class="p">:</span> <span class="s2">&quot;curl/7.68.0&quot;</span>
  642. <span class="p">}</span>
  643. <span class="p">]</span>
  644. <span class="p">}</span>
  645. </code></pre></div>
  646. <h2 class="rule" id="list-channels">Get a List of Existing Integrations</h2>
  647. <p><code>GET SITE_ROOT/api/v1/channels/</code></p>
  648. <p>Returns a list of integrations belonging to the project.</p>
  649. <h3>Response Codes</h3>
  650. <dl>
  651. <dt>200 OK</dt>
  652. <dd>The request succeeded.</dd>
  653. <dt>401 Unauthorized</dt>
  654. <dd>The API key is either missing or invalid.</dd>
  655. </dl>
  656. <h3>Example Request</h3>
  657. <div class="highlight"><pre><span></span><code>curl --header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span> SITE_ROOT/api/v1/channels/
  658. </code></pre></div>
  659. <h3>Example Response</h3>
  660. <div class="highlight"><pre><span></span><code><span class="p">{</span>
  661. <span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="p">[</span>
  662. <span class="p">{</span>
  663. <span class="nt">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;4ec5a071-2d08-4baa-898a-eb4eb3cd6941&quot;</span><span class="p">,</span>
  664. <span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;My Work Email&quot;</span><span class="p">,</span>
  665. <span class="nt">&quot;kind&quot;</span><span class="p">:</span> <span class="s2">&quot;email&quot;</span>
  666. <span class="p">},</span>
  667. <span class="p">{</span>
  668. <span class="nt">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;746a083e-f542-4554-be1a-707ce16d3acc&quot;</span><span class="p">,</span>
  669. <span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;My Phone&quot;</span><span class="p">,</span>
  670. <span class="nt">&quot;kind&quot;</span><span class="p">:</span> <span class="s2">&quot;sms&quot;</span>
  671. <span class="p">}</span>
  672. <span class="p">]</span>
  673. <span class="p">}</span>
  674. </code></pre></div>