WebhooksCreate uptime webhook

Create uptime webhook

Create an uptime webhook. Requires an agency key (ak_). The webhook URL receives a POST request when a subscribed event fires.

curl -X POST "https://mythic-analytics.gulp.workers.dev/client/v1/links/webhooks?location_id=example_string" \
  -H "Content-Type: application/json" \
  -H "X-Location-Id: example_string" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "url": "https://api.acme-retail.com/webhooks/uptime",
  "events": [
    "link_down",
    "link_up"
  ],
  "name": "Ops on-call uptime alerts",
  "method": "POST",
  "headers": {},
  "enabled": true
}'
{
  "success": true,
  "data": {
    "id": "7c1e4a2b-9d3f-4a8e-b1c2-3d4e5f6a7b8c",
    "name": "Uptime webhook: link_down, link_up",
    "enabled": true,
    "url": "https://api.acme-retail.com/webhooks/uptime",
    "method": "POST",
    "headers": {},
    "events": [
      "link_down",
      "link_up"
    ],
    "created_at": "2024-05-20T10:00:00.000Z",
    "updated_at": "2024-05-20T10:00:00.000Z"
  }
}
POST
/links/webhooks
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

Client API key as a bearer token. Use an agency key (ak_..., read-write) or a location secret key (sk_..., read-only). Format: Bearer ak_... or Bearer sk_.... Scoped keys (mcp_) are accepted too and need links:read or links:write. See Using an mcp_ key over HTTP.

Client API key as a bearer token. Use an agency key (ak_..., read-write) or a location secret key (sk_..., read-only). Format: Bearer ak_... or Bearer sk_.... Scoped keys (mcp_) are accepted too and need links:read or links:write. See Using an mcp_ key over HTTP.
query
location_idstring

Target location (client) id. Required when authenticating with an agency key (ak_); alternative to the X-Location-Id header. Ignored for secret keys.

Content-Typestring
Required

The media type of the request body

Options: application/json
header
X-Location-Idstring

Target location (client) id. Required when authenticating with an agency key (ak_); alternative to the location_id query parameter.

urlstring
Required

Endpoint that receives the webhook POST. Must be http or https.

Format: uri
eventsarray

Events to subscribe to. Defaults to both if omitted. Only link_down and link_up are accepted.

namestring

Display name. Defaults to Uptime webhook: <events> if omitted.

methodstring

HTTP method used when calling the webhook. Defaults to POST.

headersobject

Custom headers sent with the webhook request.

enabledboolean

Whether the webhook is active. Defaults to true.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Client API key as a bearer token. Use an agency key (ak_..., read-write) or a location secret key (sk_..., read-only). Format: Bearer ak_... or Bearer sk_.... Scoped keys (mcp_) are accepted too and need links:read or links:write. See Using an mcp_ key over HTTP.

Query Parameters

location_idstring

Target location (client) id. Required when authenticating with an agency key (ak_); alternative to the X-Location-Id header. Ignored for secret keys.

Headers

X-Location-Idstring

Target location (client) id. Required when authenticating with an agency key (ak_); alternative to the location_id query parameter.

Body

application/json
urlstring
Required

Endpoint that receives the webhook POST. Must be http or https.

Example:
https://api.acme-retail.com/webhooks/uptime
eventsarray

Events to subscribe to. Defaults to both if omitted. Only link_down and link_up are accepted.

Example:
["link_down","link_up"]
namestring

Display name. Defaults to Uptime webhook: \\<events\\> if omitted.

Example:
Ops on-call uptime alerts
methodstring

HTTP method used when calling the webhook. Defaults to POST.

Example:
POST
headersobject

Custom headers sent with the webhook request.

enabledboolean

Whether the webhook is active. Defaults to true.

Responses