Introduction
Welcome to the Monitive API! You can use our API to access Monitive API endpoint, which can perform pretty much any operation that you would generally log into your Monitive account to perform.
We have language bindings in Shell, possibly some Ruby, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
API Basics
JSON API Standard
All requests and responses are JSON:API compliant. If this standard is not familiar to you, please take a moment to go over it at jsonapi.org.
Endpoint
All API requests are relative to the production API endpoint:
https://api1.monitive.com
For the sandbox/testing environment, the endpoint is https://sandbox-api.monitive.com
.
Authorization
Most requests require prior authentication. For authorisation purposes, we use standard OAuth 2.0.
You can send requests on behalf of your user by generating a Personal Token.
As this feature isn't automated, please contact us and we'll send you your own Personal Token to use for managing your account.
For requests requiring authorization, send your Personal Token via HTTP header:
Authorization: Bearer eyJaccessKey
Where eyJaccessKey
is your Personal Access Token.
Pagination
Sample paginated response
{
"meta": {
"currentPage": 4,
"count": 10,
"perPage": 10,
"hasMorePages": true
},
"links": {
"first": "http:\/\/monitive-api.test\/teams\/26075\/monitors?page%5Bnumber%5D=1",
"prev": "http:\/\/monitive-api.test\/teams\/26075\/monitors?page%5Bnumber%5D=3",
"next": "http:\/\/monitive-api.test\/teams\/26075\/monitors?page%5Bnumber%5D=5"
},
"data": [
. . . . . .
]
}
All requests that return a collection of primary objects generated by the system (such as Monitors, Incidents etc.) return paginated results. The response contains top-level links
and meta
attributes.
As we're keeping an eye on performance, pagination doesn't include total pages, last page and total count.
To request a specific page, add the page[number]
query parameter, such as:
http://monitive-api.test/teams/26075/incidents?page[number]=1
Requests that return static resources such as Locations, Channels which don't grow over time don't return paginated results.
Please note that the page[number]
attribute in the first
, prev
, next
attributes of the API's responses is URL-encoded.
Users
Get User
Sample request
## GET /users/me
curl "http://monitive-api.test/users/me?include=teams,teams.channels" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****'
Sample response
{
"data": {
"type": "users",
"id": "31291",
"attributes": {
"firstName": "Lucian",
"lastName": "",
"email": "[email protected]",
"phone": "+40740828822",
"timeZone": "UTC",
"silentStart": "22:00",
"silentEnd": "08:00",
"lang": "es",
"country": "RO",
"invitation": "WIN"
},
"relationships": {
"teams": {
"data": [
{
"type": "teams",
"id": "26075"
}
],
"links": {
"related": "https:\/\/1c27064d.ngrok.io\/users\/31291\/teams"
}
}
},
"links": {
"self": "https:\/\/1c27064d.ngrok.io\/users\/31291"
}
},
"included": [
{
"type": "channels",
"id": "10",
"attributes": {
"slug": "email",
"name": "Email",
"description": "Email Alerts",
"enabled": true
}
},
{
"type": "channels",
"id": "11",
"attributes": {
"slug": "sms",
"name": "SMS Text",
"description": "SMS Text Alerts",
"enabled": true
}
},
{
"type": "channels",
"id": "12",
"attributes": {
"slug": "phone-call",
"name": "Phone Call",
"description": "Phone Call Alerts",
"enabled": true
}
},
{
"type": "teams",
"id": "26075",
"attributes": {
"name": "Lucian"
},
"relationships": {
"channels": {
"data": [
{
"type": "channels",
"id": "10"
},
{
"type": "channels",
"id": "11"
},
{
"type": "channels",
"id": "12"
}
],
"meta": {
"count": 3
}
},
"users": {
"data": [
{
"type": "users",
"id": "31291",
"meta": {
"role": "owner"
}
}
]
}
}
}
]
}
Retrieves information about a User identified by {id}
. The {id}
parameter can optionally be me
, in order to retrieve information about the currently authenticated user. This is useful after the initial authentication, when we don't know yet the user that just logged in.
HTTP Request
GET /users/{id}
URL Parameters
Parameter | Default | Description |
---|---|---|
id |
— | (required, int) The User ID that we want to get the User information for. This parameter can also be the string me to retrieve information for the currently authenticated user. |
Query Parameters
Parameter | Default | Description |
---|---|---|
include |
— | (optional, comma-separated strings) List of related resources to include |
Includable resources:
teams
- include team information. This is specifically useful to get the user'srole
in the team and the team's name.teams.channels
- include the available channels for each team. This is useful to be able to display available alerting rule channels.
JSON Payload
none, this is a GET
request
Authorization
- A user can only retrieve information about himself. Sending this request for any other user will result in
HTTP 403 Forbidden
.
Update User
Sample request
## PATCH User
curl -X "PATCH" "https://monitive-api.test/users/18940" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"data": {
"type": "users",
"attributes": {
"firstName": "Pavel",
"lastName": "Chekov"
}
}
}'
Sample response
{
"data": {
"type": "users",
"id": "18940",
"attributes": {
"firstName": "Pavel",
"lastName": "Chekov",
"email": "[email protected]",
"phone": "+5964215301556",
"timeZone": "UTC",
"silentStart": "22:00",
"silentEnd": "08:00",
"lang": "es",
"country": "RO",
"invitation": "WIN"
},
"relationships": {
"teams": {
"data": [
{
"type": "teams",
"id": "18056"
}
],
"links": {
"related": "http:\/\/localhost\/users\/18940\/teams"
}
}
},
"links": {
"self": "http:\/\/localhost\/users\/18940"
}
}
}
Update a User's attributes.
HTTP Request
PATCH /users/{id}
URL Parameters
Parameter | Default | Description |
---|---|---|
id | — | (required, int) The User ID that we want to update. |
Query Parameters
Parameter | Default | Description |
---|---|---|
- | - | - |
JSON Payload
data
type
must beusers
attributes
firstName
- (string) Users's first namelastName
- (string) User's last nameemail
- (string) User's emailphone
- (string) User's phonetimeZone
- (string) User's time zonesilentStart
- (string, HH:MM format) Silent hours startsilentEnd
- (string, HH:MM format) Silent hours endcountry
(string, 2 chars) Country codelang
(string, 2 chars) Language (locale)
Validation
silentStart
andsilentEnd
must either both be present, ornull
timeZone
must be a valid timeZone, according to PHP's List of Supported Timezonesemail
andphone
must not already be taken (by a different User)
Authorization
- A user can update information for himself. Sending this request for any other user will result in
HTTP 403 Forbidden
.
Get User's Teams
Sample request
## GET /users/me/teams
curl "https://monitive-lumen.test/users/3590/teams" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****'
Sample response
{
"data": [
{
"type": "teams",
"id": "3426",
"attributes": {
"name": "Samy"
},
"relationships": {
"users": {
"data": [
{
"type": "users",
"id": "3590",
"meta": {
"role": "owner"
}
}
]
}
},
"links": {
"self": "https:\/\/monitive-lumen.test\/teams\/3426"
}
}
]
}
Retrieves the list of Teams that a User is a part of, including the role in each team.
HTTP Request
GET /users/{id}/teams
URL Parameters
Parameter | Default | Description |
---|---|---|
id | — | (required, int) The User ID that we want to get the information for. |
Query Parameters
Parameter | Default | Description |
---|---|---|
- | - | - |
Authorization
- A user can only retrieve teams information about himself. Sending this request for any other user will result in
HTTP 403 Forbidden
.
Delete User
Sample request
## PATCH User
curl -X "DELETE" "https://monitive-api.test/users/me?include=teams" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"data": {
"type": "users",
"attributes": {
"password": "abcd1234"
}
}
}'
Sample response
422 Unprocessable Entity (wrong password)
202 Accepted (user deleted)
Delete the account.
HTTP Request
DELETE /users/me
URL Parameters
Parameter | Default | Description |
---|---|---|
- | - |
Query Parameters
Parameter | Default | Description |
---|---|---|
include | - | (optional) include all the teams the user to be deleted is owner of |
JSON Payload
data
type
must beusers
attributes
password
- (string) user's password
Validation
password
must be filled and valid
Authorization
- A user can delete his account and/or the teams he owns.
Teams
GET Team
Sample request
## GET Team
curl "http://monitive-api.test/teams/26075?include=users,channels,locations" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****'
Sample response
{
"data": {
"type": "teams",
"id": "26075",
"attributes": {
"name": "Lucian"
},
"relationships": {
"channels": {
"data": [
{
"type": "channels",
"id": "10"
},
{
"type": "channels",
"id": "11"
},
{
"type": "channels",
"id": "12"
}
],
"meta": {
"count": 3
}
},
"locations": {
"data": [
{
"type": "locations",
"id": "local-one"
},
{
"type": "locations",
"id": "local-three"
},
{
"type": "locations",
"id": "local-two"
}
],
"meta": {
"count": 3
}
},
"users": {
"data": [
{
"type": "users",
"id": "31291",
"meta": {
"role": "owner"
}
}
]
}
},
"links": {
"self": "https:\/\/monitive-api.test\/teams\/26075"
},
"meta": {
"created": "2018-08-20T13:28:43+00:00",
"updated": "2018-08-20T13:28:43+00:00",
"availableFeatures": ["keyword-monitoring"],
"monitorCounters": {
"up": 2,
"down": 0,
"paused": 1,
"pending": 0
}
}
},
"included": [
{
"type": "channels",
"id": "10",
"attributes": {
"slug": "email",
"name": "Email",
"description": "Email Alerts",
"enabled": true
}
},
{
"type": "channels",
"id": "11",
"attributes": {
"slug": "sms",
"name": "SMS Text",
"description": "SMS Text Alerts",
"enabled": true
}
},
{
"type": "channels",
"id": "12",
"attributes": {
"slug": "phone-call",
"name": "Phone Call",
"description": "Phone Call Alerts",
"enabled": true
}
},
{
"type": "locations",
"id": "local-one",
"attributes": {
"name": "Local One",
"countryCode": "CA",
"zone": "America",
"ip": "167.114.182.186"
},
"meta": {
"status": 1,
"seen": "2018-08-28T05:26:53+00:00",
"created": "2018-01-09T06:47:54+00:00",
"updated": "2018-08-28T05:26:53+00:00"
}
},
{
"type": "locations",
"id": "local-three",
"attributes": {
"name": "Local Three",
"countryCode": "JP",
"zone": "Pacific",
"ip": "180.149.230.12"
},
"meta": {
"status": 1,
"seen": "2018-08-28T05:26:53+00:00",
"created": "2018-01-10T12:04:33+00:00",
"updated": "2018-08-28T05:26:53+00:00"
}
},
{
"type": "locations",
"id": "local-two",
"attributes": {
"name": "Local Two",
"countryCode": "US",
"zone": "America",
"ip": "104.223.87.217"
},
"meta": {
"status": 1,
"seen": "2018-08-28T05:26:53+00:00",
"created": "2018-01-07T10:37:48+00:00",
"updated": "2018-08-28T05:26:53+00:00"
}
},
{
"type": "users",
"id": "31291",
"attributes": {
"firstName": "Lucian\ud83d\ude3c",
"lastName": "Daniliuc",
"email": "[email protected]",
"phone": "+40740822882",
"timeZone": "Europe\/Ljubljana",
"silentStart": "21:00",
"silentEnd": "09:00",
"lang": "es",
"country": "RO"
},
"relationships": {
"teams": {
"data": [
{
"type": "teams",
"id": "26075"
}
],
"links": {
"related": "https:\/\/monitive-api.test\/users\/31291\/teams"
}
}
}
}
]
}
Retrieves information about a specific team. This includes:
- Available features & integrations for this team (
meta.availableFeatures
)
Additional information that is optionally provided:
- Channels that are enabled for this team.
- Users that are a part of the team.
- Locations that are available to the team.
HTTP Request
GET /teams/{id}
URL Parameters
Parameter | Default | Description |
---|---|---|
id |
— | (required, int) The Team ID that we want to get |
Query Parameters (optional)
Parameter | Default | Description |
---|---|---|
include |
— | (optional, comma-separated strings) list of related resources to include |
Includable resources:
channels
- include team channels information. This is specifically useful to get the available alerting rule channels.users
- include the users on this team, including each user's role.locations
- include the locations available to the team.
JSON Payload
none, this is a GET
request
Authorization
- A user can only retrieve information about teams that he's a part of. Sending this request for any other team will result in
HTTP 403 Forbidden
. - Requesting information about a non-existing team will return
HTTP 404 Not Found
.
Get Team's Monitors
Sample request
## GET Team Monitors
curl "http://monitive-api.test/teams/1/monitors?include=checks,incidents,latency-hourly,latency-daily,availability-hourly,availability-daily&page[number]=1&filter[state]=0" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****'
Sample response
{
"meta": {
"currentPage": 1,
"count": 10,
"perPage": 10,
"hasMorePages": true
},
"links": {
"first": "http:\/\/monitive-api.test\/teams\/1\/monitors?page%5Bnumber%5D=1",
"next": "http:\/\/monitive-api.test\/teams\/1\/monitors?page%5Bnumber%5D=2"
},
"data": [
{
"type": "monitors",
"id": "729",
"attributes": {
"name": "Trello.com",
"settings": {
"url": "https:\/\/trello.com\/",
"keywordBody": ""
}
},
"relationships": {
"incidents": {
"data": [],
"meta": {
"total": 0
}
},
"checks": {
"data": []
},
"latency-hourly": {
"data": {
"type": "latency-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-hourly"
}
},
"latency-daily": {
"data": {
"type": "latency-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-daily"
}
},
"availability-hourly": {
"data": {
"type": "availability-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-hourly"
}
},
"availability-daily": {
"data": {
"type": "availability-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-daily"
}
},
"alert-rules": {
"data": [],
"meta": {
"count": 0
}
}
},
"links": {
"self": "https:\/\/monitive-api.test\/monitors\/729"
},
"meta": {
"status": 1,
"state": 10,
"created": "2019-05-29T16:09:59+00:00",
"updated": "2019-06-19T13:20:10+00:00"
}
},
{
"type": "monitors",
"id": "728",
"attributes": {
"name": "9gag Always",
"settings": {
"url": "https:\/\/9gag.com\/gag\/ayBDPNY",
"keywordBody": ""
}
},
"relationships": {
"incidents": {
"data": [],
"meta": {
"total": 0
}
},
"checks": {
"data": []
},
"latency-hourly": {
"data": {
"type": "latency-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-hourly"
}
},
"latency-daily": {
"data": {
"type": "latency-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-daily"
}
},
"availability-hourly": {
"data": {
"type": "availability-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-hourly"
}
},
"availability-daily": {
"data": {
"type": "availability-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-daily"
}
},
"alert-rules": {
"data": [],
"meta": {
"count": 0
}
}
},
"links": {
"self": "https:\/\/monitive-api.test\/monitors\/728"
},
"meta": {
"status": 1,
"state": 10,
"created": "2019-05-29T16:09:30+00:00",
"updated": "2019-06-19T13:20:10+00:00"
}
},
{
"type": "monitors",
"id": "727",
"attributes": {
"name": "MailTrap.io",
"settings": {
"url": "https:\/\/mailtrap.io",
"keywordBody": ""
}
},
"relationships": {
"incidents": {
"data": [],
"meta": {
"total": 0
}
},
"checks": {
"data": []
},
"latency-hourly": {
"data": {
"type": "latency-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-hourly"
}
},
"latency-daily": {
"data": {
"type": "latency-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-daily"
}
},
"availability-hourly": {
"data": {
"type": "availability-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-hourly"
}
},
"availability-daily": {
"data": {
"type": "availability-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-daily"
}
},
"alert-rules": {
"data": [],
"meta": {
"count": 0
}
}
},
"links": {
"self": "https:\/\/monitive-api.test\/monitors\/727"
},
"meta": {
"status": 1,
"state": 10,
"created": "2019-05-29T16:08:54+00:00",
"updated": "2019-06-19T13:20:24+00:00"
}
},
{
"type": "monitors",
"id": "726",
"attributes": {
"name": "Adam on Twitter",
"settings": {
"url": "https:\/\/twitter.com\/adamwathan\/status\/1013779187688038400\/photo\/1",
"keywordBody": ""
}
},
"relationships": {
"incidents": {
"data": [],
"meta": {
"total": 0
}
},
"checks": {
"data": []
},
"latency-hourly": {
"data": {
"type": "latency-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-hourly"
}
},
"latency-daily": {
"data": {
"type": "latency-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-daily"
}
},
"availability-hourly": {
"data": {
"type": "availability-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-hourly"
}
},
"availability-daily": {
"data": {
"type": "availability-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-daily"
}
},
"alert-rules": {
"data": [],
"meta": {
"count": 0
}
}
},
"links": {
"self": "https:\/\/monitive-api.test\/monitors\/726"
},
"meta": {
"status": 1,
"state": 10,
"created": "2019-05-29T16:07:13+00:00",
"updated": "2019-06-19T13:20:37+00:00"
}
},
{
"type": "monitors",
"id": "725",
"attributes": {
"name": "VueToolbox",
"settings": {
"url": "https:\/\/www.vuetoolbox.com\/",
"keywordBody": ""
}
},
"relationships": {
"incidents": {
"data": [],
"meta": {
"total": 0
}
},
"checks": {
"data": []
},
"latency-hourly": {
"data": {
"type": "latency-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-hourly"
}
},
"latency-daily": {
"data": {
"type": "latency-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-daily"
}
},
"availability-hourly": {
"data": {
"type": "availability-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-hourly"
}
},
"availability-daily": {
"data": {
"type": "availability-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-daily"
}
},
"alert-rules": {
"data": [],
"meta": {
"count": 0
}
}
},
"links": {
"self": "https:\/\/monitive-api.test\/monitors\/725"
},
"meta": {
"status": 1,
"state": 10,
"created": "2019-05-29T16:06:46+00:00",
"updated": "2019-06-19T13:20:31+00:00"
}
},
{
"type": "monitors",
"id": "724",
"attributes": {
"name": "Flex Cheatsheet",
"settings": {
"url": "https:\/\/yoksel.github.io\/flex-cheatsheet\/#display",
"keywordBody": ""
}
},
"relationships": {
"incidents": {
"data": [],
"meta": {
"total": 0
}
},
"checks": {
"data": []
},
"latency-hourly": {
"data": {
"type": "latency-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-hourly"
}
},
"latency-daily": {
"data": {
"type": "latency-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-daily"
}
},
"availability-hourly": {
"data": {
"type": "availability-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-hourly"
}
},
"availability-daily": {
"data": {
"type": "availability-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-daily"
}
},
"alert-rules": {
"data": [],
"meta": {
"count": 0
}
}
},
"links": {
"self": "https:\/\/monitive-api.test\/monitors\/724"
},
"meta": {
"status": 1,
"state": 10,
"created": "2019-05-29T16:06:08+00:00",
"updated": "2019-06-19T13:20:24+00:00"
}
},
{
"type": "monitors",
"id": "723",
"attributes": {
"name": "The Developer",
"settings": {
"url": "https:\/\/github.com\/TheDeveloper?page=3&tab=stars",
"keywordBody": ""
}
},
"relationships": {
"incidents": {
"data": [],
"meta": {
"total": 0
}
},
"checks": {
"data": []
},
"latency-hourly": {
"data": {
"type": "latency-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-hourly"
}
},
"latency-daily": {
"data": {
"type": "latency-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-daily"
}
},
"availability-hourly": {
"data": {
"type": "availability-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-hourly"
}
},
"availability-daily": {
"data": {
"type": "availability-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-daily"
}
},
"alert-rules": {
"data": [],
"meta": {
"count": 0
}
}
},
"links": {
"self": "https:\/\/monitive-api.test\/monitors\/723"
},
"meta": {
"status": 1,
"state": 10,
"created": "2019-05-29T16:05:45+00:00",
"updated": "2019-06-19T13:20:31+00:00"
}
},
{
"type": "monitors",
"id": "722",
"attributes": {
"name": "Some.com",
"settings": {
"url": "http:\/\/some.com",
"keywordBody": ""
}
},
"relationships": {
"incidents": {
"data": [],
"meta": {
"total": 0
}
},
"checks": {
"data": []
},
"latency-hourly": {
"data": {
"type": "latency-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-hourly"
}
},
"latency-daily": {
"data": {
"type": "latency-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-daily"
}
},
"availability-hourly": {
"data": {
"type": "availability-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-hourly"
}
},
"availability-daily": {
"data": {
"type": "availability-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-daily"
}
},
"alert-rules": {
"data": [],
"meta": {
"count": 0
}
}
},
"links": {
"self": "https:\/\/monitive-api.test\/monitors\/722"
},
"meta": {
"status": 1,
"state": 10,
"created": "2019-05-29T16:03:41+00:00",
"updated": "2019-06-19T13:20:37+00:00"
}
},
{
"type": "monitors",
"id": "720",
"attributes": {
"name": "HotNews.ro",
"settings": {
"url": "http:\/\/hotnews.ro"
}
},
"relationships": {
"incidents": {
"data": [],
"meta": {
"total": 0
}
},
"checks": {
"data": []
},
"latency-hourly": {
"data": {
"type": "latency-hourly",
"id": "2019-09-16T07:01:47+00:00-2019-09-17T07:01:47+00:00-latency-hourly"
}
},
"latency-daily": {
"data": {
"type": "latency-daily",
"id": "2019-08-18T07:01:47+00:00-2019-09-17T07:01:47+00:00-latency-daily"
}
},
"availability-hourly": {
"data": {
"type": "availability-hourly",
"id": "2019-09-16T07:01:47+00:00-2019-09-17T07:01:47+00:00-availability-hourly"
}
},
"availability-daily": {
"data": {
"type": "availability-daily",
"id": "2019-08-18T07:01:47+00:00-2019-09-17T07:01:47+00:00-availability-daily"
}
},
"alert-rules": {
"data": [
{
"type": "alert-rules",
"id": "414"
},
{
"type": "alert-rules",
"id": "415"
},
{
"type": "alert-rules",
"id": "416"
},
{
"type": "alert-rules",
"id": "417"
},
{
"type": "alert-rules",
"id": "418"
}
],
"meta": {
"count": 5
}
}
},
"links": {
"self": "https:\/\/monitive-api.test\/monitors\/720"
},
"meta": {
"status": 1,
"state": 10,
"created": "2019-05-27T16:02:06+00:00",
"updated": "2019-06-19T13:20:51+00:00"
}
},
{
"type": "monitors",
"id": "31",
"attributes": {
"name": "2Parale RO",
"settings": {
"url": "http:\/\/www.2parale.ro"
}
},
"relationships": {
"incidents": {
"data": [
{
"type": "incidents",
"id": "1045"
},
{
"type": "incidents",
"id": "1044"
},
{
"type": "incidents",
"id": "1043"
},
{
"type": "incidents",
"id": "1042"
},
{
"type": "incidents",
"id": "1041"
},
{
"type": "incidents",
"id": "1040"
},
{
"type": "incidents",
"id": "1039"
},
{
"type": "incidents",
"id": "1038"
},
{
"type": "incidents",
"id": "1037"
},
{
"type": "incidents",
"id": "1036"
}
],
"meta": {
"total": 20
}
},
"checks": {
"data": []
},
"latency-hourly": {
"data": {
"type": "latency-hourly",
"id": "2019-09-16T07:01:47+00:00-2019-09-17T07:01:47+00:00-latency-hourly"
}
},
"latency-daily": {
"data": {
"type": "latency-daily",
"id": "2019-08-18T07:01:47+00:00-2019-09-17T07:01:47+00:00-latency-daily"
}
},
"availability-hourly": {
"data": {
"type": "availability-hourly",
"id": "2019-09-16T07:01:47+00:00-2019-09-17T07:01:47+00:00-availability-hourly"
}
},
"availability-daily": {
"data": {
"type": "availability-daily",
"id": "2019-08-18T07:01:47+00:00-2019-09-17T07:01:47+00:00-availability-daily"
}
},
"alert-rules": {
"data": [
{
"type": "alert-rules",
"id": "419"
},
{
"type": "alert-rules",
"id": "420"
},
{
"type": "alert-rules",
"id": "421"
},
{
"type": "alert-rules",
"id": "422"
},
{
"type": "alert-rules",
"id": "423"
}
],
"meta": {
"count": 5
}
}
},
"links": {
"self": "https:\/\/monitive-api.test\/monitors\/31"
},
"meta": {
"status": 1,
"state": -10,
"created": "2019-03-18T16:01:53+00:00",
"updated": "2019-06-19T13:20:17+00:00"
}
}
],
"included": [
{
"type": "latency-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-hourly",
"attributes": {
"points": []
},
"meta": {
"timeFrom": "2019-09-16T07:01:46+00:00",
"timeTo": "2019-09-17T07:01:46+00:00",
"averages": []
}
},
{
"type": "latency-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-latency-daily",
"attributes": {
"points": []
},
"meta": {
"timeFrom": "2019-08-18T07:01:46+00:00",
"timeTo": "2019-09-17T07:01:46+00:00",
"averages": []
}
},
{
"type": "availability-hourly",
"id": "2019-09-16T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-hourly",
"attributes": {
"points": []
},
"meta": {
"timeFrom": "2019-09-16T07:01:46+00:00",
"timeTo": "2019-09-17T07:01:46+00:00",
"totals": {
"availability": 100,
"timeframeSeconds": 86400
}
}
},
{
"type": "availability-daily",
"id": "2019-08-18T07:01:46+00:00-2019-09-17T07:01:46+00:00-availability-daily",
"attributes": {
"points": []
},
"meta": {
"timeFrom": "2019-08-18T07:01:46+00:00",
"timeTo": "2019-09-17T07:01:46+00:00",
"totals": {
"availability": 100,
"timeframeSeconds": 2592000
}
}
},
{
"type": "latency-hourly",
"id": "2019-09-16T07:01:47+00:00-2019-09-17T07:01:47+00:00-latency-hourly",
"attributes": {
"points": []
},
"meta": {
"timeFrom": "2019-09-16T07:01:47+00:00",
"timeTo": "2019-09-17T07:01:47+00:00",
"averages": []
}
},
{
"type": "latency-daily",
"id": "2019-08-18T07:01:47+00:00-2019-09-17T07:01:47+00:00-latency-daily",
"attributes": {
"points": []
},
"meta": {
"timeFrom": "2019-08-18T07:01:47+00:00",
"timeTo": "2019-09-17T07:01:47+00:00",
"averages": []
}
},
{
"type": "availability-hourly",
"id": "2019-09-16T07:01:47+00:00-2019-09-17T07:01:47+00:00-availability-hourly",
"attributes": {
"points": []
},
"meta": {
"timeFrom": "2019-09-16T07:01:47+00:00",
"timeTo": "2019-09-17T07:01:47+00:00",
"totals": {
"availability": 100,
"timeframeSeconds": 86400
}
}
},
{
"type": "availability-daily",
"id": "2019-08-18T07:01:47+00:00-2019-09-17T07:01:47+00:00-availability-daily",
"attributes": {
"points": []
},
"meta": {
"timeFrom": "2019-08-18T07:01:47+00:00",
"timeTo": "2019-09-17T07:01:47+00:00",
"totals": {
"availability": 100,
"timeframeSeconds": 2592000
}
}
},
{
"type": "incidents",
"id": "1045",
"attributes": {
"started": "2019-06-19T13:13:48+00:00",
"ended": null,
"acknowledged": null,
"downtime": null,
"reason": null
}
},
{
"type": "incidents",
"id": "1044",
"attributes": {
"started": "2019-06-19T13:11:42+00:00",
"ended": "2019-06-19T13:13:48+00:00",
"acknowledged": null,
"downtime": 126,
"reason": null
}
},
{
"type": "incidents",
"id": "1043",
"attributes": {
"started": "2019-06-19T13:10:41+00:00",
"ended": "2019-06-19T13:11:42+00:00",
"acknowledged": null,
"downtime": 61,
"reason": null
}
},
{
"type": "incidents",
"id": "1042",
"attributes": {
"started": "2019-06-19T13:06:32+00:00",
"ended": "2019-06-19T13:10:41+00:00",
"acknowledged": null,
"downtime": 249,
"reason": null
}
},
{
"type": "incidents",
"id": "1041",
"attributes": {
"started": "2019-06-19T13:04:16+00:00",
"ended": "2019-06-19T13:06:32+00:00",
"acknowledged": null,
"downtime": 136,
"reason": null
}
},
{
"type": "incidents",
"id": "1040",
"attributes": {
"started": "2019-06-19T13:03:42+00:00",
"ended": "2019-06-19T13:04:16+00:00",
"acknowledged": null,
"downtime": 34,
"reason": null
}
},
{
"type": "incidents",
"id": "1039",
"attributes": {
"started": "2019-06-19T13:02:47+00:00",
"ended": "2019-06-19T13:03:42+00:00",
"acknowledged": null,
"downtime": 55,
"reason": null
}
},
{
"type": "incidents",
"id": "1038",
"attributes": {
"started": "2019-06-19T12:59:38+00:00",
"ended": "2019-06-19T13:02:47+00:00",
"acknowledged": null,
"downtime": 189,
"reason": null
}
},
{
"type": "incidents",
"id": "1037",
"attributes": {
"started": "2019-06-19T12:56:19+00:00",
"ended": "2019-06-19T12:59:38+00:00",
"acknowledged": null,
"downtime": 199,
"reason": null
}
},
{
"type": "incidents",
"id": "1036",
"attributes": {
"started": "2019-06-19T12:47:57+00:00",
"ended": "2019-06-19T12:56:19+00:00",
"acknowledged": null,
"downtime": 502,
"reason": null
}
}
]
}
Retrieves the monitors that belong to the {id}
team.
HTTP Request
GET /teams/{id}/monitors
URL Parameters
Parameter | Default | Description |
---|---|---|
id |
— | (required, int) The Team ID that we want to get the Monitor collection for. |
Query Parameters (optional)
Parameter | Default | Description |
---|---|---|
page |
1 |
(integer) The page requested |
filter |
— | (array) Filter results by a specific field |
include |
— | Comma-separated resources to include (ex. incidents ) |
The filter
parameter currently handles filtering by:
name
- filter by Monitor's name, use as array in the URL, such as?filter[name]=SearchStringHere
id
- filter a Monitor ID, therefore returning maximum 1 Monitor in the response.state
- filter by the state of the monitor (up / down / unknown)
Includable resources:
incidents
- include the recent incidents for each monitor.checks
- include the recent checks for each monitor.latency-hourly
- include the hourly latency information for each monitor.latency-daily
- include the daily latency information for each monitor.availability-hourly
- include the hourly availability data for each monitor.availability-daily
- include the daily availability data for each monitor.
Please note that requesting any of the above includable resources will cause a delay in the response as each information requires data retrieval efforts.
JSON Payload
none, this is a GET
request
Authorization
- A user can only retrieve information about teams that he's a part of. Sending this request for any other team will result in
HTTP 403 Forbidden
.
Get Team's Channels
Sample request
## GET Team Channels
curl "http://monitive-api.test/teams/26075/channels" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****'
Sample response
{
"data": [
{
"type": "channels",
"id": "10",
"attributes": {
"slug": "email",
"name": "Email",
"description": "Email Alerts",
"enabled": true
},
"links": {
"self": "https:\/\/1c27064d.ngrok.io\/channels\/10"
},
"meta": {
"created": "2018-06-23T09:44:53+00:00",
"updated": "2018-08-24T06:48:13+00:00"
}
},
{
"type": "channels",
"id": "11",
"attributes": {
"slug": "sms",
"name": "SMS Text",
"description": "SMS Text Alerts",
"enabled": true
},
"links": {
"self": "https:\/\/1c27064d.ngrok.io\/channels\/11"
},
"meta": {
"created": "2018-06-23T09:44:53+00:00",
"updated": "2018-08-24T06:48:13+00:00"
}
},
{
"type": "channels",
"id": "12",
"attributes": {
"slug": "phone-call",
"name": "Phone Call",
"description": "Phone Call Alerts",
"enabled": true
},
"links": {
"self": "https:\/\/1c27064d.ngrok.io\/channels\/12"
},
"meta": {
"created": "2018-06-23T09:44:53+00:00",
"updated": "2018-08-24T06:48:13+00:00"
}
}
]
}
Retrieves the channels available for the {id}
team.
HTTP Request
GET /teams/{id}/channels
URL Parameters
Parameter | Default | Description |
---|---|---|
id | — | (required, int) The Team ID that we want to get the Channels collection for. |
Query Parameters
Parameter | Default | Description |
---|---|---|
- | - | - |
JSON Payload
none, this is a GET
request
Authorization
- A user can only retrieve information about teams that he's a part of. Sending this request for any other team will result in
HTTP 403 Forbidden
. - Requesting information for a non-existing team will result in
HTTP 404 Not Found
.
Get Team's Incidents
Sample request
## GET Team Incidents
curl "http://monitive-api.test/teams/26075/incidents" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****'
Sample response
{
"meta": {
"currentPage": 1,
"count": 2,
"perPage": 10,
"hasMorePages": false
},
"links": {
"first": "http:\/\/monitive-api.test\/teams\/26075\/incidents?page=1"
},
"data": [
{
"type": "incidents",
"id": "2592",
"attributes": {
"started": "2018-08-20T13:39:15+00:00",
"ended": "2018-08-20T13:53:19+00:00",
"downtime": 844,
"reason": "The sun went behind the clouds"
},
"relationships": {
"team": {
"data": {
"type": "teams",
"id": "26075"
}
},
"monitor": {
"data": {
"type": "monitors",
"id": "17813"
}
}
},
"links": {
"self": "https:\/\/1c27064d.ngrok.io\/incidents\/2592"
},
"meta": {
"created": "2018-08-20T13:39:15+00:00",
"updated": "2018-08-20T13:53:19+00:00"
}
},
{
"type": "incidents",
"id": "2593",
"attributes": {
"started": "2018-08-20T13:56:15+00:00",
"ended": "2018-08-20T14:43:17+00:00",
"downtime": 2822,
"reason": "Server went away on vacation"
},
"relationships": {
"team": {
"data": {
"type": "teams",
"id": "26075"
}
},
"monitor": {
"data": {
"type": "monitors",
"id": "17813"
}
}
},
"links": {
"self": "https:\/\/1c27064d.ngrok.io\/incidents\/2593"
},
"meta": {
"created": "2018-08-20T13:56:15+00:00",
"updated": "2018-08-20T14:43:17+00:00"
}
}
]
}
Retrieves the incidents for monitors in the {id}
team.
HTTP Request
GET /teams/{id}/incidents
URL Parameters
Parameter | Default | Description |
---|---|---|
id |
— | (required, integer) The Team ID that we want to get the Incidents collection for. |
Query Parameters (optional)
Parameter | Default | Description |
---|---|---|
page |
1 |
(integer) The requested page. |
include |
— | (comma-delimited strings) The related resources to include in the response |
Resources that are available for inclusion:
monitors
- Include Monitor informationteams
- Include Team information
JSON Payload
none, this is a GET
request
Authorization
- A user can only retrieve information about teams that he's a part of. Sending this request for any other team will result in
HTTP 403 Forbidden
. - Requesting information for a non-existing team will result in
HTTP 404 Not Found
.
Get Team's Last Checks
Sample request
## GET Team Checks
curl "http://monitive-api.test/teams/26075/checks" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****'
Sample response
{
"data": [
{
"type": "checks",
"id": "2019-09-26T15:32:39.236838878Z",
"attributes": {
"status": 200,
"state": 1,
"location": "local-three",
"created": "2019-09-26T15:32:39+00:00",
"error": null,
"totalDuration": 101807034
},
"links": {
"self": "https:\/\/monitive-api.test\/checks\/2019-09-26T15:32:39.236838878Z"
}
},
{
"type": "checks",
"id": "2019-09-26T15:32:33.690226031Z",
"attributes": {
"status": 200,
"state": 1,
"location": "local-one",
"created": "2019-09-26T15:32:33+00:00",
"error": null,
"totalDuration": 667979841
},
"links": {
"self": "https:\/\/monitive-api.test\/checks\/2019-09-26T15:32:33.690226031Z"
}
}
]
}
Retrieves the latest checks for the {id}
team.
HTTP Request
GET /teams/{id}/checks
URL Parameters
Parameter | Default | Description |
---|---|---|
id |
— | (required, integer) The Team ID that we want to get the Checks collection for. |
Query Parameters (optional)
This request has no parameters as it is intended to be as fast as possible. The client application might request this every few seconds.
JSON Payload
none, this is a GET
request
Authorization
- A user can only retrieve information about teams that he's a part of. Sending this request for any other team will result in
HTTP 403 Forbidden
. - Requesting information for a non-existing team will result in
HTTP 404 Not Found
.
Get Team's Daily Availability
Sample request
## GET Team Availability (DAILY)
curl "http://monitive-api.test/teams/1/availability-daily" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****'
Sample response
{
"data": {
"type": "availability-daily",
"id": "2019-09-04T00:00:00+00:00-2019-10-03T23:59:59+00:00-availability-daily",
"attributes": {
"points": [
{
"time": "2019-09-04T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-05T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-06T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-07T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-08T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-09T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-10T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-11T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-12T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-13T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-14T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-15T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-16T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-17T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-18T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-19T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-20T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-21T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-22T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-23T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-24T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-25T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-26T00:00:00Z",
"downtime": 0,
"availability": 100
},
{
"time": "2019-09-27T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-09-28T00:00:00Z",
"downtime": 0,
"availability": 100
},
{
"time": "2019-09-29T00:00:00Z",
"downtime": 0,
"availability": 100
},
{
"time": "2019-09-30T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-10-01T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-10-02T00:00:00+00:00",
"downtime": null,
"availability": null
},
{
"time": "2019-10-03T00:00:00+00:00",
"downtime": null,
"availability": null
}
]
},
"links": {
"self": "https:\/\/monitive-api.test\/availability-daily\/2019-09-04T00:00:00+00:00-2019-10-03T23:59:59+00:00-availability-daily"
},
"meta": {
"timeFrom": "2019-09-04T00:00:00+00:00",
"timeTo": "2019-10-03T23:59:59+00:00",
"totals": {
"downtime": 0,
"availability": 100.0000,
"timeframeSeconds": 2591999
}
}
}
}
Retrieves daily availability information for the {id}
team.
HTTP Request
GET /teams/{id}/availability-daily
URL Parameters
Parameter | Default | Description |
---|---|---|
id |
— | (required, integer) The Team ID that we want to get the information for. |
Query Parameters (optional)
None.
JSON Payload
none, this is a GET
request
Authorization
- A user can only retrieve information about teams that he's a part of. Sending this request for any other team will result in
HTTP 403 Forbidden
. - Requesting information for a non-existing team will result in
HTTP 404 Not Found
.
Create Monitor
Sample request
## Create Team Monitor
curl -X "POST" "https://monitive-lumen.test/teams/6049/monitors" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"data": {
"type": "monitors",
"attributes": {
"name": "Ooohooo",
"settings": {
"url": "https://google.com/"
}
}
}
}'
Sample response
{
"data": {
"type": "monitors",
"id": "4764",
"attributes": {
"name": "Ooohooo",
"status": 1,
"state": null,
"settings": {
"url": "https:\/\/google.com\/"
}
},
"links": {
"self": "https:\/\/monitive-lumen.test\/monitors\/4764"
}
}
}
Sample request (with alert rules)
## Create Team Monitor
curl -X "POST" "http://monitive-api.test/teams/26075/monitors?include=alert-rules" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"data": {
"type": "monitors",
"attributes": {
"name": "Ooohooo 3",
"settings": {
"url": "https://google.com/"
}
},
"relationships": {
"alert-rules": {
"data": [
{
"channel": 10,
"delay": 0,
"alertType": 1,
"user": "31291"
},
{
"channel": 11,
"delay": 180,
"alertType": 1,
"user": "31291"
},
{
"channel": 12,
"delay": 600,
"alertType": 1,
"user": "31291"
},
{
"channel": 10,
"user": "31291",
"alertType": 2
},
{
"channel": 11,
"user": "31291",
"alertType": 2
}
]
}
}
}
}'
Sample response (with alert rules)
{
"data": {
"type": "monitors",
"id": "24014",
"attributes": {
"name": "Ooohooo 3",
"settings": {
"url": "https:\/\/google.com\/"
}
},
"relationships": {
"alert-rules": {
"data": [
{
"type": "alert-rules",
"id": "285"
},
{
"type": "alert-rules",
"id": "286"
},
{
"type": "alert-rules",
"id": "287"
},
{
"type": "alert-rules",
"id": "288"
},
{
"type": "alert-rules",
"id": "289"
}
],
"meta": {
"count": 5
}
}
},
"links": {
"self": "https:\/\/1c27064d.ngrok.io\/monitors\/24014"
},
"meta": {
"status": 1,
"state": null,
"timeframe": {
"from": "2018-07-25T00:00:00+00:00",
"to": "2018-08-24T23:59:59+00:00",
"human": "Last 30 days"
},
"availability": {
"downtime": 0,
"percent": null,
"hourly": [],
"daily": []
},
"latency": {
"hourly": [],
"daily": []
},
"incidentCount": 0,
"created": "2018-08-24T14:09:13+00:00",
"updated": "2018-08-24T14:09:13+00:00"
}
},
"included": [
{
"type": "alert-rules",
"id": "285",
"attributes": {
"alertType": 1,
"delay": 0,
"enabled": true
},
"relationships": {
"user": {
"data": {
"type": "users",
"id": "31291",
"meta": []
}
},
"channel": {
"data": {
"type": "channels",
"id": "10"
}
}
}
},
{
"type": "alert-rules",
"id": "286",
"attributes": {
"alertType": 1,
"delay": 180,
"enabled": true
},
"relationships": {
"user": {
"data": {
"type": "users",
"id": "31291",
"meta": []
}
},
"channel": {
"data": {
"type": "channels",
"id": "11"
}
}
}
},
{
"type": "alert-rules",
"id": "287",
"attributes": {
"alertType": 1,
"delay": 600,
"enabled": true
},
"relationships": {
"user": {
"data": {
"type": "users",
"id": "31291",
"meta": []
}
},
"channel": {
"data": {
"type": "channels",
"id": "12"
}
}
}
},
{
"type": "alert-rules",
"id": "288",
"attributes": {
"alertType": 2,
"delay": null,
"enabled": true
},
"relationships": {
"user": {
"data": {
"type": "users",
"id": "31291",
"meta": []
}
},
"channel": {
"data": {
"type": "channels",
"id": "10"
}
}
}
},
{
"type": "alert-rules",
"id": "289",
"attributes": {
"alertType": 2,
"delay": null,
"enabled": true
},
"relationships": {
"user": {
"data": {
"type": "users",
"id": "31291",
"meta": []
}
},
"channel": {
"data": {
"type": "channels",
"id": "11"
}
}
}
}
]
}
Creates a new Monitor on a specific Team.
HTTP Request
POST /teams/{id}/monitors
URL Parameters
Parameter | Default | Description |
---|---|---|
id | — | (required, int) The Team ID that we want to create the Monitor on. |
Query Parameters
Parameter | Default | Description |
---|---|---|
- | - | - |
JSON Payload
A data
object containig the following:
type
must bemonitors
attributes
name
- (required, string) the name of the new monitorsettings
- (required, object) Monitor settingsurl
- (required, string) the URL of the monitorkeywordBody
- (optional, string) a string to search in the target page
relationships
(optional)alert-rules
data
- array with object containing the following attributes:trigger
- string, eitheroutage
orrecovery
channel
- valid channel, such asemail
,sms
etc.userId
- user ID to alertdelay
- (integer
,outage
trigger only) - seconds to delay the alert
Notes:
- When
keywordBody
is specified, the keyword will be checked with every request, and an outage will be recorded if the keyword is not found within the page, even if the page itself responds with HTTP 200 OK.
Authorization
- A user can create a Monitor on a Team that he's a part of. Sending this request for any other team will result in
HTTP 403 Forbidden
.
Response
HTTP 201 Created
response is sent back, with the Location header to the newly created Monitor, and the Monitor object in the body.HTTP 422 Unprocessable Entity
response is sent if the data is missing or invalid.HTTP 403 Forbidden
response is sent if the User is not allowed to perform this request.HTTP 401 Unauthorized
response is sent if theaccess_token
is missing, invalid or expired.
Team Features
These requests manage the optional features and integrations for a specific team.
Available Features
Available features example in the
data.meta.availableFeatures
attribute:
{
"data": {
. . . . . . . . .
"meta": {
"created": "2018-08-20T13:28:43+00:00",
"updated": "2018-08-20T13:28:43+00:00",
"availableFeatures": [
"keyword-monitoring"
],
}
. . . . . . . . .
}
}
Whenever you request Team information via GET /teams/{id}, you will also receive and array of featues that are available for that specific team. The list can differ from team to team, as some features might be in beta and not available for all the users and some of them might be still in development and only available to the development team.
See the example in the right sidebar panel.
Enable Feature
Sample request:
## Create (enable) Team Feature
curl -X "POST" "http://monitive-api.test/teams/1728/features" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"data": {
"type": "team-features",
"attributes": {
"feature": "keyword-monitoring",
"settings": null
}
}
}'
Sample response:
{
"data": {
"type": "team-features",
"id": "195",
"attributes": {
"feature": "keyword-monitoring",
"settings": null
},
"relationships": {
"teams": {
"data": {
"type": "teams",
"id": "1728"
},
"links": {
"related": "https:\/\/monitive-api.test\/team-features\/195\/teams"
}
}
},
"links": {
"self": "https:\/\/monitive-api.test\/team-features\/195"
},
"meta": {
"created": "2018-10-20T07:45:09+00:00",
"updated": "2018-10-20T07:45:09+00:00"
}
}
}
Enables a specific feature for the selected Team ID. Each feature has a name (in slug
format) and optionally settings.
HTTP Request
POST /teams/{id}/features
URL Parameters
Parameter | Default | Description |
---|---|---|
id | — | (required, int) Team ID |
Query Parameters
Parameter | Default | Description |
---|---|---|
- | - | - |
JSON Payload
data
type
must beteam-features
attributes
feature
- (required, string) feature slugsettings
- (required, object) feature settings or null
Authorization
- Users can only send this request for a Team ID that their are a part of.
- Sending this request for any other team will result in
HTTP 403 Forbidden
.
Response
HTTP 201 Created
response is sent back, with the Location header to the newly created resource, and the new object in the body.HTTP 422 Unprocessable Entity
response is sent if the data is missing or invalid.HTTP 403 Forbidden
response is sent if the User is not allowed to perform this request.HTTP 401 Unauthorized
response is sent if theaccess_token
is missing, invalid or expired.
Retrieve Enabled Features
Sample request
## GET Team Features
curl "http://monitive-api.test/teams/1728/features" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****'
Sample response
{
"meta": {
"currentPage": 1,
"count": 1,
"perPage": 10,
"hasMorePages": false
},
"links": {
"first": "http:\/\/monitive-api.test\/teams\/1728\/features?page=1"
},
"data": [
{
"type": "team-features",
"id": "195",
"attributes": {
"feature": "keyword-monitoring",
"settings": null
},
"relationships": {
"teams": {
"data": {
"type": "teams",
"id": "1728"
},
"links": {
"related": "https:\/\/monitive-api.test\/team-features\/195\/teams"
}
}
},
"links": {
"self": "https:\/\/monitive-api.test\/team-features\/195"
},
"meta": {
"created": "2018-10-20T07:45:09+00:00",
"updated": "2018-10-20T07:45:09+00:00"
}
}
]
}
Retrieves the features that have been enabled for a Team.
HTTP Request
GET /teams/{id}/features
URL Parameters
Parameter | Default | Description |
---|---|---|
id | — | (required, int) The Team ID |
Query Parameters
Parameter | Default | Description |
---|---|---|
- | - | - |
JSON Payload
none, this is a GET
request
Authorization
- Users can only send this request for a Team ID that their are a part of.
- Sending this request for any other team will result in
HTTP 403 Forbidden
.
Response
HTTP 200 OK
response with the paginated list of features is returned if authorization is good.HTTP 403 Forbidden
response is sent if the User is not allowed to perform this request.HTTP 401 Unauthorized
response is sent if theaccess_token
is missing, invalid or expired.
Delete Feature
Sample request
## DELETE Team Feature
curl -X "DELETE" "http://monitive-api.test/team-features/5" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****'
Sample response
HTTP 204 No Content
This request disables the specified feature. This only disables a feature for a specific team, it does not delete the feature from the system. However, the feature's settings previously added will be permanently deleted.
HTTP Request
DELETE /team-features/{id}
URL Parameters
Parameter | Default | Description |
---|---|---|
id | — | (required, int) The feature ID |
Query Parameters
Parameter | Default | Description |
---|---|---|
- | - | - |
JSON Payload
none, this is a DELETE
request
Authorization
- Users can only send this request for a Team ID that their are a part of.
- Sending this request for any other team will result in
HTTP 403 Forbidden
.
Response
HTTP 204 No Content
if the feature has been successfuly removed.HTTP 403 Forbidden
response is sent if the User is not allowed to perform this request.HTTP 401 Unauthorized
response is sent if theaccess_token
is missing, invalid or expired.
Monitors
Constants
Constants for the status
attribute (numeric):
Name | JSON Value | Description |
---|---|---|
STATUS_DRAFT |
0 |
Monitor is being created (not used) |
STATUS_ENABLED |
1 |
Monitor is active |
STATUS_PAUSED |
-1 |
Monitor is paused (by the user) |
STATUS_DISABLED |
-2 |
Monitor is paused (by the system) |
Constants for the state
attribute (numeric|null
):
Name | JSON Value | Description |
---|---|---|
STATE_UNKNOWN |
null |
Monitor's state is unknown |
STATE_UP |
1 |
Monitor's state is UP / OK |
STATE_DOWN |
0 |
Monitor's state is DOWN / ERROR |
Get Monitor
Sample request
## GET Monitor
curl "http://monitive-api.test/monitors/17813?include=checks,incidents" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****'
Sample response
{
"data": {
"type": "monitors",
"id": "17813",
"attributes": {
"name": "My Happy Doppy Monitor",
"settings": {
"url": "http:\/\/monitive.com"
},
},
"relationships": {
"incidents": {
"data": [
{
"type": "incidents",
"id": "2593"
},
{
"type": "incidents",
"id": "2592"
}
],
"meta": 2
},
"checks": {
"data": []
},
"alert-rules": {
"data": [
{
"type": "alert-rules",
"id": "290"
},
{
"type": "alert-rules",
"id": "291"
}
],
"meta": {
"count": 2
}
}
},
"links": {
"self": "https:\/\/1c27064d.ngrok.io\/monitors\/17813"
},
"meta": {
"status": 1,
"state": 1,
"timeframe": {
"from": "2018-07-27T00:00:00+00:00",
"to": "2018-08-26T23:59:59+00:00",
"human": "Last 30 days"
},
"availability": {
"downtime": 0,
"percent": null,
"hourly": [],
"daily": [
{
"time": "2018-08-20T00:00:00Z",
"downtime": -2
}
]
},
"latency": {
"hourly": [
{
"time": "2018-08-20T13:00:00Z",
"ContentLenght": 13761,
"TotalDuration": 222,
"DNSLookup": 1,
"TCPConnection": 28,
"ServerProcessing": 29,
"NameLookup": 1,
"Connect": 29,
"Pretransfer": 193,
"StartTransfer": 221
},
{
"time": "2018-08-20T14:00:00Z",
"ContentLenght": 1607,
"TotalDuration": 11,
"DNSLookup": 0,
"TCPConnection": 37,
"ServerProcessing": 11,
"NameLookup": 0,
"Connect": 37,
"Pretransfer": 156,
"StartTransfer": 11
}
],
"daily": [
{
"time": "2018-08-20T00:00:00Z",
"ContentLenght": 7684,
"TotalDuration": 116,
"DNSLookup": 0,
"TCPConnection": 33,
"ServerProcessing": 20,
"NameLookup": 0,
"Connect": 33,
"Pretransfer": 174,
"StartTransfer": 116
}
]
},
"incidentCount": 2,
"created": "2018-08-20T13:28:43+00:00",
"updated": "2018-08-24T11:53:49+00:00"
}
},
"included": [
{
"type": "incidents",
"id": "2593",
"attributes": {
"started": "2018-08-20T13:56:15+00:00",
"ended": "2018-08-20T14:43:17+00:00",
"downtime": 2822,
"reason": "Server went away on vacation"
},
"relationships": {
"team": {
"data": {
"type": "teams",
"id": "26075"
}
},
"monitor": {
"data": {
"type": "monitors",
"id": "17813"
}
}
}
},
{
"type": "incidents",
"id": "2592",
"attributes": {
"started": "2018-08-20T13:39:15+00:00",
"ended": "2018-08-20T13:53:19+00:00",
"downtime": 844,
"reason": "The sun went behind the clouds"
},
"relationships": {
"team": {
"data": {
"type": "teams",
"id": "26075"
}
},
"monitor": {
"data": {
"type": "monitors",
"id": "17813"
}
}
}
}
]
}
Retrieves the monitor {id}
information.
HTTP Request
GET /monitors/{id}
URL Parameters
Parameter | Default | Description |
---|---|---|
id | — | (required, int) The Team ID that we want to get the Monitor collection for. |
Query Parameters
Parameter | Default | Description |
---|---|---|
include |
— | Comma-separated resources to include (ex. checks,incidents ) |
Includable resources:
checks
- include the most recent 10 checks (if available)incidents
- include the most recent 10 incidents (if available)
JSON Payload
none, this is a GET
request
Authorization
- A user can only retrieve information about a Monitor that is on a team he or she is a part of. Sending this request for any other monitor will result in
HTTP 403 Forbidden
.
Get Monitor's Incidents
Sample request
## GET Monitor's Incidents
curl "http://monitive-api.test/monitors/17813/incidents" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****'
Sample response
{
"meta": {
"currentPage": 1,
"count": 2,
"perPage": 10,
"hasMorePages": false
},
"links": {
"first": "http:\/\/monitive-api.test\/monitors\/17813\/incidents?page=1"
},
"data": [
{
"type": "incidents",
"id": "2593",
"attributes": {
"started": "2018-08-20T13:56:15+00:00",
"ended": "2018-08-20T14:43:17+00:00",
"downtime": 2822,
"reason": "Server went away on vacation"
},
"relationships": {
"team": {
"data": {
"type": "teams",
"id": "26075"
}
},
"monitor": {
"data": {
"type": "monitors",
"id": "17813"
}
}
},
"links": {
"self": "https:\/\/1c27064d.ngrok.io\/incidents\/2593"
},
"meta": {
"created": "2018-08-20T13:56:15+00:00",
"updated": "2018-08-20T14:43:17+00:00"
}
},
{
"type": "incidents",
"id": "2592",
"attributes": {
"started": "2018-08-20T13:39:15+00:00",
"ended": "2018-08-20T13:53:19+00:00",
"downtime": 844,
"reason": "The sun went behind the clouds"
},
"relationships": {
"team": {
"data": {
"type": "teams",
"id": "26075"
}
},
"monitor": {
"data": {
"type": "monitors",
"id": "17813"
}
}
},
"links": {
"self": "https:\/\/1c27064d.ngrok.io\/incidents\/2592"
},
"meta": {
"created": "2018-08-20T13:39:15+00:00",
"updated": "2018-08-20T13:53:19+00:00"
}
}
]
}
Retrieves the monitor {id}
incidents list.
HTTP Request
GET /monitors/{id}/incidents
URL Parameters
Parameter | Default | Description |
---|---|---|
id |
— | (required, int) The Monitor ID that we want to get the incidents collection for. |
Query Parameters
Parameter | Default | Description |
---|---|---|
page |
1 |
(optional, integer) The page requested |
JSON Payload
none, this is a GET
request
Authorization
- A user can only retrieve information about a Monitor that is on a team he or she is a part of. Sending this request for any other monitor will result in
HTTP 403 Forbidden
. - Sending this request for a non-existing Monitor will result in
HTTP 404 Not Found
.
Update Monitor
Sample request
## Create Team Monitor
curl -X "PATCH" "https://monitive-lumen.test/monitors/12721" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"data": {
"type": "monitors",
"attributes": {
"name": "My Happy Monitor",
}
}
}'
Sample response
{
"data": {
"type": "monitors",
"id": "12721",
"attributes": {
"name": "My Happy Monitor",
"settings": {
"url": "http:\/\/miller.org\/et-et-iusto-qui-quo-sed-incidunt-debitis"
}
},
"links": {
"self": "http:\/\/localhost\/monitors\/12721"
},
"meta": {
"status": 1,
"state": 1,
"timeframe": {
"from": "2018-06-04T00:00:00+00:00",
"to": "2018-07-04T23:59:59+00:00",
"human": "Last 30 days"
},
"availability": {
"downtime": 0,
"percent": null,
"hourly": [],
"daily": []
},
"latency": {
"hourly": [
{
"time": "2018-07-03T08:00:00Z",
"ContentLenght": 205953,
"TotalDuration": 9,
"DNSLookup": 8,
"TCPConnection": 6,
"ServerProcessing": 6,
"NameLookup": 4,
"Connect": 4,
"Pretransfer": 2,
"StartTransfer": 1
}
],
"daily": [
{
"time": "2018-07-03T00:00:00Z",
"ContentLenght": 205953,
"TotalDuration": 9,
"DNSLookup": 8,
"TCPConnection": 6,
"ServerProcessing": 6,
"NameLookup": 4,
"Connect": 4,
"Pretransfer": 2,
"StartTransfer": 1
}
]
},
"incidentCount": 3,
"created": "2018-07-03T08:15:17+00:00",
"updated": "2018-07-04T08:35:43+00:00"
}
}
}
Sample request (with Alert Rules update)
## PATCH Monitor
curl -X "PATCH" "http://monitive-api.test/monitors/17813?include=alert-rules" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"data": {
"type": "monitors",
"attributes": {
"name": "My Happy Doppy Monitor"
},
"relationships": {
"alert-rules": {
"data": [
{
"channel": 11,
"delay": 0,
"alertType": 1,
"user": "31291"
},
{
"channel": 11,
"user": "31291",
"alertType": 2
}
]
}
}
}
}'
Sample response (if ?include=alert-rules in
PATCH
)
{
"data": {
"type": "monitors",
"id": "17813",
"attributes": {
"name": "My Happy Doppy Monitor",
"settigs": {
"url": "http:\/\/monitive.com"
}
},
"relationships": {
"alert-rules": {
"data": [
{
"type": "alert-rules",
"id": "290"
},
{
"type": "alert-rules",
"id": "291"
}
],
"meta": {
"count": 2
}
}
},
"links": {
"self": "https:\/\/1c27064d.ngrok.io\/monitors\/17813"
},
"meta": {
"status": 1,
"state": 1,
"timeframe": {
"from": "2018-07-25T00:00:00+00:00",
"to": "2018-08-24T23:59:59+00:00",
"human": "Last 30 days"
},
"availability": {
"downtime": 0,
"percent": null,
"hourly": [],
"daily": [
{
"time": "2018-08-20T00:00:00Z",
"downtime": -2
}
]
},
"latency": {
"hourly": [
{
"time": "2018-08-20T13:00:00Z",
"ContentLenght": 13761,
"TotalDuration": 222,
"DNSLookup": 1,
"TCPConnection": 28,
"ServerProcessing": 29,
"NameLookup": 1,
"Connect": 29,
"Pretransfer": 193,
"StartTransfer": 221
},
{
"time": "2018-08-20T14:00:00Z",
"ContentLenght": 1607,
"TotalDuration": 11,
"DNSLookup": 0,
"TCPConnection": 37,
"ServerProcessing": 11,
"NameLookup": 0,
"Connect": 37,
"Pretransfer": 156,
"StartTransfer": 11
}
],
"daily": [
{
"time": "2018-08-20T00:00:00Z",
"ContentLenght": 7684,
"TotalDuration": 116,
"DNSLookup": 0,
"TCPConnection": 33,
"ServerProcessing": 20,
"NameLookup": 0,
"Connect": 33,
"Pretransfer": 174,
"StartTransfer": 116
}
]
},
"incidentCount": 2,
"created": "2018-08-20T13:28:43+00:00",
"updated": "2018-08-24T11:53:49+00:00"
}
},
"included": [
{
"type": "alert-rules",
"id": "290",
"attributes": {
"alertType": 1,
"delay": 0,
"enabled": true
},
"relationships": {
"user": {
"data": {
"type": "users",
"id": "31291",
"meta": []
}
},
"channel": {
"data": {
"type": "channels",
"id": "11"
}
}
}
},
{
"type": "alert-rules",
"id": "291",
"attributes": {
"alertType": 2,
"delay": null,
"enabled": true
},
"relationships": {
"user": {
"data": {
"type": "users",
"id": "31291",
"meta": []
}
},
"channel": {
"data": {
"type": "channels",
"id": "11"
}
}
}
}
]
}
Updates one or more attributes for a Monitor.
HTTP Request
PATCH /monitors/{id}
URL Parameters
Parameter | Default | Description |
---|---|---|
id | — | (required, int) The Monitor ID that we want to update. |
Query Parameters
Parameter | Default | Description |
---|---|---|
- | - | - |
JSON Payload
A data
object containing the following:
type
(required, must bemonitors
)attributes
name
- (string) the name of the monitorsettings
- (string)url
- (string) the URL of the monitorkeywordBody
- (optional, string) a string to search in the target page
relationships
(optional)alert-rules
data
- array with object containing the following attributes:trigger
- string, eitheroutage
orrecovery
channel
- valid channel, such asemail
,sms
etc.userId
- user ID to alertdelay
- (integer
,outage
trigger only) - seconds to delay the alert
Note:
- The
settins
attribute has to contain all the settings, even if only one of the settings (for examplekeywordBody
) is to be updated. Failure to send the completesettings
object will either result inHTTP 422 Unprocessable Entity
or lost settings.
Authorization
- A user can update a Monitor from a Team that he's a part of. Sending this request for any other team will result in
HTTP 403 Forbidden
.
Response
HTTP 200 OK
response is sent back, with the update Monitor information as JSON.HTTP 422 Unprocessable Entity
response is sent if the data is missing or invalid.HTTP 403 Forbidden
response is sent if the User is not allowed to perform this request.HTTP 401 Unauthorized
response is sent if theaccess_token
is missing, invalid or expired.
Delete Monitor
Sample request
## Create Team Monitor
curl -X "DELETE" "https://monitive-lumen.test/monitors/12721" \
-H 'Authorization: Bearer ***** Hidden credentials *****' \
Sample response
HTTP/1.1 204 No Content
Permanently deletes a monitor and all related incidents, alerts and messages.
HTTP Request
DELETE /monitors/{id}
URL Parameters
Parameter | Default | Description |
---|---|---|
id | — | (required, int) The Monitor ID that we want to delete. |
Query Parameters
Parameter | Default | Description |
---|---|---|
- | - | - |
JSON Payload
No payload
Authorization
- A user can delete a Monitor from a Team that he's a part of. Sending this request for any other team will result in
HTTP 403 Forbidden
.
Response
HTTP 204 No Content
response is sent back if the delete is successful.HTTP 403 Forbidden
response is sent if the User is not allowed to perform this request.HTTP 401 Unauthorized
response is sent if theaccess_token
is missing, invalid or expired.
Pause Monitor
Sample request
## PAUSE Monitor
curl -X "PUT" "https://monitive-api.test/monitors/12722/pause" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****'
Sample response
{
"data": {
"type": "monitors",
"id": "12722",
"attributes": {
"name": "Isai Wyman",
"settings": {
"url": "http:\/\/www.howell.com\/dolorem-excepturi-ut-aliquam-nisi-velit-velit-neque.html"
}
},
"links": {
"self": "http:\/\/localhost\/monitors\/12722"
},
"meta": {
"status": -1,
"state": 1,
"timeframe": {
"from": "2018-06-04T00:00:00+00:00",
"to": "2018-07-04T23:59:59+00:00",
"human": "Last 30 days"
},
"availability": {
"downtime": 0,
"percent": null,
"hourly": [],
"daily": []
},
"latency": {
"hourly": [
{
"time": "2018-07-03T08:00:00Z",
"ContentLenght": 205953,
"TotalDuration": 9,
"DNSLookup": 8,
"TCPConnection": 6,
"ServerProcessing": 6,
"NameLookup": 4,
"Connect": 4,
"Pretransfer": 2,
"StartTransfer": 1
}
],
"daily": [
{
"time": "2018-07-03T00:00:00Z",
"ContentLenght": 205953,
"TotalDuration": 9,
"DNSLookup": 8,
"TCPConnection": 6,
"ServerProcessing": 6,
"NameLookup": 4,
"Connect": 4,
"Pretransfer": 2,
"StartTransfer": 1
}
]
},
"incidentCount": 3,
"created": "2018-07-03T08:15:17+00:00",
"updated": "2018-07-04T10:31:15+00:00"
}
}
}
Pauses a monitor, stopping any further checks from being performed, including alerts or incidents being recorded.
HTTP Request
PUT /monitors/{id}/pause
URL Parameters
Parameter | Default | Description |
---|---|---|
id | — | (required, int) The Monitor ID that we want to pause. |
Query Parameters
Parameter | Default | Description |
---|---|---|
- | - | - |
JSON Payload
No payload
Authorization
- A user can pause a Monitor from a Team that he's a part of. Sending this request for any other team will result in
HTTP 403 Forbidden
.
Response
HTTP 202 OK
response is sent back if the pause is successful, containing the Monitor data and thestatus
attribute equalingSTATUS_PAUSED
(see constants above).HTTP 403 Forbidden
response is sent if the User is not allowed to perform this request.HTTP 401 Unauthorized
response is sent if theaccess_token
is missing, invalid or expired.
Resume Monitor
Sample request
## PAUSE Monitor
curl -X "PUT" "https://monitive-api.test/monitors/12722/resume" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***** Hidden credentials *****'
Sample response
{
"data": {
"type": "monitors",
"id": "12722",
"attributes": {
"name": "Isai Wyman",
"settings": {
"url": "http:\/\/www.howell.com\/dolorem-excepturi-ut-aliquam-nisi-velit-velit-neque.html"
}
},
"links": {
"self": "http:\/\/localhost\/monitors\/12722"
},
"meta": {
"status": 1,
"state": 1,
"timeframe": {
"from": "2018-06-04T00:00:00+00:00",
"to": "2018-07-04T23:59:59+00:00",
"human": "Last 30 days"
},
"availability": {
"downtime": 0,
"percent": null,
"hourly": [],
"daily": []
},
"latency": {
"hourly": [
{
"time": "2018-07-03T08:00:00Z",
"ContentLenght": 205953,
"TotalDuration": 9,
"DNSLookup": 8,
"TCPConnection": 6,
"ServerProcessing": 6,
"NameLookup": 4,
"Connect": 4,
"Pretransfer": 2,
"StartTransfer": 1
}
],
"daily": [
{
"time": "2018-07-03T00:00:00Z",
"ContentLenght": 205953,
"TotalDuration": 9,
"DNSLookup": 8,
"TCPConnection": 6,
"ServerProcessing": 6,
"NameLookup": 4,
"Connect": 4,
"Pretransfer": 2,
"StartTransfer": 1
}
]
},
"incidentCount": 3,
"created": "2018-07-03T08:15:17+00:00",
"updated": "2018-07-04T10:31:15+00:00"
}
}
}
Resumes a (paused) monitor. The request is idempotent, so resuming an active monitor will do nothing spectacular.
HTTP Request
PUT /monitors/{id}/resume
URL Parameters
Parameter | Default | Description |
---|---|---|
id | — | (required, int) The Monitor ID that we want to resume. |
Query Parameters
Parameter | Default | Description |
---|---|---|
- | - | - |
JSON Payload
No payload
Authorization
- A user can resume a Monitor from a Team that he's a part of. Sending this request for any other team will result in
HTTP 403 Forbidden
.
Response
HTTP 202 OK
response is sent back if the resuming is successful, containing the Monitor data and thestatus
attribute equalingSTATUS_ENABLED
(see constants above).HTTP 403 Forbidden
response is sent if the User is not allowed to perform this request.HTTP 401 Unauthorized
response is sent if theaccess_token
is missing, invalid or expired.
Test Monitor
Sample request
## Test Monitor
curl -X "POST" "http://monitive-api.test/monitors/test" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"data": {
"type": "monitors",
"attributes": {
"name": "My Happy Doppy Monitor",
"settings": {
"url": "https://monitive.com"
}
}
}
}'
Sample response (test target is up)
{
"data": [
{
"type": "checks",
"id": "2018-09-01T10:58:05.10768139+03:00",
"attributes": {
"status": 200,
"state": 1,
"location": "local-one",
"created": "2018-09-01T10:58:05+03:00",
"error": null,
"totalDuration": 207577969
},
"links": {
"self": "https:\/\/monitive-api.test\/checks\/2018-09-01T10:58:05.10768139+03:00"
}
}
]
}
Sample respose (test target is down)
{
"data": [
{
"type": "checks",
"id": "2018-09-01T10:58:56.376860234+03:00",
"attributes": {
"status": null,
"state": 0,
"location": "local-one",
"created": "2018-09-01T10:58:56+03:00",
"error": "Get https:\/\/no-site-here.com: dial tcp: lookup no-site-here.com: no such host",
"totalDuration": -1
},
"links": {
"self": "https:\/\/monitive-api.test\/checks\/2018-09-01T10:58:56.376860234+03:00"
}
}
]
}
Sample response (validation error)
{
"errors": [
{
"status": "422",
"code": "ApiValidationException",
"title": "Invalid attribute",
"detail": "The data.attributes.url field is required.",
"source": {
"pointer": "\/data\/attributes\/url"
}
}
]
}
Tests a monitor target, without creating it or requiring that it exists beforehand.
HTTP Request
POST /monitors/test
URL Parameters
Parameter | Default | Description |
---|---|---|
- | — | - |
Query Parameters
Parameter | Default | Description |
---|---|---|
- | — | - |
JSON Payload
data
type
must bemonitors
attributes
name
- (string) the name of the new monitorurl
- (string) the URL of the monitor
Authorization
- Any user can send this request, no prior authorization required.
Incidents
These requests manage Incidents, by retrieving information about incidents that occured, and dispatching actions that may be perfomed on incidents, such as acknowledging an incident.
Retrieve Incident
Sample request
## GET Incident
curl "http://monitive-api.test/incidents/2592?include=monitors,teams,acknowledger" \
-H 'Accept: application/json'
Sample response
{
"data": {
"type": "incidents",
"id": "2592",
"attributes": {
"started": "2018-08-20T13:39:15+00:00",
"ended": "2018-08-20T13:53:19+00:00",
"acknowledged": "2018-08-20T10:44:33+00:00",
"downtime": 844,
"reason": "The sun went behind the clouds"
},
"relationships": {
"monitors": {
"data": {
"type": "monitors",
"id": "17813"
}
},
"acknowledger": {
"data": {
"type": "users",
"id": "31291",
"meta": []
}
},
"teams": {
"data": {
"type": "teams",
"id": "26075"
}
}
},
"links": {
"self": "https:\/\/monitive-api.test\/incidents\/2592"
},
"meta": {
"created": "2018-08-20T13:39:15+00:00",
"updated": "2018-08-20T13:53:19+00:00"
}
},
"included": [
{
"type": "monitors",
"id": "17813",
"attributes": {
"name": "My Happy Doppy Monitor",
"settings": {
"url": "http:\/\/monitive.com"
},
},
"relationships": {
"alert-rules": {
"data": [
{
"type": "alert-rules",
"id": "290"
},
{
"type": "alert-rules",
"id": "291"
}
],
"meta": {
"count": 2
}
}
},
"meta": {
"status": 1,
"state": 1,
"created": "2018-08-20T13:28:43+00:00",
"updated": "2018-09-16T13:05:16+00:00"
}
},
{
"type": "users",
"id": "31291",
"attributes": {
"firstName": "Lucian",
"lastName": "Daniliuc",
"email": "[email protected]",
"phone": "+40740822882",
"timeZone": "Europe\/Paris",
"silentStart": "22:00",
"silentEnd": "08:00",
"invitation": "WIN"
},
"relationships": {
"teams": {
"data": [
{
"type": "teams",
"id": "26075"
}
],
"links": {
"related": "https:\/\/monitive-api.test\/users\/31291\/teams"
}
}
}
},
{
"type": "teams",
"id": "26075",
"attributes": {
"name": "Lucian"
},
"relationships": {
"users": {
"data": [
{
"type": "users",
"id": "31291",
"meta": {
"role": "owner"
}
}
]
}
}
}
]
}
Purpose: Retrieves the incident {id}
information.
HTTP Request
GET /incidents/{id}
URL Parameters
Parameter | Default | Description |
---|---|---|
id | — | (required, int) The Incident ID that we want to get information for. |
Query Parameters
Parameter | Default | Description |
---|---|---|
include |
— | Comma-separated resources to include (ex. monitors,teams ) |
Includable resources:
monitors
- include the Monitor that the Incident belongs toteams
- include the Team that the Incident belongs toacknowledger
- include the User that acknowledged the outage
JSON Payload
none, this is a GET
request
Authorization
- Authenticated users that are on the Team that the Incident is a part of can execute this request.
- All other users will received
HTTP 403 Forbidden
Acknowledge Incident
Sample request
## POST ACK
curl -X "POST" "http://monitive-api.test/incidents/2592/acknowledge" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json; charset=utf-8' \
Sample response
{
"data": {
"type": "incidents",
"id": "2592",
"attributes": {
"started": "2018-08-20T13:39:15+00:00",
"ended": "2018-08-20T13:53:19+00:00",
"acknowledged": "2018-09-17T12:46:06+00:00",
"downtime": 844,
"reason": "The sun went behind the clouds"
},
"links": {
"self": "https:\/\/monitive-api.test\/incidents\/2592"
},
"meta": {
"created": "2018-08-20T13:39:15+00:00",
"updated": "2018-09-17T12:46:06+00:00"
}
}
}
Purpose: Acknowledges an Incident. When an incident is "acknowledged", all further alerts will be silenced. This is because we're assuming the User is aware of the problem.
Acknowledging an incident saves the User and the time of the request, for future reference. These are included in the GET /incidents/{id}
request in the acknowledged
data attribute (the date and time), and the acknowledger
relationship (the User that acknowledged the Incident).
HTTP Request
POST /incidents/{id}/acknowledge
URL Parameters
Parameter | Default | Description |
---|---|---|
id | — | (required, int) The Incident ID that we want to acknowledge. |
Query Parameters
Parameter | Default | Description |
---|---|---|
include |
— | Comma-separated resources to include in the response (ex. monitors,teams ) |
Please refer to the Retrieve Incident request for details.
JSON Payload
- none
Authorization
- Users that are on the Team where the Incident
{id}
has been recorded can execute this request.
Responses
200 OK
- if the Incident has been successfuly acknowledged (and the User was recorded as acknowledger).403 Forbidden
- if the userid
is not on the Team with the Incident (and therefore its Monitor)404 Not Found
- either the Incident or the User was not found (or their hashes don't match)409 Conflict
- the Incident is already acknowledge (an Incident can only be acknowledged once)
Acknowledge
Purpose: provide a way for a user, based on a link included in an outage alert, to quickly see and acknowledge the outage.
Since these requests work without authentication (the user might not be nor want to be logged in on the device he's receiving the link on), we're using an Incident's and User's hash to properly identify an authentic request.
The hashes for the Incidents and Users cannot be generated outside of the system, they're only made available by including them in the outage acknowledgement URLs.
Retrieve Incident information
Sample request
## GET Incident for ACK
curl "http://monitive-api.test/ack/2592-JDJ5JDEwJHJxQnY1VHBrNkZGL3RPOGpHZVBaZk9zMnBib0hGZ0R6MTh5L2kuTmRObGVqekxhdTBlRzZD?include=monitors,teams,acknowledger" \
-H 'Accept: application/json'
Sample response
{
"data": {
"type": "incidents",
"id": "2592",
"attributes": {
"started": "2018-08-20T13:39:15+00:00",
"ended": "2018-08-20T13:53:19+00:00",
"acknowledged": "2018-08-20T10:44:33+00:00",
"downtime": 844,
"reason": "The sun went behind the clouds"
},
"relationships": {
"monitors": {
"data": {
"type": "monitors",
"id": "17813"
}
},
"acknowledger": {
"data": {
"type": "users",
"id": "31291",
"meta": []
}
},
"teams": {
"data": {
"type": "teams",
"id": "26075"
}
}
},
"links": {
"self": "https:\/\/monitive-api.test\/incidents\/2592"
},
"meta": {
"created": "2018-08-20T13:39:15+00:00",
"updated": "2018-08-20T13:53:19+00:00"
}
},
"included": [
{
"type": "monitors",
"id": "17813",
"attributes": {
"name": "My Happy Doppy Monitor",
"settings": {
"url": "http:\/\/monitive.com"
},
},
"relationships": {
"alert-rules": {
"data": [
{
"type": "alert-rules",
"id": "290"
},
{
"type": "alert-rules",
"id": "291"
}
],
"meta": {
"count": 2
}
}
},
"meta": {
"status": 1,
"state": 1,
"created": "2018-08-20T13:28:43+00:00",
"updated": "2018-09-16T13:05:16+00:00"
}
},
{
"type": "users",
"id": "31291",
"attributes": {
"firstName": "Lucian",
"lastName": "Daniliuc",
"email": "[email protected]",
"phone": "+40740822882",
"timeZone": "Europe\/Paris",
"silentStart": "22:00",
"silentEnd": "08:00",
"invitation": "WIN"
},
"relationships": {
"teams": {
"data": [
{
"type": "teams",
"id": "26075"
}
],
"links": {
"related": "https:\/\/monitive-api.test\/users\/31291\/teams"
}
}
}
},
{
"type": "teams",
"id": "26075",
"attributes": {
"name": "Lucian"
},
"relationships": {
"users": {
"data": [
{
"type": "users",
"id": "31291",
"meta": {
"role": "owner"
}
}
]
}
}
}
]
}
Purpose: Retrieves the incident {id}
information.
HTTP Request
GET /ack/{id}-{hash}
URL Parameters
Parameter | Default | Description |
---|---|---|
id | — | (required, int) The Incident ID that we want to get information for. |
hash | — | (required, string) The hash corresponding to the Incident |
Query Parameters
Parameter | Default | Description |
---|---|---|
include |
— | Comma-separated resources to include (ex. monitors,teams ) |
Includable resources:
monitors
- include the Monitor that the Incident belongs toteams
- include the Team that the Incident belongs toacknowledger
- include the User that acknowledged the outage
JSON Payload
none, this is a GET
request
Authorization
- Anyone can execute this request
Acknowledge Incident
Sample request
## POST ACK
curl -X "POST" "http://monitive-api.test/ack/2592-JDJ5JDEwJHJxQnY1VHBrNkZGL3RPOGpHZVBaZk9zMnBib0hGZ0R6MTh5L2kuTmRObGVqekxhdTBlRzZD?include=monitors,teams,acknowledger" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"data": {
"type": "users",
"id": "31291",
"meta": {
"hash": "JDJ5JDEwJFV5TkJHNm10aGlNa0lJRzhMZDFZb2VxRGYxMURiVzVDNFRVbXd1a3JUelpubFdDRXphUThL"
}
}
}'
Sample response
{
"data": {
"type": "incidents",
"id": "2592",
"attributes": {
"started": "2018-08-20T13:39:15+00:00",
"ended": "2018-08-20T13:53:19+00:00",
"acknowledged": "2018-09-17T12:46:06+00:00",
"downtime": 844,
"reason": "The sun went behind the clouds"
},
"links": {
"self": "https:\/\/monitive-api.test\/incidents\/2592"
},
"meta": {
"created": "2018-08-20T13:39:15+00:00",
"updated": "2018-09-17T12:46:06+00:00"
}
}
}
Purpose: Acknowledges the {id}
incident.
HTTP Request
POST /ack/{id}-{hash}
URL Parameters
Parameter | Default | Description |
---|---|---|
id | — | (required, int) The Incident ID that we want to acknowledge. |
hash | — | (required, string) The hash corresponding to the Incident |
Query Parameters
Parameter | Default | Description |
---|---|---|
include |
— | Comma-separated resources to include (ex. monitors,teams ) |
Includable resources:
monitors
- include the Monitor that the Incident belongs toteams
- include the Team that the Incident belongs toacknowledger
- include the User that acknowledged the outage
JSON Payload
data
type
(string, required) - must beusers
id
(string, required) - the User ID that acnowledges this Incidentmeta
(object, required)hash
- the User's hash
Authorization
- Anyone can execute this request.
Responses
200 OK
- if the Incident has been successfuly acknowledged (and the User was recorded as acknowledger).403 Forbidden
- if the userid
is not on the Team with the Incident (and therefore its Monitor)404 Not Found
- either the Incident or the User was not found (or their hashes don't match)409 Conflict
- the Incident is already acknowledge (an Incident can only be acknowledged once)422 Unprocessable Entity
- missing or invalid JSON payload was sent.
Errors
The Kittn API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request -- Your request is invalid. |
401 | Unauthorized -- Your API key is wrong. |
403 | Forbidden -- The kitten requested is hidden for administrators only. |
404 | Not Found -- The specified kitten could not be found. |
405 | Method Not Allowed -- You tried to access a kitten with an invalid method. |
406 | Not Acceptable -- You requested a format that isn't json. |
410 | Gone -- The kitten requested has been removed from our servers. |
418 | I'm a teapot. |
429 | Too Many Requests -- You're requesting too many kittens! Slow down! |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |