Heroku API

Development / OAuth Advanced HTTPS CORS
Varies by plan (check documentation)

Overview

The Heroku Platform API provides full programmatic control over your Heroku apps, dynos, add-ons, pipelines, and configuration variables. It allows DevOps engineers and CI/CD systems to automate deployments, scale dynos, manage environment secrets, and inspect release history. Authentication is via OAuth tokens or API keys passed as Bearer tokens in the Authorization header.

💡

Beginner Tip

You can get your personal API token from the Heroku CLI by running heroku auth:token, or from the Heroku Dashboard under Account Settings. All requests must include the Accept: application/vnd.heroku+json; version=3 header — without it you will receive a 422 error. Start with the apps list endpoint to verify your authentication is working before attempting write operations.

Available Data

phone number validation
carrier information
country code
line type

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Heroku",
    "description": "REST API to programmatically create apps, provision add-ons and perform other task on Heroku",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

id UUID uniquely identifying the Heroku resource (app, dyno, release, etc.).
name Human-readable name of the app, used in URLs and CLI commands.
web_url The public HTTPS URL where the deployed application is accessible.
region.name The Heroku region where the app is hosted, such as us or eu.
released_at ISO 8601 timestamp of the most recent release of the app.
slug Information about the compiled slug (build artifact) currently deployed to the app.

Implementation Example

const url = "https://devcenter.heroku.com/articles/platform-api-reference/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "Authorization": "Bearer YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

422 Unprocessable Entity The required Accept header with the Heroku API version is missing from the request.
Add the header: Accept: application/vnd.heroku+json; version=3 to every request.
401 Unauthorized The OAuth token or API key is invalid, expired, or not passed correctly in the Authorization header.
Ensure you are sending Authorization: Bearer YOUR_TOKEN and that the token has not been revoked.
404 Not Found on app operations The app name or ID in the URL does not match any app accessible to the authenticated account.
Run a GET request to /apps first to list all accessible apps and confirm the correct name or ID.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 8/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth OAuth
HTTPS REQUIRED
CORS YES
Category Development
Difficulty Advanced
Verified: 2026-04-04

Similar APIs

View All →