{% extends "front/base_docs.html" %} {% load staticfiles %} {% block title %}REST API - healthchecks.io{% endblock %} {% block docs_content %}

REST API

This is early days for healtchecks.io REST API. For now, there's just one API resource for listing and creating checks.

Authentication

Your requests to healtchecks.io REST API must authenticate using an API key. By default, an user account on healthchecks.io doesn't have an API key. You can create one in the Settings page.

The API uses a simple authentication scheme: the API key should be included in the request body (a JSON document) along other fields.

API Requests

For POST requests, the healthchecks.io API expects request body to be a JSON document (not a mulitpart/form-data encoded form data).

API Responses

healthchecks.io uses HTTP status codes wherever possible. In general, 2xx class indicates success, 4xx indicates an client error, and 5xx indicates a server error.

The response may contain a JSON document with additional data.

List checks

GET {{ SITE_ROOT }}/api/v1/checks/

Returns a list of checks. This API call takes no parameters and returns a JSON document with all checks in user's account.

Example Request

{% include "front/snippets/list_checks_request.html" %}

Example Response

{% include "front/snippets/list_checks_response.html" %}

Create a check

POST {{ SITE_ROOT }}/api/v1/checks/

Creates a new check and returns its ping URL. All request parameters are optional and will use their default values if omitted.

Request Parameters

name

string, optional, default value: ""

Name for the new check.

tags

string, optional, default value: ""

A space-delimited list of tags for the new check.

timeout

number, optional, default value: {{ default_timeout }}.

A number of seconds, the expected period of this check.

Minimum: 60 (one minute), maximum: 604800 (one week).

grace

number, optional, default value: {{ default_grace }}.

A number of seconds, the grace period for this check.

Minimum: 60 (one minute), maximum: 604800 (one week).

channels

string, optional, default value: ""

By default, if a check is created through API, no notification channels are assigned to it. So, when the check goes up or down, no notifications would be sent. Set this field to a special value "*" to automatically assign all existing notification channels.

Example Request

{% include "front/snippets/create_check_request.html" %}

Example Response

{% include "front/snippets/create_check_response.html" %} {% endblock %}