REST API v1

API Documentation

Integrate DataSync into your infrastructure with our REST API. Manage backup jobs, agents, databases, destinations, and more programmatically.

Overview

The DataSync API is a standard REST API that accepts JSON request bodies and returns JSON responses. All API endpoints are served from a single base URL.

Base URL

https://api.data-sync.co.uk

Authentication Methods

  • Bearer JWT — Obtained by calling /api/auth/login. Short-lived access tokens suitable for interactive sessions.
  • API Keys Requires Professional+ — Long-lived keys for automation and CI/CD. Generated from your account dashboard under Account > API Keys.

Both methods use the Authorization header:

Authorization: Bearer <your-token-or-api-key>

Content Type

All requests with a body must include:

Content-Type: application/json

Authentication

JWT Token Flow

Authenticate by posting credentials to /api/auth/login. The response includes a JWT access token you can use on subsequent requests.

# 1. Get a token
curl -X POST https://api.data-sync.co.uk/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@example.com",
    "password": "your-password"
  }'

# 2. Use the token
curl https://api.data-sync.co.uk/api/backupjob \
  -H "Authorization: Bearer <token-from-step-1>"

API Key Authentication Requires Professional+

API keys do not expire and are ideal for scripts and integrations. Create them in the DataSync dashboard under Account > API Keys.

curl https://api.data-sync.co.uk/api/backupjob \
  -H "Authorization: Bearer ds_live_abc123..."

Security: Never expose API keys in client-side code or public repositories. Rotate keys immediately if compromised.

Rate Limits

API requests are rate-limited per subscriber to ensure fair usage:

PlanLimit
Free60 requests / minute
Starter120 requests / minute
Professional300 requests / minute
Ultimate600 requests / minute

When rate-limited, the API responds with 429 Too Many Requests. Use the Retry-After header to determine when to retry.

Response Format

All responses are JSON. Successful responses return the data directly. Error responses include an error field.

Success Response

{
  "backupJobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Nightly Full Backup",
  "isEnabled": true
}

Error Response

{
  "error": "Backup job not found."
}

Standard Status Codes

CodeMeaning
200OK — Request succeeded
201Created — Resource created
400Bad Request — Invalid input
401Unauthorized — Missing or invalid token
403Forbidden — Insufficient permissions or plan limit
404Not Found — Resource does not exist
429Too Many Requests — Rate limit exceeded
500Server Error — Unexpected failure

Auth

POST /api/auth/login Authenticate and receive a JWT

Authenticate with email and password to receive a JWT access token.

Public

Request Body

{
  "email": "you@example.com",
  "password": "your-password"
}

Response 200

{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "expiry": "2026-03-27T10:00:00Z"
}

Status Codes

200Login successful, token returned
400Invalid email or password
401Credentials incorrect or email not confirmed
POST /api/auth/register Create a new account

Register a new user account and subscriber. A confirmation email will be sent.

Public

Request Body

{
  "forename": "Jane",
  "email": "jane@example.com",
  "password": "SecureP@ss123",
  "organisationName": "Acme Corp"
}

Response 200

{
  "message": "Registration successful. Please check your email to confirm your account."
}

Status Codes

200Account created, confirmation email sent
400Validation error (email taken, weak password, etc.)
POST /api/auth/resetpassword Request a password reset

Sends a password reset link to the registered email address.

Public

Request Body

{
  "email": "you@example.com"
}

Response 200

{
  "message": "If that email exists, a reset link has been sent."
}

Status Codes

200Always returns 200 (prevents email enumeration)

Agents

Agents are lightweight services installed on your servers that perform backups. They connect to DataSync via SignalR and are managed through these endpoints.

GET /api/agent List all agents

Returns all agents registered under your subscriber account, including their connection status and metadata.

Auth Required

Response 200

[
  {
    "agentId": "d290f1ee-6c54-4b01-90e6-d701748f0851",
    "hostname": "PROD-SQL-01",
    "displayName": "Production SQL Server",
    "version": "1.4.2",
    "isOnline": true,
    "lastSeenUtc": "2026-03-26T14:30:00Z",
    "operatingSystem": "Windows Server 2022"
  }
]

Status Codes

200Agent list returned
401Not authenticated
GET /api/agent/{agentId} Get agent details

Returns detailed information about a specific agent, including discovered engines and databases.

Auth Required

Response 200

{
  "agentId": "d290f1ee-6c54-4b01-90e6-d701748f0851",
  "hostname": "PROD-SQL-01",
  "displayName": "Production SQL Server",
  "version": "1.4.2",
  "isOnline": true,
  "lastSeenUtc": "2026-03-26T14:30:00Z",
  "engines": [
    {
      "engineId": "b1c2d3e4-...",
      "dbmsType": "MicrosoftSql",
      "version": "16.0.4175.1"
    }
  ]
}

Status Codes

200Agent details returned
404Agent not found
DELETE /api/agent/{agentId} Delete an agent

Permanently removes an agent and all its associated engines. Backup jobs referencing this agent will be orphaned.

Auth Required

Response 200

{
  "message": "Agent deleted."
}

Status Codes

200Agent deleted
404Agent not found

Backup Jobs

Backup jobs define what to back up, where to store it, and when to run. Each job targets one or more databases and destinations via an agent.

GET /api/backupjob List all backup jobs

Returns all backup jobs for your subscriber, including schedules, latest status, and associated agent.

Auth Required

Response 200

[
  {
    "backupJobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "Nightly Full Backup",
    "isEnabled": true,
    "agentId": "d290f1ee-...",
    "schedules": [
      { "backupMode": "Full", "cronExpression": "0 2 * * *" }
    ],
    "lastStatus": "Success",
    "lastRunUtc": "2026-03-26T02:00:00Z"
  }
]

Status Codes

200Job list returned
401Not authenticated
GET /api/backupjob/{id} Get backup job details

Returns full details of a backup job including databases, destinations, schedules, encryption, and retention settings.

Auth Required

Response 200

{
  "backupJobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Nightly Full Backup",
  "isEnabled": true,
  "agentId": "d290f1ee-...",
  "databases": [ "..." ],
  "destinations": [ "..." ],
  "schedules": [
    { "backupMode": "Full", "cronExpression": "0 2 * * *" }
  ],
  "retentionDays": 30,
  "encryption": {
    "enabled": true,
    "algorithm": "AES-256"
  }
}

Status Codes

200Job details returned
404Job not found
POST /api/backupjob Create a backup job

Creates a new backup job. The agent must be online for the job to be synced.

Auth Required

Request Body

{
  "name": "Nightly Full Backup",
  "agentId": "d290f1ee-6c54-4b01-90e6-d701748f0851",
  "databaseIds": ["..."],
  "destinationIds": ["..."],
  "schedules": [
    {
      "backupMode": "Full",
      "cronExpression": "0 2 * * *"
    }
  ],
  "retentionDays": 30,
  "encryption": {
    "enabled": true,
    "passphrase": "your-encryption-passphrase"
  }
}

Response 200

{
  "backupJobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Nightly Full Backup",
  "isEnabled": true
}

Status Codes

200Job created and synced to agent
400Validation error
403Plan limit exceeded
PUT /api/backupjob/{id} Update a backup job

Updates an existing backup job. Changes are synced to the agent immediately if it is online.

Auth Required

Request Body

{
  "name": "Updated Job Name",
  "schedules": [
    {
      "backupMode": "Full",
      "cronExpression": "0 3 * * *"
    },
    {
      "backupMode": "Differential",
      "cronExpression": "0 */6 * * *"
    }
  ],
  "retentionDays": 60
}

Status Codes

200Job updated
400Validation error
404Job not found
DELETE /api/backupjob/{id} Delete a backup job

Permanently deletes a backup job. The agent is notified to remove it from its schedule. Associated backup history is retained.

Auth Required

Response 200

{
  "message": "Backup job deleted."
}

Status Codes

200Job deleted
404Job not found
POST /api/backupjob/{id}/run Trigger an on-demand backup

Triggers an immediate backup run for the specified job. The agent must be online. The backup runs asynchronously; monitor progress via the backup history endpoint.

Auth Required

Request Body (optional)

{
  "backupMode": "Full"
}

Response 200

{
  "message": "Backup triggered."
}

Status Codes

200Backup triggered on agent
400Agent is offline or job is disabled
404Job not found

Databases

Databases are discovered automatically by agents from connected database engines. Use these endpoints to list discovered databases.

GET /api/database List all databases

Returns all databases discovered across all agents and engines.

Auth Required

Response 200

[
  {
    "databaseId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "name": "AdventureWorks",
    "dbmsType": "MicrosoftSql",
    "engineId": "b1c2d3e4-...",
    "agentId": "d290f1ee-..."
  }
]

Status Codes

200Database list returned
401Not authenticated

Destinations

Destinations are storage targets for backup files: local directories, S3, Azure Blob, SFTP, Google Cloud, and more.

GET /api/destination List all destinations

Returns all backup destinations configured for your subscriber.

Auth Required

Response 200

[
  {
    "destinationId": "c1d2e3f4-...",
    "name": "AWS S3 Production",
    "type": "S3Storage",
    "agentId": "d290f1ee-..."
  }
]

Status Codes

200Destination list returned
401Not authenticated

Backup Files

Backup files represent completed backup artifacts stored at destinations. Query them to audit your backup inventory.

GET /api/backupfile List backup files

Returns all backup files recorded for your subscriber, with file size, checksum, and creation date.

Auth Required

Response 200

[
  {
    "backupFileId": "e1f2a3b4-...",
    "backupJobId": "a1b2c3d4-...",
    "fileName": "AdventureWorks_Full_20260326_020000.bak",
    "fileSize": 1073741824,
    "checksum": "sha256:ab12cd34...",
    "dateCreated": "2026-03-26T02:01:30Z"
  }
]

Status Codes

200File list returned
401Not authenticated

Credentials

Credentials are encrypted references used by agents to connect to database engines and storage destinations.

GET /api/credential List credentials

Returns all credential references. Sensitive fields (passwords, keys) are never returned in plaintext.

Auth Required

Response 200

[
  {
    "credentialReferenceId": "f1e2d3c4-...",
    "name": "SQL Server SA",
    "type": "BasicCredential",
    "agentId": "d290f1ee-..."
  }
]

Status Codes

200Credential list returned
401Not authenticated
POST /api/credential Create a credential

Creates a new encrypted credential reference. The agent is notified to store it securely.

Auth Required

Request Body

{
  "name": "S3 Access Key",
  "agentId": "d290f1ee-...",
  "credential": {
    "$type": "S3Credential",
    "accessKeyId": "AKIA...",
    "secretAccessKey": "wJal...",
    "region": "eu-west-2"
  }
}

Status Codes

200Credential created
400Validation error

Logs

Query structured log messages from agents and the platform. Useful for diagnostics and audit trails.

GET /api/log Query logs

Returns paginated log messages. Supports filtering by severity, date range, and agent.

Auth Required

Query Parameters

ParameterTypeDescription
severitystringFilter by severity: Information, Warning, Error, Critical
fromdatetimeStart date (ISO 8601)
todatetimeEnd date (ISO 8601)
pageintPage number (default: 1)
pageSizeintItems per page (default: 50, max: 200)

Response 200

[
  {
    "logMessageId": "...",
    "severity": "Error",
    "message": "Backup failed: disk space insufficient",
    "timestamp": "2026-03-26T02:15:00Z",
    "agentId": "d290f1ee-..."
  }
]

Status Codes

200Log entries returned
401Not authenticated

Webhooks Requires Professional+

Configure webhook endpoints to receive real-time notifications for backup events: success, failure, anomaly detection, and more.

GET /api/webhooks List webhooks

Returns all webhook endpoints configured for your subscriber.

Auth Required

Response 200

[
  {
    "webhookId": "a1b2c3d4-...",
    "url": "https://hooks.example.com/datasync",
    "events": ["backup.success", "backup.failure"],
    "isEnabled": true,
    "createdAt": "2026-03-20T10:00:00Z"
  }
]

Status Codes

200Webhook list returned
401Not authenticated
POST /api/webhooks Create a webhook

Registers a new webhook endpoint. DataSync will POST JSON payloads to this URL when subscribed events occur.

Auth Required

Request Body

{
  "url": "https://hooks.example.com/datasync",
  "events": [
    "backup.success",
    "backup.failure",
    "backup.anomaly"
  ],
  "secret": "whsec_your-signing-secret"
}

Supported Events

backup.successFired when a backup completes successfully
backup.failureFired when a backup fails
backup.anomalyFired when an anomaly is detected (size, duration, missing)
agent.connectedFired when an agent comes online
agent.disconnectedFired when an agent goes offline

Status Codes

200Webhook created
400Invalid URL or events
PUT /api/webhooks/{id} Update a webhook

Updates an existing webhook configuration.

Auth Required

Request Body

{
  "url": "https://hooks.example.com/datasync-v2",
  "events": ["backup.success", "backup.failure"],
  "isEnabled": true
}

Status Codes

200Webhook updated
404Webhook not found
DELETE /api/webhooks/{id} Delete a webhook

Permanently removes a webhook endpoint. No further events will be delivered.

Auth Required

Response 200

{
  "message": "Webhook deleted."
}

Status Codes

200Webhook deleted
404Webhook not found

Bug Reports

Submit bug reports and view known issues directly through the API.

POST /api/bug-reports Submit a bug report

Submits a new bug report. The report is triaged by the DataSync team and you will be notified of status changes via email.

Auth Required

Request Body

{
  "title": "Backup fails on databases with spaces in name",
  "description": "When a database name contains spaces, the agent throws a parsing error.",
  "category": "backup",
  "severity": "high"
}

Categories: backup, restore, agent, billing, ui, api, other

Severities: low, medium, high, critical

Status Codes

200Bug report submitted
400Validation error (missing title, invalid category, etc.)
GET /api/bug-reports/known-issues List known issues

Returns a list of acknowledged known issues that the DataSync team is working on. This endpoint is public and does not require authentication.

Public

Response 200

[
  {
    "id": 42,
    "title": "Differential backups fail on SQL Server 2014",
    "category": "backup",
    "severity": "high",
    "status": "in_progress",
    "createdAt": "2026-03-20T09:00:00Z"
  }
]

Status Codes

200Known issues returned

Ready to integrate?

Create a free account and start making API calls in minutes.

Get Started Free View Plans