TABLE OF CONTENTS


Overview

Freshping allows companies to monitor their websites from 10 different locations. Users can monitor uptime/downtime, outages and performance of websites, APIs, web services, web applications with instant outage/downtime alerts. With Freshping, companies can efficiently monitor end-points and communicate outages to customers. Our goal is simple: make it effortless for companies to monitor and communicate downtimes to their customers and reduce helpdesk costs.

Freshping's APIs belong to the Representational State Transfer (REST) category. They allow you to perform 'RESTful' operations such as reading, modifying, adding or deleting data from your monitoring dashboard.

What API commands are used by Freshping?

Freshping APIs are plain JSON over HTTP and use the following HTTP verbs:

COMMAND

PURPOSE

POST

Create an object

GET

Fetch one or more objects

PATCH

Update an object

DELETE

Remove an object

Note: All API requests should hit the secured endpoint, that is, only HTTPS

Rate Limit

The number of API calls per hour is based on the subscribed plan.

PLAN

RATE LIMIT

Sprout

100

Blossom

200

Garden

300


Policies

Freshping APIs are classified into either production or beta APIs. A production API is one that has been made generally available for public use and is stable. A beta API is one that is still in development or is for internal or limited use and whose stability cannot be guaranteed. Beta APIs may be removed or modified at any time without advance notice. The following policies apply to production APIs only.

Deprecation Policy

The current version of production level APIs is v1. When a new version of APIs is made generally available (not beta), the older version will be deprecated and will cease to function after six months. Once an API is removed, any request to it will result in a 404 error.

Breaking Change Policy

Changes that do not break an API, such as adding a new attribute can be made at any time. Changes that break a production level API such as removing attributes or making major changes to the API’s behavior will only be done with an advance notice of 60 days. However, there may be rare occasions where due to legal, performance, or security reasons, we are forced to make breaking changes without advance notice.

Authentication


Authentication is done over Basic Authentication using your organization API key as Username and Freshping subdomain as Password to authenticate the request.


curl -v -u <apikey>:<freshping_subdomain> -H "Content-Type: application/json" -X GET 'https://api.freshping.io/api/v1/'


For example, if your API key is abcdefghij1234567890 and Freshping URL is xyz.freshping.io, the curl command to use is:


curl -v -u abcdefghij1234567890:xyz -H "Content-Type: application/json" -X GET 'https://api.freshping.io/api/v1/checks/'



Note:

If you are sure that your credentials are correct, but are still unable to access the APIs, make sure that the "APIkey:X" is Base64-encoded before passing it as an "Authorization" header.


Where can I find my API key?

  1. Login to your account

  2. Go to settings > Account

  3. Copy API Key


Checks


Check Types

Check Type

Protocol prefix

Example

HTTP

http://

http://freshping.io

HTTPS

https://

https://freshping.io

WebSocket

ws://

wss://freshping.io/server

ICMP Ping

icmp-ping://

icmp-ping://94.140.140.101

TCP

tcp://

tcp://94.140.140.101:355

UDP

udp://

udp://94.140.140.101:355

DNS

dns-resolve://

dns-resolve://freshping.io


Parameters

Attribute

Mandatory

Type

Details

name

Yes

String


url

Yes

String

Prefix the URL with the protocol provided in Check Types table

Port number is mandatory in case of TCP and UDP

location

No

String

Default: us-east-1

Enum: 

1. us-east-1: US East (N. Virginia),

2. us-west-2: US West (Oregon)

3. sa-east-1: South America (Sao Paulo)

4. eu-west-1: EU (Ireland)

5. eu-west-2: EU (London)

6. ap-northeast-1: Asia Pacific (Tokyo),

7. ap-southeast-1: Asia Pacific (Singapore)

8. ap-southeast-2: Asia Pacific (Sydney)

9. ap-south-1: Asia Pacific (Mumbai)

10. ca-central-1: Canada (Central)


monitoring_interval

No

Integer

Default: 300

Enum: 300, 60

Pass 60 for 1 min and 300 for 5 min

request_timeout

No

Integer in Range 1-30

Default: 30

Range 1 second  to 30 seconds

basic_auth_username

No

String


basic_auth_password

No

String


custom_header

No

Array of objects

Format: [{"header1":"value1"},{"header2":"value2"}]


alert_users

No

Array of integers

Default: []

Get list of users from /users/ API


Pass array of id of the users

alert_contacts

No

Array of integers

Default: []

Get list of contacts from /users/ API


Pass array of id of the contacts

alert_note

No

String

Add a note in alert email

command_string

No

String


sucess_string

No

String


error_string

No

String


status

No

Readonly


Can be in one of the following state -

'AV': 'Available',

'NR': 'Not Responding',

'RE': 'Reporting Error',

'PS': 'Monitoring Paused',

'DME': 'DNS Record Matching Failure',

'SME': 'String Check Matching Failure',

'SCE': 'Status Code check Failure'



performance_status

No

Readonly


Can be in one of the following state -

'GP': 'Good Performance',

'DP': 'Degraded Performance',

'AV': 'Available',

'PS': 'Monitoring Paused'





List all checks

    

GET: checks/      

                                                                                                                                              

Response:

{

   "count"1,

   "next"null,

   "previous"null,

   "results": [

       {

           "id"1,

           "name""Example",

           "status""AV",

           "performance_status"null,

           "alert_note""",

           "location""us-east-1",

           "alert_users": [1],

           "alert_contacts": [],

           "monitoring_interval"60,

           "url""https://example.com",

           "request_timeout"30,

           "basic_auth_username""",

           "basic_auth_password""",

           "custom_header": {},

           "command_string"null,

           "success_string"null,

           "error_string"null

       }

   ]

}




Get a specific check

GET: checks/<check_id>/



Response:

{

   "id"1,

   "name""Example",

   "status""AV",

   "performance_status"null,

   "alert_note""",

   "location""us-east-1",

   "alert_users": [1],

   "alert_contacts": [],

   "monitoring_interval"60,

   "url""https://example.com",

   "request_timeout"30,

   "basic_auth_username""",

   "basic_auth_password""",

   "custom_header": {},

   "command_string"null,

   "success_string"null,

   "error_string"null

}




Create a check


POST: checks/

Request:


{

   "name""Example",

   "alert_note""This is a note",

   "location""us-east-1",

   "alert_users": [1],

   "alert_contacts": [],

   "monitoring_interval"300,

   "url""https://example.com",

   "request_timeout"30,

   "basic_auth_username""",

   "basic_auth_password""",

   "custom_header": {},

   "command_string"null,

   "success_string"null,

   "error_string"null

}



 

Response:


{

   "id"1,

   "name""Example",

   "status""AV",

   "performance_status"null,

   "alert_note""",

   "location""us-east-1",

   "alert_users": [1],

   "alert_contacts": [],

   "monitoring_interval"60,

   "url""https://example.com",

   "request_timeout"30,

   "basic_auth_username""",

   "basic_auth_password""",

   "custom_header": {},

   "command_string"null,

   "success_string"null,

   "error_string"null

}



 

Update a check


PATCH: checks/<check_id>/


Request:

{

   "name""Example",

   "alert_note""This is a note",

   "location""us-east-1",

   "alert_users": [1],

   "alert_contacts": [],

   "monitoring_interval"300,

   "url""https://example.com",

   "request_timeout"30,

   "basic_auth_username""",

   "basic_auth_password""",

   "custom_header": {},

   "command_string"null,

   "success_string"null,

   "error_string"null

}



 

Response:

{

   "id"1,

   "name""Example",

   "status""AV",

   "performance_status"null,

   "alert_note""",

   "location""us-east-1",

   "alert_users": [1],

   "alert_contacts": [],

   "monitoring_interval"60,

   "url""https://example.com",

   "request_timeout"30,

   "basic_auth_username""",

   "basic_auth_password""",

   "custom_header": {},

   "command_string"null,

   "success_string"null,

   "error_string"null

}



 

Delete a check


DELETE: checks/<check_id>/


Response:


HTTP Status: 204 No Content



Pause checks in bulk

Parameters

Attribute

Mandatory

Type

Details

checks

Yes

Array of Integers




POST: checks/pause/


Request:

{

   "checks": [1,2]

}


Response:

HTTP Status: 200 OK


 

Restart checks in bulk

Parameters

Attribute

Mandatory

Type

Details

checks

Yes

Array of Integers




POST: checks/restart/



Request:

{

   "checks": [1,2]

}


Response:

HTTP Status: 200 OK



Users

Parameters

Attribute

Mandatory

Type

Details

users

No

Array of Objects

List of users

contacts

No

Array of Objects

List of contacts


List all users


GET: users/


Response:

{

   "users": [

       {

           "id"1,

           "name""test1",

           "email""test1@test.com",

           "role""Admin",

           "disable_weekly_report_emails"null,

           "disable_alert_emails"null,

       },

       {

           "id"2,

           "name""test2",

           "email""test2@test.com",

           "role""Read Only",

           "disable_weekly_report_emails"null,

           "disable_alert_emails"null,

       }

   ],

   "contacts": [

       {

           "id"1,

           "name""test3",

           "email""test3@test.com"

       },

       {

           "id"2,

           "name""test4",

           "email""test4@test.com"

       }

   ]

}