Prerequisites
- A Heroku account with access to the apps, teams, and pipelines you want to investigate.
- The Heroku CLI installed, to create the API token.
Setup
1
Create an API token
Run this in the Heroku CLI, signed in as the account CloudThinker should use:Copy the value printed as
Token when the command prints it — it begins with HRKU-. The token is created with global scope and does not expire unless you set --expires-in <seconds>; use heroku authorizations:revoke <id> to invalidate it later.The Heroku Dashboard also exposes an account-level API Key under Account Settings, but Heroku revokes that key whenever your account password changes, so prefer the CLI authorization. If your account signs in through SSO, Heroku will not let it create a non-expiring token; Heroku’s own guidance is to keep a separate non-SSO user for integration tokens.2
Add the connection in CloudThinker
Navigate to Connections → Heroku and enter:
- API token: the token you just created
Connection details
Required permissions
Create the token from a Heroku account that belongs to only the teams CloudThinker should reach, then give that account the smallest app role that covers what you want the agent to do.Reading app logs requires Operate. A View-only account connects successfully and can list apps, but every log request fails.
global token scope. Heroku’s narrower scopes — read, write, read-protected, and write-protected — all exclude account information, and Heroku cannot resolve the token’s own account without it, so app and pipeline lookups fail. Create the token from a dedicated Heroku user rather than an account owner, keep that user out of teams the agent does not need, and rotate the token on your normal schedule.
Agent capabilities
Once connected, agents have read access to your Heroku apps, dynos, add-ons, teams, and pipelines.
Every Heroku operation that is not a read is approval-gated: CloudThinker states the effect and the exact inputs, then waits for your confirmation. Approving one change is not approval for the next one, or for the same change on a different app.
Verify the connection
Example prompts
Write access
Restarts and maintenance mode are reversible in one step: a restart replaces dynos with the same formation, and maintenance mode is a switch the paired action clears. Database operations are outside this connection entirely. No agent tool reads Heroku Postgres credentials, runs SQL against your databases, or reads config vars. If you need query access to a Heroku Postgres database, add a PostgreSQL connection with its own credentials.Troubleshooting
403 Forbidden on an app or team
403 Forbidden on an app or team
The token’s account is not a member of that app or team, or its app role is too low. Add the account to the team, or raise its app role to Operate for logs and dyno actions.
404 Couldn't find that user
404 Couldn't find that user
The token cannot read its own account, so Heroku cannot resolve which apps and pipelines it owns. This is what a narrow token scope looks like. Create a new authorization with the default
global scope and reconnect.404 for a named app or pipeline
404 for a named app or pipeline
The name is wrong, or the token’s account cannot see that resource. Ask the agent to list apps or pipelines first and use a name from that list.
429 Too Many Requests
429 Too Many Requests
Heroku allows 4,500 API requests per hour per account and refills the pool at roughly 75 per minute. Wait for the pool to refill, and scope requests to a single app so the agent makes fewer calls per run.
A change was requested but never ran
A change was requested but never ran
Writes need explicit approval in the same turn. Approve the action when prompted; a rejected call is final and the agent will not retry it.
No private spaces are listed
No private spaces are listed
Private Spaces are available only to verified Heroku Teams and to Heroku Enterprise. An account without them has none to list, so an empty result here is not a fault in the connection.
Security
- Least privilege — grant only the permissions the agents need for your use case; start read-only and widen later.
- Read-only by default — use read-only credentials unless you want agents to make changes through this connection.
- Rotate credentials — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
- Revoke on offboarding — remove the credential at the provider when you delete a connection or a teammate leaves.
- Use a dedicated account — a Heroku token inherits everything its user can reach and cannot be narrowed to specific apps, so choose the account carefully, pass
--expires-into plan rotation, and revoke withheroku authorizations:revoke <id>when you are done. - Treat logs as sensitive — an app can print secrets into its own log output, so log triage can surface values you did not intend to share.
Related
Vercel Connection
Similar setup for Vercel projects and deployments
PostgreSQL Connection
Query access to a Heroku Postgres database