Grim Reaper API Documentation
Complete guide to integrating with the Grim Reaper data protection platform
Authentication
All API requests require authentication using API keys. Include your API key in the request headers.
curl -X GET "https://api.grim.so/v2/backups" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
🔑 Getting Your API Key
1. Log into your Grim Reaper dashboard
2. Navigate to Account → API Keys
3. Generate a new API key
4. Keep your API key secure and never share it publicly
Rate Limits
API requests are rate-limited to ensure fair usage and system stability.
Plan | Requests per Minute | Requests per Hour | Requests per Day |
---|---|---|---|
FREE | 60 | 1,000 | 10,000 |
PRO | 300 | 10,000 | 100,000 |
MASTER | 1,000 | 50,000 | 500,000 |
REAPER | Unlimited | Unlimited | Unlimited |
⚠️ Rate Limit Headers
Rate limit information is included in response headers:
X-RateLimit-Limit
: Maximum requests per windowX-RateLimit-Remaining
: Remaining requests in current windowX-RateLimit-Reset
: Time when the rate limit resets (Unix timestamp)
Error Handling
The API uses standard HTTP status codes and returns detailed error messages.
Common Error Codes
Bad Request
Invalid request parameters or malformed JSON
Unauthorized
Invalid or missing API key
Forbidden
Insufficient permissions for the requested resource
Not Found
Requested resource does not exist
Too Many Requests
Rate limit exceeded
Internal Server Error
Unexpected server error
{
"error": {
"code": "INVALID_PARAMETER",
"message": "The 'backup_id' parameter is required",
"details": {
"parameter": "backup_id",
"type": "required"
}
},
"request_id": "req_1234567890abcdef"
}
Backup Management API
Create, manage, and monitor your data backups programmatically.
Create Backup
Create a new backup of specified data sources.
curl -X POST "https://api.grim.so/v2/backups" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Daily Database Backup",
"sources": [
{
"type": "database",
"connection": {
"host": "localhost",
"port": 5432,
"database": "myapp",
"username": "backup_user"
}
}
],
"schedule": {
"frequency": "daily",
"time": "02:00"
},
"retention": {
"days": 30,
"copies": 5
}
}'
Response
{
"backup": {
"id": "backup_1234567890abcdef",
"name": "Daily Database Backup",
"status": "scheduled",
"created_at": "2024-01-15T10:30:00Z",
"next_run": "2024-01-16T02:00:00Z",
"sources": [...],
"schedule": {...},
"retention": {...}
}
}
List Backups
Retrieve a list of all backups for your account.
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
limit | integer | No | Number of backups to return (default: 20, max: 100) |
offset | integer | No | Number of backups to skip (default: 0) |
status | string | No | Filter by status (scheduled, running, completed, failed) |
created_after | string | No | Filter backups created after this date (ISO 8601) |
Get Backup Details
Retrieve detailed information about a specific backup.
Update Backup
Update backup configuration and settings.
Delete Backup
Delete a backup and all associated data.
Storage Management API
Manage storage allocation, monitor usage, and configure storage policies.
Get Storage Usage
Retrieve current storage usage statistics.
Response
{
"usage": {
"total_allocated": "100GB",
"total_used": "45.2GB",
"total_available": "54.8GB",
"usage_percentage": 45.2,
"breakdown": {
"backups": "23.4GB",
"snapshots": "15.8GB",
"archives": "6.0GB"
},
"last_updated": "2024-01-15T10:30:00Z"
}
}
Get Storage Policies
Retrieve storage policies and configuration.
Update Storage Policy
Update storage policy configuration.
Monitoring & Analytics API
Monitor system performance, track metrics, and analyze backup patterns.
Get System Metrics
Retrieve system performance metrics.
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
timeframe | string | No | Time range (1h, 24h, 7d, 30d) |
metrics | string | No | Comma-separated list of metrics to include |
Get Backup Analytics
Retrieve backup performance analytics and trends.
Get API Usage
Retrieve API usage statistics and trends.
Security & Encryption API
Manage encryption keys, security policies, and access controls.
Get Encryption Keys
Retrieve encryption key information (metadata only).
Rotate Encryption Key
Rotate encryption keys for enhanced security.
Get Security Policies
Retrieve security policies and configuration.
Webhooks
Receive real-time notifications about backup events and system changes.
Supported Events
backup.started
Triggered when a backup job starts
backup.completed
Triggered when a backup job completes successfully
backup.failed
Triggered when a backup job fails
storage.threshold
Triggered when storage usage exceeds threshold
security.alert
Triggered when security events occur
{
"event": "backup.completed",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"backup_id": "backup_1234567890abcdef",
"name": "Daily Database Backup",
"size": "2.3GB",
"duration": 180,
"status": "completed"
},
"signature": "sha256=abc123..."
}
Python SDK
Official Python SDK for easy integration with Grim Reaper APIs.
Installation
pip install grim-reaper-sdk
Quick Start
from grim_reaper import GrimReaper
# Initialize client
client = GrimReaper(api_key="YOUR_API_KEY")
# Create a backup
backup = client.backups.create(
name="My Database Backup",
sources=[{
"type": "database",
"connection": {
"host": "localhost",
"database": "myapp"
}
}]
)
# List backups
backups = client.backups.list(limit=10)
# Get backup details
backup_details = client.backups.get(backup.id)
# Monitor storage usage
usage = client.storage.get_usage()
print(f"Used: {usage.total_used} of {usage.total_allocated}")
JavaScript SDK
Official JavaScript/Node.js SDK for web and server applications.
Installation
npm install @grim-reaper/sdk
Quick Start
const { GrimReaper } = require('@grim-reaper/sdk');
// Initialize client
const client = new GrimReaper({
apiKey: 'YOUR_API_KEY'
});
// Create a backup
const backup = await client.backups.create({
name: 'My Database Backup',
sources: [{
type: 'database',
connection: {
host: 'localhost',
database: 'myapp'
}
}]
});
// List backups
const backups = await client.backups.list({ limit: 10 });
// Get storage usage
const usage = await client.storage.getUsage();
console.log(`Used: ${usage.totalUsed} of ${usage.totalAllocated}`);
Postman Collection
Import our Postman collection to test APIs directly in your browser.
Import this collection into Postman to get started quickly with all API endpoints.