Get an API token, then send it in the Authorization header of every request to https://wokku.cloud/api/v1.
Create a token
- Open Profile in the dashboard.
- Under API Tokens, enter a name and create the token.
- Copy it now — it is shown only once.
wokku tokens:create ci
The token is printed once. Copy it now.
With an existing token:
curl -X POST https://wokku.cloud/api/v1/auth/tokens \
-H "Authorization: Bearer $WOKKU_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "ci"}'
{"id": "…", "token": "…", "name": "ci"}
Add "expires_at" (an ISO 8601 time) to make the token expire.
“Create a Wokku API token called ci”
Use the token
curl https://wokku.cloud/api/v1/apps \
-H "Authorization: Bearer $WOKKU_API_TOKEN"
Check who a token belongs to:
curl https://wokku.cloud/api/v1/auth/whoami \
-H "Authorization: Bearer $WOKKU_API_TOKEN"
A token can do whatever its user can do, in every team the user belongs to.
Sign in a tool through the browser (device flow)
If you are building a tool that runs on someone’s machine, let them approve it in the browser instead of pasting a token. This is how wokku auth:login works.
- Request a code:
The response has a
curl -X POST https://wokku.cloud/api/v1/auth/device/codedevice_code, auser_code, averification_uri_completelink,expires_inandinterval(seconds). - Show the user the link and code. They open it, sign in and approve.
- Poll every
intervalseconds:While waiting you getcurl -X POST https://wokku.cloud/api/v1/auth/device/token \ -H "Content-Type: application/json" \ -d '{"device_code": "…"}'{"error": "authorization_pending"}. Once approved you get{"token": "…", "user": {…}}— this is the only time the token is returned.slow_downmeans poll less often;access_deniedorexpired_tokenmeans start again.
Revoke a token
Profile → API Tokens, then revoke the token.
wokku tokens # find the ID
wokku tokens:revoke TOKEN_ID
curl -X DELETE https://wokku.cloud/api/v1/auth/tokens/TOKEN_ID \
-H "Authorization: Bearer $WOKKU_API_TOKEN"
“Revoke my Wokku API token called ci”
Anything using a revoked token stops working immediately.
Errors and limits
Failed requests return JSON in one shape:
{"error": "Invalid or expired token", "error_code": "invalid_token", "hint": "…", "retryable": false}
Requests are limited to 60 per minute per IP address.
Next
- Endpoints
- Full reference:
/api/v1/openapi.yaml