Everything an AI agent can do with the Heroku API.

A reference guide for building AI agents: every method, how to authenticate, and the permissions each one needs.

Endpoints37
API version3
Last updated23 June 2026
Orientation

How the Heroku API works.

The Heroku API is how an app or AI agent works with a Heroku account: creating and updating apps, scaling and restarting the dynos that run them, deploying releases and rolling them back, and provisioning add-ons like databases. Access is granted through a token sent as a Bearer credential and an OAuth scope that decides how far it reaches, where reading config vars needs a protected scope because they hold runtime secrets. The Platform API is selected by a version header, and Heroku can also push events to a webhook when something happens on an app.

37Endpoints
12Capability groups
18Read
19Write
5Permissions
Authentication
Every request sends a credential in the Authorization header as a Bearer token. The credential is either a personal API token, suited to scripts and server-side calls, or an OAuth access token prefixed HRKU- that a third-party service obtains on a user's behalf. OAuth web-flow tokens expire after eight hours and can be refreshed; a direct-authorization token does not expire. Every request also sends Accept: application/vnd.heroku+json; version=3.
Permissions
OAuth tokens carry a scope that sets how far they reach. The global scope covers everything, identity reads account information only, and read with its paired write covers apps and resources but deliberately excludes account details and config vars. To reach config vars, which hold runtime secrets like database connection strings, a token needs read-protected, or write-protected to change them. A 403 response means the scope does not cover the request.
Versioning
The Platform API is at version 3, selected by the Accept: application/vnd.heroku+json; version=3 header on every request. The webhooks API uses version=3.webhooks. Each resource also carries a stability level of prototype, development, or production that signals how settled it is and how much notice a change will get.
Data model
The API is resource-oriented JSON at https://api.heroku.com. Most resources are addressed by either a UUID or a human-friendly name, and app-scoped resources nest under /apps/{app_id_or_name}, covering dynos, formation, config-vars, releases, builds, addons, domains, and collaborators, while pipelines and the account sit at the top level. Lists are paged with the Range header, and app webhooks push events for activity on an app.
Connect & authenticate

Connection & authentication methods.

How an app or AI agent connects to Heroku determines what it can reach. There is a route for making calls and a route for receiving events, each governed by the token behind it and the OAuth scope that token carries.

Ways to connect

Platform API (REST)

The Platform API answers at https://api.heroku.com and returns JSON. Every request sends the header Accept: application/vnd.heroku+json; version=3 to select the API version, and most resources are addressed by either a UUID or a human-friendly name.

Best forConnecting an app or AI agent to Heroku.
Governed byThe token and the OAuth scope it carries.
Docs ↗

App webhooks

Heroku posts an event to a registered receiver URL when something happens on an app, such as a release or a dyno starting. The webhooks API uses the header Accept: application/vnd.heroku+json; version=3.webhooks, and each delivery is retried for up to 72 hours if the receiver does not accept it.

Best forReceiving Heroku app events at an app or AI agent.
Governed byThe token and scope used to create the webhook subscription.
Docs ↗
Authentication

API token (Bearer)

A personal API token is sent in the Authorization header as a Bearer credential. It carries the account's full access and suits personal scripts and server-side calls. A token can be generated with the CLI or rotated from the account dashboard.

TokenBearer API token
Best forPersonal scripts and server-side calls
Docs ↗

OAuth 2.0

OAuth lets a third-party service request scoped access on behalf of a Heroku user through the authorization-code flow at id.heroku.com. The resulting access token is prefixed HRKU- and carries the scopes granted. Web-flow tokens expire after eight hours and can be refreshed, while a direct-authorization token does not expire.

TokenOAuth access token (HRKU-)
Best forThird-party integrations acting for a user
Docs ↗
Capability map

What an AI agent can do in Heroku.

The Heroku API is split into areas an agent can act on, like apps, dynos, config vars, releases, and add-ons. Each area has its own methods, and writes in some areas restart running processes, change which code is live, or expose runtime secrets.

Apps

5 endpoints

List, read, create, update, and delete apps, and read the authenticated account.

Deleting an app is irreversible and takes down everything running on it.
View endpoints

Dynos

5 endpoints

List and read dynos, run a one-off dyno, and restart or stop dynos.

Writes here start, stop, and restart running processes.
View endpoints

Formation (scale)

3 endpoints

Read the dyno formation for an app and change how many dynos of each process type run, and their size.

Writes here change how many dynos run and how much they cost.
View endpoints

Config vars

2 endpoints

Read and update an app's config vars, the environment variables that hold its settings and secrets.

Config vars hold runtime secrets like database connection strings.
View endpoints

Releases

3 endpoints

List and read releases, and create a release to deploy a slug or roll back to a previous one.

Creating a release changes which code is live for users.
View endpoints

Builds

3 endpoints

List and read builds, and create a build from source to produce a deployable slug.

Writes here start a build that can lead to a new release.
View endpoints

Add-ons

4 endpoints

List, read, provision, and remove add-ons, the attached services like databases and queues.

Provisioning an add-on can incur charges; removing one destroys its data.
View endpoints

Domains

3 endpoints

List, add, and remove the custom domains pointed at an app.

Writes here change which domains serve the app's traffic.
View endpoints

Collaborators

3 endpoints

List, add, and remove the people who can access an app.

Adding a collaborator grants another person access to the app.
View endpoints

Pipelines

3 endpoints

List, read, and create pipelines, which group an app's staging and production environments.

Writes here change how apps are grouped for promotion.
View endpoints

Logs

1 endpoint

Create a log session to stream or read an app's recent log output.

Logs can contain request details and other operational data.
View endpoints

Account & limits

2 endpoints

Read the authenticated account and the current rate-limit allowance.

Account reads expose profile and billing-related details.
View endpoints
Endpoint reference

Every Heroku API method.

Filter by method, access, or permission, or search any path. Select a row for version detail, rate limits, the related webhook event, and the source.

MethodEndpointWhat it doesAccessPermissionVersion

Apps

List, read, create, update, and delete apps, and read the authenticated account.5

The global scope also covers this. Identity scope is account-only and does not reach apps.

Acts onapp
Permission (capability)read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

An app is addressed by its UUID or its human-friendly name.

Acts onapp
Permission (capability)read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Needs the write scope, which pairs with read. The global scope also covers this.

Acts onapp
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventapi-app
Rate limitStandard limits apply

Needs the write scope, which pairs with read.

Acts onapp
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventapi-app
Rate limitStandard limits apply

Irreversible. Needs the write scope, which pairs with read.

Acts onapp
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventapi-app
Rate limitStandard limits apply

Dynos

List and read dynos, run a one-off dyno, and restart or stop dynos.5

Read-only.

Acts ondyno
Permission (capability)read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only.

Acts ondyno
Permission (capability)read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Runs a process with the app's config vars, so it can reach runtime secrets. Needs the write scope.

Acts ondyno
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventapi-dyno
Rate limitStandard limits apply

A managed dyno restarts; a one-off dyno stops. Needs the write scope.

Acts ondyno
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Restarts every running process at once. Needs the write scope.

Acts ondyno
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Formation (scale)

Read the dyno formation for an app and change how many dynos of each process type run, and their size.3

Read-only.

Acts onformation
Permission (capability)read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Changing quantity or size affects capacity and cost. Needs the write scope.

Acts onformation
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventapi-formation
Rate limitStandard limits apply

Updates the quantity and size of multiple process types in one call. Needs the write scope.

Acts onformation
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventapi-formation
Rate limitStandard limits apply

Config vars

Read and update an app's config vars, the environment variables that hold its settings and secrets.2

The read scope excludes config vars on purpose, since they hold runtime secrets; reading them needs read-protected or global.

Acts onconfig-var
Permission (capability)read-protected
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Setting null removes a key. Writing config vars needs write-protected or global, not the plain write scope.

Acts onconfig-var
Permission (capability)write-protected
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Releases

List and read releases, and create a release to deploy a slug or roll back to a previous one.3

Read-only.

Acts onrelease
Permission (capability)read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only.

Acts onrelease
Permission (capability)read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Takes a slug id; releasing an earlier slug is how a rollback is performed. Needs the write scope.

Acts onrelease
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventapi-release
Rate limitStandard limits apply

Builds

List and read builds, and create a build from source to produce a deployable slug.3

Read-only.

Acts onbuild
Permission (capability)read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only.

Acts onbuild
Permission (capability)read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Takes a source_blob pointing at the code to build. Needs the write scope.

Acts onbuild
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventapi-build
Rate limitStandard limits apply

Add-ons

List, read, provision, and remove add-ons, the attached services like databases and queues.4

Read-only.

Acts onadd-on
Permission (capability)read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only.

Acts onadd-on
Permission (capability)read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

A paid plan starts billing as soon as it is provisioned. Needs the write scope.

Acts onadd-on
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventapi-addon
Rate limitStandard limits apply

Destroys the add-on and its data, such as a database. Needs the write scope.

Acts onadd-on
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventapi-addon
Rate limitStandard limits apply

Domains

List, add, and remove the custom domains pointed at an app.3

Read-only.

Acts ondomain
Permission (capability)read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Needs the write scope, which pairs with read.

Acts ondomain
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventapi-domain
Rate limitStandard limits apply

The app stops serving that hostname. Needs the write scope.

Acts ondomain
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventapi-domain
Rate limitStandard limits apply

Collaborators

List, add, and remove the people who can access an app.3

Read-only.

Acts oncollaborator
Permission (capability)read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Grants another person access to the app. Needs the write scope.

Acts oncollaborator
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventapi-collaborator
Rate limitStandard limits apply

Revokes that person's access. Needs the write scope.

Acts oncollaborator
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventapi-collaborator
Rate limitStandard limits apply

Pipelines

List, read, and create pipelines, which group an app's staging and production environments.3

Read-only.

Acts onpipeline
Permission (capability)read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Read-only.

Acts onpipeline
Permission (capability)read
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Needs the write scope, which pairs with read.

Acts onpipeline
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Logs

Create a log session to stream or read an app's recent log output.1

Returns a temporary URL to fetch the log output. Needs the write scope.

Acts onlog-session
Permission (capability)write
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

Account & limits

Read the authenticated account and the current rate-limit allowance.2

The identity scope reaches account information; the app-level read scope does not.

Acts onaccount
Permission (capability)identity
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply

This call does not consume a request token of its own.

Acts onrate-limit
Permission (capability)identity
VersionAvailable since the API’s base version
Webhook eventNone
Rate limitStandard limits apply
No endpoints match those filters.
Webhooks

Webhook events.

Heroku can notify an app or AI agent when something happens to an app, like a release being created or a dyno starting, instead of the app repeatedly asking. Heroku posts the event to a webhook URL that has been registered on the app for the chosen entities.

EventWhat it signalsTriggered by
api:appFires when an app is created, updated, or destroyed./apps
/apps/{app_id_or_name}
/apps/{app_id_or_name}
api:dynoFires when a new dyno has begun running./apps/{app_id_or_name}/dynos
api:formationFires when the dyno formation for a process type is updated or destroyed./apps/{app_id_or_name}/formation/{formation_id_or_type}
/apps/{app_id_or_name}/formation
api:releaseFires when a new release is initiated and again when its status changes, such as from pending to succeeded or failed./apps/{app_id_or_name}/releases
api:buildFires when a new build is initiated and again when the build status changes./apps/{app_id_or_name}/builds
api:addonFires when an add-on is provisioned, updated, or removed./apps/{app_id_or_name}/addons
/apps/{app_id_or_name}/addons/{add_on_id_or_name}
api:domainFires when a custom domain is added to or removed from an app./apps/{app_id_or_name}/domains
/apps/{app_id_or_name}/domains/{domain_id_or_hostname}
api:collaboratorFires when a collaborator is added, updated, or removed on an app./apps/{app_id_or_name}/collaborators
/apps/{app_id_or_name}/collaborators/{collaborator_id_or_email}
No events match that search.
Rate limits & pagination

Rate limits, pagination & request size.

Heroku limits how fast an app or AI agent can call, through a per-account pool of request tokens that refills over time, and reports the remaining count on every response.

Request rate

Heroku meters calls with a per-account pool of request tokens that holds at most 4,500. Each API call spends one token, and tokens refill at roughly 75 per minute, which is 4,500 per hour, up to the 4,500 ceiling. Every response carries a RateLimit-Remaining header with the tokens left, and the dedicated rate-limit endpoint reports the same figure without spending a token. When the pool is empty a call returns 429 with an id of rate_limit.

Pagination

List endpoints page through the Range header rather than query parameters. The default page size is 200 and the maximum is 1,000. A truncated list returns 206 Partial Content with a Next-Range header, and the next page is fetched by repeating the request with Range set to that value. The page size is set with a max key in the header, such as Range: id ..; max=10, and the sort property and direction are set the same way, such as order=desc.

Request size

Responses are JSON. A single list page returns at most 1,000 values, the maximum the Range header allows, and larger result sets are walked one page at a time through the Next-Range header.

Errors

Status codes & error handling.

The status codes an agent should handle, and what to do about each.

StatusCodeMeaningWhat to do
401unauthorizedThe request had no valid token, or the token was invalid or expired.Send a valid API token or OAuth access token in the Authorization header.
403forbiddenThe token is valid but its scope or the account's access does not cover this resource.Use a token whose OAuth scope reaches the resource, such as read-protected for config vars.
404not_foundThe requested resource does not exist, or the token cannot see it.Confirm the app id or name and the path, and that the token has access.
422invalid_paramsThe request was understood but the parameters were invalid, or extra verification is required.Read the message field, correct the parameters, and resend.
429rate_limitThe account ran out of request tokens in its hourly pool.Wait for the pool to refill, around 75 tokens per minute, and check RateLimit-Remaining before retrying.
503service_unavailableThe API is temporarily unavailable.Retry after a short, backed-off delay.
Versioning & freshness

Version history.

Heroku versions its Platform API by a number sent in the Accept header. The current version is 3, and each resource also carries a stability level that signals how settled it is.

Version history

What changed, and when

Latest version3
3Current version
Platform API version 3 (current)

Version 3 is the current Platform API, selected by sending Accept: application/vnd.heroku+json; version=3 on every request. It is the stable, supported version, and each resource within it carries a stability level of prototype, development, or production that governs how much notice any change to that resource gets. Heroku ships dated, additive changes to version 3 through its changelog rather than minting a new major version for each one.

What changed
  • Selected by the Accept header value version=3 on every request.
  • The webhooks API is addressed as version=3.webhooks.
  • Per-resource stability levels (prototype, development, production) signal change-management guarantees.
Earlier
Earlier API generations

Before version 3, Heroku exposed earlier API generations that have since been superseded. Version 3 is the one Heroku documents and supports for new integrations, and the version is pinned explicitly in the Accept header so an integration is never moved between generations without changing that header.

What changed
  • Superseded by version 3, which is the documented and supported generation.
  • The Accept header pins the version so upgrades are deliberate.

An integration pins version 3 in the Accept header on every request.

Heroku changelog ↗
Questions

Heroku API, answered.

How do I authenticate, with an API token or OAuth?+
Both are sent as a Bearer credential in the Authorization header. A personal API token is the quickest route for a script or a server-side integration acting as its own account. OAuth is for a third-party service that needs scoped access on a user's behalf: it runs the authorization-code flow at id.heroku.com and receives an HRKU- access token. Web-flow OAuth tokens expire after eight hours and can be refreshed, while a personal token and a direct-authorization token do not expire on their own.
What do the OAuth scopes mean?+
A scope sets how far a token reaches. global covers the whole account and its apps. identity reads account information only. read, paired with write, covers apps and resources but leaves out account details and config vars on purpose, so a token can act on apps without seeing runtime secrets. read-protected, paired with write-protected, adds access to those secrets, like database connection strings held in config vars. A request that a token's scope does not cover returns 403.
Why does reading config vars need a special scope?+
Config vars hold an app's environment variables, which often include runtime secrets such as database connection strings and API keys. The plain read scope excludes them by design, so an integration can read and change apps without being handed those secrets. A token needs read-protected to read config vars, write-protected to change them, or global for both. This lets an agent be granted app access without secret access.
What are the rate limits?+
Each account has a pool that holds at most 4,500 request tokens. Every API call spends one token, and the pool refills at about 75 tokens per minute, which is 4,500 per hour, up to the 4,500 cap. The RateLimit-Remaining response header shows how many tokens are left, and the rate-limit endpoint reports the same number without spending one. When the pool is empty, calls return 429 with an id of rate_limit until it refills.
How does pagination work?+
List endpoints use the Range header rather than page query parameters. The default page size is 200 and the maximum is 1,000. A truncated response returns 206 Partial Content along with a Next-Range header, and the next page is fetched by repeating the request with the Range header set to that value. The page size is set with a max key, such as Range: id ..; max=10, and the sort property and order are set in the same header.
How do I receive events instead of polling?+
Register an app webhook with a receiver URL and the entities to watch, such as api:release, api:dyno, api:build, api:formation, or api:addon. Heroku then posts a JSON payload when each matching event fires, so an integration learns about activity without polling. A release usually produces more than one event as its status moves from pending to succeeded or failed, and failed deliveries are retried for up to 72 hours.
How do I roll back a release?+
A rollback is a new release that re-uses an earlier slug. Listing releases shows each one and the slug it ran, and creating a release with that earlier slug id puts that version live again. Because the slug is already built, the rollback is fast, and it produces a fresh release entry rather than deleting history.
Related

More developer API guides for agents

What is Bollard AI?

Control what every AI agent can do in Heroku.

Bollard AI sits between a team's AI agents and Heroku. Grant each agent exactly the access it needs, read or write, resource by resource, and every call is checked and logged.

  • Set read, write, or full access per agent, never a shared Heroku token.
  • Denied by default, so an agent reaches only what has been explicitly allowed.
  • Every call recorded in plain English: who, what, where, and the decision.
Heroku
Deploy Agent
View apps and releases ResourceOffReadFull use
Scale and restart dynos ActionOffReadFull use
Read config vars ResourceOffReadFull use
Per-agent access, set in Bollard AI, not in Heroku