Dataset restrictions are in public beta on the Honeycomb Enterprise plan.
Before you begin
The API uses a team-wide Management Key, so set one up with the scopes your automation needs.- You must be a Team Owner to create a Management Key. To learn how, visit Create Management API Key.
- Send the key in an
Authorization: Bearer KEY_ID:SECRETheader. To learn more, visit Authentication. - To restrict an environment, use the Honeycomb UI. The API restricts individual datasets.
https://api.honeycomb.io.
If your team is in the EU, use https://api.eu1.honeycomb.io.
They also assume that HONEYCOMB_API_KEY holds your key ID and secret, separated by a colon, and that TEAM holds your team slug.
Scopes
Each task needs its own scope, so give a key only the scopes it uses.
A key with
environments:write, groups:write, and users:read can do every task on this page.
A write scope includes its read scope.
Restrict a dataset and grant a group access
This walkthrough restricts a dataset and gives one person access to it through a user group. Every request body uses the JSON:API format, so sendContent-Type: application/vnd.api+json with each request that has a body.
-
Find the ID of the environment that holds the dataset.
Each environment in the response has an
id, such ashcxen_01m7nbghdat0t6awx7gmnx1mck. -
Find the ID of the dataset, using its slug.
The dataset in the response has an
id, such ashcxds_01m7tkca520rdch211n2gq8d7t, and arestrictedattribute. -
Restrict the dataset.
The response shows the dataset with
"restricted": true. Only Team Owners can read the dataset until you grant a group access. -
Create a user group.
Honeycomb returns
201 Createdand the group’sid, such ashcxgr_01m7tkcmhh8kdamjrkhveeetxa. Group names are unique in a team, so a duplicate name returns422. -
Find the user’s ID by email address.
The user in the response has an
id, such ashcxus_01m7tkd0q3vfp8x2c9a4rjz6hn, and their teamrole. -
Add the user to the group.
Honeycomb returns
204 No Content. -
Grant the group access to the dataset.
Honeycomb returns
204 No Content. You can grant access only to a restricted dataset, so an unrestricted dataset returns422.
DELETE.
Sync group membership
Use the members endpoints to keep a group in step with a list you manage elsewhere, such as a group in your identity provider. Each request takes users by ID, so look up IDs first with theusers endpoint.
Within a minute, added users gain the group’s access and removed users lose it, unless another group grants the same access.
Remove a dataset’s restriction
Remove a restriction when everyone on your team should read the dataset again.groups:write scope.
Without it, Honeycomb returns 403 and the dataset stays restricted.
Limits and errors
Plan your automation around these limits.- A team can have up to 50 user groups.
- A members request can include up to 15,000 users.
- A request to grant or revoke datasets can include up to 100 datasets.
- Requests that add, remove, or replace members, or grant or revoke datasets, are all-or-nothing.
If any user or dataset in the request is unknown, Honeycomb changes nothing and returns
422, with one error for each unknown entry. Each error’ssource.pointergives the entry’s position indata, such as/data/1. - If the
typeoridin a request body doesn’t match the path, Honeycomb returns409. - A request without
Content-Type: application/vnd.api+jsonreturns415. - Requests count toward the API rate limits. To learn more, visit Rate Limits.