[GH-ISSUE #45] Create HTTP API endpoint aimed to create a new check #22

Closed
opened 2026-02-25 23:40:49 +03:00 by kerem · 5 comments
Owner

Originally created by @ViachKakovskyi on GitHub (Feb 11, 2016).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/45

It would be very handy to have HTTP API for spawning new checks.

Many thanks for your service.

Originally created by @ViachKakovskyi on GitHub (Feb 11, 2016). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/45 It would be very handy to have HTTP API for spawning new checks. Many thanks for your service.
kerem closed this issue 2026-02-25 23:40:49 +03:00
Author
Owner

@pataquets commented on GitHub (Feb 16, 2016):

Even an "autocreate checks on first ping" kind of setting would be great for short-lived services, such as autoscaled instances.

<!-- gh-comment-id:184527082 --> @pataquets commented on GitHub (Feb 16, 2016): Even an "autocreate checks on first ping" kind of setting would be great for short-lived services, such as autoscaled instances.
Author
Owner

@cuu508 commented on GitHub (Feb 16, 2016):

By now there are 3 issues asking for API access – #4, #42 and this one, so clearly this is something that's missing and worth adding.

Here's what we could start with:

  • Each account gets an API key, accessible from settings page

  • There's an API call for creating a new check. It takes a JSON payload with parameters (all optional):

    curl -H "Content-Type: application/json" -X POST -d '{"name":"ip-10-0-0-1", "tags":"web,aws", "period":86400, "grace":300}' http://healthchecks.io/api/check

  • the response would be a JSON dictionary with ping URL:

    {"url": "https://hchk.io/..."}

With this in place, one could write a CLI client in Python/Ruby/Go/whatever which creates the check if needed and then pings it. It could store the created URL in e.g. a dotfile in $HOME.

$ hchk --api-key=base64gibberish --name=`hostname` --tags=web,aws --period=86400 --grace=300

Would this help? What would be the use cases where this would not be sufficient?

<!-- gh-comment-id:184616374 --> @cuu508 commented on GitHub (Feb 16, 2016): By now there are 3 issues asking for API access – #4, #42 and this one, so clearly this is something that's missing and worth adding. Here's what we could start with: - Each account gets an API key, accessible from settings page - There's an API call for creating a new check. It takes a JSON payload with parameters (all optional): `curl -H "Content-Type: application/json" -X POST -d '{"name":"ip-10-0-0-1", "tags":"web,aws", "period":86400, "grace":300}' http://healthchecks.io/api/check` - the response would be a JSON dictionary with ping URL: `{"url": "https://hchk.io/..."}` With this in place, one could write a CLI client in Python/Ruby/Go/whatever which creates the check if needed and then pings it. It could store the created URL in e.g. a dotfile in $HOME. ``` $ hchk --api-key=base64gibberish --name=`hostname` --tags=web,aws --period=86400 --grace=300 ``` Would this help? What would be the use cases where this would not be sufficient?
Author
Owner

@ViachKakovskyi commented on GitHub (Feb 16, 2016):

The way which you described here sounds good for me.

I have one concern about enabling HipChat/Slack/etc integrations for a new check. Should all the integrations be disabled for a new check? If so, it still requires manual operations in Healthchecks dashboard.

The ability to enable existing integration in POST request could be added in the next step (if you like the option).

And, probably, ability to delete a check via API would be a handy one.

Thanks, @cuu508.

<!-- gh-comment-id:184637796 --> @ViachKakovskyi commented on GitHub (Feb 16, 2016): The way which you described here sounds good for me. I have one concern about enabling HipChat/Slack/etc integrations for a new check. Should all the integrations be disabled for a new check? If so, it still requires manual operations in Healthchecks dashboard. The ability to enable existing integration in POST request could be added in the next step (if you like the option). And, probably, ability to delete a check via API would be a handy one. Thanks, @cuu508.
Author
Owner

@cuu508 commented on GitHub (Feb 18, 2016):

I've added an API call for creating a new check. It's very limited for time being, but we have to start somewhere!

Documentation: https://healthchecks.io/docs/api/
Very-alpha command line client: https://github.com/healthchecks/hchk

<!-- gh-comment-id:185659359 --> @cuu508 commented on GitHub (Feb 18, 2016): I've added an API call for creating a new check. It's very limited for time being, but we have to start somewhere! Documentation: https://healthchecks.io/docs/api/ Very-alpha command line client: https://github.com/healthchecks/hchk
Author
Owner

@ViachKakovskyi commented on GitHub (Feb 18, 2016):

Nice, many thanks.

<!-- gh-comment-id:185675379 --> @ViachKakovskyi commented on GitHub (Feb 18, 2016): Nice, many thanks.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#22
No description provided.