Skip to content

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.

Terminal window
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"
}
}
Terminal window
curl -u AUTH_TOKEN: https://app.honeybadger.io/v2/accounts/ID

Returns 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”
Terminal window
curl -u AUTH_TOKEN: https://app.honeybadger.io/v2/accounts/ID/users
curl -u AUTH_TOKEN: https://app.honeybadger.io/v2/accounts/ID/users/ID

Returns all the users or a single user for the given account:

{
"results": [
{
"id": 1,
"role": "Owner",
"name": "",
"email": "westley@honeybadger.io"
}
]
}
Terminal window
curl -u AUTH_TOKEN: -X PUT -H 'Content-type: application/json' -d '{"user":{"role":"Admin"}}' https://app.honeybadger.io/v2/accounts/ID/users/ID

The list of valid fields is as follows:

Field nameTypeDescription
rolestringOne of “Member”, “Billing”, “Admin”, or “Owner”
Terminal window
curl -u AUTH_TOKEN: -X DELETE https://app.honeybadger.io/v2/accounts/ID/users/ID

Create an invitation for a user to join an account

Section titled “Create an invitation for a user to join an account”
Terminal window
curl -u AUTH_TOKEN: -X POST -H 'Content-type: application/json' \
-d '{"invitation":{"email":"inigo@honeybadger.io"}}' \
https://app.honeybadger.io/v2/accounts/ID/invitations

You can specify these fields:

Field nameTypeDescription
emailstringThe invited user’s email address.
rolestringOne of “Member”, “Billing”, “Admin”, or “Owner”
team_idsarrayArray 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": []
}
Terminal window
curl -u AUTH_TOKEN: -X PUT -H 'Content-type: application/json' \
-d '{"invitation":{"role": "Admin"}}' \
https://app.honeybadger.io/v2/accounts/ID/invitations/ID

You can specify either of these fields:

Field nameTypeDescription
rolestringOne of “Member”, “Billing”, “Admin”, or “Owner”
team_idsarrayArray 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”
Terminal window
curl -u AUTH_TOKEN: https://app.honeybadger.io/v2/accounts/ID/invitations
curl -u AUTH_TOKEN: https://app.honeybadger.io/v2/accounts/ID/invitations/ID

Returns 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": []
}
]
}
Terminal window
curl -u AUTH_TOKEN: -X DELETE https://app.honeybadger.io/v2/accounts/ID/invitations/ID