API Usage Examples
To interact with the Pulsetic API, you'll typically use an API token for authentication. This token is included in the Authorization
header of your HTTP requests. Here are some common examples of how to use the API (using curl
for demonstration):
Monitor Management
Listing monitors
This example shows how to retrieve a list of all monitor IDs associated with your account.
curl --location "https://api.pulsetic.com/api/public/monitors" --header 'Authorization: YOUR_API_TOKEN' --header 'Content-Type: application/json'
Adding a Monitor
This command adds a new monitor to your account. In this example, it's configured to monitor the URL https://w5.com
.
curl --location "https://api.pulsetic.com/api/public/monitors" --header "Authorization: YOUR_API_TOKEN" --header "Content-Type: application/json" --data '{ "urls": ["https://w5.com"], "add_account_email" : true }'
Updating a Monitor
This command updates an existing monitor with the ID 1
. It modifies the URL, check frequency, name, request details (using the POST method with form parameters and a header), and expected response criteria.
curl --location --request PUT "https://api.pulsetic.com/api/public/monitors/1" --header 'Authorization: YOUR_API_TOKEN' --header 'Content-Type: application/json' --data '{ "url": "https://facebook.com", "uptime_check_frequency": "600", "name": "Facebook Page", "request": { "type": "http", "body_type": "form_params", "body_form_params": [ { "name": "param1", "value": "param1value" }, { "name": "param2", "value": "param2value" } ], "method": "post", "headers":[ { "name": "Accept", "value": "application/json" } ] }, "response": { "body": "some text", "headers": [ {"header1": "header1value"}, {"header2": "header2value"} ], "isNegative": false }'
Deleting a Monitor
This command deletes the monitor with the ID 1
from your Pulsetic account.
curl --location --request DELETE "https://api.pulsetic.com/api/public/monitors/1" --header 'Authorization: YOUR_API_TOKEN' --header 'Content-Type: application/json'
Retrieving Monitor Checks (Historical Data)
This command retrieves historical check data for the monitor with the ID 4172
within the specified date and time range (from January 3, 2021, to September 12, 2022).
curl --location --request GET "https://api.pulsetic.com/api/public/4172/checks?end_dt=2022-09-12+16:05:03&start_dt=2021-01-03+14:00:00" --header "Authorization: YOUR_API_TOKEN"
Retrieving Monitor Downtime
This command retrieves the total downtime in seconds for the monitor with the ID 4
the last 3600 seconds (1 hour).
curl --location "https://api.pulsetic.com/api/public/monitors/4/downtime?seconds=3600" --header 'Authorization: YOUR_API_TOKEN' --header 'Content-Type: application/json'
Status Page Management
Adding a Status Page
This command creates a new status page with the specified title, domain, meta title, and various other configuration options, including associating it with monitors having IDs 1
and 2
.
curl --location --request POST 'https://api.pulsetic.com/api/public/status-page' --header 'Authorization: YOUR_API_TOKEN' --header 'Content-Type: application/json' --data '{ "title": "My Second Status Page", "domain": "mydomain.com", "meta_title": "My Title", "site_key": "", "secret_key": "", "uptime_threshold": 0.9, "remove_branding": false, "subscribe_to_updates": false, "private": false, "password": "mypass", "uptime_percentage_style": false, "show_location_tooltip": true, "monitors": [1, 2] }'
Updating a Status Page
This command updates the status page with the ID 13
, changing its title and potentially other settings like the uptime percentage style and associated monitors.
curl --location --request PUT 'https://api.pulsetic.com/api/public/status-page/13' --header 'Authorization: YOUR_API_TOKEN' --header 'Content-Type: application/json' --data '{ "title": "My Status Page Updated", "domain": "mydomain.com", "meta_title": "My Title", "site_key": "", "secret_key": "", "uptime_threshold": 0.9, "remove_branding": false, "subscribe_to_updates": false, "private": false, "password": "mypass", "uptime_percentage_style": true, "show_location_tooltip": true, "monitors": [1,2] }'
Retrieving All Status Pages
This command retrieves a list of all status pages configured in your Pulsetic account.
curl --location 'https://api.pulsetic.com/api/public/status-page' --header 'Authorization: YOUR_API_TOKEN'
Deleting a Status Page
This command deletes the status page with the ID 1
from your Pulsetic account.
curl --location --request DELETE 'https://api.pulsetic.com/api/public/status-page/1' --header 'Authorization: YOUR_API_TOKEN'
Adding Status Page Maintenance
This command adds a scheduled maintenance event to the status page with the ID 13
. It includes details like the maintenance name, description, timezone, affected monitors (ID 610
), and start and end dates and times.
curl --location 'https://api.pulsetic.com/api/public/status-page/13/maintenance' --header 'Authorization: YOUR_API_TOKEN' --header 'Content-Type: application/json' --data '{ "name":"test name", "description":"test description", "timezone":{"value":"Hawaiian Standard Time","abbr":"HST","offset":-10,"isdst":false,"title":"(UTC-10:00) Hawaii","utc":["Etc/GMT+10","Pacific/Honolulu","Pacific/Johnston","Pacific/Rarotonga","Pacific/Tahiti"]},"monitors":[610],"date":{"starting":"2025-01-01","ending":"2025-01-30"},"time":{"starting":"12:00 PM","ending":"12:00 PM"}}'
Updating Status Page Maintenance
This command updates an existing maintenance event with the ID 13
on a status page. It modifies the name and description while keeping other details.
curl --location --request PUT 'https://api.pulsetic.com/api/public/status-page/maintenance/13' --header 'Authorization: YOUR_API_TOKEN' --header 'Content-Type: application/json' --data '{"name":"test2 name","description":"test2 description","timezone":{"value":"Hawaiian Standard Time","abbr":"HST","offset":-10,"isdst":false,"title":"(UTC-10:00) Hawaii","utc":["Etc/GMT+10","Pacific/Honolulu","Pacific/Johnston","Pacific/Rarotonga","Pacific/Tahiti"]},"monitors":[610],"date":{"starting":"2025-01-01","ending":"2025-01-30"},"time":{"starting":"12:00 PM","ending":"12:00 PM"}}'
Deleting Status Page Maintenance
This command deletes the maintenance event with the ID 8
from a status page.
curl --location --request DELETE 'https://api.pulsetic.com/api/public/status-page/maintenance/8' --header 'Authorization: YOUR_API_TOKEN'
Adding Status Page Incident
This command adds a new incident to the status page with the ID 13
. It includes a title and an initial update with the status "exploring," a date, and a message.
curl --location 'https://api.pulsetic.com/api/public/status-page/13/incidents' --header 'Authorization: YOUR_API_TOKEN' --header 'Content-Type: application/json' --data '{"title": "test title","update": {"status": "exploring","date": "2025-01-14 12:00","message": "message test"}}'
Updating Status Page Incident
This command updates the incident with the ID 30
on a status page, changing its title.
curl --location --request PUT 'https://api.pulsetic.com/api/public/status-page/incidents/30' --header 'Authorization: YOUR_API_TOKEN' --header 'Content-Type: application/json' --data '{"title": "test update title"}'
Deleting Status Page Incident
This command deletes the incident with the ID 30
from a status page.
curl --location --request DELETE 'https://api.pulsetic.com/api/public/status-page/incidents/30' --header 'Authorization: YOUR_API_TOKEN'
Adding Status Page Incident Update
This command adds a new update to the incident with the ID 29
. The update includes a status, message, and date.
curl --location 'https://api.pulsetic.com/api/public/incidents/29/incident-update' --header 'Authorization: YOUR_API_TOKEN' --header 'Content-Type: application/json' --data '{"status": "status","message": "message","date": "2025-02-05 12:00:00"}'
Updating Status Page Incident Update
This command updates a specific incident update with the ID 57
. It allows modification of the status, message, and date of the update.
curl --location --request PUT 'https://api.pulsetic.com/api/public/incidents/updates/57' --header 'Authorization: YOUR_API_TOKEN' --header 'Content-Type: application/json' --data '{"id": 57,"status": "status","message": "message","date": "2025-02-05 12:00:00"}'
Deleting Status Page Incident Update
This command deletes the incident update with the ID 57
.
curl --location --request DELETE 'https://api.pulsetic.com/api/public/incidents/updates/57' --header 'Authorization: YOUR_API_TOKEN' --header 'Content-Type: application/json'
Retrieving Status Page Incidents
This command retrieves a list of incidents for the status page with the specified ID 13
.
curl --location 'https://api.pulsetic.com/api/public/status-page/13/incidents' --header 'Authorization: YOUR_API_TOKEN'
These examples provide a starting point for integrating the Pulsetic API into your applications. Remember to consult the official Pulsetic API documentation for complete details on available endpoints and parameters.
Note:
Remember to replace YOUR_API_TOKEN
and any placeholder IDs with your actual credentials and identifiers.