At a glance
- Availability: Experimental (how to enable).
- Auth: API key.
- Connection: The key comes from
HEROKU_API_KEY. - Docs: https://devcenter.heroku.com/articles/platform-api-reference#authentication
Credentials
Set these per environment. See Connect an integration.| Variable | Required | Description |
|---|---|---|
HEROKU_API_KEY | Yes | Heroku API token (from ‘heroku authorizations:create’ or the Account page) Docs. |
Setup
- Sign in to Heroku: Go to https://dashboard.heroku.com and sign in (an Eco/Basic app is enough for testing; SSO-federated users must use a separate non-federated account for API tokens).
- Create an API token: With the Heroku CLI, run ‘heroku authorizations:create -d “veryfront token”’ for a non-expiring OAuth token, or ‘heroku auth:token’ for a token valid up to one year.
- Set the environment variable: Add the token to your .env as HEROKU_API_KEY=…
- Verify access: Run List Apps, then List Dynos with one of your app names.
- Every request must send ‘Accept: application/vnd.heroku+json; version=3’ - tools include this header by default
- Restarting dynos uses the DELETE method (DELETE /apps/{app}/dynos restarts all dynos; it does not delete the app)
- List endpoints paginate with Range/Next-Range headers (max 1000 items per page) and return 206 Partial Content when truncated
Tools
| Tool | Access | Description |
|---|---|---|
| List Apps | Read | List apps the authenticated user can access |
| Get App | Read | Get details of an app |
| List Dynos | Read | List the dynos of an app with their state |
| Restart Dyno | Write | Restart a specific dyno of an app |
| Restart All Dynos | Write | Restart every dyno of an app |
| Get Config Vars | Read | Get the config vars (environment variables) of an app |
| List Releases | Read | List the release history of an app |
Example prompts
- List the dynos of my Heroku app and tell me if any are crashed or not in the ‘up’ state.
- Show the latest releases of my Heroku app and who deployed them.