Uptime Monitors: Create
This documentation entry provides a clear guide for developers on how to create a new uptime monitor using the API, including the necessary parameters and headers, and what to expect in the response.
Endpoint
POST /api/monitors
/api/monitorsCreate a new uptime monitor with the specified parameters.
Request
HTTP Request
POST https://uptimekeep.com/api/monitorsHeaders
Authorization
String
Bearer token for API authentication.
Content-Type
String
Must be set to multipart/form-data for file uploads.
Parameters
name
String
Yes
Name of the uptime monitor.
target
String
Yes
The URL or IP address to be monitored.
port
String
No
Port number for the target (if applicable).
type
String
No
Type of monitor. Allowed values: website, ping, port.
project_id
Integer
No
ID of the associated project (if applicable).
ping_servers_ids
Array
No
List of server IDs for pinging. Allowed values: 1, 2.
check_interval_seconds
Integer
No
Interval between checks. Allowed values: 60, 180, 300, 600, 1800, 3600, 21600, 43200, 86400 (in seconds).
timeout_seconds
Integer
No
Timeout for each check. Allowed values: 1, 2, 3, 5, 10, 25 (in seconds).
request_method
String
No
HTTP method used for the check. Allowed values: HEAD, GET, POST, PUT, PATCH.
request_body
String
No
Body content for the request (if applicable).
request_basic_auth_username
String
No
Username for basic authentication (if required).
request_basic_auth_password
String
No
Password for basic authentication (if required).
request_header_name
Array
No
Array of request header names (if applicable).
request_header_value
Array
No
Array of request header values corresponding to the names.
response_status_code
Integer
No
Expected status code in the response.
response_body
String
No
Expected body content in the response (if applicable).
response_header_name
String
No
Expected header name in the response.
response_header_value
String
No
Expected header value corresponding to the name.
is_ok_notifications
Array
No
Array of notification handler IDs for successful checks.
email_reports_is_enabled
Boolean
No
Enable or disable email reports.
cache_buster_is_enabled
Boolean
No
Enable or disable cache buster for the requests.
is_enabled
Boolean
No
Enable or disable the monitor.
Example of a request:
Response
A successful response returns a JSON object containing the unique identifier of the newly created uptime monitor.
Response Example
Fields
Data Object
id
Integer
Unique identifier for the new monitor.
Errors
If the request fails, the API will return an error message with an appropriate HTTP status code.
Last updated