Prerequisites
- A Heroku account that belongs to the apps, teams, and pipelines you want to investigate.
- Optional: the Heroku CLI, signed in as that account with
heroku login. You can use the Heroku Dashboard instead. - The Admin role in your CloudThinker workspace, which can add and edit connections. See Roles.
Setup
1
Create an API token
Sign in as the account CloudThinker should use, then pick one way:
-
CLI: run this.
2592000seconds is 30 days. Without--expires-in, the token never expires. -
Dashboard: go to Account settings → Applications → Authorizations and click Create authorization. Enter
cloudthinkeras the description, set an expiry, and create it.
Token: line of the output. It starts with HRKU-. Keep the global scope; see Required permissions for why.To cancel it later, run heroku authorizations to find its id, then heroku authorizations:revoke <id>.2
Add the connection in CloudThinker
In the sidebar, click More → Workspace settings → Connections. On the Builtin Connections tab, search for Heroku, paste the token into API token, and click Connect.Success state: the Heroku card shows Connected.
3
Run the verify prompt
Run the verify prompt to confirm the token can read your account.Success state: CloudThinker returns your apps with their dyno formation.
Connection details
Required permissions
A Heroku token can’t be limited to some apps. It can reach whatever its user can, so least privilege comes from the account you create it with.- Use the
globalscope. The Heroku CLI that agents use resolves the token’s own account before it lists apps or pipelines. Heroku’sidentityscope is read-only but covers only account information, and theread,write,read-protected, andwrite-protectedscopes exclude account information. No single narrower scope covers both, so a token with one of them fails when it lists apps and pipelines. - Use a dedicated account. Add it only to the teams and apps CloudThinker needs.
- If you sign in with SSO, create the token from a separate non-SSO user for the integration.
Agent capabilities
Agents never read config vars, environment values, or database credentials. For queries against a Heroku Postgres database, add a separate PostgreSQL connection.
Verify the connection
Example prompts
Troubleshooting
403 Forbidden on an app or team
403 Forbidden on an app or team
The token’s account isn’t a member of that app or team. Add the account in Heroku, then ask again.
404 Couldn't find that user
404 Couldn't find that user
The token can’t read its own account, which is what a narrow scope looks like. Add-ons and teams still list, but apps and pipelines fail. Create a new authorization with the default
global scope and replace it on the connection. See Rotate a credential.404 for a named app, add-on, or pipeline
404 for a named app, add-on, or pipeline
The name is wrong, or it belongs to an account the token can’t see. Ask CloudThinker to list your apps or pipelines, then use a name from that list.
429 Too Many Requests
429 Too Many Requests
Heroku throttled the account. Wait a few minutes, then ask about one app at a time so each run makes fewer calls.
No private spaces are listed
No private spaces are listed
Private spaces are a Heroku Enterprise feature. If your account has none, an empty list is the correct answer.
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.
- No read-only token on Heroku: the read-only advice above doesn’t apply here. The connection needs a
globaltoken, which always carries full write access at Heroku, and a narrower scope breaks it. CloudThinker itself only reads, so limit the risk with a dedicated low-privilege account and a short expiry. - Plan rotation: pass
--expires-inwhen you create the token. When you no longer need it, find its id withheroku authorizationsand runheroku authorizations:revoke <id>. - Treat logs as sensitive: an app can print secrets into its own logs. CloudThinker avoids quoting lines that look like tokens or passwords, but don’t rely on that alone.
Related
PostgreSQL Connection
Query a Heroku Postgres database with its own credentials
Connections overview
See every platform you can connect and how to rotate a credential