API Reference

Complete HTTP API documentation for direct integration

Authentication

All API requests must be authenticated using an API key sent in the X-Api-Key header.

# Example request with authentication

curl -X GET \

-H "X-Api-Key: your_api_key_here" \

-H "Accept: application/json" \

"https://api.killswitchguardian.com/v1/killswitch?customerId=cust_12345"

API Key Security

  • Keep your API keys secure and never commit them to version control
  • Use environment variables or secure configuration management
  • Rotate keys regularly using the dashboard
  • Different keys for different environments (production, staging, development)

KillSwitch Check

The primary endpoint for checking customer entitlement status.

Endpoint

GET https://api.killswitchguardian.com/v1/killswitch

Query Parameters

Parameter Type Required Description
customerId string Yes Unique customer identifier

Response Format

{

"allowed": true,

"message": "Active subscription",

"expiresAt": "2024-12-31T23:59:59Z",

"signature": "a1b2c3d4e5f6...",

"cacheTtl": 3600

}

Customer Management

Endpoints for managing customer accounts and status.

Create Customer

POST https://api.killswitchguardian.com/v1/customers

{

"name": "Customer Name",

"email": "[email protected]",

"metadata": {"plan": "premium"}

}

Update Customer Status

PATCH https://api.killswitchguardian.com/v1/customers/{customerId}

{

"status": "active", // active, suspended, inactive

"expiresAt": "2024-12-31T23:59:59Z"

}

Error Codes

Code Message Description
400 Bad Request Invalid request parameters
401 Unauthorized Invalid or missing API key
404 Not Found Customer or resource not found
429 Rate Limit Exceeded Too many requests
500 Internal Server Error Server-side error

Rate Limiting

API requests are rate-limited to ensure service stability.

100

Requests per minute (per API key)

1,000

Requests per hour (per API key)

10,000

Requests per day (per API key)

Rate Limit Headers

Rate limit information is included in response headers:

X-RateLimit-Limit: 100

X-RateLimit-Remaining: 95

X-RateLimit-Reset: 1640995200