diff --git a/static/css/docs.css b/static/css/docs.css index dbc6a1f4..ad246e91 100644 --- a/static/css/docs.css +++ b/static/css/docs.css @@ -114,7 +114,7 @@ h2.rule { .docs-api dl { display: grid; - grid-template-columns: 120px auto; + grid-template-columns: 150px auto; } .docs-api dt { diff --git a/templates/docs/api.html b/templates/docs/api.html index 3bb14260..9f0801a6 100644 --- a/templates/docs/api.html +++ b/templates/docs/api.html @@ -89,6 +89,13 @@ specified value.

SITE_ROOT/api/v1/checks/?tag=foo&tag=bar

+

Response Codes

+
+
200 OK
+
The request succeeded.
+
401 Unauthorized
+
The API key is either missing or invalid.
+

Example Request

curl --header "X-Api-Key: your-api-key" SITE_ROOT/api/v1/checks/
 
@@ -254,11 +261,16 @@ Otherwise, a new check will be created and returned.

Response Codes

201 Created
-
Returned if the check was successfully created.
+
The check was successfully created.
200 OK
-
Returned if the unique parameter was used and an existing check was matched.
+
The unique parameter was used and an existing check was matched.
+
400 Bad Request
+
The request is not well-formed, violates schema, or uses invalid +field values.
+
401 Unauthorized
+
The API key is either missing or invalid.
403 Forbidden
-
Returned if the account's check limit has been reached. For free accounts, +
The account's check limit has been reached. For free accounts, the limit is 20 checks per account.

Example Request

@@ -364,7 +376,16 @@ specific notification channels.

Response Codes

200 OK
-
Returned if the check was successfully updated.
+
The check was successfully updated.
+
400 Bad Request
+
The request is not well-formed, violates schema, or uses invalid +field values.
+
401 Unauthorized
+
The API key is either missing or invalid.
+
403 Forbidden
+
Access denied, wrong API key.
+
404 Not Found
+
The specified check does not exist.

Example Request

curl SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc \
@@ -403,6 +424,17 @@ specific notification channels.

Disables monitoring for a check, without removing it. The check goes into a "paused" state. You can resume monitoring of the check by pinging it.

This API call has no request parameters.

+

Response Codes

+
+
200 OK
+
The check was successfully paused.
+
401 Unauthorized
+
The API key is either missing or invalid.
+
403 Forbidden
+
Access denied, wrong API key.
+
404 Not Found
+
The specified check does not exist.
+

Example Request

curl SITE_ROOT/api/v1/checks/0c8983c9-9d73-446f-adb5-0641fdacc9d4/pause \
     --request POST --header "X-Api-Key: your-api-key" --data ""
@@ -436,6 +468,17 @@ header is sometimes required by some network proxies and web servers.

Permanently deletes the check from user's account. Returns JSON representation of the check that was just deleted.

This API call has no request parameters.

+

Response Codes

+
+
200 OK
+
The check was successfully deleted.
+
401 Unauthorized
+
The API key is either missing or invalid.
+
403 Forbidden
+
Access denied, wrong API key.
+
404 Not Found
+
The specified check does not exist.
+

Example Request

curl SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc \
     --request DELETE --header "X-Api-Key: your-api-key"
@@ -464,6 +507,13 @@ check that was just deleted.

Get a List of Existing Integrations

GET SITE_ROOT/api/v1/channels/

Returns a list of integrations belonging to the user.

+

Response Codes

+
+
200 OK
+
The request succeeded.
+
401 Unauthorized
+
The API key is either missing or invalid.
+

Example Request

curl --header "X-Api-Key: your-api-key" SITE_ROOT/api/v1/channels/
 
diff --git a/templates/docs/api.md b/templates/docs/api.md index ec02ed36..f23d69b6 100644 --- a/templates/docs/api.md +++ b/templates/docs/api.md @@ -68,6 +68,14 @@ tag=<value> `SITE_ROOT/api/v1/checks/?tag=foo&tag=bar` +### Response Codes + +200 OK +: The request succeeded. + +401 Unauthorized +: The API key is either missing or invalid. + ### Example Request ```bash @@ -255,13 +263,20 @@ unique ### Response Codes 201 Created -: Returned if the check was successfully created. +: The check was successfully created. 200 OK -: Returned if the `unique` parameter was used and an existing check was matched. +: The `unique` parameter was used and an existing check was matched. + +400 Bad Request +: The request is not well-formed, violates schema, or uses invalid + field values. + +401 Unauthorized +: The API key is either missing or invalid. 403 Forbidden -: Returned if the account's check limit has been reached. For free accounts, +: The account's check limit has been reached. For free accounts, the limit is 20 checks per account. ### Example Request @@ -388,7 +403,21 @@ channels ### Response Codes 200 OK -: Returned if the check was successfully updated. +: The check was successfully updated. + +400 Bad Request +: The request is not well-formed, violates schema, or uses invalid + field values. + +401 Unauthorized +: The API key is either missing or invalid. + +403 Forbidden +: Access denied, wrong API key. + +404 Not Found +: The specified check does not exist. + ### Example Request @@ -434,6 +463,20 @@ state. You can resume monitoring of the check by pinging it. This API call has no request parameters. +### Response Codes + +200 OK +: The check was successfully paused. + +401 Unauthorized +: The API key is either missing or invalid. + +403 Forbidden +: Access denied, wrong API key. + +404 Not Found +: The specified check does not exist. + ### Example Request ```bash @@ -474,6 +517,20 @@ check that was just deleted. This API call has no request parameters. +### Response Codes + +200 OK +: The check was successfully deleted. + +401 Unauthorized +: The API key is either missing or invalid. + +403 Forbidden +: Access denied, wrong API key. + +404 Not Found +: The specified check does not exist. + ### Example Request ```bash @@ -507,6 +564,14 @@ curl SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc \ Returns a list of integrations belonging to the user. +### Response Codes + +200 OK +: The request succeeded. + +401 Unauthorized +: The API key is either missing or invalid. + ### Example Request ```bash