Skip to content

API Documentation

Dokku Pro exposes all of it's functionality behind a restful API using the json-api specification. See the swagger documentation for more information on exposed endpoints.

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:

jwt_token="$(cat token.json | jq -r '.data.id')"

curl -H 'Authorization: Bearer ${jwt_token}' \
     -H "Content-Type: application/json" \
     "https://admin.dokku.me/@api/apps"