MetriBeacon
Menu

POST Create log alert

/api/v1/logs/alerts

Create a count or silence rule with its own filter and notification destinations. Incomplete observation never confirms recovery.

On this page

Access and permissions

Create a count or silence rule with its own filter and notification destinations. Incomplete observation never confirms recovery.

Browser session: __Host-mb_session cookie.

Machine management credentials in Authorization: Bearer. Check the permissions (scopes) required by the operation.

Parameters and headers

No path, query or additional request-header parameters.

Request body

FieldType and limitsRequiredMeaning
$CentralLogAlertInputYes—
$.destination_idsarray<string; {"format":"uuid"}>; {"maxItems":100}No—
$.destination_ids[]string; {"format":"uuid"}Yes—
$.enabledbooleanNo—
$.escalation_policy_idstring | null; {"format":"uuid"}No—
$.expected_revisionintegerNo—
$.group_bystring | null; {"enum":["service","host",null]}No—
$.modestring; {"enum":["count","silence"]}Yes—
$.namestringYes—
$.notification_modestring; {"enum":["all_active","selected"]}No—
$.queryCentralLogQueryYes—
$.query.cursorstring; {"maxLength":4096}No—
$.query.environmentstringNo—
$.query.fromstring; {"format":"date-time"}No—
$.query.hoststringNo—
$.query.levelsarray<string>; {"maxItems":7}No—
$.query.levels[]stringYes—
$.query.limitinteger; {"default":50,"maximum":100,"minimum":1}No—
$.query.patternstringNo—
$.query.servicestringNo—
$.query.snapshotstring; {"format":"date-time"}No—
$.query.source_idsarray<string; {"format":"uuid"}>; {"maxItems":100}No—
$.query.source_ids[]string; {"format":"uuid"}Yes—
$.query.textstring; {"maxLength":4096}No—
$.query.tostring; {"format":"date-time"}No—
$.query.trace_idstringNo—
$.query.workspace_idstring; {"format":"uuid"}Yes—
$.query.facet_fieldsarray<string; {"enum":["service","environment","host","level","source_id"]}>; {"maxItems":5}NoAdditional exact field-value counts to calculate for the complete filtered time range. Omit when not needed; normal search still returns the complete count, histogram and message patterns.
$.query.facet_fields[]string; {"enum":["service","environment","host","level","source_id"]}Yes—
$.query.stream_idstring; {"maxLength":128}No—
$.query.incident_idstring; {"format":"uuid"}No—
$.query.incident_scopestring; {"enum":["associated","workspace"]}No—
$.query.incident_modestring; {"enum":["matched","warnings","all"]}No—
$.severitystring; {"enum":["info","warning","critical"]}No—
$.thresholdinteger; {"minimum":1}Yes—
$.window_secondsinteger; {"maximum":21600,"minimum":60}Yes—
$.workspace_idstring; {"format":"uuid"}Yes—

Responses

application/json

FieldType and limitsRequiredMeaning
$object; {"additionalProperties":false}Yes—
$.idstring; {"format":"uuid"}Yes—
Stable error codes
invalid_credential
unauthorized
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
Stable error codes
csrf
insufficient_scope
invalid_origin
operator_required
forbidden
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
Stable error codes
invalid_workspace
not_found
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
Stable error codes
invalid_workspace
stale_check
result_conflict
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
Stable error codes
invalid_config
invalid_monitor
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
Stable error codes
invalid_workspace
check_capacity
HeaderType and limitsMeaning
Retry-Afterstring; {"pattern":"^[0-9]+$"}Temporary server error; retry unchanged with Retry-After and the same idempotency identifier

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
Stable error codes
check_location_unavailable
feature_unavailable
log_admission_busy
log_queue_full
log_storage_unavailable
unavailable
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
Stable error codes
log_limit
request_too_large
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—

Retries and asynchronous work

This change does not have a general retry guarantee. If the response is unclear, read the affected resource before trying again. Follow Retry-After waiting times and request new sign-in or action codes when they expire.

Request examples

Replace demo IDs, timestamps and placeholders with your own values. For a retry, keep the same IDs, time and content. These examples do not run requests on this page.

Keep login links, codes, cookies and keys private. Do not print them in logs or share them in support requests.

shell
curl --proto "=https" --tlsv1.2 --fail-with-body --max-time 30 --request POST --header @"$HOME/.config/metribeacon/headers.txt" --header "Content-Type: application/json" --data-binary '{"workspace_id":"00000000-0000-4000-8000-000000000001","name":"Application errors","mode":"count","window_seconds":300,"threshold":5,"query":{"workspace_id":"00000000-0000-4000-8000-000000000001","text":"service:api level:>=error","source_ids":[],"levels":[]},"enabled":false,"severity":"warning","notification_mode":"selected","destination_ids":[]}' https://metribeacon.com/api/v1/logs/alerts
python
import json
from pathlib import Path
from urllib.request import Request, urlopen
headers=json.loads((Path.home()/".config/metribeacon/headers.json").read_text())
headers["Content-Type"]="application/json"
request=Request('https://metribeacon.com/api/v1/logs/alerts',headers=headers,method='POST',data='{"workspace_id":"00000000-0000-4000-8000-000000000001","name":"Application errors","mode":"count","window_seconds":300,"threshold":5,"query":{"workspace_id":"00000000-0000-4000-8000-000000000001","text":"service:api level:>=error","source_ids":[],"levels":[]},"enabled":false,"severity":"warning","notification_mode":"selected","destination_ids":[]}'.encode())
with urlopen(request,timeout=30) as response:
    print(response.status)
javascript
import {readFile} from "node:fs/promises";
import {homedir} from "node:os";
const headers=JSON.parse(await readFile(homedir()+"/.config/metribeacon/headers.json","utf8"));
headers["Content-Type"]="application/json";
const response=await fetch("https://metribeacon.com/api/v1/logs/alerts",{method:"POST",headers,redirect:"error",signal:AbortSignal.timeout(30000),body:"{\"workspace_id\":\"00000000-0000-4000-8000-000000000001\",\"name\":\"Application errors\",\"mode\":\"count\",\"window_seconds\":300,\"threshold\":5,\"query\":{\"workspace_id\":\"00000000-0000-4000-8000-000000000001\",\"text\":\"service:api level:>=error\",\"source_ids\":[],\"levels\":[]},\"enabled\":false,\"severity\":\"warning\",\"notification_mode\":\"selected\",\"destination_ids\":[]}"});
console.log(response.status);await response.body?.cancel();
go
package main
import("net/http";"os";"path/filepath";"encoding/json";"time";"fmt";"strings")
func main(){home,_:=os.UserHomeDir();raw,e:=os.ReadFile(filepath.Join(home,".config/metribeacon/headers.json"));if e!=nil{panic("headers unavailable")};var h map[string]string;if json.Unmarshal(raw,&h)!=nil{panic("invalid headers")};r,_:=http.NewRequest("POST","https://metribeacon.com/api/v1/logs/alerts",strings.NewReader("{\"workspace_id\":\"00000000-0000-4000-8000-000000000001\",\"name\":\"Application errors\",\"mode\":\"count\",\"window_seconds\":300,\"threshold\":5,\"query\":{\"workspace_id\":\"00000000-0000-4000-8000-000000000001\",\"text\":\"service:api level:>=error\",\"source_ids\":[],\"levels\":[]},\"enabled\":false,\"severity\":\"warning\",\"notification_mode\":\"selected\",\"destination_ids\":[]}"));for k,v:=range h{r.Header.Set(k,v)};r.Header.Set("Content-Type","application/json");c:=&http.Client{Timeout:30*time.Second,CheckRedirect:func(*http.Request,[]*http.Request)error{return http.ErrUseLastResponse}};res,e:=c.Do(r);if e!=nil{panic("request failed")};defer res.Body.Close();fmt.Println(res.StatusCode)}
  • HTTP API, OAuth and MCP

    Find the user API endpoints, their permissions, fields, examples and response formats.

  • GET List log alerts

    Read log rule definitions, delivery configuration and current evaluation coverage for the authorized workspace.

  • DELETE Delete log alert

    Archive a log rule and its grouped instances and stop further evaluations and queued notification delivery.

  • PUT Update log alert

    Update a revision-bound log rule and its grouped instances, retaining their existing incidents and collaboration.