Projects

Get a project list or project details

bash
curl -u AUTH_TOKEN: https://app.honeybadger.io/v2/projects?account_id=ACCOUNT_ID curl -u AUTH_TOKEN: https://app.honeybadger.io/v2/projects/ID

Returns a list or a single project with the following format:

json
{ "active": true, "created_at": "2012-06-09T20:33:27.798800Z", "earliest_notice_at": "2015-12-18T19:30:32.470689Z", "environments": ["development", "production"], "fault_count": 14, "id": 1, "last_notice_at": "2016-06-14T18:31:54.000000Z", "name": "Rails exception tracking gem", "owner": { "email": "westley@honeybadger.io", "id": 1, "name": "Westley" }, "sites": [ { "active": true, "id": "9eed6a7e-af77-4cc6-8c55-7a5afa59a90b", "last_checked_at": "2016-06-15T12:57:29.646956Z", "name": "Main site", "state": "up", "url": "http://www.example.com" } ], "teams": [ { "id": 1, "name": "Team Marie" } ], "token": "098sflj2", "unresolved_fault_count": 1, "users": [ { "email": "inigo@honeybadger.io", "id": 2, "name": "Inigo Montoya" }, { "email": "westley@honeybadger.io", "id": 1, "name": "Westley" } ] }

If the account_id parameter is not supplied when requesting the list of projects, all projects will be returned across all accounts to which the provided AUTH_TOKEN has access.

Create a project

bash
curl -u AUTH_TOKEN: \ -X POST \ -H 'Content-type: application/json' \ -d '{"project":{"name":"My project"}}' \ https://app.honeybadger.io/v2/projects?account_id=ACCOUNT_ID

Here is a list of the fields that can be provided:

Field name Type Description
name string
resolve_errors_on_deploy boolean Whether all unresolved faults should be marked as resolved when a deploy is recorded
disable_public_links boolean Whether to allow fault details to be publicly shareable via a button on the fault detail page
language string One of “js”, “elixir”, “golang”, “java”, “node”, “php”, “python”, “ruby”, or “other”
user_url string A URL format like “http://example.com/admin/users/[user_id]” that will be displayed on the fault detail page and have [user_id] replaced with the user_id from the fault’s context hash.
source_url string A URL format like “https://gitlab.com/username/reponame/blob/[sha]/[file]#L[line]” that is used to link lines in the backtrace to your git browser. This can be left blank if you provide the repository info in your deploy payloads or if you use the GitHub integration for your project.
purge_days integer The number of days to retain data (up the to max number of days available to your subscription plan).
user_search_field string A field such as “context.user_email” that you provide in your error context. This field will be used to create the aggregated list of affected users.

If the account_id query parameter is not provided, the project will be associated with the first account accessible by the user associated with the AUTH_TOKEN.

Update a project

bash
curl -u AUTH_TOKEN: -X PUT -H 'Content-type: application/json' -d '{"project":{"name":"Updated project name"}}' https://app.honeybadger.io/v2/projects/ID

The fields listed in the prior section are also available when updating a project.

Delete a project

bash
curl -u AUTH_TOKEN: -X DELETE https://app.honeybadger.io/v2/projects/ID

Get a count of occurrences for all projects or a single project

bash
curl -u AUTH_TOKEN: https://app.honeybadger.io/v2/projects/occurrences curl -u AUTH_TOKEN: https://app.honeybadger.io/v2/projects/ID/occurrences

Provides the number of times errors have been encountered in your project or across all your projects.

json
[ [ 1510963200, 1440 ], [ 1511049600, 1441 ], [ 1511136000, 1441 ], [ 1511222400, 1441 ], ... ]

The data is returned as an array of epoch seconds/count pairs, and it can be filtered with these URL parameters:

Parameter Description
period One of “hour”, “day”, “week”, or “month”. Defaults to “hour”
environment Limit results to this environment

When the period is “hour” (the default), the data returned is the most recent 60 one-minute buckets. When it is “day”, the data comes from the most recent 24 one-hour buckets, and when it is “week” or “month”, the data is grouped into one-day buckets. All times and bucket boundaries are UTC.

Get a list of integrations for a project

bash
curl -u AUTH_TOKEN: https://app.honeybadger.io/v2/projects/ID/integrations

Returns a list of integrations (a.k.a. channels) for a project:

json
[ { "id": 9693, "active": false, "events": ["occurred", "assigned"], "site_ids": ["605e7c8e-e6c8-4102-a8f8-37a9431ee78be"], "options": { "url": "http://requestb.in/7d87eae" }, "excluded_environments": [], "filters": [], "type": "WebHook" } ]

The options element varies depending on the type of integration.