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/servicescurl -X POST -H "Authorization: Bearer $KASTARO_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action":"redeploy"}' \
https://api.kastaro.com/api/v1/services/SERVICE_ID/actions3. What you can do
| Request | What it does | Token access |
|---|---|---|
GET /services | List 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=200 | The latest log lines. | Read only |
POST /services/{id}/actions | Start, stop, restart or redeploy. Body: {"action":"restart"}. | Read and change |
PUT /services/{id}/env | Add, change or delete environment variables. A running service restarts to use them. | Read and change |
POST /services/{id}/console | Send a line to your app’s input. Body: {"command":"..."}. | Read and change |
POST /services/{id}/shell | Run a shell command in the service and get its output. Body: {"command":"ls"}. | Read and change |
GET /workspaces | The workspaces you belong to. | Read only |
GET /regions | Locations 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.