API Reference

# Public API: S3 object storage, database backup, and restore

Everything you can do in the dashboard can be done through the REST API with a per-user API token. The OpenAPI 3.1 specification below is generated from the same code as the server, so it always matches the running version.

-   [openapi.json](/api/v1/openapi.json)
-   [openapi.yaml](/api/v1/openapi.yaml)
-   [MCP server](/en/docs/mcp)
-   [Create an API token](/app/settings)

Last updated: October 21, 2026

Quick start

## Four steps from token to restore

Base URL: `https://linuxteknosia.cloud/api/v1`. Responses are always JSON; errors look like `{ "error": "…" }`. Commands to the agent (backup, restore, connection test) return 202 with a `command_id` that can be monitored.

-   Tokens are scoped to their owner's organization and can be revoked at any time from the dashboard.
-   API tokens cannot create or revoke other tokens.
-   The S3 endpoint (`storage.linuxteknosia.cloud`) uses the standard S3 protocol with access keys from this API.

1.  ### 1\. Create an API token
    
    Dashboard → Settings → MCP server & API tokens → Create token. The token value (lt\_…) is shown only once. All /app endpoints accept the Authorization: Bearer header.
    
    ```
    export LT_TOKEN="lt_..."
    curl https://linuxteknosia.cloud/api/v1/app/overview \
      -H "Authorization: Bearer $LT_TOKEN"
    ```
    
2.  ### 2\. Object storage: create a bucket and access key
    
    Buckets are automatically prefixed with your account and limited by a hard quota. S3 access keys can be restricted to a single bucket and given an expiry; secret\_key is returned only once.
    
    ```
    curl -X POST https://linuxteknosia.cloud/api/v1/app/storage/buckets \
      -H "Authorization: Bearer $LT_TOKEN" -H "Content-Type: application/json" \
      -d '{"name":"aset-web","quota_gb":5}'
    
    curl -X POST https://linuxteknosia.cloud/api/v1/app/storage/keys \
      -H "Authorization: Bearer $LT_TOKEN" -H "Content-Type: application/json" \
      -d '{"name":"ci-deploy","bucket":"aset-web","expires_days":90}'
    ```
    
3.  ### 3\. Database backup: create and run a job
    
    Once the agent is installed (POST /app/servers/enroll) and a connection is added, create a job with a cron schedule. Running a backup is asynchronous and returns a command\_id.
    
    ```
    curl -X POST https://linuxteknosia.cloud/api/v1/app/jobs \
      -H "Authorization: Bearer $LT_TOKEN" -H "Content-Type: application/json" \
      -d '{"server_id":"<uuid>","connection_id":"<uuid>","name":"produksi harian","schedule_cron":"0 2 * * *","timezone":"Asia/Jakarta","backup_type":"incremental","encrypt":true,"retention_days":30}'
    
    curl -X POST https://linuxteknosia.cloud/api/v1/app/jobs/<job_id>/run \
      -H "Authorization: Bearer $LT_TOKEN"
    ```
    
4.  ### 4\. Restore and monitor commands
    
    Pick a run from the history, send a restore to the target connection, then poll /app/commands/{id} until the status is acked. Restore overwrites data in the target database.
    
    ```
    curl -X POST https://linuxteknosia.cloud/api/v1/app/runs/<run_id>/restore \
      -H "Authorization: Bearer $LT_TOKEN" -H "Content-Type: application/json" \
      -d '{"connection_id":"<uuid>","database":"app_staging"}'
    
    curl https://linuxteknosia.cloud/api/v1/app/commands/<command_id> \
      -H "Authorization: Bearer $LT_TOKEN"
    ```
    

Full reference

## All endpoints, schemas, and request examples

Pick an endpoint in the left panel. Every operation includes request and response schemas plus examples in curl, JavaScript, Python, Go, and PHP. Enter your API token in the authentication section to try it directly from the browser.