Websites
Please refer to the Authentication document on how to obtain and use an API key.
Available actions & endpoints
Fetching all websites
GET /v1/websites (Fetch all websites)
URL Parameters
name type data type description None N/A N/A N/A
Query Parameters
name required data type description businessUuid Yes string The uuid of the business you would like to fetch the websites for
Responses
http code content-type response 200application/jsonSee example response401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL
curl -X GET -H "api-key: [YOUR API KEY]" https://api.monitor.insites.com/v1/websites?websiteUuid=[THE websiteUuid]
Example Response
{
"data": [
{
"uuid": "15022766-dc8f-44c2-9542-b998c6793922",
"hostname": "https://www.insites.com",
"business_uuid": "e3f59007-0cf7-461d-9c10-b90c949273a5",
"created_at": "2022-08-31T14:23:40+00:00",
"updated_at": "2022-08-31T14:23:40+00:00",
"is_hostname_up": true
}
],
"meta": {
"per_page": 20,
"from": 1,
"to": 1,
"current_page": 1,
"last_page": 1,
"total": 1,
"next_page_url": null,
"prev_page_url": null,
"first_page_url": "http://localhost:8000/v1/websites?page=1",
"last_page_url": "http://localhost:8000/v1/websites?page=1"
}
}
Fetching a specific website
GET /v1/websites/[website_uuid] (Fetch website)
URL Parameters
name required data type description website_uuid Yes string The uuid of the website you would like to fetch
Query Parameters
name required data type description None N/A N/A N/A
Responses
http code content-type response 200application/jsonSee example response404application/json{"code":404,"message": "Record not found in table \"websites\""}401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL
curl -X GET https://api.monitor.insites.com/v1/website/[website_uuid]
-H "api-key: [YOUR API KEY]"
Example Response
{
"data": {
"uuid": "15022766-dc8f-44c2-9542-b998c6793922",
"hostname": "https://www.insites.com",
"business_uuid": "e3f59007-0cf7-461d-9c10-b90c949273a5",
"created_at": "2022-08-31T14:23:40+00:00",
"updated_at": "2022-08-31T14:23:40+00:00",
"is_hostname_up": true
}
}
Creating a website
POST /v1/websites (Create website)
URL Parameters
name required data type description None N/A N/A N/A
Query Parameters
name required data type description businessUuid Yes string The uuid of the business you would like to create a website for
Responses
http code content-type response 200application/jsonSee example response422application/json{"success":false,"message":"error","errors":{"hostname":{"length":"Hostname name must be < 255 characters"}}}401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL
curl -X POST https://api.monitor.insites.com/v1/websites
-H "api-key: [YOUR API KEY]"
-H "Content-Type: application/json"
-d "[SEE EXAMPLE REQUEST BODY]"
Example Request Body
{
"hostname": "https://www.insites.com"
}
Example Response
{
"message": "success",
"success": true,
"data": {
"uuid": "15022766-dc8f-44c2-9542-b998c6793922",
"hostname": "https://www.insites.com",
"business_uuid": "e3f59007-0cf7-461d-9c10-b90c949273a5",
"created_at": "2022-08-31T14:23:40+00:00",
"updated_at": "2022-08-31T14:23:40+00:00",
"is_hostname_up": true
}
}
Updating a website
PATCH /v1/websites/[website_uuid] (Update website)
URL Parameters
name required data type description website_uuid Yes string The uuid of the website you would like to update
Query Parameters
name required data type description None N/A N/A N/A
Responses
http code content-type response 200application/jsonSee example response422application/json{"success":false,"message":"error","errors":{"hostname":{"length":"Hostname name must be < 255 characters"}}}401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL
curl -X PATCH https://api.monitor.insites.com/v1/websites/[website_uuid]
-H "api-key: [YOUR API KEY]"
-H "Content-Type: application/json"
-d "[SEE EXAMPLE REQUEST BODY]"
Example Request Body
{
"hostname": "https://app.insites.com"
}
Example Response
{
"message": "success",
"success": true,
"data": {
"uuid": "15022766-dc8f-44c2-9542-b998c6793922",
"hostname": "https://app.insites.com",
"business_uuid": "e3f59007-0cf7-461d-9c10-b90c949273a5",
"created_at": "2022-08-31T14:23:40+00:00",
"updated_at": "2022-08-31T14:23:40+00:00",
"is_hostname_up": true
}
}
Deleting a website
DELETE /v1/websites/[website_uuid] (Delete website)
URL Parameters
name required data type description website_uuid Yes string The uuid of the website you would like to delete
Query Parameters
name required data type description None N/A N/A N/A
Responses
http code content-type response 200application/json{"success":true,"message":"success"}401application/json{"code":401,"message": "Authentication is required to continue"}
Example cURL
curl -X DELETE https://api.monitor.insites.com/v1/websites/[website_uuid]
-H "api-key: [YOUR API KEY]"