REST API Reference

219 endpoints covering every feature. Ideal for automation and integration.

Basics

Ginkgo Backup exposes a REST API at 127.0.0.1:9275. All responses are JSON, timestamps are Unix microseconds (int64), and list endpoints support limit/offset pagination. Pro-only endpoints are marked with (Pro).

Base URL

http://127.0.0.1:9275

Authentication

All /api/v1/ endpoints (except /health and /settings/ca-cert) require a Bearer token. The token is auto-generated on first start and saved to ~/.ginkgo-backup/config.json. Localhost connections may be auto-authenticated depending on config.

Header

Authorization: Bearer <token>

Rate Limiting

600 requests/minute. Recommended polling intervals: backup progress 500ms, watch status 3s, checkpoints 30s, mount status 5s.

Response Format

Successful responses return a JSON object or array directly. Error responses:

Error

{ "error": "description of the error", "code": "ERROR_CODE" }

Pagination

List endpoints support limit and offset parameters. Responses include:

Example

{ "items": [...], "total": 1000, "has_more": true }

Endpoints

Health Check

MethodPathDescription
GET/api/v1/healthServer health check (no auth)
GET/healthAlias for /api/v1/health

Authentication

MethodPathDescription
POST/api/v1/auth/loginLog in and obtain a session token
POST/api/v1/auth/logoutInvalidate current session
GET/api/v1/auth/statusCheck auth status (returns needs_setup if no password set)
POST/api/v1/auth/setup-passwordSet initial password (first-time setup)
GET/api/v1/auth/login-auditList login audit logs
POST/api/v1/auth/revoke-sessionsRevoke all other sessions
GET/api/v1/auth/totp/statusCheck TOTP 2FA status
POST/api/v1/auth/totp/setupBegin TOTP 2FA setup
POST/api/v1/auth/totp/confirmConfirm TOTP 2FA with verification code
POST/api/v1/auth/totp/disableDisable TOTP 2FA

System Status

MethodPathDescription
GET/api/v1/statusSystem status overview
GET/api/v1/index/healthIndex DB health check
GET/api/v1/index/dedupDeduplication statistics
GET/api/v1/index/statsIndex statistics
POST/api/v1/index/compactCompact the index DB
POST/api/v1/index/fix-first-seenFix first-seen timestamps
GET/api/v1/watch/statusFile watch service status

Backup Sources

MethodPathDescription
GET/api/v1/sourcesList all backup sources
POST/api/v1/sourcesCreate a backup source
GET/api/v1/sources/{id}Get source details
PUT/api/v1/sources/{id}Update source config
DELETE/api/v1/sources/{id}Delete a source

Backup Operations

MethodPathDescription
POST/api/v1/backup/runTrigger a backup
POST/api/v1/backup/preflightPre-flight check before backup (estimates size, checks disk)
GET/api/v1/backup/progressGet current backup progress
GET/api/v1/backup/stateGet backup state (idle/running/error)
POST/api/v1/backup/cancelCancel a running backup
GET/api/v1/backup/checkpointsList backup checkpoints
GET/api/v1/backup/checkpoints/{id}Get checkpoint details
GET/api/v1/backup/recover-sessionsList recoverable backup sessions

Snapshots

MethodPathDescription
GET/api/v1/snapshotsList snapshots (query: source_id)
GET/api/v1/snapshots/{id}Get snapshot details
GET/api/v1/snapshots/changesList file changes in a snapshot
GET/api/v1/snapshots/space-estimateEstimate space for a snapshot

File Browsing & History

MethodPathDescription
GET/api/v1/filesBrowse files in a snapshot (FTS5 search supported)
GET/api/v1/historyGet file version history
GET/api/v1/history/contentGet file content at a version
GET/api/v1/history/diffDiff two versions of a file
GET/api/v1/history/download-zipDownload multiple files as a zip
GET/api/v1/history/download-fileDownload a single file
POST/api/v1/history/restoreRestore a single file from a snapshot

Restore Tasks

MethodPathDescription
POST/api/v1/restoreStart a restore task (batch)
GET/api/v1/restore/tasksList restore tasks
GET/api/v1/restore/{id}Get restore task status

Repositories

MethodPathDescription
GET/api/v1/repositoriesList all repositories
POST/api/v1/repositoriesCreate a repository
GET/api/v1/repositories/{id}Get repository details
PUT/api/v1/repositories/{id}Update repository
DELETE/api/v1/repositories/{id}Delete a repository
GET/api/v1/repo/compression-statsGet compression statistics
POST/api/v1/repo/scanScan repository for existing data
POST/api/v1/repo/connectConnect to an existing repository
POST/api/v1/repo/sources-scanScan sources in a repository
POST/api/v1/repo/importImport data into a repository
POST/api/v1/repo/delete-source-dataDelete source data from a repository
GET/api/v1/repo/is-encryptedCheck if repository is encrypted
POST/api/v1/repo/unlockUnlock a locked repository

GBF Low-Level Operations

MethodPathDescription
POST/api/v1/gb/initInitialize a GBF repository
POST/api/v1/gb/backup/runTrigger a GBF backup
POST/api/v1/gb/restoreRestore from a GBF snapshot
POST/api/v1/gb/gcRun garbage collection on a GBF repo
GET/api/v1/gb/snapshotsList GBF snapshots
POST/api/v1/gb/formatFormat a GBF repository
POST/api/v1/gb/retentionApply retention to a GBF repo

Cloud Storage

MethodPathDescription
GET/api/v1/cloud/backendsList cloud backends
POST/api/v1/cloud/backendsCreate a cloud backend
GET/api/v1/cloud/backends/{id}Get backend details
PUT/api/v1/cloud/backends/{id}Update backend
DELETE/api/v1/cloud/backends/{id}Delete backend
POST/api/v1/cloud/backends/{id}/reauthRe-authorize a backend
POST/api/v1/cloud/backends/{id}/clear-cacheClear backend cache
POST/api/v1/cloud/testTest cloud connection
GET/api/v1/cloud/oauth2/startStart OAuth2 flow
GET/api/v1/cloud/oauth2/statusCheck OAuth2 status
GET/api/v1/cloud/oauth2/callbackOAuth2 callback (no auth)
POST/api/v1/cloud/oauth2/submit-codeSubmit OAuth2 auth code
GET/api/v1/cloud/sourcesDiscover cloud sources

Sync Jobs

MethodPathDescription
GET/api/v1/sync/jobsList sync jobs
GET/api/v1/pending-syncsList pending syncs

Retention & GC

MethodPathDescription
POST/api/v1/retention/applyApply retention policy
POST/api/v1/retention/gcRun garbage collection
GET/api/v1/retention/gc/statusGet GC status
GET/api/v1/retention/gc/directivesGet GC directives
POST/api/v1/retention/verifyVerify backup integrity
POST/api/v1/retention/cloud-gcRun cloud GC
GET/api/v1/retention/cloud-gc/statusGet cloud GC status
POST/api/v1/retention/cloud-maintenanceRun cloud maintenance
POST/api/v1/retention/delete-snapshotsDelete specific snapshots
POST/api/v1/retention/remove-source-manifestsRemove source manifests
POST/api/v1/retention/reset-safetyReset retention safety counter

Database Maintenance

MethodPathDescription
POST/api/v1/database/vacuumVacuum the main SQLite DB
POST/api/v1/database/integrity-checkRun SQLite integrity check
GET/api/v1/databasesList external databases
GET/api/v1/databases/check-toolCheck if DB backup tool is installed
POST/api/v1/databases/createRegister an external database
GET/api/v1/databases/{id}Get database details
POST/api/v1/databases/{id}/updateUpdate database config
POST/api/v1/databases/{id}/deleteDelete database record
POST/api/v1/databases/{id}/testTest database connection
POST/api/v1/databases/{id}/backupTrigger a database backup
GET/api/v1/databases/{id}/tasksList database backup tasks
GET/api/v1/maintenance/scheduler/statusGet maintenance scheduler status

Monitoring & Patrol

MethodPathDescription
GET/api/v1/oversight/healthSystem health overview
GET/api/v1/oversight/alertsList active alerts
GET/api/v1/oversight/alerts/{id}Get alert details
GET/api/v1/oversight/cleanup-logsList cleanup/GC logs
POST/api/v1/oversight/delete-auditDelete audit log entries
GET/api/v1/oversight/delete-audit/statsGet delete audit stats
POST/api/v1/oversight/patrolRun patrol check
GET/api/v1/oversight/patrol/historyGet patrol history
POST/api/v1/oversight/verifyRun verification
POST/api/v1/oversight/repairRun repair operation

Cross-Repository Protection (Anti-Ransomware)

MethodPathDescription
POST/api/v1/cross-repo/backupCross-repo config backup
GET/api/v1/cross-repo/alertsList cross-repo alerts
POST/api/v1/cross-repo/alerts/clearClear cross-repo alerts
POST/api/v1/cross-repo/recoverCross-repo recovery
POST/api/v1/cross-repo/replicateCross-repo replication
POST/api/v1/cross-repo/classify-pathClassify a file path
POST/api/v1/cross-repo/vault-snapshotCreate vault snapshot
POST/api/v1/cross-repo/config-snapshotCreate config snapshot
POST/api/v1/cross-repo/config-restoreRestore from config snapshot
POST/api/v1/cross-repo/verify-alertsVerify cross-repo alerts
POST/api/v1/cross-repo/ransomware-lockEnable ransomware lock

Settings

MethodPathDescription
GET/api/v1/settingsGet app settings
PUT/api/v1/settingsUpdate app settings
GET/api/v1/settings/api-infoGet API info (version, port, TLS)
GET/api/v1/settings/cli-statusCheck CLI installation status
POST/api/v1/settings/install-cliInstall CLI to user PATH
POST/api/v1/settings/uninstall-cliUninstall CLI from PATH
GET/api/v1/settings/ca-certDownload CA certificate (public, no auth)
GET/api/v1/settings/ca-trust-statusCheck CA trust status
POST/api/v1/settings/trust-caInstall CA into trust store
GET/api/v1/settings/tls-sansList TLS SANs
POST/api/v1/settings/restartRestart the server
POST/api/v1/settings/regenerate-tokenRegenerate API token
PUT/api/v1/settings/webui-passwordChange WebUI password

Config Vault

MethodPathDescription
GET/api/v1/config-vault/targetsList vault targets
POST/api/v1/config-vault/targetsCreate vault target
GET/api/v1/config-vault/targets/{id}Get vault target
PUT/api/v1/config-vault/targets/{id}Update vault target
DELETE/api/v1/config-vault/targets/{id}Delete vault target
POST/api/v1/config-vault/backupRun config vault backup
GET/api/v1/config-vault/healthGet vault health

Encryption Keys

MethodPathDescription
POST/api/v1/keys/exportExport encryption key
POST/api/v1/keys/importImport encryption key

Disaster Recovery

MethodPathDescription
POST/api/v1/recovery/startStart disaster recovery
POST/api/v1/recovery/cancelCancel recovery
GET/api/v1/recovery/progressGet recovery progress
POST/api/v1/recovery-code/exportExport recovery code
POST/api/v1/recovery-code/importImport recovery code

AI Integration

MethodPathDescription
POST/api/v1/integrations/ai/syncSync AI tool rule files into a project
GET/api/v1/integrations/ai/statusGet AI integration status
GET/api/v1/integrations/ai/diagnosticsGet AI diagnostics context
GET/api/v1/integrations/ai/skill-templatesGet AI skill template presets
POST/api/v1/ai/generate-noteGenerate AI snapshot note
POST/api/v1/ai/diagnoseRun AI diagnosis (Pro)
POST/api/v1/ai/repairRun AI-guided repair (Pro)
POST/api/v1/ai/skillInvoke an AI skill (Pro)

Pins & Notes

MethodPathDescription
GET/api/v1/pinsList pinned snapshots
POST/api/v1/pins/createPin a snapshot (protect from GC)
POST/api/v1/pins/deleteUnpin a snapshot
GET/api/v1/notesList snapshot notes
POST/api/v1/notes/cleanup-orphanedClean up orphaned notes
POST/api/v1/notes/syncSync notes to cloud

Sessions & Logs

MethodPathDescription
GET/api/v1/sessionsList backup sessions
GET/api/v1/sessions/{id}Get session details
GET/api/v1/sessions/statsGet session statistics
GET/api/v1/logsList operation logs
GET/api/v1/logs/statsGet log statistics
GET/api/v1/logs/rawGet raw log entries

Staging

MethodPathDescription
POST/api/v1/staging/pushPush files to staging area (general, preserves note_source)
POST/api/v1/staging/push-aiPush files marked AI-generated (forces note_source=ai)
GET/api/v1/staging/sessionGet current staging session

Mount & WebDAV

MethodPathDescription
POST/api/v1/mount/{source_id}Mount a snapshot as a filesystem
GET/api/v1/webdav/sessionGet WebDAV session info
*/webdav/WebDAV file access (all methods)

Filesystem Operations

MethodPathDescription
GET/api/v1/fs/browseBrowse local filesystem
POST/api/v1/fs/mkdirCreate directory

Notifications

MethodPathDescription
GET/api/v1/notify/configGet notification config
POST/api/v1/notify/test-emailSend a test email
POST/api/v1/notify/test-webhookSend a test webhook

Bug Reports

MethodPathDescription
GET/api/v1/bug-reportsList bug reports
GET/api/v1/bug-reports/{id}Get bug report details

License

MethodPathDescription
GET/api/v1/license/infoGet license info
POST/api/v1/license/activateActivate a license key
POST/api/v1/license/deactivateDeactivate the license
POST/api/v1/license/handshakeVerify license with server

Peer / Mesh Backup

MethodPathDescription
POST/peer/pairPair a peer device (invitation code, no auth)
GET/peer/pingPeer ping (peer token auth)
GET/peer/reposList peer receive repos (peer token)
POST/peer/sync/{...}Begin/commit/fail a sync session (peer token)
POST/peer/blob/{...}Upload blob to peer repo (peer token)
GET/peer/listList blobs on peer (peer token)
GET/api/v1/peersList paired peers (WebUI)
POST/api/v1/peers/inviteGenerate a peer invitation
POST/api/v1/peers/pairInitiate pairing from local side
GET/api/v1/peers/{id}Get peer details
GET/api/v1/peer/discoverDiscover peers on LAN
GET/api/v1/peer-reposList local receive repos
GET/api/v1/peer-repos/{id}Get receive repo details

Plugins (Pro)

MethodPathDescription
GET/api/v1/pluginsList plugins (Pro)
POST/api/v1/plugins/detectDetect installed plugins (Pro)
POST/api/v1/plugins/create-sourceCreate a backup source from a plugin (Pro)
POST/api/v1/plugins/enableEnable a plugin (Pro)
POST/api/v1/plugins/disableDisable a plugin (Pro)
POST/api/v1/plugins/configConfigure a plugin (Pro)
GET/api/v1/plugins/dependenciesList plugin dependencies (Pro)
POST/api/v1/plugins/reloadReload plugins (Pro)
POST/api/v1/plugins/restoreRestore from a plugin snapshot (Pro)
GET/api/v1/plugins/snapshotsList plugin snapshots (Pro)

Notion Integration (Pro)

MethodPathDescription
GET/POST/api/v1/notion/configGet/set Notion config (Pro)
GET/api/v1/notion/accountsList Notion accounts
POST/api/v1/notion/syncTrigger Notion sync (Pro)
POST/api/v1/notion/testTest Notion connection (Pro)
POST/api/v1/notion/auto-setupAuto-setup Notion integration (Pro)
POST/api/v1/notion/deleteDelete a Notion account (Pro)
POST/api/v1/notion/re-renderRe-render Notion content (Pro)
GET/api/v1/notion/pagesList Notion pages (Pro)
GET/api/v1/notion/page/{id}Get Notion page content (Pro)
GET/api/v1/notion/page-versionsList page versions (Pro)
POST/api/v1/notion/exportExport Notion pages (Pro)
GET/api/v1/notion/snapshotsList Notion snapshots (Pro)
GET/api/v1/notion/attachmentGet Notion attachment (Pro)
POST/api/v1/notion/mountMount Notion workspace (Pro)
POST/api/v1/notion/unmountUnmount Notion workspace (Pro)
GET/api/v1/notion/mount-listList Notion mounts (Pro)

Team (Pro)

MethodPathDescription
POST/api/v1/team/inviteCreate team invitation (Pro)
POST/api/v1/team/joinJoin a team (Pro)
GET/api/v1/team/invite-infoGet invitation info (Pro)

Example: Create a source and trigger a backup

curl

curl -X POST http://127.0.0.1:9275/api/v1/sources \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "path": "/home/user/documents", "name": "My Documents", "schedule": "daily", "schedule_config": "{\"hour\":2,\"minute\":30}", "retention": "smart", "excludes": ["*.tmp", "node_modules"], "compression_type": "zstd", "repo_paths": ["/backup/repo1"] }' # Trigger a backup curl -X POST http://127.0.0.1:9275/api/v1/backup/run \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{"source_id": 1}' # Poll progress curl http://127.0.0.1:9275/api/v1/backup/progress \ -H "Authorization: Bearer $TOKEN"

See Also