MySitesAlive API Documentation

Integrate our monitoring services with your applications using our REST API.

Get Started with the API

To generate your API key and start using these endpoints, sign in to your MySitesAlive account. If you don't have an account yet, register now.

Authentication

All API requests must include your API key in the header:

X-API-Key: your_api_key_here
Rate Limiting

API requests are limited to 100 requests per minute. If you exceed this limit, you'll receive a 429 Too Many Requests response.

API Endpoints

Returns a list of all websites monitored by your account.

Example Request:
curl -H "X-API-Key: your_api_key_here" https://mysitesalive.com/api/websites
Example Response:
{
  "success": true,
  "websites": [
    {
      "id": 1,
      "name": "Example Website",
      "url": "https://www.example.com",
      "status": "up",
      "last_checked": "2025-04-18T08:30:00Z",
      "ssl_status": "valid",
      "ssl_expiry": "2026-04-18T00:00:00Z",
      "keyword_status": "found",
      "monitor_type": "http"
    },
    {
      "id": 2,
      "name": "SIP Server",
      "url": "sip:sipserver.example.com:5060",
      "status": "up",
      "last_checked": "2025-04-18T08:35:00Z",
      "monitor_type": "sip"
    }
  ]
}

Returns detailed information about a specific website.

Parameters:
  • id (path parameter): The ID of the website
Example Request:
curl -H "X-API-Key: your_api_key_here" https://mysitesalive.com/api/website/1
Example Response:
{
  "success": true,
  "website": {
    "id": 1,
    "name": "Example Website",
    "url": "https://www.example.com",
    "status": "up",
    "last_checked": "2025-04-18T08:30:00Z",
    "ssl_status": "valid",
    "ssl_expiry": "2026-04-18T00:00:00Z",
    "keyword_status": "found",
    "keywords": ["example", "test", "monitoring"],
    "check_interval": 5,
    "monitor_type": "http",
    "uptime_30d": 99.98,
    "response_time_avg": 320
  }
}

Returns a list of alert configurations for a specific website.

Parameters:
  • id (path parameter): The ID of the website
Example Request:
curl -H "X-API-Key: your_api_key_here" https://mysitesalive.com/api/website/1/alerts
Example Response:
{
  "success": true,
  "alerts": [
    {
      "id": 1,
      "website_id": 1,
      "type": "downtime",
      "threshold": 5,
      "notification_method": "email",
      "email": "admin@example.com",
      "is_active": true
    },
    {
      "id": 2,
      "website_id": 1,
      "type": "ssl_expiry",
      "threshold": 30,
      "notification_method": "both",
      "email": "admin@example.com",
      "phone": "+1234567890",
      "is_active": true
    }
  ]
}

Returns recent notifications sent for a specific website.

Parameters:
  • id (path parameter): The ID of the website
  • limit (query parameter, optional): Maximum number of notifications to return (default: 10)
Example Request:
curl -H "X-API-Key: your_api_key_here" https://mysitesalive.com/api/website/1/notifications?limit=5
Example Response:
{
  "success": true,
  "notifications": [
    {
      "id": 1,
      "website_id": 1,
      "alert_id": 1,
      "message": "Website Example Website is down (HTTP 500)",
      "sent_at": "2025-04-17T14:30:00Z",
      "notification_method": "email"
    },
    {
      "id": 2,
      "website_id": 1,
      "alert_id": 1,
      "message": "Website Example Website is back up",
      "sent_at": "2025-04-17T14:45:00Z",
      "notification_method": "email"
    }
  ]
}

Returns information about your tenant account.

Example Request:
curl -H "X-API-Key: your_api_key_here" https://mysitesalive.com/api/tenant
Example Response:
{
  "success": true,
  "tenant": {
    "id": 1,
    "name": "Example Company",
    "subdomain": "example",
    "logo_url": "/static/uploads/logos/tenant_1_logo.png",
    "created_at": "2025-01-15T10:00:00Z",
    "website_count": 5,
    "user_count": 3
  }
}

Returns information about the authenticated user.

Example Request:
curl -H "X-API-Key: your_api_key_here" https://mysitesalive.com/api/user
Example Response:
{
  "success": true,
  "user": {
    "id": 1,
    "username": "admin",
    "email": "admin@example.com",
    "role": "admin",
    "tenant_id": 1,
    "created_at": "2025-01-15T10:00:00Z",
    "last_login": "2025-04-18T08:00:00Z"
  }
}

Triggers an immediate check of a website and returns the results.

Parameters:
  • id (path parameter): The ID of the website to check
Example Request:
curl -X POST -H "X-API-Key: your_api_key_here" https://mysitesalive.com/api/website/1/check
Example Response:
{
  "success": true,
  "check_result": {
    "website_id": 1,
    "status": "up",
    "response_time": 215,
    "response_code": 200,
    "ssl_status": "valid",
    "ssl_expiry": "2026-04-18T00:00:00Z",
    "keyword_status": "found",
    "checked_at": "2025-04-18T10:30:00Z"
  }
}

Error Codes

The API uses standard HTTP status codes to indicate the success or failure of a request. Additional information may be provided in the response body.

Status Code Description
200 OK The request was successful.
400 Bad Request The request was invalid or cannot be served. The exact error is explained in the response body.
401 Unauthorized Authentication failed or user doesn't have permissions for the requested operation.
404 Not Found The requested resource could not be found.
429 Too Many Requests You have sent too many requests in a given amount of time.
500 Internal Server Error An error occurred on the server while processing the request.

Ready to integrate with our API?

Sign in to your account to generate your API key and start building with our monitoring platform.