https://github.com/heroku/heroku-api-plugin
Heroku API plugin for Heroku Toolbelt
https://github.com/heroku/heroku-api-plugin
heroku heroku-cli-plugin
Last synced: 7 months ago
JSON representation
Heroku API plugin for Heroku Toolbelt
- Host: GitHub
- URL: https://github.com/heroku/heroku-api-plugin
- Owner: heroku
- License: apache-2.0
- Created: 2015-06-30T05:46:54.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2025-04-29T17:17:59.000Z (9 months ago)
- Last Synced: 2025-06-10T04:07:53.552Z (7 months ago)
- Topics: heroku, heroku-cli-plugin
- Language: TypeScript
- Size: 636 KB
- Stars: 33
- Watchers: 92
- Forks: 14
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# API Plugin for Heroku Toolbelt
[](http://badge.fury.io/js/heroku-api-plugin)

[](https://ci.appveyor.com/project/Heroku/heroku-api-plugin/branch/master)
## How to install this plugin
```shell
$ heroku plugins:install @heroku-cli/plugin-api
```
## Usage
* [`heroku api METHOD [PATH]`](#heroku-api-method-path)
## `heroku api METHOD [PATH]`
make a manual API request
```
USAGE
$ heroku api METHOD [PATH] [-a ] [-b ] [-v ]
ARGUMENTS
METHOD GET, POST, PUT, PATCH, or DELETE
PATH endpoint to call
FLAGS
-a, --accept-inclusion= Accept-Inclusion header to use
-b, --body= JSON input body
-v, --version= version to use (e.g. 2, 3, or 3.variant)
DESCRIPTION
make a manual API request
The api command is a convenient but low-level way to send requests
to the Heroku API. It sends an HTTP request to the Heroku API
using the given method on the given path. For methods PUT, PATCH,
and POST, it uses stdin unmodified as the request body. It prints
the response unmodified on stdout.
It is essentially like curl for the Heroku API.
Method name input will be upcased, so both 'heroku api GET /apps' and
'heroku api get /apps' are valid commands.
EXAMPLES
$ heroku api GET /apps/myapp
{
created_at: "2011-11-11T04:17:13-00:00",
id: "12345678-9abc-def0-1234-456789012345",
name: "myapp",
…
}
$ heroku api PATCH /apps/myapp/config-vars --body '{"FOO": "bar"}'
{
FOO: "bar"
…
}
$ printf '{"updates":[{"type":"web", "quantity":2}]}' | heroku api POST /apps/myapp/formation
[
{
"app": {
"name": "myapp",
"id": "01234567-89ab-cdef-0123-456789abcdef"
},
"quantity": 2,
"type": "web",
"updated_at": "2012-01-01T12:00:00Z"
...
}
]
```
_See code: [src/commands/api.ts](https://github.com/heroku/heroku-api-plugin/blob/v2.3.0/src/commands/api.ts)_