Skip to main content

API Playground

Test the PulseGuard API directly in your browser with our interactive playground. All examples include authentication and can be run immediately.

Authentication Setup

Before using the playground, you’ll need to authenticate. Choose your preferred method:
  1. Go to your PulseGuard Dashboard
  2. Navigate to Settings → API Keys
  3. Click “Generate New Key”
  4. Copy the key and use it in the Authorization header

Option 2: JWT Token

If you’re logged in to the dashboard, your JWT token is automatically used for API calls.

Domain Monitoring

Create a Domain

Test domain creation with custom monitoring settings.
curl -X POST "https://api.ipulse.one/api/domains" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "name": "My Test Website",
    "check_interval": 300,
    "ssl_check": {
      "enabled": true,
      "warn_days_before_expiry": 30
    },
    "tags": ["test", "demo"]
  }'

Get Domain Statistics

Retrieve uptime statistics for the last 30 days.
curl -X GET "https://api.ipulse.one/api/domains/domain_123/stats?period=30d" \
  -H "Authorization: Bearer YOUR_API_KEY"
Get detailed response time data over time.
curl -X GET "https://api.ipulse.one/api/domains/domain_123/response-time-trends?period=24h&resolution=5m" \
  -H "Authorization: Bearer YOUR_API_KEY"

Device Monitoring

Register a Device

Add a new device for monitoring.
curl -X POST "https://api.ipulse.one/devices" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Web Server 01",
    "description": "Production web server",
    "tags": ["production", "web"]
  }'

Get Device Metrics

Retrieve real-time metrics from a device.
curl -X GET "https://api.ipulse.one/devices/device_456/metrics?period=1h" \
  -H "Authorization: Bearer YOUR_API_KEY"

Service Monitoring

Create a Service

Monitor a custom service or API endpoint.
curl -X POST "https://api.ipulse.one/api/services" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "User API",
    "type": "http",
    "host": "api.example.com",
    "port": 443,
    "check_interval": 60
  }'

Toolbox Tools

DNS Lookup

Perform DNS lookups for troubleshooting.
curl -X GET "https://api.ipulse.one/api/toolbox/dns-lookup?domain=example.com&type=A" \
  -H "Authorization: Bearer YOUR_API_KEY"

SSL Certificate Check

Analyze SSL certificate details.
curl -X GET "https://api.ipulse.one/api/toolbox/ssl-check?host=example.com&port=443" \
  -H "Authorization: Bearer YOUR_API_KEY"

Website Analysis

Get comprehensive website analysis.
curl -X POST "https://api.ipulse.one/api/toolbox/analyze" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com"
  }'

Incident Management

Create Incident

Manually create an incident for tracking.
curl -X POST "https://api.ipulse.one/incidents" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Database Connection Issues",
    "description": "Users reporting slow page loads",
    "severity": "high",
    "affected_domains": ["domain_123"]
  }'

Add Comment to Incident

Collaborate on incident resolution.
curl -X POST "https://api.ipulse.one/incidents/incident_101/comments" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Investigating database connection pool exhaustion",
    "internal_only": false
  }'

Dashboard & Reports

Get Dashboard Statistics

Retrieve high-level monitoring statistics.
curl -X GET "https://api.ipulse.one/dashboard/stats" \
  -H "Authorization: Bearer YOUR_API_KEY"

SDK Examples

JavaScript SDK

import { PulseGuard } from '@pulseguard/sdk';

const client = new PulseGuard({
  apiKey: 'your_api_key'
});

// Create a domain
const domain = await client.domains.create({
  url: 'https://example.com',
  name: 'My Website'
});

// Get statistics
const stats = await client.domains.getStats(domain.id, {
  period: '30d'
});

console.log(`Uptime: ${stats.uptime_percentage}%`);

Python SDK

from pulseguard import PulseGuardClient

client = PulseGuardClient(api_key='your_api_key')

# Create a domain
domain = client.domains.create(
    url='https://example.com',
    name='My Website'
)

# Get statistics
stats = client.domains.get_stats(domain.id, period='30d')

print(f"Uptime: {stats['uptime_percentage']}%")

PHP SDK

use PulseGuard\\PulseGuardClient;

$client = new PulseGuardClient([
    'api_key' => 'your_api_key'
]);

// Create a domain
$domain = $client->domains()->create([
    'url' => 'https://example.com',
    'name' => 'My Website'
]);

// Get statistics
$stats = $client->domains()->getStats($domain['id'], [
    'period' => '30d'
]);

echo "Uptime: {$stats['uptime_percentage']}%";

Error Examples

Rate Limit Exceeded

curl -X GET "https://api.ipulse.one/api/domains" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response (429)
{
  "error": "RATE_LIMIT_EXCEEDED",
  "message": "API rate limit exceeded",
  "details": {
    "limit": 1000,
    "window": "1h",
    "reset_in_seconds": 1800
  }
}

Domain Not Found

curl -X GET "https://api.ipulse.one/api/domains/domain_999" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response (404)
{
  "error": "DOMAIN_NOT_FOUND",
  "message": "Domain with ID 'domain_999' not found"
}

Validation Error

curl -X POST "https://api.ipulse.one/api/domains" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Test Domain"}'
Response (400)
{
  "error": "VALIDATION_ERROR",
  "message": "Validation failed",
  "details": {
    "field": "url",
    "reason": "URL is required for domain creation"
  }
}

Webhook Testing

Register Webhook

curl -X POST "https://api.ipulse.one/api/webhooks" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-app.com/webhooks/pulseguard",
    "events": ["domain_up", "domain_down"],
    "secret": "your_webhook_secret"
  }'

Test Webhook

curl -X POST "https://api.ipulse.one/api/webhooks/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "domain_down",
    "domain_id": "domain_123"
  }'

Next Steps

  1. Explore the Full API: Check the complete API Reference for all endpoints
  2. Build an Integration: Use our SDKs or direct API calls
  3. Set Up Webhooks: Get real-time notifications
  4. Monitor Usage: Track your API usage in the dashboard

Support

Need help with the API? Check our: