Overview
Drive Quasar from a script or a CI pipeline.
On this page
The API is served by the dashboard, at https://admin.your-domain.com/api/v1/. It sends and returns JSON.
Create a token in Settings → API tokens. Give it a name (such as github-actions) and a role:
| Role | Can |
|---|---|
| viewer | List and inspect applications, read server usage. |
| admin | Also deploy and restart applications. |
- The token is shown once. Only its hash is stored, so a lost token can’t be recovered: revoke it and create another.
- No token can read environment variables or compose files.
- Every call that changes something is recorded in the audit log, under the token’s name.
Send the token in the Authorization header:
curl -H "Authorization: Bearer qsr_…" https://admin.your-domain.com/api/v1/appsErrors return a JSON body with a message:
{ "error": "invalid token" }| Status | Meaning |
|---|---|
401 |
The token is missing or invalid. |
403 |
The call needs an admin token, and this one is a viewer token. |
404 |
No application has this identifier. |
409 |
A deployment of this application is already running. |
| Method | Path | Role | |
|---|---|---|---|
GET |
/api/v1/apps |
viewer | List applications |
GET |
/api/v1/apps/{id} |
viewer | Get an application |
POST |
/api/v1/apps/{id}/deploy |
admin | Deploy an application |
POST |
/api/v1/apps/{id}/restart |
admin | Restart an application |
GET |
/api/v1/system |
viewer | Get server usage |
POST |
/hooks/{id}/{secret} |
none | Deploy webhook |
Both can deploy an application on push.
| Deploy webhook | API token | |
|---|---|---|
| Setup | Paste one URL in GitHub or GitLab. | Store a token as a CI secret. |
| Scope | One application. | Every application. |
| Can also | Nothing else. | List apps, restart, read usage. |
| Best for | Deploying on every push. | Deploying at the end of a CI pipeline, after tests. |
Deploy after the tests pass, with an admin token stored as the QUASAR_TOKEN secret, and the application’s identifier as the QUASAR_APP_ID variable:
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- run: |
curl -fsS -X POST \
-H "Authorization: Bearer ${{ secrets.QUASAR_TOKEN }}" \
https://admin.your-domain.com/api/v1/apps/${{ vars.QUASAR_APP_ID }}/deployFind the application’s identifier with List applications, or in the address of its page in the dashboard.