export const metadata = {
  title: "Webhooks - OnlineOrNot API Documentation",
  description:
    "Configure webhook integrations for alert notifications",
}

## List all webhooks   {{ tag: 'GET', label: '/v1/webhooks' }}
<Row>
<Col>

<a id="opIdlistWebhooks"></a>

*Retrieve a paginated list of all webhooks for your organization*

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","default":"1","example":1,"description":"Page number of paginated results."},"required":false,"description":"Page number of paginated results.","name":"page","in":"query","exampleValues":{"object":1,"json":"'1'"},"originalType":"string","safeType":"string","shortDesc":"Page number of paginated results.","style":"form"},{"schema":{"type":"string","default":"20","example":20,"description":"Number of items per page."},"required":false,"description":"Number of items per page.","name":"per_page","in":"query","exampleValues":{"object":20,"json":"'20'"},"originalType":"string","safeType":"string","shortDesc":"Number of items per page.","style":"form"},{"schema":{"type":"string","example":"example","description":"Search term to filter results."},"required":false,"description":"Search term to filter results.","name":"search","in":"query","exampleValues":{"object":"example","json":"'example'"},"originalType":"string","safeType":"string","shortDesc":"Search term to filter results.","style":"form"}]} title="Query parameters" />

<h3 id="retrieve-a-paginated-list-of-all-webhooks-for-your-organization-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Returns a list of webhooks|
|401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Unauthorized|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"200","properties":[{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Webhook ID"},"url":{"type":"string","format":"uri","example":"https://api.example.com/webhooks/onlineornot","description":"Webhook endpoint URL"},"description":{"type":["string","null"],"example":"Production webhook for incident notifications","description":"Optional description of the webhook"},"events":{"type":"array","items":{"type":"string","enum":["status_page.incident.started","status_page.incident.updated","status_page.incident.resolved","uptime.down","uptime.up","heartbeat.down","heartbeat.up"],"description":"Webhook event type","example":"status_page.incident.started"},"example":["status_page.incident.started","status_page.incident.resolved"],"description":"Event types this webhook subscribes to"},"created_at":{"type":"string","example":"2024-01-15T10:30:00.000Z","description":"Webhook creation timestamp"},"updated_at":{"type":"string","example":"2024-01-15T10:30:00.000Z","description":"Webhook last update timestamp"},"status_pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"x9y8z7w6","description":"Status page ID"},"name":{"type":"string","example":"My Status Page","description":"Status page name"}},"required":["id","name"]},"description":"Status pages this webhook is associated with"},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"c1d2e3f4","description":"Check ID"},"name":{"type":"string","example":"API Health Check","description":"Check name"}},"required":["id","name"]},"description":"Uptime checks this webhook is associated with"},"heartbeats":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"h1i2j3k4","description":"Heartbeat ID"},"name":{"type":"string","example":"Daily Backup Job","description":"Heartbeat name"}},"required":["id","name"]},"description":"Heartbeats this webhook is associated with"}},"required":["id","url","description","events","created_at","updated_at","status_pages","checks","heartbeats"]}},"in":"body","name":"result","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» result"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Webhook ID"},"in":"body","name":"id","depth":2,"description":"Webhook ID","type":"string","safeType":"string","required":true,"displayName":"»» id"},{"schema":{"type":"string","format":"uri","example":"https://api.example.com/webhooks/onlineornot","description":"Webhook endpoint URL"},"in":"body","name":"url","depth":2,"description":"Webhook endpoint URL","type":"string","format":"uri","safeType":"string(uri)","required":true,"displayName":"»» url"},{"schema":{"type":["string","null"],"example":"Production webhook for incident notifications","description":"Optional description of the webhook"},"in":"body","name":"description","depth":2,"description":"Optional description of the webhook","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»» description"},{"schema":{"type":"array","items":{"type":"string","enum":["status_page.incident.started","status_page.incident.updated","status_page.incident.resolved","uptime.down","uptime.up","heartbeat.down","heartbeat.up"],"description":"Webhook event type","example":"status_page.incident.started"},"example":["status_page.incident.started","status_page.incident.resolved"],"description":"Event types this webhook subscribes to"},"in":"body","name":"events","depth":2,"description":"Event types this webhook subscribes to","type":"array","safeType":"string[]","required":true,"displayName":"»» events"},{"schema":{"type":"string","example":"2024-01-15T10:30:00.000Z","description":"Webhook creation timestamp"},"in":"body","name":"created_at","depth":2,"description":"Webhook creation timestamp","type":"string","safeType":"string","required":true,"displayName":"»» created_at"},{"schema":{"type":"string","example":"2024-01-15T10:30:00.000Z","description":"Webhook last update timestamp"},"in":"body","name":"updated_at","depth":2,"description":"Webhook last update timestamp","type":"string","safeType":"string","required":true,"displayName":"»» updated_at"},{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"x9y8z7w6","description":"Status page ID"},"name":{"type":"string","example":"My Status Page","description":"Status page name"}},"required":["id","name"]},"description":"Status pages this webhook is associated with"},"in":"body","name":"status_pages","depth":2,"description":"Status pages this webhook is associated with","type":"array","safeType":"object[]","required":true,"displayName":"»» status_pages"},{"schema":{"type":"string","example":"x9y8z7w6","description":"Status page ID"},"in":"body","name":"id","depth":3,"description":"Status page ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","example":"My Status Page","description":"Status page name"},"in":"body","name":"name","depth":3,"description":"Status page name","type":"string","safeType":"string","required":true,"displayName":"»»» name"},{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"c1d2e3f4","description":"Check ID"},"name":{"type":"string","example":"API Health Check","description":"Check name"}},"required":["id","name"]},"description":"Uptime checks this webhook is associated with"},"in":"body","name":"checks","depth":2,"description":"Uptime checks this webhook is associated with","type":"array","safeType":"object[]","required":true,"displayName":"»» checks"},{"schema":{"type":"string","example":"c1d2e3f4","description":"Check ID"},"in":"body","name":"id","depth":3,"description":"Check ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","example":"API Health Check","description":"Check name"},"in":"body","name":"name","depth":3,"description":"Check name","type":"string","safeType":"string","required":true,"displayName":"»»» name"},{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"h1i2j3k4","description":"Heartbeat ID"},"name":{"type":"string","example":"Daily Backup Job","description":"Heartbeat name"}},"required":["id","name"]},"description":"Heartbeats this webhook is associated with"},"in":"body","name":"heartbeats","depth":2,"description":"Heartbeats this webhook is associated with","type":"array","safeType":"object[]","required":true,"displayName":"»» heartbeats"},{"schema":{"type":"string","example":"h1i2j3k4","description":"Heartbeat ID"},"in":"body","name":"id","depth":3,"description":"Heartbeat ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","example":"Daily Backup Job","description":"Heartbeat name"},"in":"body","name":"name","depth":3,"description":"Heartbeat name","type":"string","safeType":"string","required":true,"displayName":"»»» name"},{"schema":{"type":"object","properties":{"page":{"type":"number","default":1,"example":1,"description":"Page number of paginated results."},"per_page":{"type":"number","default":20,"example":20,"description":"Number of items per page."},"count":{"type":"number","example":1,"description":"Number of items on the current page."},"total_count":{"type":"number","example":1,"description":"Total number of items."}},"required":["count","total_count"]},"in":"body","name":"result_info","depth":1,"type":"object","safeType":"object","required":true,"displayName":"» result_info"},{"schema":{"type":"number","default":1,"example":1,"description":"Page number of paginated results."},"in":"body","name":"page","depth":2,"description":"Page number of paginated results.","type":"number","safeType":"number","required":false,"displayName":"»» page"},{"schema":{"type":"number","default":20,"example":20,"description":"Number of items per page."},"in":"body","name":"per_page","depth":2,"description":"Number of items per page.","type":"number","safeType":"number","required":false,"displayName":"»» per_page"},{"schema":{"type":"number","example":1,"description":"Number of items on the current page."},"in":"body","name":"count","depth":2,"description":"Number of items on the current page.","type":"number","safeType":"number","required":true,"displayName":"»» count"},{"schema":{"type":"number","example":1,"description":"Total number of items."},"in":"body","name":"total_count","depth":2,"description":"Total number of items.","type":"number","safeType":"number","required":true,"displayName":"»» total_count"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="GET" label="/v1/webhooks">
```bash {{ title: 'cURL' }}
curl --request GET \
  --url https://api.onlineornot.com/v1/webhooks \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'
```

```javascript
fetch("https://api.onlineornot.com/v1/webhooks", {
  "method": "GET",
  "headers": {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/webhooks")
  .get()
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/webhooks');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/webhooks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/webhooks"

headers = {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": [
    {
      "id": "a1b2c3d4",
      "url": "https://api.example.com/webhooks/onlineornot",
      "description": "Production webhook for incident notifications",
      "events": [
        "status_page.incident.started",
        "status_page.incident.resolved"
      ],
      "created_at": "2024-01-15T10:30:00.000Z",
      "updated_at": "2024-01-15T10:30:00.000Z",
      "status_pages": [
        {
          "id": "x9y8z7w6",
          "name": "My Status Page"
        }
      ],
      "checks": [
        {
          "id": "c1d2e3f4",
          "name": "API Health Check"
        }
      ],
      "heartbeats": [
        {
          "id": "h1i2j3k4",
          "name": "Daily Backup Job"
        }
      ]
    }
  ],
  "result_info": {
    "page": 1,
    "per_page": 20,
    "count": 1,
    "total_count": 1
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

## Create a webhook   {{ tag: 'POST', label: '/v1/webhooks' }}
<Row>
<Col>

<a id="opIdcreateWebhook"></a>

*Create a new webhook to receive event notifications*

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"in":"body","schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","example":"https://api.example.com/webhooks/onlineornot","description":"Webhook endpoint URL"},"description":{"type":"string","example":"Production webhook for incident notifications","description":"Optional description of the webhook"},"events":{"type":"array","items":{"type":"string","enum":["status_page.incident.started","status_page.incident.updated","status_page.incident.resolved","uptime.down","uptime.up","heartbeat.down","heartbeat.up"],"description":"Webhook event type","example":"status_page.incident.started"},"minItems":1,"example":["status_page.incident.started","status_page.incident.resolved"],"description":"Event types this webhook should subscribe to"},"status_page_ids":{"type":"array","items":{"type":"string"},"example":["x9y8z7w6","p5q4r3s2"],"description":"IDs of status pages to associate with this webhook"},"check_ids":{"type":"array","items":{"type":"string"},"example":["c1d2e3f4","g5h6i7j8"],"description":"IDs of uptime checks to associate with this webhook"},"heartbeat_ids":{"type":"array","items":{"type":"string"},"example":["h1i2j3k4","l5m6n7o8"],"description":"IDs of heartbeats to associate with this webhook"}},"required":["url","events"]},"name":"body","required":true,"exampleValues":{"object":{"url":"https://api.example.com/webhooks/onlineornot","description":"Production webhook for incident notifications","events":["status_page.incident.started","status_page.incident.resolved"],"status_page_ids":["x9y8z7w6","p5q4r3s2"],"check_ids":["c1d2e3f4","g5h6i7j8"],"heartbeat_ids":["h1i2j3k4","l5m6n7o8"]},"json":"{\n  \"url\": \"https://api.example.com/webhooks/onlineornot\",\n  \"description\": \"Production webhook for incident notifications\",\n  \"events\": [\n    \"status_page.incident.started\",\n    \"status_page.incident.resolved\"\n  ],\n  \"status_page_ids\": [\n    \"x9y8z7w6\",\n    \"p5q4r3s2\"\n  ],\n  \"check_ids\": [\n    \"c1d2e3f4\",\n    \"g5h6i7j8\"\n  ],\n  \"heartbeat_ids\": [\n    \"h1i2j3k4\",\n    \"l5m6n7o8\"\n  ]\n}"},"originalType":"object","safeType":"object"},{"in":"body","schema":{"type":"string","format":"uri","example":"https://api.example.com/webhooks/onlineornot","description":"Webhook endpoint URL"},"name":"» url","required":true,"description":"Webhook endpoint URL","safeType":"string(uri)","depth":1,"exampleValues":{"object":"https://api.example.com/webhooks/onlineornot","json":"'https://api.example.com/webhooks/onlineornot'"},"shortDesc":"Webhook endpoint URL"},{"in":"body","schema":{"type":"string","example":"Production webhook for incident notifications","description":"Optional description of the webhook"},"name":"» description","required":false,"description":"Optional description of the webhook","safeType":"string","depth":1,"exampleValues":{"object":"Production webhook for incident notifications","json":"'Production webhook for incident notifications'"},"shortDesc":"Optional description of the webhook"},{"in":"body","schema":{"type":"array","items":{"type":"string","enum":["status_page.incident.started","status_page.incident.updated","status_page.incident.resolved","uptime.down","uptime.up","heartbeat.down","heartbeat.up"],"description":"Webhook event type","example":"status_page.incident.started"},"minItems":1,"example":["status_page.incident.started","status_page.incident.resolved"],"description":"Event types this webhook should subscribe to"},"name":"» events","required":true,"description":"Event types this webhook should subscribe to","safeType":"string[]","depth":1,"exampleValues":{"object":["status_page.incident.started","status_page.incident.resolved"],"json":"[\n  \"status_page.incident.started\",\n  \"status_page.incident.resolved\"\n]"},"shortDesc":"Event types this webhook should subscribe to"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"example":["x9y8z7w6","p5q4r3s2"],"description":"IDs of status pages to associate with this webhook"},"name":"» status_page_ids","required":false,"description":"IDs of status pages to associate with this webhook","safeType":"string[]","depth":1,"exampleValues":{"object":["x9y8z7w6","p5q4r3s2"],"json":"[\n  \"x9y8z7w6\",\n  \"p5q4r3s2\"\n]"},"shortDesc":"IDs of status pages to associate with this webhook"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"example":["c1d2e3f4","g5h6i7j8"],"description":"IDs of uptime checks to associate with this webhook"},"name":"» check_ids","required":false,"description":"IDs of uptime checks to associate with this webhook","safeType":"string[]","depth":1,"exampleValues":{"object":["c1d2e3f4","g5h6i7j8"],"json":"[\n  \"c1d2e3f4\",\n  \"g5h6i7j8\"\n]"},"shortDesc":"IDs of uptime checks to associate with this webhook"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"example":["h1i2j3k4","l5m6n7o8"],"description":"IDs of heartbeats to associate with this webhook"},"name":"» heartbeat_ids","required":false,"description":"IDs of heartbeats to associate with this webhook","safeType":"string[]","depth":1,"exampleValues":{"object":["h1i2j3k4","l5m6n7o8"],"json":"[\n  \"h1i2j3k4\",\n  \"l5m6n7o8\"\n]"},"shortDesc":"IDs of heartbeats to associate with this webhook"}]} title="Body parameters" />

<h3 id="create-a-new-webhook-to-receive-event-notifications-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|Webhook created successfully|
|401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Unauthorized|
|403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|Forbidden - Webhooks require a paid plan|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"201","properties":[{"schema":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Webhook ID"},"url":{"type":"string","format":"uri","example":"https://api.example.com/webhooks/onlineornot","description":"Webhook endpoint URL"},"description":{"type":["string","null"],"example":"Production webhook for incident notifications","description":"Optional description of the webhook"},"events":{"type":"array","items":{"type":"string","enum":["status_page.incident.started","status_page.incident.updated","status_page.incident.resolved","uptime.down","uptime.up","heartbeat.down","heartbeat.up"],"description":"Webhook event type","example":"status_page.incident.started"},"example":["status_page.incident.started","status_page.incident.resolved"],"description":"Event types this webhook subscribes to"},"created_at":{"type":"string","example":"2024-01-15T10:30:00.000Z","description":"Webhook creation timestamp"},"updated_at":{"type":"string","example":"2024-01-15T10:30:00.000Z","description":"Webhook last update timestamp"},"status_pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"x9y8z7w6","description":"Status page ID"},"name":{"type":"string","example":"My Status Page","description":"Status page name"}},"required":["id","name"]},"description":"Status pages this webhook is associated with"},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"c1d2e3f4","description":"Check ID"},"name":{"type":"string","example":"API Health Check","description":"Check name"}},"required":["id","name"]},"description":"Uptime checks this webhook is associated with"},"heartbeats":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"h1i2j3k4","description":"Heartbeat ID"},"name":{"type":"string","example":"Daily Backup Job","description":"Heartbeat name"}},"required":["id","name"]},"description":"Heartbeats this webhook is associated with"}},"required":["id","url","description","events","created_at","updated_at","status_pages","checks","heartbeats"]},"in":"body","name":"result","depth":1,"type":"object","safeType":"object","required":true,"displayName":"» result"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Webhook ID"},"in":"body","name":"id","depth":2,"description":"Webhook ID","type":"string","safeType":"string","required":true,"displayName":"»» id"},{"schema":{"type":"string","format":"uri","example":"https://api.example.com/webhooks/onlineornot","description":"Webhook endpoint URL"},"in":"body","name":"url","depth":2,"description":"Webhook endpoint URL","type":"string","format":"uri","safeType":"string(uri)","required":true,"displayName":"»» url"},{"schema":{"type":["string","null"],"example":"Production webhook for incident notifications","description":"Optional description of the webhook"},"in":"body","name":"description","depth":2,"description":"Optional description of the webhook","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»» description"},{"schema":{"type":"array","items":{"type":"string","enum":["status_page.incident.started","status_page.incident.updated","status_page.incident.resolved","uptime.down","uptime.up","heartbeat.down","heartbeat.up"],"description":"Webhook event type","example":"status_page.incident.started"},"example":["status_page.incident.started","status_page.incident.resolved"],"description":"Event types this webhook subscribes to"},"in":"body","name":"events","depth":2,"description":"Event types this webhook subscribes to","type":"array","safeType":"string[]","required":true,"displayName":"»» events"},{"schema":{"type":"string","example":"2024-01-15T10:30:00.000Z","description":"Webhook creation timestamp"},"in":"body","name":"created_at","depth":2,"description":"Webhook creation timestamp","type":"string","safeType":"string","required":true,"displayName":"»» created_at"},{"schema":{"type":"string","example":"2024-01-15T10:30:00.000Z","description":"Webhook last update timestamp"},"in":"body","name":"updated_at","depth":2,"description":"Webhook last update timestamp","type":"string","safeType":"string","required":true,"displayName":"»» updated_at"},{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"x9y8z7w6","description":"Status page ID"},"name":{"type":"string","example":"My Status Page","description":"Status page name"}},"required":["id","name"]},"description":"Status pages this webhook is associated with"},"in":"body","name":"status_pages","depth":2,"description":"Status pages this webhook is associated with","type":"array","safeType":"object[]","required":true,"displayName":"»» status_pages"},{"schema":{"type":"string","example":"x9y8z7w6","description":"Status page ID"},"in":"body","name":"id","depth":3,"description":"Status page ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","example":"My Status Page","description":"Status page name"},"in":"body","name":"name","depth":3,"description":"Status page name","type":"string","safeType":"string","required":true,"displayName":"»»» name"},{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"c1d2e3f4","description":"Check ID"},"name":{"type":"string","example":"API Health Check","description":"Check name"}},"required":["id","name"]},"description":"Uptime checks this webhook is associated with"},"in":"body","name":"checks","depth":2,"description":"Uptime checks this webhook is associated with","type":"array","safeType":"object[]","required":true,"displayName":"»» checks"},{"schema":{"type":"string","example":"c1d2e3f4","description":"Check ID"},"in":"body","name":"id","depth":3,"description":"Check ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","example":"API Health Check","description":"Check name"},"in":"body","name":"name","depth":3,"description":"Check name","type":"string","safeType":"string","required":true,"displayName":"»»» name"},{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"h1i2j3k4","description":"Heartbeat ID"},"name":{"type":"string","example":"Daily Backup Job","description":"Heartbeat name"}},"required":["id","name"]},"description":"Heartbeats this webhook is associated with"},"in":"body","name":"heartbeats","depth":2,"description":"Heartbeats this webhook is associated with","type":"array","safeType":"object[]","required":true,"displayName":"»» heartbeats"},{"schema":{"type":"string","example":"h1i2j3k4","description":"Heartbeat ID"},"in":"body","name":"id","depth":3,"description":"Heartbeat ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","example":"Daily Backup Job","description":"Heartbeat name"},"in":"body","name":"name","depth":3,"description":"Heartbeat name","type":"string","safeType":"string","required":true,"displayName":"»»» name"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="POST" label="/v1/webhooks">
```bash {{ title: 'cURL' }}
curl --request POST \
  --url https://api.onlineornot.com/v1/webhooks \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"url":"https://api.example.com/webhooks/onlineornot","events":["status_page.incident.started","status_page.incident.resolved"]}'
```

```javascript
fetch("https://api.onlineornot.com/v1/webhooks", {
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  },
  "body": "{\"url\":\"https://api.example.com/webhooks/onlineornot\",\"events\":[\"status_page.incident.started\",\"status_page.incident.resolved\"]}"
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"url\":\"https://api.example.com/webhooks/onlineornot\",\"events\":[\"status_page.incident.started\",\"status_page.incident.resolved\"]}");
Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/webhooks")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/webhooks');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders([
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

$request->setBody('{"url":"https://api.example.com/webhooks/onlineornot","events":["status_page.incident.started","status_page.incident.resolved"]}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/webhooks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'
request.body = "{\"url\":\"https://api.example.com/webhooks/onlineornot\",\"events\":[\"status_page.incident.started\",\"status_page.incident.resolved\"]}"

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/webhooks"

payload = {
    "url": "https://api.example.com/webhooks/onlineornot",
    "events": ["status_page.incident.started", "status_page.incident.resolved"]
}
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "id": "a1b2c3d4",
    "url": "https://api.example.com/webhooks/onlineornot",
    "description": "Production webhook for incident notifications",
    "events": [
      "status_page.incident.started",
      "status_page.incident.resolved"
    ],
    "created_at": "2024-01-15T10:30:00.000Z",
    "updated_at": "2024-01-15T10:30:00.000Z",
    "status_pages": [
      {
        "id": "x9y8z7w6",
        "name": "My Status Page"
      }
    ],
    "checks": [
      {
        "id": "c1d2e3f4",
        "name": "API Health Check"
      }
    ],
    "heartbeats": [
      {
        "id": "h1i2j3k4",
        "name": "Daily Backup Job"
      }
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

## Retrieve a webhook   {{ tag: 'GET', label: '/v1/webhooks/{webhook_id}' }}
<Row>
<Col>

<a id="opIdgetWebhook"></a>

*Look up detailed information about a specific webhook*

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Webhook ID"},"required":true,"description":"Webhook ID","name":"webhook_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Webhook ID","style":"simple"}]} title="Path parameters" />

<h3 id="look-up-detailed-information-about-a-specific-webhook-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Returns the specified webhook|
|401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Unauthorized|
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Webhook not found|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"200","properties":[{"schema":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Webhook ID"},"url":{"type":"string","format":"uri","example":"https://api.example.com/webhooks/onlineornot","description":"Webhook endpoint URL"},"description":{"type":["string","null"],"example":"Production webhook for incident notifications","description":"Optional description of the webhook"},"events":{"type":"array","items":{"type":"string","enum":["status_page.incident.started","status_page.incident.updated","status_page.incident.resolved","uptime.down","uptime.up","heartbeat.down","heartbeat.up"],"description":"Webhook event type","example":"status_page.incident.started"},"example":["status_page.incident.started","status_page.incident.resolved"],"description":"Event types this webhook subscribes to"},"created_at":{"type":"string","example":"2024-01-15T10:30:00.000Z","description":"Webhook creation timestamp"},"updated_at":{"type":"string","example":"2024-01-15T10:30:00.000Z","description":"Webhook last update timestamp"},"status_pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"x9y8z7w6","description":"Status page ID"},"name":{"type":"string","example":"My Status Page","description":"Status page name"}},"required":["id","name"]},"description":"Status pages this webhook is associated with"},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"c1d2e3f4","description":"Check ID"},"name":{"type":"string","example":"API Health Check","description":"Check name"}},"required":["id","name"]},"description":"Uptime checks this webhook is associated with"},"heartbeats":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"h1i2j3k4","description":"Heartbeat ID"},"name":{"type":"string","example":"Daily Backup Job","description":"Heartbeat name"}},"required":["id","name"]},"description":"Heartbeats this webhook is associated with"}},"required":["id","url","description","events","created_at","updated_at","status_pages","checks","heartbeats"]},"in":"body","name":"result","depth":1,"type":"object","safeType":"object","required":true,"displayName":"» result"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Webhook ID"},"in":"body","name":"id","depth":2,"description":"Webhook ID","type":"string","safeType":"string","required":true,"displayName":"»» id"},{"schema":{"type":"string","format":"uri","example":"https://api.example.com/webhooks/onlineornot","description":"Webhook endpoint URL"},"in":"body","name":"url","depth":2,"description":"Webhook endpoint URL","type":"string","format":"uri","safeType":"string(uri)","required":true,"displayName":"»» url"},{"schema":{"type":["string","null"],"example":"Production webhook for incident notifications","description":"Optional description of the webhook"},"in":"body","name":"description","depth":2,"description":"Optional description of the webhook","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»» description"},{"schema":{"type":"array","items":{"type":"string","enum":["status_page.incident.started","status_page.incident.updated","status_page.incident.resolved","uptime.down","uptime.up","heartbeat.down","heartbeat.up"],"description":"Webhook event type","example":"status_page.incident.started"},"example":["status_page.incident.started","status_page.incident.resolved"],"description":"Event types this webhook subscribes to"},"in":"body","name":"events","depth":2,"description":"Event types this webhook subscribes to","type":"array","safeType":"string[]","required":true,"displayName":"»» events"},{"schema":{"type":"string","example":"2024-01-15T10:30:00.000Z","description":"Webhook creation timestamp"},"in":"body","name":"created_at","depth":2,"description":"Webhook creation timestamp","type":"string","safeType":"string","required":true,"displayName":"»» created_at"},{"schema":{"type":"string","example":"2024-01-15T10:30:00.000Z","description":"Webhook last update timestamp"},"in":"body","name":"updated_at","depth":2,"description":"Webhook last update timestamp","type":"string","safeType":"string","required":true,"displayName":"»» updated_at"},{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"x9y8z7w6","description":"Status page ID"},"name":{"type":"string","example":"My Status Page","description":"Status page name"}},"required":["id","name"]},"description":"Status pages this webhook is associated with"},"in":"body","name":"status_pages","depth":2,"description":"Status pages this webhook is associated with","type":"array","safeType":"object[]","required":true,"displayName":"»» status_pages"},{"schema":{"type":"string","example":"x9y8z7w6","description":"Status page ID"},"in":"body","name":"id","depth":3,"description":"Status page ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","example":"My Status Page","description":"Status page name"},"in":"body","name":"name","depth":3,"description":"Status page name","type":"string","safeType":"string","required":true,"displayName":"»»» name"},{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"c1d2e3f4","description":"Check ID"},"name":{"type":"string","example":"API Health Check","description":"Check name"}},"required":["id","name"]},"description":"Uptime checks this webhook is associated with"},"in":"body","name":"checks","depth":2,"description":"Uptime checks this webhook is associated with","type":"array","safeType":"object[]","required":true,"displayName":"»» checks"},{"schema":{"type":"string","example":"c1d2e3f4","description":"Check ID"},"in":"body","name":"id","depth":3,"description":"Check ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","example":"API Health Check","description":"Check name"},"in":"body","name":"name","depth":3,"description":"Check name","type":"string","safeType":"string","required":true,"displayName":"»»» name"},{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"h1i2j3k4","description":"Heartbeat ID"},"name":{"type":"string","example":"Daily Backup Job","description":"Heartbeat name"}},"required":["id","name"]},"description":"Heartbeats this webhook is associated with"},"in":"body","name":"heartbeats","depth":2,"description":"Heartbeats this webhook is associated with","type":"array","safeType":"object[]","required":true,"displayName":"»» heartbeats"},{"schema":{"type":"string","example":"h1i2j3k4","description":"Heartbeat ID"},"in":"body","name":"id","depth":3,"description":"Heartbeat ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","example":"Daily Backup Job","description":"Heartbeat name"},"in":"body","name":"name","depth":3,"description":"Heartbeat name","type":"string","safeType":"string","required":true,"displayName":"»»» name"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="GET" label="/v1/webhooks/{webhook_id}">
```bash {{ title: 'cURL' }}
curl --request GET \
  --url https://api.onlineornot.com/v1/webhooks/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'
```

```javascript
fetch("https://api.onlineornot.com/v1/webhooks/a1b2c3d4", {
  "method": "GET",
  "headers": {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/webhooks/a1b2c3d4")
  .get()
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/webhooks/a1b2c3d4');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/webhooks/a1b2c3d4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/webhooks/a1b2c3d4"

headers = {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "id": "a1b2c3d4",
    "url": "https://api.example.com/webhooks/onlineornot",
    "description": "Production webhook for incident notifications",
    "events": [
      "status_page.incident.started",
      "status_page.incident.resolved"
    ],
    "created_at": "2024-01-15T10:30:00.000Z",
    "updated_at": "2024-01-15T10:30:00.000Z",
    "status_pages": [
      {
        "id": "x9y8z7w6",
        "name": "My Status Page"
      }
    ],
    "checks": [
      {
        "id": "c1d2e3f4",
        "name": "API Health Check"
      }
    ],
    "heartbeats": [
      {
        "id": "h1i2j3k4",
        "name": "Daily Backup Job"
      }
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

## Modify a webhook   {{ tag: 'PATCH', label: '/v1/webhooks/{webhook_id}' }}
<Row>
<Col>

<a id="opIdupdateWebhook"></a>

*Update the configuration of an existing webhook*

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Webhook ID"},"required":true,"description":"Webhook ID","name":"webhook_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Webhook ID","style":"simple"}]} title="Path parameters" />

<ParameterTree parameters={[{"in":"body","schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","example":"https://api.example.com/webhooks/onlineornot","description":"Webhook endpoint URL"},"description":{"type":"string","example":"Production webhook for incident notifications","description":"Optional description of the webhook"},"events":{"type":"array","items":{"type":"string","enum":["status_page.incident.started","status_page.incident.updated","status_page.incident.resolved","uptime.down","uptime.up","heartbeat.down","heartbeat.up"],"description":"Webhook event type","example":"status_page.incident.started"},"minItems":1,"example":["status_page.incident.started","status_page.incident.resolved"],"description":"Event types this webhook should subscribe to"},"status_page_ids":{"type":"array","items":{"type":"string"},"example":["x9y8z7w6","p5q4r3s2"],"description":"IDs of status pages to associate with this webhook"},"check_ids":{"type":"array","items":{"type":"string"},"example":["c1d2e3f4","g5h6i7j8"],"description":"IDs of uptime checks to associate with this webhook"},"heartbeat_ids":{"type":"array","items":{"type":"string"},"example":["h1i2j3k4","l5m6n7o8"],"description":"IDs of heartbeats to associate with this webhook"}}},"name":"body","required":true,"exampleValues":{"object":{"url":"https://api.example.com/webhooks/onlineornot","description":"Production webhook for incident notifications","events":["status_page.incident.started","status_page.incident.resolved"],"status_page_ids":["x9y8z7w6","p5q4r3s2"],"check_ids":["c1d2e3f4","g5h6i7j8"],"heartbeat_ids":["h1i2j3k4","l5m6n7o8"]},"json":"{\n  \"url\": \"https://api.example.com/webhooks/onlineornot\",\n  \"description\": \"Production webhook for incident notifications\",\n  \"events\": [\n    \"status_page.incident.started\",\n    \"status_page.incident.resolved\"\n  ],\n  \"status_page_ids\": [\n    \"x9y8z7w6\",\n    \"p5q4r3s2\"\n  ],\n  \"check_ids\": [\n    \"c1d2e3f4\",\n    \"g5h6i7j8\"\n  ],\n  \"heartbeat_ids\": [\n    \"h1i2j3k4\",\n    \"l5m6n7o8\"\n  ]\n}"},"originalType":"object","safeType":"object"},{"in":"body","schema":{"type":"string","format":"uri","example":"https://api.example.com/webhooks/onlineornot","description":"Webhook endpoint URL"},"name":"» url","required":false,"description":"Webhook endpoint URL","safeType":"string(uri)","depth":1,"exampleValues":{"object":"https://api.example.com/webhooks/onlineornot","json":"'https://api.example.com/webhooks/onlineornot'"},"shortDesc":"Webhook endpoint URL"},{"in":"body","schema":{"type":"string","example":"Production webhook for incident notifications","description":"Optional description of the webhook"},"name":"» description","required":false,"description":"Optional description of the webhook","safeType":"string","depth":1,"exampleValues":{"object":"Production webhook for incident notifications","json":"'Production webhook for incident notifications'"},"shortDesc":"Optional description of the webhook"},{"in":"body","schema":{"type":"array","items":{"type":"string","enum":["status_page.incident.started","status_page.incident.updated","status_page.incident.resolved","uptime.down","uptime.up","heartbeat.down","heartbeat.up"],"description":"Webhook event type","example":"status_page.incident.started"},"minItems":1,"example":["status_page.incident.started","status_page.incident.resolved"],"description":"Event types this webhook should subscribe to"},"name":"» events","required":false,"description":"Event types this webhook should subscribe to","safeType":"string[]","depth":1,"exampleValues":{"object":["status_page.incident.started","status_page.incident.resolved"],"json":"[\n  \"status_page.incident.started\",\n  \"status_page.incident.resolved\"\n]"},"shortDesc":"Event types this webhook should subscribe to"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"example":["x9y8z7w6","p5q4r3s2"],"description":"IDs of status pages to associate with this webhook"},"name":"» status_page_ids","required":false,"description":"IDs of status pages to associate with this webhook","safeType":"string[]","depth":1,"exampleValues":{"object":["x9y8z7w6","p5q4r3s2"],"json":"[\n  \"x9y8z7w6\",\n  \"p5q4r3s2\"\n]"},"shortDesc":"IDs of status pages to associate with this webhook"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"example":["c1d2e3f4","g5h6i7j8"],"description":"IDs of uptime checks to associate with this webhook"},"name":"» check_ids","required":false,"description":"IDs of uptime checks to associate with this webhook","safeType":"string[]","depth":1,"exampleValues":{"object":["c1d2e3f4","g5h6i7j8"],"json":"[\n  \"c1d2e3f4\",\n  \"g5h6i7j8\"\n]"},"shortDesc":"IDs of uptime checks to associate with this webhook"},{"in":"body","schema":{"type":"array","items":{"type":"string"},"example":["h1i2j3k4","l5m6n7o8"],"description":"IDs of heartbeats to associate with this webhook"},"name":"» heartbeat_ids","required":false,"description":"IDs of heartbeats to associate with this webhook","safeType":"string[]","depth":1,"exampleValues":{"object":["h1i2j3k4","l5m6n7o8"],"json":"[\n  \"h1i2j3k4\",\n  \"l5m6n7o8\"\n]"},"shortDesc":"IDs of heartbeats to associate with this webhook"}]} title="Body parameters" />

<h3 id="update-the-configuration-of-an-existing-webhook-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Webhook updated successfully|
|401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Unauthorized|
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Webhook not found|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"200","properties":[{"schema":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"Webhook ID"},"url":{"type":"string","format":"uri","example":"https://api.example.com/webhooks/onlineornot","description":"Webhook endpoint URL"},"description":{"type":["string","null"],"example":"Production webhook for incident notifications","description":"Optional description of the webhook"},"events":{"type":"array","items":{"type":"string","enum":["status_page.incident.started","status_page.incident.updated","status_page.incident.resolved","uptime.down","uptime.up","heartbeat.down","heartbeat.up"],"description":"Webhook event type","example":"status_page.incident.started"},"example":["status_page.incident.started","status_page.incident.resolved"],"description":"Event types this webhook subscribes to"},"created_at":{"type":"string","example":"2024-01-15T10:30:00.000Z","description":"Webhook creation timestamp"},"updated_at":{"type":"string","example":"2024-01-15T10:30:00.000Z","description":"Webhook last update timestamp"},"status_pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"x9y8z7w6","description":"Status page ID"},"name":{"type":"string","example":"My Status Page","description":"Status page name"}},"required":["id","name"]},"description":"Status pages this webhook is associated with"},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"c1d2e3f4","description":"Check ID"},"name":{"type":"string","example":"API Health Check","description":"Check name"}},"required":["id","name"]},"description":"Uptime checks this webhook is associated with"},"heartbeats":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"h1i2j3k4","description":"Heartbeat ID"},"name":{"type":"string","example":"Daily Backup Job","description":"Heartbeat name"}},"required":["id","name"]},"description":"Heartbeats this webhook is associated with"}},"required":["id","url","description","events","created_at","updated_at","status_pages","checks","heartbeats"]},"in":"body","name":"result","depth":1,"type":"object","safeType":"object","required":true,"displayName":"» result"},{"schema":{"type":"string","example":"a1b2c3d4","description":"Webhook ID"},"in":"body","name":"id","depth":2,"description":"Webhook ID","type":"string","safeType":"string","required":true,"displayName":"»» id"},{"schema":{"type":"string","format":"uri","example":"https://api.example.com/webhooks/onlineornot","description":"Webhook endpoint URL"},"in":"body","name":"url","depth":2,"description":"Webhook endpoint URL","type":"string","format":"uri","safeType":"string(uri)","required":true,"displayName":"»» url"},{"schema":{"type":["string","null"],"example":"Production webhook for incident notifications","description":"Optional description of the webhook"},"in":"body","name":"description","depth":2,"description":"Optional description of the webhook","type":["string","null"],"safeType":["string","null"],"required":true,"displayName":"»» description"},{"schema":{"type":"array","items":{"type":"string","enum":["status_page.incident.started","status_page.incident.updated","status_page.incident.resolved","uptime.down","uptime.up","heartbeat.down","heartbeat.up"],"description":"Webhook event type","example":"status_page.incident.started"},"example":["status_page.incident.started","status_page.incident.resolved"],"description":"Event types this webhook subscribes to"},"in":"body","name":"events","depth":2,"description":"Event types this webhook subscribes to","type":"array","safeType":"string[]","required":true,"displayName":"»» events"},{"schema":{"type":"string","example":"2024-01-15T10:30:00.000Z","description":"Webhook creation timestamp"},"in":"body","name":"created_at","depth":2,"description":"Webhook creation timestamp","type":"string","safeType":"string","required":true,"displayName":"»» created_at"},{"schema":{"type":"string","example":"2024-01-15T10:30:00.000Z","description":"Webhook last update timestamp"},"in":"body","name":"updated_at","depth":2,"description":"Webhook last update timestamp","type":"string","safeType":"string","required":true,"displayName":"»» updated_at"},{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"x9y8z7w6","description":"Status page ID"},"name":{"type":"string","example":"My Status Page","description":"Status page name"}},"required":["id","name"]},"description":"Status pages this webhook is associated with"},"in":"body","name":"status_pages","depth":2,"description":"Status pages this webhook is associated with","type":"array","safeType":"object[]","required":true,"displayName":"»» status_pages"},{"schema":{"type":"string","example":"x9y8z7w6","description":"Status page ID"},"in":"body","name":"id","depth":3,"description":"Status page ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","example":"My Status Page","description":"Status page name"},"in":"body","name":"name","depth":3,"description":"Status page name","type":"string","safeType":"string","required":true,"displayName":"»»» name"},{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"c1d2e3f4","description":"Check ID"},"name":{"type":"string","example":"API Health Check","description":"Check name"}},"required":["id","name"]},"description":"Uptime checks this webhook is associated with"},"in":"body","name":"checks","depth":2,"description":"Uptime checks this webhook is associated with","type":"array","safeType":"object[]","required":true,"displayName":"»» checks"},{"schema":{"type":"string","example":"c1d2e3f4","description":"Check ID"},"in":"body","name":"id","depth":3,"description":"Check ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","example":"API Health Check","description":"Check name"},"in":"body","name":"name","depth":3,"description":"Check name","type":"string","safeType":"string","required":true,"displayName":"»»» name"},{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"h1i2j3k4","description":"Heartbeat ID"},"name":{"type":"string","example":"Daily Backup Job","description":"Heartbeat name"}},"required":["id","name"]},"description":"Heartbeats this webhook is associated with"},"in":"body","name":"heartbeats","depth":2,"description":"Heartbeats this webhook is associated with","type":"array","safeType":"object[]","required":true,"displayName":"»» heartbeats"},{"schema":{"type":"string","example":"h1i2j3k4","description":"Heartbeat ID"},"in":"body","name":"id","depth":3,"description":"Heartbeat ID","type":"string","safeType":"string","required":true,"displayName":"»»» id"},{"schema":{"type":"string","example":"Daily Backup Job","description":"Heartbeat name"},"in":"body","name":"name","depth":3,"description":"Heartbeat name","type":"string","safeType":"string","required":true,"displayName":"»»» name"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="PATCH" label="/v1/webhooks/{webhook_id}">
```bash {{ title: 'cURL' }}
curl --request PATCH \
  --url https://api.onlineornot.com/v1/webhooks/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"url":"https://api.example.com/webhooks/new-endpoint"}'
```

```javascript
fetch("https://api.onlineornot.com/v1/webhooks/a1b2c3d4", {
  "method": "PATCH",
  "headers": {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  },
  "body": "{\"url\":\"https://api.example.com/webhooks/new-endpoint\"}"
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"url\":\"https://api.example.com/webhooks/new-endpoint\"}");
Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/webhooks/a1b2c3d4")
  .patch(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

HttpRequest::methodRegister('PATCH');
$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/webhooks/a1b2c3d4');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);

$request->setHeaders([
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

$request->setBody('{"url":"https://api.example.com/webhooks/new-endpoint"}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/webhooks/a1b2c3d4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'
request.body = "{\"url\":\"https://api.example.com/webhooks/new-endpoint\"}"

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/webhooks/a1b2c3d4"

payload = {"url": "https://api.example.com/webhooks/new-endpoint"}
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("PATCH", url, json=payload, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "id": "a1b2c3d4",
    "url": "https://api.example.com/webhooks/onlineornot",
    "description": "Production webhook for incident notifications",
    "events": [
      "status_page.incident.started",
      "status_page.incident.resolved"
    ],
    "created_at": "2024-01-15T10:30:00.000Z",
    "updated_at": "2024-01-15T10:30:00.000Z",
    "status_pages": [
      {
        "id": "x9y8z7w6",
        "name": "My Status Page"
      }
    ],
    "checks": [
      {
        "id": "c1d2e3f4",
        "name": "API Health Check"
      }
    ],
    "heartbeats": [
      {
        "id": "h1i2j3k4",
        "name": "Daily Backup Job"
      }
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

## Delete a webhook   {{ tag: 'DELETE', label: '/v1/webhooks/{webhook_id}' }}
<Row>
<Col>

<a id="opIddeleteWebhook"></a>

*Permanently delete a webhook*

### Security: Bearer Auth
Provide your bearer token in the Authorization header when making requests to protected resources.

Example: `Authorization: Bearer 123`

<ParameterTree parameters={[{"schema":{"type":"string","minLength":8,"example":"a1b2c3d4","description":"Webhook ID"},"required":true,"description":"Webhook ID","name":"webhook_id","in":"path","exampleValues":{"object":"a1b2c3d4","json":"'a1b2c3d4'"},"originalType":"string","safeType":"string","shortDesc":"Webhook ID","style":"simple"}]} title="Path parameters" />

<h3 id="permanently-delete-a-webhook-responses">Responses</h3>

|Status|Meaning|Description|
|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Returns the deleted webhook's ID|
|401|[Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1)|Unauthorized|
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Webhook not found|
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal Server Error|

<ResponseSchemas schemas={[{"status":"200","properties":[{"schema":{"type":"object","properties":{"id":{"type":"string","example":"a1b2c3d4","description":"ID of the deleted webhook"}},"required":["id"]},"in":"body","name":"result","depth":1,"type":"object","safeType":"object","required":true,"displayName":"» result"},{"schema":{"type":"string","example":"a1b2c3d4","description":"ID of the deleted webhook"},"in":"body","name":"id","depth":2,"description":"ID of the deleted webhook","type":"string","safeType":"string","required":true,"displayName":"»» id"},{"schema":{"type":"boolean","default":true,"example":true,"description":"Whether the API call was successful"},"in":"body","name":"success","depth":1,"description":"Whether the API call was successful","type":"boolean","safeType":"boolean","required":true,"displayName":"» success"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"errors","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» errors"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"},{"schema":{"type":"array","items":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"type":{"type":"string"}},"required":["code","message"]},"example":[]},"in":"body","name":"messages","depth":1,"type":"array","safeType":"object[]","required":true,"displayName":"» messages"},{"schema":{"type":"number"},"in":"body","name":"code","depth":2,"type":"number","safeType":"number","required":true,"displayName":"»» code"},{"schema":{"type":"string"},"in":"body","name":"message","depth":2,"type":"string","safeType":"string","required":true,"displayName":"»» message"},{"schema":{"type":"string"},"in":"body","name":"type","depth":2,"type":"string","safeType":"string","required":false,"displayName":"»» type"}]}]} />

</Col>

<Col sticky>

<CodeGroup title="Request" tag="DELETE" label="/v1/webhooks/{webhook_id}">
```bash {{ title: 'cURL' }}
curl --request DELETE \
  --url https://api.onlineornot.com/v1/webhooks/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'
```

```javascript
fetch("https://api.onlineornot.com/v1/webhooks/a1b2c3d4", {
  "method": "DELETE",
  "headers": {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});
```

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.onlineornot.com/v1/webhooks/a1b2c3d4")
  .delete(null)
  .addHeader("Accept", "application/json")
  .addHeader("Authorization", "Bearer {access-token}")
  .build();

Response response = client.newCall(request).execute();
```

```php
<?php

$request = new HttpRequest();
$request->setUrl('https://api.onlineornot.com/v1/webhooks/a1b2c3d4');
$request->setMethod(HTTP_METH_DELETE);

$request->setHeaders([
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
]);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
```

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.onlineornot.com/v1/webhooks/a1b2c3d4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["Accept"] = 'application/json'
request["Authorization"] = 'Bearer {access-token}'

response = http.request(request)
puts response.read_body
```

```python
import requests

url = "https://api.onlineornot.com/v1/webhooks/a1b2c3d4"

headers = {
    "Accept": "application/json",
    "Authorization": "Bearer {access-token}"
}

response = requests.request("DELETE", url, headers=headers)

print(response.text)
```

</CodeGroup>

```json {{ title: 'Response' }}
{
  "result": {
    "id": "a1b2c3d4"
  },
  "success": true,
  "errors": [],
  "messages": []
}
```

</Col>
</Row>

---

