Pular para o conteúdo principal
PUT
/
api
/
v2
/
alerts
/
{id}
Atualizar alerta
curl --request PUT \
  --url https://api.hyperdx.io/api/v2/alerts/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "channel": {
    "type": "webhook",
    "webhookId": "65f5e4a3b9e77c001a789012"
  },
  "dashboardId": "65f5e4a3b9e77c001a567890",
  "interval": "1h",
  "message": "Updated threshold and interval",
  "name": "Updated Alert Name",
  "source": "tile",
  "threshold": 500,
  "thresholdType": "above",
  "tileId": "65f5e4a3b9e77c001a901234"
}
'
import requests

url = "https://api.hyperdx.io/api/v2/alerts/{id}"

payload = {
"channel": {
"type": "webhook",
"webhookId": "65f5e4a3b9e77c001a789012"
},
"dashboardId": "65f5e4a3b9e77c001a567890",
"interval": "1h",
"message": "Updated threshold and interval",
"name": "Updated Alert Name",
"source": "tile",
"threshold": 500,
"thresholdType": "above",
"tileId": "65f5e4a3b9e77c001a901234"
}
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({
channel: {type: 'webhook', webhookId: '65f5e4a3b9e77c001a789012'},
dashboardId: '65f5e4a3b9e77c001a567890',
interval: '1h',
message: 'Updated threshold and interval',
name: 'Updated Alert Name',
source: 'tile',
threshold: 500,
thresholdType: 'above',
tileId: '65f5e4a3b9e77c001a901234'
})
};

fetch('https://api.hyperdx.io/api/v2/alerts/{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.hyperdx.io/api/v2/alerts/{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([
'channel' => [
'type' => 'webhook',
'webhookId' => '65f5e4a3b9e77c001a789012'
],
'dashboardId' => '65f5e4a3b9e77c001a567890',
'interval' => '1h',
'message' => 'Updated threshold and interval',
'name' => 'Updated Alert Name',
'source' => 'tile',
'threshold' => 500,
'thresholdType' => 'above',
'tileId' => '65f5e4a3b9e77c001a901234'
]),
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.hyperdx.io/api/v2/alerts/{id}"

payload := strings.NewReader("{\n \"channel\": {\n \"type\": \"webhook\",\n \"webhookId\": \"65f5e4a3b9e77c001a789012\"\n },\n \"dashboardId\": \"65f5e4a3b9e77c001a567890\",\n \"interval\": \"1h\",\n \"message\": \"Updated threshold and interval\",\n \"name\": \"Updated Alert Name\",\n \"source\": \"tile\",\n \"threshold\": 500,\n \"thresholdType\": \"above\",\n \"tileId\": \"65f5e4a3b9e77c001a901234\"\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.hyperdx.io/api/v2/alerts/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel\": {\n \"type\": \"webhook\",\n \"webhookId\": \"65f5e4a3b9e77c001a789012\"\n },\n \"dashboardId\": \"65f5e4a3b9e77c001a567890\",\n \"interval\": \"1h\",\n \"message\": \"Updated threshold and interval\",\n \"name\": \"Updated Alert Name\",\n \"source\": \"tile\",\n \"threshold\": 500,\n \"thresholdType\": \"above\",\n \"tileId\": \"65f5e4a3b9e77c001a901234\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.hyperdx.io/api/v2/alerts/{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 \"channel\": {\n \"type\": \"webhook\",\n \"webhookId\": \"65f5e4a3b9e77c001a789012\"\n },\n \"dashboardId\": \"65f5e4a3b9e77c001a567890\",\n \"interval\": \"1h\",\n \"message\": \"Updated threshold and interval\",\n \"name\": \"Updated Alert Name\",\n \"source\": \"tile\",\n \"threshold\": 500,\n \"thresholdType\": \"above\",\n \"tileId\": \"65f5e4a3b9e77c001a901234\"\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "channel": {
      "type": "webhook",
      "webhookId": "65f5e4a3b9e77c001a789012"
    },
    "createdAt": "2023-01-01T00:00:00.000Z",
    "dashboard": "65f5e4a3b9e77c001a567890",
    "groupBy": "<string>",
    "id": "65f5e4a3b9e77c001a123456",
    "interval": "15m",
    "message": "Error rate exceeds threshold",
    "name": "High Error Rate",
    "savedSearch": "<string>",
    "silenced": true,
    "source": "tile",
    "state": "inactive",
    "team": "65f5e4a3b9e77c001a345678",
    "threshold": 100,
    "thresholdType": "above",
    "tileId": "65f5e4a3b9e77c001a901234",
    "updatedAt": "2023-01-01T00:00:00.000Z"
  }
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}

Autorizações

Authorization
string
header
obrigatório

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Parâmetros de caminho

id
string
obrigatório

ID do alerta

Corpo

application/json
channel
object
dashboardId
string
Exemplo:

"65f5e4a3b9e77c001a567890"

interval
string
Exemplo:

"1h"

message
string
Exemplo:

"Updated message"

name
string
Exemplo:

"Updated Alert Name"

source
enum<string>
Opções disponíveis:
tile,
search
Exemplo:

"tile"

threshold
number
Exemplo:

500

thresholdType
enum<string>
Opções disponíveis:
above,
below
Exemplo:

"above"

tileId
string
Exemplo:

"65f5e4a3b9e77c001a901234"

Resposta

Alerta atualizado com sucesso

data
object
Última modificação em 12 de junho de 2026