API Documentation, version 2


POST /api/add-check

Adds a check to an account or organisation

Arguments:

Parameter:Type:Required:Description:
checkcertbooleanNoWhether to check TLS certificates for validity
classstringNoOptional notification class to assign check to (defaults to organisation/account default notification)
deletebooleanNoIf editing an existing check, set this to true to delete the check
descriptionstringYesDescription of the service check
flakybooleanNoWhether to notify of services being flaky or only report when globally down
hoststringNoThe service host name (optional if hosts are specified instead
hostsarrayNoA list of hosts to check (LDAPSYNC only)
idstringNoOptional service check ID to override with this
intervalnumberNoThe service chek scanning interval in seconds. Defaults to 600.
isenumberNoFor HTTP(S) checks, which HTTP error code minimum that denotes an error. Defaults to >=500.
orgstringNoOptional organisation slug to add check to. Defaults to personal account
pingersarrayNoOptional list of PMB nodes who will run this check. Defaults to all applicable nodes
portnumberNoThe service port (can be left out for certain check types)
prettybooleanNoTurns on pretty JSON output
privatebooleanNoWhether to make this service non-public (optional)
typestringYesService check type (HTTP, SMTP, SSH, ICMP etc)
warncertbooleanNoWhether to warn if a TLS certificate is about to expire

Returns:

Parameter:Type:Description:
createdbooleanWhether the check was created/updated
idnumberThe ID of the check created/updated
okaybooleanWhether the operation was successful.

Example output:

{
	"created": true,
	"okay": true,
	"id": 103
}


POST /api/check

Display details about a service check

Arguments:

Parameter:Type:Required:Description:
idstringYesThe check ID
prettybooleanNoTurns on pretty JSON output

Returns:

Parameter:Type:Description:
checkhashCheck metadata
okaybooleanWhether the operation was successful.

Example output:

{
	"okay": true,
	"check": {
		"host": "humbedooh.com",
		"type": "SMTP",
		"description": "Humbedooh's Mail",
		"id": "bfa04",
		"group": "default",
		"status": 0
	}
}


POST /api/checks

Display the service checks available to the user

Arguments:

Parameter:Type:Required:Description:
prettybooleanNoTurns on pretty JSON output

Returns:

Parameter:Type:Description:
checkshashA list of checks in place.
okaybooleanWhether the operation was successful.

Example output:

{
	"okay": true,
	"checks": {
		"personal": [
			{
				"host": "humbedooh.com",
				"type": "HTTP",
				"description": "My web site",
				"id": 101,
				"group": "default",
				"status": 0
			},
			{
				"host": "humbedooh.com",
				"type": "SMTP",
				"description": "Humbedooh's Mail",
				"id": 102,
				"group": "default",
				"status": -1
			}
		]
	}
}


POST /api/classes

Display or modify notification classes for an organisation

Arguments:

Parameter:Type:Required:Description:
classstringYesID of the class to edit, if editing a class
deletebooleanYesIf true and class ID provided, delete the class
orgstringYesThe organisation to view/edit
prettybooleanNoTurns on pretty JSON output

Returns:

Parameter:Type:Description:
classesarrayClasses in this organisation
okaybooleanWhether the operation was successful.

Example output:

{
	"orgname": "Foo Org",
	"okay": true,
	"classes": [
		{
			"organisation": "abde723",
			"notes": "This is where we put stuff",
			"description": "Standard",
			"hc_token": "abcdef12345",
			"phone": "1+8005555555",
			"hc_room": "myroom",
			"webhook": "https:\/\/example.org\/webhook",
			"email": "foo@bar.baz"
		}
	]
}


POST /api/errors

Display details about a service check's last 10 errors

Arguments:

Parameter:Type:Required:Description:
idstringYesThe check ID
prettybooleanNoTurns on pretty JSON output

Returns:

Parameter:Type:Description:
errorsarrayError log
okaybooleanWhether the operation was successful.

Example output:

{
	"okay": true,
	"errors": [
		{
			"host": "91488",
			"pinger": 26,
			"time": 1487815699.1637,
			"time_taken": 0.013256072998047,
			"errorcode": "Internal Server Error or equivalent bad message received: HTTP\/1.1 302 Found\r",
			"component": "response",
			"debug": "        [Thu Feb 23 02:08:19 2017]: Initialising socket\n        [Thu Feb 23 02:08:19 2017]: Looking up hostname www.google.com...\n        [Thu Feb 23 02:08:19 2017]: Connecting to 216.58.204.132:443\n        [Thu Feb 23 02:08:19 2017]: Connected, sending HTTPS payload.\n        [Thu Feb 23 02:08:19 2017]: Analyzing server certificate\n        [Thu Feb 23 02:08:19 2017]: Saving certificate data\n        [Thu Feb 23 02:08:19 2017]: Reading response header from server\n        [Thu Feb 23 02:08:19 2017]: Caught exception: Internal Server Error or equivalent bad message received: HTTP\/1.1 302 Found\n        \n        "
		},
		{
			"host": "91488",
			"pinger": 25,
			"time": 1487815678.7073,
			"time_taken": 0.045815944671631,
			"errorcode": "Internal Server Error or equivalent bad message received: HTTP\/1.1 302 Found\r",
			"component": "response",
			"debug": "        [Thu Feb 23 02:07:58 2017]: Initialising socket\n        [Thu Feb 23 02:07:58 2017]: Looking up hostname www.google.com...\n        [Thu Feb 23 02:07:58 2017]: Connecting to 172.217.22.164:443\n        [Thu Feb 23 02:07:58 2017]: Connected, sending HTTPS payload.\n        [Thu Feb 23 02:07:58 2017]: Analyzing server certificate\n        [Thu Feb 23 02:07:58 2017]: Saving certificate data\n        [Thu Feb 23 02:07:58 2017]: Reading response header from server\n        [Thu Feb 23 02:07:58 2017]: Caught exception: Internal Server Error or equivalent bad message received: HTTP\/1.1 302 Found\n        \n        "
		}
	]
}


POST /api/login

Logs on users or displays basic user information if logged on.

Arguments:

Parameter:Type:Required:Description:
passstringNopassword
prettybooleanNoTurns on pretty JSON output
ptokenstringNo2fa token (if applicable)
userstringNousername (email)

Returns:

Parameter:Type:Description:
checksnumberThe number of current checks
fullnamestringThe full name of the user
levelstringThe account subscription type
loginstringThe login ID of the user (email)
messagesnumberThe number of unread messages
okaybooleanWhether the operation was successful.

Example output:

{
	"login": "foo@bar.com",
	"checks": 37,
	"messages": 0,
	"level": "executive",
	"okay": true,
	"fullname": "John Doe"
}


POST /api/members

Display or modify memberships for an organisation

Arguments:

Parameter:Type:Required:Description:
orgstringYesThe organisation to view/edit
prettybooleanNoTurns on pretty JSON output

Returns:

Parameter:Type:Description:
adminsarrayAdmins of this organisation (if user is admin)
membersarrayMembers of this organisation
okaybooleanWhether the operation was successful.

Example output:

{
	"admins": [
		"humbedooh@apache.org"
	],
	"okay": true,
	"members": [
		"humbedooh@apache.org"
	]
}


POST /api/orgs

Display details about all your organisations

Arguments:

Parameter:Type:Required:Description:
prettybooleanNoTurns on pretty JSON output

Returns:

Parameter:Type:Description:
okaybooleanWhether the operation was successful.
orgsarrayList of organisations and their details

Example output:

{
	"okay": true,
	"errors": [
		{
			"host": "91488",
			"pinger": 26,
			"time": 1487815699.1637,
			"time_taken": 0.013256072998047,
			"errorcode": "Internal Server Error or equivalent bad message received: HTTP\/1.1 302 Found\r",
			"component": "response",
			"debug": "        [Thu Feb 23 02:08:19 2017]: Initialising socket\n        [Thu Feb 23 02:08:19 2017]: Looking up hostname www.google.com...\n        [Thu Feb 23 02:08:19 2017]: Connecting to 216.58.204.132:443\n        [Thu Feb 23 02:08:19 2017]: Connected, sending HTTPS payload.\n        [Thu Feb 23 02:08:19 2017]: Analyzing server certificate\n        [Thu Feb 23 02:08:19 2017]: Saving certificate data\n        [Thu Feb 23 02:08:19 2017]: Reading response header from server\n        [Thu Feb 23 02:08:19 2017]: Caught exception: Internal Server Error or equivalent bad message received: HTTP\/1.1 302 Found\n        \n        "
		},
		{
			"host": "91488",
			"pinger": 25,
			"time": 1487815678.7073,
			"time_taken": 0.045815944671631,
			"errorcode": "Internal Server Error or equivalent bad message received: HTTP\/1.1 302 Found\r",
			"component": "response",
			"debug": "        [Thu Feb 23 02:07:58 2017]: Initialising socket\n        [Thu Feb 23 02:07:58 2017]: Looking up hostname www.google.com...\n        [Thu Feb 23 02:07:58 2017]: Connecting to 172.217.22.164:443\n        [Thu Feb 23 02:07:58 2017]: Connected, sending HTTPS payload.\n        [Thu Feb 23 02:07:58 2017]: Analyzing server certificate\n        [Thu Feb 23 02:07:58 2017]: Saving certificate data\n        [Thu Feb 23 02:07:58 2017]: Reading response header from server\n        [Thu Feb 23 02:07:58 2017]: Caught exception: Internal Server Error or equivalent bad message received: HTTP\/1.1 302 Found\n        \n        "
		}
	]
}


POST /api/pause

Pauses or unpauses a service check

Arguments:

Parameter:Type:Required:Description:
idstringYesThe check ID
pausebooleanYesWhether the check should be paused or not
prettybooleanNoTurns on pretty JSON output

Returns:

Parameter:Type:Description:
okaybooleanWhether the operation was successful.

Example output:

{
	"okay": true
}


POST /api/pings

Display check results for a given service

Arguments:

Parameter:Type:Required:Description:
idstringYesThe check ID
pingernumberYesThe pinger to fetch data from
prettybooleanNoTurns on pretty JSON output

Returns:

Parameter:Type:Description:
okaybooleanWhether the operation was successful.
pingsarrayPings in reverse chronological order (latest first).

Example output:

{
	"okay": true
}