Back to Documentation
API Reference
Complete REST API documentation for automating backup operations and integrating with your infrastructure.
Authentication
All API requests require authentication using an API key in the Authorization header:
Authorization: Bearer YOUR_API_KEYGenerate API keys in Settings → API Keys
Base URL
https://api.nexus.next-pal.com/v1Servers
List Servers
GET /serversResponse:
{
"success": true,
"data": {
"servers": [
{
"id": 1,
"name": "Production DB",
"hostname": "db.example.com",
"status": "active"
}
]
}
}Create Server
POST /serversRequest Body:
{
"name": "Production DB",
"hostname": "db.example.com",
"port": 22,
"username": "backup",
"sshKey": "ssh-rsa AAAA..."
}Backups
List Backups
GET /backups?serverId=1Query Parameters:
serverId- Filter by server IDtype- Filter by type (full, diff, incr)limit- Number of results (default: 50)
Create Backup
POST /backupsRequest Body:
{
"serverId": 1,
"type": "full",
"stanza": "main"
}Get Backup Status
GET /backups/:idRestore Operations
Restore from Backup
POST /restoreRequest Body:
{
"backupId": 123,
"targetTime": "2024-01-15T10:30:00Z",
"targetPath": "/var/lib/postgresql/restore"
}Schedules
Create Schedule
POST /schedulesRequest Body:
{
"serverId": 1,
"type": "full",
"cron": "0 2 * * 0",
"enabled": true
}Webhooks
Configure webhooks to receive real-time notifications:
POST /webhooksRequest Body:
{
"url": "https://your-app.com/webhook",
"events": ["backup.completed", "backup.failed"],
"secret": "your-webhook-secret"
}Rate Limits
- Free tier: 100 requests/hour
- Professional: 1,000 requests/hour
- Enterprise: Unlimited
Error Codes
| Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid API key |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
SDK Libraries
Official SDKs available for:
- Python -
pip install nextpal-nexus - Node.js -
npm install @nextpal/nexus - Go -
go get github.com/nextpal/nexus-go