Reporting deployments
Use this endpoint to notify Honeybadger when a deploy occurs. For an overview of all reporting methods, see the Deployments guide.
POST /v1/deploys
Section titled “POST /v1/deploys”Make a POST request to https://api.honeybadger.io/v1/deploys with the following parameters:
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your project’s API key |
| deploy[environment] | Optional | The environment name. Example: production |
| deploy[revision] | Optional | The VCS revision being deployed. Could be a git hash, or a tag name. Example: 7cd4bac1bd7e2ddf858d10ee86e362c8d8e2f912 |
| deploy[repository] | Optional | The base URL of the VCS repository. It should be HTTPS-style. Example: https://github.com/honeybadger-io/honeybadger-ruby |
| deploy[local_username] | Optional | The name of the user who is deploying. Example: Jane |
Example curl command:
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:
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"}.