Skip to content

REST API basics

Everything the dashboard does goes through the REST API, and your programs can use the same API.

  • Base address: https://dashboard.sbx09.online/api
  • Send an API key with every call: Authorization: Bearer wsla_key_...
  • Bodies and answers are JSON.
Terminal window
export WSLA_KEY="wsla_key_..."
curl -H "Authorization: Bearer $WSLA_KEY" https://dashboard.sbx09.online/api/orgs

GET /api/health needs no key and answers with the platform’s version.

Almost every address starts with /api/orgs/{org_id}/. GET /api/orgs lists the organizations the key can reach, each with its id.

What Call
List servers GET /api/orgs/{org_id}/servers
List projects GET /api/orgs/{org_id}/projects
List environments GET /api/orgs/{org_id}/environments
One environment GET /api/orgs/{org_id}/environments/{environment_id}
Deploy POST /api/orgs/{org_id}/environments/{environment_id}/deploy
Back up POST /api/orgs/{org_id}/environments/{environment_id}/backups
List backups GET /api/orgs/{org_id}/backups
List tasks GET /api/orgs/{org_id}/tasks
Monitoring GET /api/orgs/{org_id}/monitoring
Alerts GET /api/orgs/{org_id}/alerts

A deploy, a backup, a restore or a clone answers at once with status 202 and a task. Follow it:

Terminal window
# start a deploy
curl -X POST -H "Authorization: Bearer $WSLA_KEY" -H "Content-Type: application/json" -d '{}' \
https://dashboard.sbx09.online/api/orgs/$ORG/environments/$ENV/deploy
# the task's status, then its log
curl -H "Authorization: Bearer $WSLA_KEY" https://dashboard.sbx09.online/api/tasks/$TASK
curl -H "Authorization: Bearer $WSLA_KEY" https://dashboard.sbx09.online/api/tasks/$TASK/log

To update modules during the deploy, send {"update_modules": "sale,stock"} (or "all").

POST /api/tasks/{task_id}/cancel cancels a task that is still waiting or running.

Nothing is deleted by one call. First ask for a preview, which lists what would be removed and returns a confirm_token; then send the token:

Terminal window
curl -X POST -H "Authorization: Bearer $WSLA_KEY" \
https://dashboard.sbx09.online/api/orgs/$ORG/environments/$ENV/delete-preview
curl -X POST -H "Authorization: Bearer $WSLA_KEY" -H "Content-Type: application/json" \
-d '{"confirm_token": "..."}' \
https://dashboard.sbx09.online/api/orgs/$ORG/environments/$ENV/delete

Projects and backups are deleted the same way; a restore uses restore-preview and restore.

A refused call answers with an HTTP error status and a body of this shape:

{ "error": "not_found", "message": "No such environment." }

message is a sentence for a person; error is a short code for your program.

A read-only key gets every GET; anything that changes something is refused. A key for one project reaches only that project, its environments, their backups and tasks. Every call, allowed or refused, is written to the audit log.