Prerequisites
- A Heroku account with access to the apps, teams, and pipelines you want to investigate.
- An API token created from that account.
- The Heroku CLI installed, if you use the recommended token path.
There is no way to scope a Heroku token to a subset of apps. Least privilege comes from the account you create the token with, not from the token itself — see Required permissions.
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. 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.2
Add the connection in CloudThinker
Navigate to Connections → Heroku and enter:
- API token: the token you just created
The Heroku Dashboard also exposes an account-level API Key under Account Settings. Heroku revokes that key whenever your account password changes, so it is a poor fit for a long-lived connection. Prefer the CLI authorization above.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.
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.
Use the
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. See Troubleshooting.
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 before running it. Approving one change is not approval for the next one, or for the same change on a different app.
Verify the connection
Example prompts
For accounts with many apps, name the app or the pipeline in your prompt so the agent returns focused results.
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. Scaling, add-on creation, and pipeline promotion are not. Each one is recoverable only by a second deliberate action, and two of them change your bill. CloudThinker asks for approval on every one of them, one call at a time. 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. Choose the account carefully.
- Set an expiration — pass
--expires-in <seconds>toheroku authorizations:createand plan to rotate; a default authorization never expires on its own. - Revoke when you are done —
heroku authorizationslists your authorizations by ID and description, andheroku authorizations:revoke <id>blocks the token from making further requests. The Heroku Dashboard’s account area also lists the applications that have access to your account and lets you revoke them there. - 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.
- Approval for writes — keep restarts, maintenance mode, scaling, add-on creation, and pipeline promotion approval-gated rather than removing the guardrail.
Related
Vercel Connection
Similar setup for Vercel projects and deployments
Netlify Connection
Similar setup for Netlify projects and deploys
PostgreSQL Connection
Query access to a Heroku Postgres database
Approval
How approval-gated actions work