Update a Recipient
curl --request PUT \
--url https://api.honeycomb.io/1/recipients/{recipientId} \
--header 'Content-Type: application/json' \
--header 'X-Honeycomb-Team: <api-key>' \
--data '
{
"type": "pagerduty"
}
'import requests
url = "https://api.honeycomb.io/1/recipients/{recipientId}"
payload = { "type": "pagerduty" }
headers = {
"X-Honeycomb-Team": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Honeycomb-Team': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: 'pagerduty'})
};
fetch('https://api.honeycomb.io/1/recipients/{recipientId}', 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/1/recipients/{recipientId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'pagerduty'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Honeycomb-Team: <api-key>"
],
]);
$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/1/recipients/{recipientId}"
payload := strings.NewReader("{\n \"type\": \"pagerduty\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Honeycomb-Team", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.honeycomb.io/1/recipients/{recipientId}")
.header("X-Honeycomb-Team", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"pagerduty\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeycomb.io/1/recipients/{recipientId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Honeycomb-Team"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"pagerduty\"\n}"
response = http.request(request)
puts response.read_body{
"type": "pagerduty",
"id": "yUheCUmgZ8p",
"created_at": "2022-07-26T22:38:04Z",
"updated_at": "2022-07-26T22:38:04Z",
"details": {
"pagerduty_integration_name": "Example PagerDuty Service",
"pagerduty_integration_key": "7zOwh1edS8xHGcwfb2bA4sqY8E6PJzSK"
}
}{
"error": "unknown API key - check your credentials"
}{
"error": "dataset not found"
}{
"error": "dataset not found"
}{
"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"
}
]
}Update a Recipient
Update a Recipient by specifying the recipient ID and full recipient details. (Partial PUT is not supported.) Updates to the Recipient Type is not supported. For example, changing an existing Recipient from PagerDuty to Email is not allowed. Important: Modifying an existing recipient will change the destination of all triggers/burn alerts that use that recipient.
PUT
/
1
/
recipients
/
{recipientId}
Update a Recipient
curl --request PUT \
--url https://api.honeycomb.io/1/recipients/{recipientId} \
--header 'Content-Type: application/json' \
--header 'X-Honeycomb-Team: <api-key>' \
--data '
{
"type": "pagerduty"
}
'import requests
url = "https://api.honeycomb.io/1/recipients/{recipientId}"
payload = { "type": "pagerduty" }
headers = {
"X-Honeycomb-Team": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Honeycomb-Team': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: 'pagerduty'})
};
fetch('https://api.honeycomb.io/1/recipients/{recipientId}', 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/1/recipients/{recipientId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'pagerduty'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Honeycomb-Team: <api-key>"
],
]);
$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/1/recipients/{recipientId}"
payload := strings.NewReader("{\n \"type\": \"pagerduty\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Honeycomb-Team", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.honeycomb.io/1/recipients/{recipientId}")
.header("X-Honeycomb-Team", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"pagerduty\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeycomb.io/1/recipients/{recipientId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Honeycomb-Team"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"pagerduty\"\n}"
response = http.request(request)
puts response.read_body{
"type": "pagerduty",
"id": "yUheCUmgZ8p",
"created_at": "2022-07-26T22:38:04Z",
"updated_at": "2022-07-26T22:38:04Z",
"details": {
"pagerduty_integration_name": "Example PagerDuty Service",
"pagerduty_integration_key": "7zOwh1edS8xHGcwfb2bA4sqY8E6PJzSK"
}
}{
"error": "unknown API key - check your credentials"
}{
"error": "dataset not found"
}{
"error": "dataset not found"
}{
"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"
}
]
}Authorizations
Authenticate using a Honeycomb Configuration Key.
Pass the Token in the X-Honeycomb-Team header:
X-Honeycomb-Team: 1234567890123456789012
If you created your key using the API, use data.attributes.secret; this is the same value as the Token in the UI.
To learn how to create a Configuration Key, visit Manage Environment API Keys. To learn more about authenticating requests, visit API Authentication.
Body
application/json
Response
Success
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6