curl --request PATCH \
--url https://api.honeycomb.io/2/teams/{teamSlug}/groups/{ID}/relationships/members \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": [
{
"type": "users",
"id": "hcxus_01hzqr5g7jg9qz40xtgx7rjwj0"
},
{
"type": "users",
"id": "hcxus_01hzqr6m2c4v8w9x0y1z2a3b4c"
}
]
}
'import requests
url = "https://api.honeycomb.io/2/teams/{teamSlug}/groups/{ID}/relationships/members"
payload = { "data": [
{
"type": "users",
"id": "hcxus_01hzqr5g7jg9qz40xtgx7rjwj0"
},
{
"type": "users",
"id": "hcxus_01hzqr6m2c4v8w9x0y1z2a3b4c"
}
] }
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: [
{type: 'users', id: 'hcxus_01hzqr5g7jg9qz40xtgx7rjwj0'},
{type: 'users', id: 'hcxus_01hzqr6m2c4v8w9x0y1z2a3b4c'}
]
})
};
fetch('https://api.honeycomb.io/2/teams/{teamSlug}/groups/{ID}/relationships/members', 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}/groups/{ID}/relationships/members",
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' => [
[
'type' => 'users',
'id' => 'hcxus_01hzqr5g7jg9qz40xtgx7rjwj0'
],
[
'type' => 'users',
'id' => 'hcxus_01hzqr6m2c4v8w9x0y1z2a3b4c'
]
]
]),
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}/groups/{ID}/relationships/members"
payload := strings.NewReader("{\n \"data\": [\n {\n \"type\": \"users\",\n \"id\": \"hcxus_01hzqr5g7jg9qz40xtgx7rjwj0\"\n },\n {\n \"type\": \"users\",\n \"id\": \"hcxus_01hzqr6m2c4v8w9x0y1z2a3b4c\"\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}/groups/{ID}/relationships/members")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": [\n {\n \"type\": \"users\",\n \"id\": \"hcxus_01hzqr5g7jg9qz40xtgx7rjwj0\"\n },\n {\n \"type\": \"users\",\n \"id\": \"hcxus_01hzqr6m2c4v8w9x0y1z2a3b4c\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeycomb.io/2/teams/{teamSlug}/groups/{ID}/relationships/members")
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 {\n \"type\": \"users\",\n \"id\": \"hcxus_01hzqr5g7jg9qz40xtgx7rjwj0\"\n },\n {\n \"type\": \"users\",\n \"id\": \"hcxus_01hzqr6m2c4v8w9x0y1z2a3b4c\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"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"
}{
"errors": [
{
"id": "<string>",
"code": "<string>",
"status": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"header": "<string>",
"parameter": "<string>"
}
}
]
}{
"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>"
}Replace a Group's members
Replaces the Group’s whole member list with the users in data. This is not a partial
update: listed users who are not members are added, and members who are not listed are
removed. To add or remove only some users, use POST or DELETE on this path instead.
Send the full list on every call. An empty data list removes every user from the Group.
A request without data is rejected with a 422, so it cannot empty the Group by mistake.
Listed users who are already members are not changed. Agent members are not changed either, because this path names users only.
The key needs the groups:write and users:read scopes.
The change is all or nothing. Every user must belong to the Team. If any user cannot be
found, nothing changes, and the response is a 422 with one error for each unknown user,
pointing at its entry in data.
One request adds or removes at most 15,000 users. If the list would remove more than that,
nothing changes and the response is a 422; remove some members with DELETE first.
Send one replace at a time for a Group. Two replaces that run at the same time can leave the users added by both. Sending the list again makes the Group match it.
curl --request PATCH \
--url https://api.honeycomb.io/2/teams/{teamSlug}/groups/{ID}/relationships/members \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": [
{
"type": "users",
"id": "hcxus_01hzqr5g7jg9qz40xtgx7rjwj0"
},
{
"type": "users",
"id": "hcxus_01hzqr6m2c4v8w9x0y1z2a3b4c"
}
]
}
'import requests
url = "https://api.honeycomb.io/2/teams/{teamSlug}/groups/{ID}/relationships/members"
payload = { "data": [
{
"type": "users",
"id": "hcxus_01hzqr5g7jg9qz40xtgx7rjwj0"
},
{
"type": "users",
"id": "hcxus_01hzqr6m2c4v8w9x0y1z2a3b4c"
}
] }
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: [
{type: 'users', id: 'hcxus_01hzqr5g7jg9qz40xtgx7rjwj0'},
{type: 'users', id: 'hcxus_01hzqr6m2c4v8w9x0y1z2a3b4c'}
]
})
};
fetch('https://api.honeycomb.io/2/teams/{teamSlug}/groups/{ID}/relationships/members', 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}/groups/{ID}/relationships/members",
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' => [
[
'type' => 'users',
'id' => 'hcxus_01hzqr5g7jg9qz40xtgx7rjwj0'
],
[
'type' => 'users',
'id' => 'hcxus_01hzqr6m2c4v8w9x0y1z2a3b4c'
]
]
]),
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}/groups/{ID}/relationships/members"
payload := strings.NewReader("{\n \"data\": [\n {\n \"type\": \"users\",\n \"id\": \"hcxus_01hzqr5g7jg9qz40xtgx7rjwj0\"\n },\n {\n \"type\": \"users\",\n \"id\": \"hcxus_01hzqr6m2c4v8w9x0y1z2a3b4c\"\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}/groups/{ID}/relationships/members")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": [\n {\n \"type\": \"users\",\n \"id\": \"hcxus_01hzqr5g7jg9qz40xtgx7rjwj0\"\n },\n {\n \"type\": \"users\",\n \"id\": \"hcxus_01hzqr6m2c4v8w9x0y1z2a3b4c\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeycomb.io/2/teams/{teamSlug}/groups/{ID}/relationships/members")
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 {\n \"type\": \"users\",\n \"id\": \"hcxus_01hzqr5g7jg9qz40xtgx7rjwj0\"\n },\n {\n \"type\": \"users\",\n \"id\": \"hcxus_01hzqr6m2c4v8w9x0y1z2a3b4c\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"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"
}{
"errors": [
{
"id": "<string>",
"code": "<string>",
"status": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"header": "<string>",
"parameter": "<string>"
}
}
]
}{
"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.
Body
Response
No Content