Update
Update the credentials or configuration of a telemetry data source. Provide only the config block that matches your data source type (e.g. grafana_config for Grafana, datadog_config for Datadog). New credentials are validated against the provider before being saved.
PUT
/
v2
/
telemetry
/
data_sources
/
{id}
Update
curl --request PUT \
--url https://api.incident.io/v2/telemetry/data_sources/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"datadog_config": {
"api_key": "abc123",
"app_key": "abc123"
},
"grafana_config": {
"api_key": "glsa_123",
"api_url": "grafana.example.com"
},
"name": "Production Grafana"
}
'import requests
url = "https://api.incident.io/v2/telemetry/data_sources/{id}"
payload = {
"datadog_config": {
"api_key": "abc123",
"app_key": "abc123"
},
"grafana_config": {
"api_key": "glsa_123",
"api_url": "grafana.example.com"
},
"name": "Production Grafana"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
datadog_config: {api_key: 'abc123', app_key: 'abc123'},
grafana_config: {api_key: 'glsa_123', api_url: 'grafana.example.com'},
name: 'Production Grafana'
})
};
fetch('https://api.incident.io/v2/telemetry/data_sources/{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.incident.io/v2/telemetry/data_sources/{id}",
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([
'datadog_config' => [
'api_key' => 'abc123',
'app_key' => 'abc123'
],
'grafana_config' => [
'api_key' => 'glsa_123',
'api_url' => 'grafana.example.com'
],
'name' => 'Production Grafana'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/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.incident.io/v2/telemetry/data_sources/{id}"
payload := strings.NewReader("{\n \"datadog_config\": {\n \"api_key\": \"abc123\",\n \"app_key\": \"abc123\"\n },\n \"grafana_config\": {\n \"api_key\": \"glsa_123\",\n \"api_url\": \"grafana.example.com\"\n },\n \"name\": \"Production Grafana\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.incident.io/v2/telemetry/data_sources/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"datadog_config\": {\n \"api_key\": \"abc123\",\n \"app_key\": \"abc123\"\n },\n \"grafana_config\": {\n \"api_key\": \"glsa_123\",\n \"api_url\": \"grafana.example.com\"\n },\n \"name\": \"Production Grafana\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/telemetry/data_sources/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"datadog_config\": {\n \"api_key\": \"abc123\",\n \"app_key\": \"abc123\"\n },\n \"grafana_config\": {\n \"api_key\": \"glsa_123\",\n \"api_url\": \"grafana.example.com\"\n },\n \"name\": \"Production Grafana\"\n}"
response = http.request(request)
puts response.read_body{
"data_source": {
"created_at": "2021-08-17T13:28:57.801578Z",
"enabled": true,
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"name": "Primary Prometheus",
"provider": "grafana",
"source_type": "grafana",
"updated_at": "2021-08-17T13:28:57.801578Z",
"version": "8.5.27"
}
}Authorizations
API key from your incident.io dashboard (Settings → API keys)
Path Parameters
Data source ID
Example:
"01G0J1EXE7AXZ2C93K61WBPYEH"
Body
application/json
Datadog-specific credential updates
Show child attributes
Show child attributes
Example:
{ "api_key": "abc123", "app_key": "abc123" }
Grafana-specific credential and endpoint updates
Show child attributes
Show child attributes
Example:
{ "api_key": "glsa_123", "api_url": "grafana.example.com" }
Updated display name
Example:
"Production Grafana"
Response
200 - application/json
OK response.
A telemetry data source integration
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Update
curl --request PUT \
--url https://api.incident.io/v2/telemetry/data_sources/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"datadog_config": {
"api_key": "abc123",
"app_key": "abc123"
},
"grafana_config": {
"api_key": "glsa_123",
"api_url": "grafana.example.com"
},
"name": "Production Grafana"
}
'import requests
url = "https://api.incident.io/v2/telemetry/data_sources/{id}"
payload = {
"datadog_config": {
"api_key": "abc123",
"app_key": "abc123"
},
"grafana_config": {
"api_key": "glsa_123",
"api_url": "grafana.example.com"
},
"name": "Production Grafana"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
datadog_config: {api_key: 'abc123', app_key: 'abc123'},
grafana_config: {api_key: 'glsa_123', api_url: 'grafana.example.com'},
name: 'Production Grafana'
})
};
fetch('https://api.incident.io/v2/telemetry/data_sources/{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.incident.io/v2/telemetry/data_sources/{id}",
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([
'datadog_config' => [
'api_key' => 'abc123',
'app_key' => 'abc123'
],
'grafana_config' => [
'api_key' => 'glsa_123',
'api_url' => 'grafana.example.com'
],
'name' => 'Production Grafana'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/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.incident.io/v2/telemetry/data_sources/{id}"
payload := strings.NewReader("{\n \"datadog_config\": {\n \"api_key\": \"abc123\",\n \"app_key\": \"abc123\"\n },\n \"grafana_config\": {\n \"api_key\": \"glsa_123\",\n \"api_url\": \"grafana.example.com\"\n },\n \"name\": \"Production Grafana\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.incident.io/v2/telemetry/data_sources/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"datadog_config\": {\n \"api_key\": \"abc123\",\n \"app_key\": \"abc123\"\n },\n \"grafana_config\": {\n \"api_key\": \"glsa_123\",\n \"api_url\": \"grafana.example.com\"\n },\n \"name\": \"Production Grafana\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/telemetry/data_sources/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"datadog_config\": {\n \"api_key\": \"abc123\",\n \"app_key\": \"abc123\"\n },\n \"grafana_config\": {\n \"api_key\": \"glsa_123\",\n \"api_url\": \"grafana.example.com\"\n },\n \"name\": \"Production Grafana\"\n}"
response = http.request(request)
puts response.read_body{
"data_source": {
"created_at": "2021-08-17T13:28:57.801578Z",
"enabled": true,
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"name": "Primary Prometheus",
"provider": "grafana",
"source_type": "grafana",
"updated_at": "2021-08-17T13:28:57.801578Z",
"version": "8.5.27"
}
}