Developers API

Overview

UptimeGuard API is build with REST principles. It uses JSON format for request and response bodies.
Base URL: https://uptimeguard.net/api/v1
Current API version: v1

Authentication

Get your API token in User Profile (or using "/login" API function, to authorize via email/password and get user profile details with API token).
Each request should contain "Authorization" and "Content-Type" headers
Authorization: Bearer [API token here]
Content-Type: application/json

Request format

All params should be transmitted as a properties of a JSON object, for example
{
  "email":"john@example.com",
  "password":"password",
  "confirm_password": "password",
  "name": "John Doe",
  "time_zone": "Pacific Time (US & Canada)",
  "settings": {
    "nested_param": "value 1",
    "nested_param2": "value 2",
  }
}

Response format and codes

General success response format is
{
  status: 0,
  response: [... response object/array ...]
}
General error response format is
{
  status: 1,
  response: "Error description string"
}
status filed helps to detect response type from JSON contents.

API also uses following HTTP response codes to make high-level indication of error condition
400: Wrong request params
401: Auth token is not correct or user not found
404: Accessed route not found or your user does not have an access
200: Success or handled error condition, that differs from 400/404 codes
500: Internal server error, that can't be handled from client side

User / Authorization

Register

POST
/register

Authorization: none

Request params
  • email: string
  • password: string
  • confirm_password: string
  • name: string
  • time_zone: string, in format as "Pacific Time (US & Canada)", available values could be taken in Profile dropdown
Response example
{
  "status": 0,
  "response": {
    "id": 1,
    "email": "john@example.com",
    "name": "John Doe",
    "time_zone": "Pacific Time (US & Canada)",
    "api_token": "eyJ...LB_k",
    "monitors_count": 0,
    "monitors_limit": null
  }
}

Login

POST
/login

Authorization: none

Request params
  • email: string
  • password: string
Response example
{
  "status": 0,
  "response": {
    "id": 1,
    "email": "john@example.com",
    "name": "John Doe",
    "time_zone": "Pacific Time (US & Canada)",
    "api_token": "eyJ...LB_k",
    "monitors_count": 0,
    "monitors_limit": null
  }
}

Get current user profile

GET
/user

Authorization: required

Request params
none
Response example
{
  "status": 0,
  "response": {
    "id": 1,
    "email": "john@example.com",
    "name": "John Doe",
    "time_zone": "Pacific Time (US & Canada)",
    "api_token": "eyJ...LB_k",
    "monitors_count": 0,
    "monitors_limit": null
  }
}

Update current user profile

POST
/user

Authorization: required

Request params
  • email: string
  • name: string
  • time_zone: string
  • password: string, OMIT THIS IF YOU DO NOT WANT TO CHANGE PASSWORD
  • confirm_password: string, OMIT THIS IF YOU DO NOT WANT TO CHANGE PASSWORD
Response example
{
  "status": 0,
  "response": {
    "id": 1,
    "email": "john@example.com",
    "name": "I like UptimeGuard",
    "time_zone": "Pacific Time (US & Canada)",
    "api_token": "eyJ...LB_k",
    "monitors_count": 0,
    "monitors_limit": null
  }
}

Monitors

Get brief monitors list

GET
/monitors

Authorization: required

Request params
none
Response example
{
  "status": 0,
  "response": [
    {
      "id": 301,
      "host": "http://stdout.in",
      "port": 80,
      "normalized_uri": "http://stdout.in:80/",
      "friendly_name": "stdout.in",
      "time_interval": 5,
      "last_ping": "2016-08-22 16:48:00 UTC",
      "next_ping": "2016-08-22 16:53:00 UTC",
      "current_status": "up",
      "current_status_created_at": "2016-07-13T09:09:55.203Z",
      "favicon": "/uploads/favicons/301.ico",
      "emails_for_notifications": [
        "abc@example.com"
      ],
      "slack_for_notifications": "",
      "created_at": "2016-07-13T09:09:48.790Z",
      "updated_at": "2016-08-22T16:48:18.509Z",
      "has_status_page": false,
      "type": "base"
    },
    {
      "id": 331,
      "host": "http://stackoverflow.com",
      "port": 80,
      "normalized_uri": "http://stackoverflow.com:80/",
      "friendly_name": "stackoverflow.com",
      "time_interval": 5,
      "last_ping": "2016-08-22 16:48:00 UTC",
      "next_ping": "2016-08-22 16:53:00 UTC",
      "current_status": "up",
      "current_status_created_at": "2016-08-22T16:48:19.996Z",
      "favicon": "/uploads/favicons/331.ico",
      "emails_for_notifications": [
        "abc@example.com"
      ],
      "slack_for_notifications": "",
      "created_at": "2016-08-22T16:47:34.216Z",
      "updated_at": "2016-08-22T16:48:20.042Z",
      "has_status_page": true,
      "type": "advanced"
    }
  ]
}

Get base monitor

GET
/monitors/base/:id

Authorization: required

Request params
none
Response example
{
  "status": 0,
  "response": {
    "id": 111,
    "host": "http://example.com",
    "port": 80,
    "normalized_uri": "http://example.com:80/",
    "friendly_name": "Example web site",
    "time_interval": 15,
    "last_ping": "2016-08-19 15:33:00 UTC",
    "next_ping": "2016-08-19 15:43:00 UTC",
    "current_status": "up",
    "current_status_created_at": "2016-08-19T15:43:44.816Z",
    "favicon": "/images/default_ico.png",
    "emails_for_notifications": [
      "a@a.a",
      "b@b.b"
    ],
    "slack_for_notifications": null,
    "created_at": "2016-08-22T17:13:25.530Z",
    "updated_at": "2016-08-22T17:13:25.530Z",
    "has_status_page": true,
    "settings": null,
    "links": [
      {
        "rel": "self",
        "href": "http://uptimeguard.net/api/v1/monitors/base/111"
      },
      {
        "rel": "public_status_page",
        "href": "http://uptimeguard.net/status/d113422a09"
      },
      {
        "rel": "embedded_public_status_page",
        "href": "https://uptimeguard.net/status/d113422a09/embedded"
      }
    ]
  }
}

Create base monitor

POST
/monitors/base

Authorization: required

Request params
  • host: string
  • friendly_name: string
  • time_interval: integer
  • emails_for_notifications: string, example : "one@example.com another@example.com"
  • slack_for_notifications: string
  • status_page: boolean
Response example
{
  "status": 0,
  "response": {
    "id": 111,
    "host": "http://example.com",
    "port": 80,
    "normalized_uri": "http://example.com:80/",
    "friendly_name": "Example web site",
    "time_interval": 15,
    "last_ping": "2016-08-19 15:33:00 UTC",
    "next_ping": "2016-08-19 15:43:00 UTC",
    "current_status": "up",
    "current_status_created_at": "2016-08-19T15:43:44.816Z",
    "favicon": "/images/default_ico.png",
    "emails_for_notifications": [
      "a@a.a",
      "b@b.b"
    ],
    "slack_for_notifications": null,
    "created_at": "2016-08-22T17:13:25.530Z",
    "updated_at": "2016-08-22T17:13:25.530Z",
    "has_status_page": true,
    "settings": null,
    "links": [
      {
        "rel": "self",
        "href": "http://uptimeguard.net/api/v1/monitors/base/111"
      },
      {
        "rel": "public_status_page",
        "href": "http://uptimeguard.net/status/d113422a09"
      },
      {
        "rel": "embedded_public_status_page",
        "href": "https://uptimeguard.net/status/d113422a09/embedded"
      }
    ]
  }
}

Update base monitor

POST
/monitors/base/:id

Authorization: required

Request params
  • host: string
  • friendly_name: string
  • time_interval: integer
  • emails_for_notifications: string, example : "one@example.com another@example.com"
  • slack_for_notifications: string
  • status_page: boolean
Response example
{
  "status": 0,
  "response": {
    "id": 111,
    "host": "http://example.com",
    "port": 80,
    "normalized_uri": "http://example.com:80/",
    "friendly_name": "Example web site",
    "time_interval": 20,
    "last_ping": "2016-08-23 14:56:00 UTC",
    "next_ping": "2016-08-23 15:26:00 UTC",
    "current_status": "up",
    "current_status_created_at": "2016-08-23T14:56:47.341Z",
    "favicon": "/images/default_ico.png",
    "emails_for_notifications": [
      "one@example.com",
      "another@example.com"
    ],
    "slack_for_notifications": "",
    "created_at": "2016-08-17T17:01:40.021Z",
    "updated_at": "2016-08-23T15:02:44.328Z",
    "has_status_page": false,
    "settings": null,
    "links": [
      {
        "rel": "self",
        "href": "https://uptimeguard.net/api/v1/monitors/base/111"
      },
      {
        "rel": "public_status_page",
        "href": "https://uptimeguard.net/status/d113422a09"
      },
      {
        "rel": "embedded_public_status_page",
        "href": "https://uptimeguard.net/status/d113422a09/embedded"
      }
    ]
  }
}

Delete base monitor

DELETE
/monitors/base/:id

Authorization: required

Request params
none
Response example
{
  "status": 0,
  "response": null
}

Pause base monitor

POST
/monitors/base/:id/pause

Authorization: required

Request params
none
Response example
{
  "status": 0,
  "response": {
    "id": 111,
    "host": "http://example.com",
    "port": 80,
    "normalized_uri": "http://example.com:80/",
    "friendly_name": "Example web site",
    "time_interval": 15,
    "last_ping": "2016-08-19 15:33:00 UTC",
    "next_ping": null,
    "current_status": "paused",
    "current_status_created_at": "2016-08-19T15:43:44.816Z",
    "favicon": "/images/default_ico.png",
    "emails_for_notifications": [
      "a@a.a",
      "b@b.b"
    ],
    "slack_for_notifications": null,
    "created_at": "2016-08-22T17:13:25.530Z",
    "updated_at": "2016-08-22T17:13:25.530Z",
    "has_status_page": true,
    "settings": null,
    "links": [
      {
        "rel": "self",
        "href": "http://uptimeguard.net/api/v1/monitors/base/111"
      },
      {
        "rel": "public_status_page",
        "href": "http://uptimeguard.net/status/d113422a09"
      },
      {
        "rel": "embedded_public_status_page",
        "href": "https://uptimeguard.net/status/d113422a09/embedded"
      }
    ]
  }
}

Resume base monitor

POST
/monitors/base/:id/resume

Authorization: required

Request params
none
Response example
{
  "status": 0,
  "response": {
    "id": 111,
    "host": "http://example.com",
    "port": 80,
    "normalized_uri": "http://example.com:80/",
    "friendly_name": "Example web site",
    "time_interval": 15,
    "last_ping": "2016-08-19 15:33:00 UTC",
    "next_ping": "2016-08-19 15:44:00 UTC",
    "current_status": "unknown",
    "current_status_created_at": "2016-08-19T15:43:44.816Z",
    "favicon": "/images/default_ico.png",
    "emails_for_notifications": [
      "a@a.a",
      "b@b.b"
    ],
    "slack_for_notifications": null,
    "created_at": "2016-08-22T17:13:25.530Z",
    "updated_at": "2016-08-22T17:13:25.530Z",
    "has_status_page": true,
    "settings": null,
    "links": [
      {
        "rel": "self",
        "href": "http://uptimeguard.net/api/v1/monitors/base/111"
      },
      {
        "rel": "public_status_page",
        "href": "http://uptimeguard.net/status/d113422a09"
      },
      {
        "rel": "embedded_public_status_page",
        "href": "https://uptimeguard.net/status/d113422a09/embedded"
      }
    ]
  }
}

Reset statistics in base monitor

POST
/monitors/base/:id/reset_stats

Authorization: required

Request params
none
Response example
{
  "status": 0,
  "response": null
}

Get advanced monitor

GET
/monitors/advanced/:id

Authorization: required

Request params
none
Response example
{
  "status": 0,
  "response": {
    "id": 222,
    "host": "http://example.com",
    "port": 443,
    "normalized_uri": "http://example.com:443/",
    "friendly_name": "Example web site",
    "time_interval": 15,
    "last_ping": null,
    "next_ping": "2016-08-23 13:51:00 UTC",
    "current_status": "unknown",
    "current_status_created_at": "2016-08-23T13:51:44.733Z",
    "favicon": "/images/default_ico.png",
    "emails_for_notifications": [
      "a@a.a",
      "b@b.b"
    ],
    "slack_for_notifications": null,
    "created_at": "2016-08-23T15:19:24.755Z",
    "updated_at": "2016-08-23T15:19:24.755Z",
    "has_status_page": true,
    "settings": {
      "request_type": "GET",
      "support_redirects": true,
      "success_response_codes": [
        200,
        404
      ],
      "body_response": "String to find in body",
      "response_condition": true,
      "base_authentication_pass": "pass",
      "base_authentication_login": "login"
    },
    "links": [
      {
        "rel": "self",
        "href": "https://uptimeguard.net/api/v1/monitors/advanced/222"
      },
      {
        "rel": "public_status_page",
        "href": "https://uptimeguard.net/status/33a112eda1"
      },
      {
        "rel": "embedded_public_status_page",
        "href": "https://uptimeguard.net/status/33a112eda1/embedded"
      }
    ]
  }
}

Create advanced monitor

POST
/monitors/advanced

Authorization: required

Request params
  • host: string
  • friendly_name: string
  • time_interval: integer
  • port: integer
  • settings:
    • request_type: string
    • support_redirects: boolean
    • body_response: string
    • response_condition: boolean
    • success_response_codes: string, example: "200 404"
    • base_authentication_login: string
    • base_authentication_pass: string
  • emails_for_notifications: string, example : "one@example.com another@example.com"
  • slack_for_notifications: string
  • status_page: boolean
Response example
{
  "status": 0,
  "response": {
    "id": 222,
    "host": "http://example.com",
    "port": 443,
    "normalized_uri": "http://example.com:443/",
    "friendly_name": "Example web site",
    "time_interval": 15,
    "last_ping": null,
    "next_ping": "2016-08-23 13:51:00 UTC",
    "current_status": "unknown",
    "current_status_created_at": "2016-08-23T13:51:44.733Z",
    "favicon": "/images/default_ico.png",
    "emails_for_notifications": [
      "a@a.a",
      "b@b.b"
    ],
    "slack_for_notifications": null,
    "created_at": "2016-08-23T15:19:24.755Z",
    "updated_at": "2016-08-23T15:19:24.755Z",
    "has_status_page": true,
    "settings": {
      "request_type": "GET",
      "support_redirects": true,
      "success_response_codes": [
        200,
        404
      ],
      "body_response": "String to find in body",
      "response_condition": true,
      "base_authentication_pass": "pass",
      "base_authentication_login": "login"
    },
    "links": [
      {
        "rel": "self",
        "href": "https://uptimeguard.net/api/v1/monitors/advanced/222"
      },
      {
        "rel": "public_status_page",
        "href": "https://uptimeguard.net/status/33a112eda1"
      },
      {
        "rel": "embedded_public_status_page",
        "href": "https://uptimeguard.net/status/33a112eda1/embedded"
      }
    ]
  }
}

Update advanced monitor

POST
/monitors/advanced/:id

Authorization: required

Request params
  • host: string
  • friendly_name: string
  • time_interval: integer
  • port: integer
  • settings:
    • request_type: string
    • support_redirects: boolean
    • body_response: string
    • response_condition: boolean
    • success_response_codes: string, example: "200 404"
    • base_authentication_login: string
    • base_authentication_pass: string
  • emails_for_notifications: string, example : "one@example.com another@example.com"
  • slack_for_notifications: string
  • status_page: boolean
Response example
{
  "status": 0,
  "response": {
    "id": 222,
    "host": "http://example.com",
    "port": 443,
    "normalized_uri": "http://example.com:443/",
    "friendly_name": "Example web site",
    "time_interval": 40,
    "last_ping": "2016-08-23 15:23:00 UTC",
    "next_ping": "2016-08-23 15:38:00 UTC",
    "current_status": "down",
    "current_status_created_at": "2016-08-23T15:23:47.591Z",
    "favicon": "/images/default_ico.png",
    "emails_for_notifications": [
      "a@a.a",
      "b@b.b"
    ],
    "slack_for_notifications": null,
    "created_at": "2016-08-23T15:22:50.681Z",
    "updated_at": "2016-08-23T15:24:12.725Z",
    "has_status_page": true,
    "settings": {
      "request_type": "POST",
      "support_redirects": false,
      "success_response_codes": [
        200
      ],
      "body_response": "String to find in body",
      "response_condition": true,
      "base_authentication_pass": "pass",
      "base_authentication_login": "login"
    },
    "links": [
      {
        "rel": "self",
        "href": "https://uptimeguard.net/api/v1/monitors/advanced/222"
      },
      {
        "rel": "public_status_page",
        "href": "https://uptimeguard.net/status/33a112eda1"
      },
      {
        "rel": "embedded_public_status_page",
        "href": "https://uptimeguard.net/status/33a112eda1/embedded"
      }
    ]
  }
}

Delete advanced monitor

DELETE
/monitors/advanced/:id

Authorization: required

Request params
none
Response example
{
  "status": 0,
  "response": null
}

Pause advanced monitor

POST
/monitors/advanced/:id/pause

Authorization: required

Request params
none
Response example
{
  "status": 0,
  "response": {
    "id": 222,
    "host": "http://example.com",
    "port": 443,
    "normalized_uri": "http://example.com:443/",
    "friendly_name": "Example web site",
    "time_interval": 15,
    "last_ping": "2016-08-23 13:51:00 UTC",
    "next_ping": null,
    "current_status": "paused",
    "current_status_created_at": "2016-08-23T13:51:44.733Z",
    "favicon": "/images/default_ico.png",
    "emails_for_notifications": [
      "a@a.a",
      "b@b.b"
    ],
    "slack_for_notifications": null,
    "created_at": "2016-08-23T15:19:24.755Z",
    "updated_at": "2016-08-23T15:19:24.755Z",
    "has_status_page": true,
    "settings": {
      "request_type": "GET",
      "support_redirects": true,
      "success_response_codes": [
        200,
        404
      ],
      "body_response": "String to find in body",
      "response_condition": true,
      "base_authentication_pass": "pass",
      "base_authentication_login": "login"
    },
    "links": [
      {
        "rel": "self",
        "href": "https://uptimeguard.net/api/v1/monitors/advanced/222"
      },
      {
        "rel": "public_status_page",
        "href": "https://uptimeguard.net/status/33a112eda1"
      },
      {
        "rel": "embedded_public_status_page",
        "href": "https://uptimeguard.net/status/33a112eda1/embedded"
      }
    ]
  }
}

Resume advanced monitor

POST
/monitors/advanced/:id/resume

Authorization: required

Request params
none
Response example
{
  "status": 0,
  "response": {
    "id": 222,
    "host": "http://example.com",
    "port": 443,
    "normalized_uri": "http://example.com:443/",
    "friendly_name": "Example web site",
    "time_interval": 15,
    "last_ping": "2016-08-23 13:21:00 UTC",
    "next_ping": "2016-08-23 13:51:00 UTC",
    "current_status": "unknown",
    "current_status_created_at": "2016-08-23T13:51:44.733Z",
    "favicon": "/images/default_ico.png",
    "emails_for_notifications": [
      "a@a.a",
      "b@b.b"
    ],
    "slack_for_notifications": null,
    "created_at": "2016-08-23T15:19:24.755Z",
    "updated_at": "2016-08-23T15:19:24.755Z",
    "has_status_page": true,
    "settings": {
      "request_type": "GET",
      "support_redirects": true,
      "success_response_codes": [
        200,
        404
      ],
      "body_response": "String to find in body",
      "response_condition": true,
      "base_authentication_pass": "pass",
      "base_authentication_login": "login"
    },
    "links": [
      {
        "rel": "self",
        "href": "https://uptimeguard.net/api/v1/monitors/advanced/222"
      },
      {
        "rel": "public_status_page",
        "href": "https://uptimeguard.net/status/33a112eda1"
      },
      {
        "rel": "embedded_public_status_page",
        "href": "https://uptimeguard.net/status/33a112eda1/embedded"
      }
    ]
  }
}

Reset statistics in advanced monitor

POST
/monitors/advanced/:id/reset_stats

Authorization: required

Request params
none
Response example
{
  "status": 0,
  "response": null
}