Kastaro API

Manage your bots, sites, workers and databases from your own scripts, CI pipelines and tools.

1. Make a token

Sign in and open API tokens in the dashboard. Choose read only, or read and change, and an expiry date. Copy the token when it appears: it is shown once.

2. Call the API

Send the token in the Authorization header. Keep it in an environment variable or your CI secrets, never in your code.

curl -H "Authorization: Bearer $KASTARO_TOKEN" \
  https://api.kastaro.com/api/v1/services
curl -X POST -H "Authorization: Bearer $KASTARO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action":"redeploy"}' \
  https://api.kastaro.com/api/v1/services/SERVICE_ID/actions

3. What you can do

RequestWhat it doesToken access
GET /servicesList your services, with status and usage.Read only
GET /services/{id}One service, with its environment variables (secret values are never returned).Read only
GET /services/{id}/logs?tail=200The latest log lines.Read only
POST /services/{id}/actionsStart, stop, restart or redeploy. Body: {"action":"restart"}.Read and change
PUT /services/{id}/envAdd, change or delete environment variables. A running service restarts to use them.Read and change
POST /services/{id}/consoleSend a line to your app’s input. Body: {"command":"..."}.Read and change
POST /services/{id}/shellRun a shell command in the service and get its output. Body: {"command":"ls"}.Read and change
GET /workspacesThe workspaces you belong to.Read only
GET /regionsLocations and whether they take new services.Read only

Limits and safety

  • Tokens reach services, workspaces and locations only. They cannot change your account, sign-in, billing or other tokens.
  • A token acts as you, with your workspace roles. Revoke it in Account settings the moment you think it has leaked.
  • Requests are rate limited. Answers are JSON, and errors have an error code and a message.
  • Deploy hooks (under a service’s Deploys tab) are the simplest way to redeploy from GitHub Actions without a token.