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_KEY

Generate API keys in SettingsAPI Keys

Base URL

https://api.nexus.next-pal.com/v1

Servers

List Servers

GET /servers

Response:

{
  "success": true,
  "data": {
    "servers": [
      {
        "id": 1,
        "name": "Production DB",
        "hostname": "db.example.com",
        "status": "active"
      }
    ]
  }
}

Create Server

POST /servers

Request Body:

{
  "name": "Production DB",
  "hostname": "db.example.com",
  "port": 22,
  "username": "backup",
  "sshKey": "ssh-rsa AAAA..."
}

Backups

List Backups

GET /backups?serverId=1

Query Parameters:

  • serverId - Filter by server ID
  • type - Filter by type (full, diff, incr)
  • limit - Number of results (default: 50)

Create Backup

POST /backups

Request Body:

{
  "serverId": 1,
  "type": "full",
  "stanza": "main"
}

Get Backup Status

GET /backups/:id

Restore Operations

Restore from Backup

POST /restore

Request Body:

{
  "backupId": 123,
  "targetTime": "2024-01-15T10:30:00Z",
  "targetPath": "/var/lib/postgresql/restore"
}

Schedules

Create Schedule

POST /schedules

Request Body:

{
  "serverId": 1,
  "type": "full",
  "cron": "0 2 * * 0",
  "enabled": true
}

Webhooks

Configure webhooks to receive real-time notifications:

POST /webhooks

Request 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

CodeDescription
400Bad Request - Invalid parameters
401Unauthorized - Invalid API key
403Forbidden - Insufficient permissions
404Not Found - Resource doesn't exist
429Too Many Requests - Rate limit exceeded
500Internal 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

Ready to protect your PostgreSQL data?