Skip to content

Reporting deployments

View Markdown

Use this endpoint to notify Honeybadger when a deploy occurs. For an overview of all reporting methods, see the Deployments guide.

Make a POST request to https://api.honeybadger.io/v1/deploys with the following parameters:

ParameterRequiredDescription
api_keyRequiredYour project’s API key
deploy[environment]OptionalThe environment name.
Example: production
deploy[revision]OptionalThe VCS revision being deployed. Could be a git hash, or a tag name.
Example: 7cd4bac1bd7e2ddf858d10ee86e362c8d8e2f912
deploy[repository]OptionalThe base URL of the VCS repository. It should be HTTPS-style.
Example: https://github.com/honeybadger-io/honeybadger-ruby
deploy[local_username]OptionalThe name of the user who is deploying.
Example: Jane

Example curl command:

Terminal window
HONEYBADGER_ENV="production" \
HONEYBADGER_REVISION="$(git rev-parse HEAD)" \
HONEYBADGER_REPOSITORY="$(git config --get remote.origin.url)" \
HONEYBADGER_API_KEY="Your project API key" \
&& curl -g "https://api.honeybadger.io/v1/deploys?deploy[environment]=$HONEYBADGER_ENV&deploy[local_username]=$USER&deploy[revision]=$HONEYBADGER_REVISION&deploy[repository]=$HONEYBADGER_REPOSITORY&api_key=$HONEYBADGER_API_KEY"

You can also send a JSON payload with Content-Type: application/json:

Terminal window
curl https://api.honeybadger.io/v1/deploys \
-H 'X-API-Key: Your project API key' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"deploy": {
"environment": "production",
"local_username": "sam",
"revision": "7cd4bac1bd7e2ddf858d10ee86e362c8d8e2f912",
"repository": "https://github.com/someuser/somerepo"
}
}'

A successful response returns {"status":"OK"}.