curl --request PATCH \
--url https://api.honeycomb.io/2/teams/{teamSlug}/environments/{environmentID}/datasets/{ID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"id": "hcxds_01jbr4k2m7n8p9q0r1s2t3v4wx",
"type": "datasets",
"attributes": {
"restricted": true
}
}
}
'import requests
url = "https://api.honeycomb.io/2/teams/{teamSlug}/environments/{environmentID}/datasets/{ID}"
payload = { "data": {
"id": "hcxds_01jbr4k2m7n8p9q0r1s2t3v4wx",
"type": "datasets",
"attributes": { "restricted": True }
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
id: 'hcxds_01jbr4k2m7n8p9q0r1s2t3v4wx',
type: 'datasets',
attributes: {restricted: true}
}
})
};
fetch('https://api.honeycomb.io/2/teams/{teamSlug}/environments/{environmentID}/datasets/{ID}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.honeycomb.io/2/teams/{teamSlug}/environments/{environmentID}/datasets/{ID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'id' => 'hcxds_01jbr4k2m7n8p9q0r1s2t3v4wx',
'type' => 'datasets',
'attributes' => [
'restricted' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.honeycomb.io/2/teams/{teamSlug}/environments/{environmentID}/datasets/{ID}"
payload := strings.NewReader("{\n \"data\": {\n \"id\": \"hcxds_01jbr4k2m7n8p9q0r1s2t3v4wx\",\n \"type\": \"datasets\",\n \"attributes\": {\n \"restricted\": true\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.honeycomb.io/2/teams/{teamSlug}/environments/{environmentID}/datasets/{ID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"id\": \"hcxds_01jbr4k2m7n8p9q0r1s2t3v4wx\",\n \"type\": \"datasets\",\n \"attributes\": {\n \"restricted\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeycomb.io/2/teams/{teamSlug}/environments/{environmentID}/datasets/{ID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"id\": \"hcxds_01jbr4k2m7n8p9q0r1s2t3v4wx\",\n \"type\": \"datasets\",\n \"attributes\": {\n \"restricted\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "hcxds_01jbr4k2m7n8p9q0r1s2t3v4wx",
"type": "datasets",
"attributes": {
"name": "Checkout",
"slug": "checkout",
"description": "Events from the checkout service",
"expand_json_depth": 3,
"settings": {
"delete_protected": true
},
"dataset_type": "events",
"restricted": true,
"regular_columns_count": 100,
"last_written_at": "2026-11-18T15:28:22Z",
"created_at": "2023-11-07T05:31:56Z"
},
"relationships": {
"environment": {
"data": {
"id": "hxenv_12345678901234567890123456",
"type": "environments"
}
}
}
}
}{
"status": 400,
"type": "https://api.honeycomb.io/problems/unparseable",
"title": "The request body could not be parsed.",
"error": "invalid gzip data"
}{
"error": "unknown API key - check your credentials"
}{
"error": "Your team has been denied access to Management APIs, please contact support to be unblocked."
}{
"error": "dataset not found"
}{
"error": "dataset not found"
}{
"status": 413,
"type": "https://api.honeycomb.io/problems/payload-too-large",
"title": "Request body is too large.",
"error": "Body size is larger than maximum size of 100000 bytes"
}{
"errors": [
{
"id": "<string>",
"code": "<string>",
"status": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"header": "<string>",
"parameter": "<string>"
}
}
]
}{
"status": 422,
"type": "https://api.honeycomb.io/problems/validation-failed",
"error": "The provided input is invalid.",
"title": "The provided input is invalid",
"type_detail": [
{
"field": "type",
"code": "invalid",
"description": "type: must be a valid value"
}
]
}{
"error": "Rate Limited"
}{
"error": "something went wrong!",
"status": 123,
"type": "<string>",
"title": "<string>",
"detail": "<string>",
"instance": "<string>"
}Update a Dataset
Updates a dataset’s restricted, description, expand_json_depth and
settings.delete_protected. Only the fields in the request change. Only Team owners and
members of a Group that has access to the dataset can read a restricted dataset.
A team-wide key needs the environments:write scope. An environment-scoped key needs the
datasets:write scope and can change only its own Environment’s datasets.
Unrestricting a dataset makes it readable by every Team member again and removes it from every Group that has access to it. Restricting it again does not restore that access.
If a Group has access to the dataset, a team-wide key also needs the groups:write scope to
unrestrict it. An environment-scoped key cannot unrestrict it, and gets a 403.
A dataset ID from a different Environment is treated as not found. If the type or id in
the body does not match the endpoint, the response is a 409.
curl --request PATCH \
--url https://api.honeycomb.io/2/teams/{teamSlug}/environments/{environmentID}/datasets/{ID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"id": "hcxds_01jbr4k2m7n8p9q0r1s2t3v4wx",
"type": "datasets",
"attributes": {
"restricted": true
}
}
}
'import requests
url = "https://api.honeycomb.io/2/teams/{teamSlug}/environments/{environmentID}/datasets/{ID}"
payload = { "data": {
"id": "hcxds_01jbr4k2m7n8p9q0r1s2t3v4wx",
"type": "datasets",
"attributes": { "restricted": True }
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
id: 'hcxds_01jbr4k2m7n8p9q0r1s2t3v4wx',
type: 'datasets',
attributes: {restricted: true}
}
})
};
fetch('https://api.honeycomb.io/2/teams/{teamSlug}/environments/{environmentID}/datasets/{ID}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.honeycomb.io/2/teams/{teamSlug}/environments/{environmentID}/datasets/{ID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'id' => 'hcxds_01jbr4k2m7n8p9q0r1s2t3v4wx',
'type' => 'datasets',
'attributes' => [
'restricted' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.honeycomb.io/2/teams/{teamSlug}/environments/{environmentID}/datasets/{ID}"
payload := strings.NewReader("{\n \"data\": {\n \"id\": \"hcxds_01jbr4k2m7n8p9q0r1s2t3v4wx\",\n \"type\": \"datasets\",\n \"attributes\": {\n \"restricted\": true\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.honeycomb.io/2/teams/{teamSlug}/environments/{environmentID}/datasets/{ID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"id\": \"hcxds_01jbr4k2m7n8p9q0r1s2t3v4wx\",\n \"type\": \"datasets\",\n \"attributes\": {\n \"restricted\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeycomb.io/2/teams/{teamSlug}/environments/{environmentID}/datasets/{ID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"id\": \"hcxds_01jbr4k2m7n8p9q0r1s2t3v4wx\",\n \"type\": \"datasets\",\n \"attributes\": {\n \"restricted\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "hcxds_01jbr4k2m7n8p9q0r1s2t3v4wx",
"type": "datasets",
"attributes": {
"name": "Checkout",
"slug": "checkout",
"description": "Events from the checkout service",
"expand_json_depth": 3,
"settings": {
"delete_protected": true
},
"dataset_type": "events",
"restricted": true,
"regular_columns_count": 100,
"last_written_at": "2026-11-18T15:28:22Z",
"created_at": "2023-11-07T05:31:56Z"
},
"relationships": {
"environment": {
"data": {
"id": "hxenv_12345678901234567890123456",
"type": "environments"
}
}
}
}
}{
"status": 400,
"type": "https://api.honeycomb.io/problems/unparseable",
"title": "The request body could not be parsed.",
"error": "invalid gzip data"
}{
"error": "unknown API key - check your credentials"
}{
"error": "Your team has been denied access to Management APIs, please contact support to be unblocked."
}{
"error": "dataset not found"
}{
"error": "dataset not found"
}{
"status": 413,
"type": "https://api.honeycomb.io/problems/payload-too-large",
"title": "Request body is too large.",
"error": "Body size is larger than maximum size of 100000 bytes"
}{
"errors": [
{
"id": "<string>",
"code": "<string>",
"status": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"header": "<string>",
"parameter": "<string>"
}
}
]
}{
"status": 422,
"type": "https://api.honeycomb.io/problems/validation-failed",
"error": "The provided input is invalid.",
"title": "The provided input is invalid",
"type_detail": [
{
"field": "type",
"code": "invalid",
"description": "type: must be a valid value"
}
]
}{
"error": "Rate Limited"
}{
"error": "something went wrong!",
"status": 123,
"type": "<string>",
"title": "<string>",
"detail": "<string>",
"instance": "<string>"
}Authorizations
Authenticate using a Honeycomb Management Key.
Pass the Management Key as a Bearer token in the Authorization header:
Authorization: Bearer hcxmk_12345678901234567890123456:12345678901234567890123456789012
Construct the key value by joining the Key ID and Secret with a colon (:).
To learn how to create a Management Key, visit Manage Team API Keys. To learn more about authenticating requests, visit API Authentication.