Skip to main content
Connect Heroku to let CloudThinker agents list your apps, read dyno formation and recent logs, review add-ons and their plans, and show which pipeline stage each app sits in. CloudThinker only reads, but it uses one Heroku API token, and that token has full write access to every app and team its user can reach, so protect it.

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. 2592000 seconds is 30 days. Without --expires-in, the token never expires.
  • Dashboard: go to Account settings → Applications → Authorizations and click Create authorization. Enter cloudthinker as the description, set an expiry, and create it.
Copy the token. With the CLI, it’s the value on the 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 global scope. The Heroku CLI that agents use resolves the token’s own account before it lists apps or pipelines. Heroku’s identity scope is read-only but covers only account information, and the read, write, read-protected, and write-protected scopes 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.
A global token has full write access at Heroku. If it leaks, whoever holds it can change or delete every app its user can reach. Use a dedicated low-privilege account and a short expiry.
This connection only reads. Agents can’t restart, scale, or change apps, whatever the token allows.

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

Name the app or pipeline in your prompt when the account has many apps. The answer stays focused on it.

Troubleshooting

The token is wrong, expired, or revoked. Create a new one, then open the connection, click the edit icon on the instance, click Replace… in Edit Instance, paste the token, and click Save and test.
The token’s account isn’t a member of that app or team. Add the account in Heroku, then ask again.
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.
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.
Heroku throttled the account. Wait a few minutes, then ask about one app at a time so each run makes fewer calls.
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 global token, 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-in when you create the token. When you no longer need it, find its id with heroku authorizations and run heroku 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.

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