[GH-ISSUE #844] Get by slug #593

Closed
opened 2026-02-25 23:42:57 +03:00 by kerem · 3 comments
Owner

Originally created by @scheibling on GitHub (Jun 16, 2023).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/844

With it now being possible to create a check with a specific slug instead of auto-generating it, it would be really helpful to have a get endpoint in the v3 API that supports accessing a specific slug.

Just saw that the auto-provisioning is now enabled which is nice as well, we're currently creating checks via the API if it doesn't exist and are using the Tag-field as a unique "external" identifier (which means list -> get first result), the by-slug endpoint would be a much better solution

Originally created by @scheibling on GitHub (Jun 16, 2023). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/844 With it now being possible to create a check with a specific slug instead of auto-generating it, it would be really helpful to have a get endpoint in the v3 API that supports accessing a specific slug. Just saw that the auto-provisioning is now enabled which is nice as well, we're currently creating checks via the API if it doesn't exist and are using the Tag-field as a unique "external" identifier (which means list -> get first result), the by-slug endpoint would be a much better solution
kerem closed this issue 2026-02-25 23:42:57 +03:00
Author
Owner

@cuu508 commented on GitHub (Jun 16, 2023):

Slugs are not guaranteed to be unique, so a "get by slug" call could have 0, 1 or N matches.

The "List Existing Checks" API call currently supports filtering by tag:

https://healthchecks.io/api/v3/checks/?tag=foo&tag=bar

We could add an option to filter by slug as well:

https://healthchecks.io/api/v3/checks/?slug=my-custom-slug

Would that help?

Just saw that the auto-provisioning is now enabled which is nice as well

Yep! But, note, this change has not yet been deployed to the hosted service.

<!-- gh-comment-id:1594663535 --> @cuu508 commented on GitHub (Jun 16, 2023): Slugs are not guaranteed to be unique, so a "get by slug" call could have 0, 1 or N matches. The "List Existing Checks" API call currently supports filtering by tag: ``` https://healthchecks.io/api/v3/checks/?tag=foo&tag=bar ``` We could add an option to filter by slug as well: ``` https://healthchecks.io/api/v3/checks/?slug=my-custom-slug ``` Would that help? > Just saw that the auto-provisioning is now enabled which is nice as well Yep! But, note, this change has not yet been deployed to the hosted service.
Author
Owner

@scheibling commented on GitHub (Jun 16, 2023):

The slug is unique per project though, right?

I opened a pull request with an example, feel free to have a look at it and push it in if you want, I'm gonna try it out locally on our instance since it saves us a couple of requests for some of our checks.

<!-- gh-comment-id:1594685090 --> @scheibling commented on GitHub (Jun 16, 2023): The slug is unique per project though, right? I opened a pull request with an example, feel free to have a look at it and push it in if you want, I'm gonna try it out locally on our instance since it saves us a couple of requests for some of our checks.
Author
Owner

@cuu508 commented on GitHub (Jun 27, 2023):

No, there is no uniqueness constraint for slugs even within a single project. Multiple checks can have the same slug, and a check can have an empty slug.

I just pushed a commit which adds filtering by slug to the "List Checks" call:

http://healthchecks.io/api/v3/checks/?slug=foo
<!-- gh-comment-id:1609153320 --> @cuu508 commented on GitHub (Jun 27, 2023): No, there is no uniqueness constraint for slugs even within a single project. Multiple checks can have the same slug, and a check can have an empty slug. I just pushed a commit which adds filtering by slug to the "List Checks" call: ``` http://healthchecks.io/api/v3/checks/?slug=foo ```
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#593
No description provided.