Accounts API reference
In Honeybadger, all resources are tied to an account. A user may belong to one or more accounts (for instance, you can have a work account and a personal account). The Accounts API allows you to programmatically fetch details about your accounts.
Get all accounts
Section titled “Get all accounts”curl -u AUTH_TOKEN: https://app.honeybadger.io/v2/accounts/Returns a list of all accounts the authenticated user belongs to.
{ "results": [ { "id": "Me3upk", "email": "homerjsimpson@gmail.com", "name": "homer", "active": true, "parked": false }, { "id": "9bYfrm", "email": "homer.j@simpsons.io", "name": "Work", "active": true, "parked": false } ], "links": { "self": "http://localhost:3000/v2/accounts" }}Get info for one account
Section titled “Get info for one account”curl -u AUTH_TOKEN: https://app.honeybadger.io/v2/accounts/IDReturns info about an account, including the quota consumption for the current month. Each of the three sets of quota info is returned as an array of arrays, with one date & count pair for each day of the month, starting at midnight UTC on the first of the month. The different types of stats are as follows:
- Stored: The number of error notifications saved and available for display in the UI
- Limited: The number of notifications that were discarded due to throttling (429 responses)
- Ignored: Notifications discarded as a result of errors being flagged as ignored in the UI
The quota_consumed value is a percentage, so 0.75 would mean 75% of the
month’s quota has been consumed. The quota resets at the first of the month.
{ "id": "Me3upk", "email": "homerjsimpson@gmail.com", "name": "homer", "active": true, "parked": false, "quota_consumed": 0.75, "api_stats": { "stored": [ [ 1648767600, 116 ], [ 1648771200, 65 ], ... ], "limited": [], "ignored": [] }}Get a list of account users or user details
Section titled “Get a list of account users or user details”curl -u AUTH_TOKEN: https://app.honeybadger.io/v2/accounts/ID/userscurl -u AUTH_TOKEN: https://app.honeybadger.io/v2/accounts/ID/users/IDReturns all the users or a single user for the given account:
{ "results": [ { "id": 1, "role": "Owner", "name": "", "email": "westley@honeybadger.io" } ]}Update a user
Section titled “Update a user”curl -u AUTH_TOKEN: -X PUT -H 'Content-type: application/json' -d '{"user":{"role":"Admin"}}' https://app.honeybadger.io/v2/accounts/ID/users/IDThe list of valid fields is as follows:
| Field name | Type | Description |
|---|---|---|
role | string | One of “Member”, “Billing”, “Admin”, or “Owner” |
Remove a user from the account
Section titled “Remove a user from the account”curl -u AUTH_TOKEN: -X DELETE https://app.honeybadger.io/v2/accounts/ID/users/IDCreate an invitation for a user to join an account
Section titled “Create an invitation for a user to join an account”curl -u AUTH_TOKEN: -X POST -H 'Content-type: application/json' \ -d '{"invitation":{"email":"inigo@honeybadger.io"}}' \ https://app.honeybadger.io/v2/accounts/ID/invitationsYou can specify these fields:
| Field name | Type | Description |
|---|---|---|
email | string | The invited user’s email address. |
role | string | One of “Member”, “Billing”, “Admin”, or “Owner” |
team_ids | array | Array of team ids to which the invited user will be added |
Returns the created user invitation:
{ "id": 9, "token": "e62394d2", "email": "inigo@honeybadger.io", "created_by": { "email": "westley@honeybadger.io", "name": "Westley" }, "accepted_by": null, "role": "Member", "accepted_at": null, "created_at": "2013-01-08T15:42:16Z", "team_ids": []}Update an account invitation
Section titled “Update an account invitation”curl -u AUTH_TOKEN: -X PUT -H 'Content-type: application/json' \ -d '{"invitation":{"role": "Admin"}}' \ https://app.honeybadger.io/v2/accounts/ID/invitations/IDYou can specify either of these fields:
| Field name | Type | Description |
|---|---|---|
role | string | One of “Member”, “Billing”, “Admin”, or “Owner” |
team_ids | array | Array of team ids to which the invited user will be added |
Get an account invitation list or account invitation details
Section titled “Get an account invitation list or account invitation details”curl -u AUTH_TOKEN: https://app.honeybadger.io/v2/accounts/ID/invitationscurl -u AUTH_TOKEN: https://app.honeybadger.io/v2/accounts/ID/invitations/IDReturns a list of account invitations or a single account invitation for the given account:
{ "results": [ { "id": 9, "token": "e62394d2", "email": "", "created_by": { "email": "westley@honeybadger.io", "name": "Westley" }, "accepted_by": { "email": "inigo@honeybadger.io", "name": "Inigo Montoya" }, "role": "Member", "accepted_at": "2013-01-08T15:42:41Z", "created_at": "2013-01-08T15:42:16Z", "team_ids": [] } ]}Delete an account invitation
Section titled “Delete an account invitation”curl -u AUTH_TOKEN: -X DELETE https://app.honeybadger.io/v2/accounts/ID/invitations/ID