Cahook provides a simple API to list, create, and update your monitors with your API token. The API token can be found in the user menu > My Profile.
You can make API request by sending an HTTP request to our API endpoint at
https://cahook.com/api/v1/{function}
The endpoint accepts both GET and POST method.
name=Example&interval=15.{"name":"Example", "interval": 15}.
Authenticate by including your API token in the Authorization header, prefixed with Bearer. For example:
Authorization: Bearer YOUR_API_TOKEN
You can also add the token in the POST payload.
Call monitor_list to receive a list of all monitors in your account.
Example request:
curl --request GET \
--url "https://cahook.com/api/v1/monitor_list" \
--header "Authorization: Bearer API-TOKEN"
Example response:
[
{
"id": 3,
"name": "Cahook API",
"url": "https://cahook.com/api/v1/monitor_list",
"status": 0,
"interval": 15,
"httpMethod": "GET",
"httpHeaders": "Authorization: Bearer SECRET_GARDEN",
"httpBody": null,
"username": null,
"password": null,
"successHttpStatus": "2xx",
"keyword": null
},
{
"id": 2,
"name": "Cahook App",
"url": "https://cahook.com/signup",
"status": 0,
"interval": 15,
"httpMethod": "GET",
"httpHeaders": null,
"httpBody": null,
"username": null,
"password": null,
"successHttpStatus": "2xx",
"keyword": null
}
]
Call monitor_add to create a monitor.
| Field | Type | Description |
|---|---|---|
| url | string | Monitor URL, required. |
| interval | ?integer | Monitor interval in seconds. Default is 300 for free plan, and 60 for paid plans. Min 15, max 86400. |
| name | ?string | Monitor name. If not provided, the host part of the URL will be used. |
| httpMethod | ?string | HTTP method, default GET. |
| httpHeaders | ?string | HTTP headers with new lines as delimiters. |
| httpBody | ?string | HTTP body, may be in query or JSON format. |
| username | ?string | Username for HTTP basic authentication. |
| password | ?string | Password for HTTP basic authentication. |
| successHttpStatus | ?string | Comma-separated list of accepted HTTP status, default 2xx (200 to 205). |
| keyword | ?string | Keyword to check for in the HTTP response. |
Example request:
curl --request POST \
--url "https://cahook.com/api/v1/monitor_add" \
--header "Authorization: Bearer API-TOKEN" \
--header 'Content-Type: application/json' \
--data '{"name":"Example","url":"https://example.com","interval":60}'
Example success response:
{
"id": 5,
"name": "Example",
"url": "https://example.com",
"status": 0,
"interval": 60,
"httpMethod": "GET",
"httpHeaders": null,
"httpBody": null,
"username": null,
"password": null,
"successHttpStatus": "2xx",
"keyword": null
}
Example failed response:
{"error": "You can only have 10 monitors. Please upgrade your account."}
Call monitor_edit with an id to edit a monitor.
Example request:
curl --request POST \
--url "https://cahook.com/api/v1/monitor_get" \
--header "Authorization: Bearer API-TOKEN" \
--data "id=5&interval=15"
Call monitor_get with an id to get a monitor.
Example request:
curl --request GET \
--url "https://cahook.com/api/v1/monitor_get?id=5" \
--header "Authorization: Bearer API-TOKEN"
Call monitor_pause with an id to pause a monitor.
Example request:
curl --request POST \
--url "https://cahook.com/api/v1/monitor_pause" \
--header "Authorization: Bearer API-TOKEN" \
--data "id=5"
Call monitor_resume with an id to resume a monitor.
Example request:
curl --request GET \
--url "https://cahook.com/api/v1/monitor_resume?id=5" \
--header "Authorization: Bearer API-TOKEN"
Call monitor_check with an id to check a monitor.
Example request:
curl --request GET \
--url "https://cahook.com/api/v1/monitor_check?id=5" \
--header "Authorization: Bearer API-TOKEN"
Call monitor_delete with an id to delete a monitor.
Example request:
curl --request GET \
--url "https://cahook.com/api/v1/monitor_delete?id=5" \
--header "Authorization: Bearer API-TOKEN"
Need help? Reach out to support@cahook.com - we're happy to help.
Start with 14-day free trial, no credit card required.
Monitor your website every 15 seconds, and notify you instantly.