API Documentation
Dokku Pro exposes all of it's functionality behind a restful API using the json-api specification. The OpenAPI spec is exposed via swagger integration for ease of development.
A copy of the OpenAPI specification is available here.
Authentication
Dokku uses Token-based Authentication to exchange user credentials for an expiring JWT token. The JWT token can then be used to access any internal Dokku api endpoints.
The following is an example of authenticating via curl:
username="root"
password="root-token"
curl --silent \
-u "${username}:${password}" \
-H "Content-Type: application/json" \
-d '{"data": {"type": "tokens"}}' \
--output token.json \
"https://admin.dokku.me/@api/tokens"
# the jwt token is in the response
cat token.json | jq -r '.data.id'
The JWT token is then used for Bearer authentication to other API endpoints: