GET/v1/webhooks

List all webhooks

Retrieve a paginated list of all webhooks for your organization

Requires WEBHOOKS:READ; EDIT also grants READ. Session cookies are accepted only when no bearer credential is supplied.

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Query parameters

page:integeroptional
Page number of paginated results, starting at 1.
Default: 1
per_page:integeroptional
Number of items per page. Defaults to 20. Continue requesting subsequent pages until the accumulated item count reaches result_info.total_count or a page is empty.
Default: 20
search:stringoptional
Search term to filter results.

Responses

StatusMeaningDescription
200OKReturns a list of webhooks. May also return a canonical failure envelope with success: false at HTTP200.
400Bad RequestInvalid request
401UnauthorizedUnauthorized
403ForbiddenInsufficient permissions
500Internal Server ErrorInternal Server Error

Response Schema

success:boolean
false
result:null
errors:object[]
messages:[any]

Request

GET
/v1/webhooks
curl --request GET \
  --url https://api.onlineornot.com/v1/webhooks \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'X-OnlineOrNot-Organisation: string'

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": []
}

POST/v1/webhooks

Create a webhook

Create a new webhook to receive event notifications

Requires WEBHOOKS:EDIT; EDIT also grants READ. Session cookies are accepted only when no bearer credential is supplied.

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Body parameters

url:string(uri)
Webhook endpoint URL
description:stringoptional
Optional description of the webhook
events:enum[]
Event types this webhook should subscribe to
Accepted values: "status_page.incident.started" | "status_page.incident.updated" | "status_page.incident.resolved" | "uptime.down" | "uptime.up" | "heartbeat.down" | "heartbeat.up"
status_page_ids:string[]optional
IDs of status pages to associate with this webhook
check_ids:string[]optional
IDs of uptime checks to associate with this webhook
heartbeat_ids:string[]optional
IDs of heartbeats to associate with this webhook
*anonymous*:objectoptional

Responses

StatusMeaningDescription
201CreatedWebhook created successfully
400Bad RequestInvalid request
401UnauthorizedUnauthorized
403ForbiddenForbidden - Webhooks require a paid plan
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

POST
/v1/webhooks
curl --request POST \
  --url https://api.onlineornot.com/v1/webhooks \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --header 'X-OnlineOrNot-Organisation: string' \
  --data '{"url":"https://api.example.com/webhooks/onlineornot","events":["status_page.incident.started","status_page.incident.resolved"],"status_page_ids":["x9y8z7w6"]}'

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": []
}

GET/v1/webhooks/{webhook_id}

Retrieve a webhook

Look up detailed information about a specific webhook

Requires WEBHOOKS:READ; EDIT also grants READ. Session cookies are accepted only when no bearer credential is supplied.

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Path parameters

webhook_id:string
Webhook ID

Responses

StatusMeaningDescription
200OKReturns the specified webhook
400Bad RequestInvalid request
401UnauthorizedUnauthorized
403ForbiddenInsufficient permissions
404Not FoundWebhook not found
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

GET
/v1/webhooks/{webhook_id}
curl --request GET \
  --url https://api.onlineornot.com/v1/webhooks/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'X-OnlineOrNot-Organisation: string'

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": []
}

PATCH/v1/webhooks/{webhook_id}

Modify a webhook

Update the configuration of an existing webhook

Requires WEBHOOKS:EDIT; EDIT also grants READ. Session cookies are accepted only when no bearer credential is supplied.

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Path parameters

webhook_id:string
Webhook ID

Body parameters

url:string(uri)optional
Webhook endpoint URL
description:stringoptional
Optional description of the webhook
events:enum[]optional
Event types this webhook should subscribe to
Accepted values: "status_page.incident.started" | "status_page.incident.updated" | "status_page.incident.resolved" | "uptime.down" | "uptime.up" | "heartbeat.down" | "heartbeat.up"
status_page_ids:string[]optional
IDs of status pages to associate with this webhook
check_ids:string[]optional
IDs of uptime checks to associate with this webhook
heartbeat_ids:string[]optional
IDs of heartbeats to associate with this webhook

Responses

StatusMeaningDescription
200OKWebhook updated successfully
400Bad RequestInvalid request
401UnauthorizedUnauthorized
403ForbiddenInsufficient permissions
404Not FoundWebhook not found
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

PATCH
/v1/webhooks/{webhook_id}
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' \
  --header 'X-OnlineOrNot-Organisation: string' \
  --data '{"url":"https://api.example.com/webhooks/new-endpoint"}'

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": []
}

DELETE/v1/webhooks/{webhook_id}

Delete a webhook

Permanently delete a webhook

Requires WEBHOOKS:EDIT; EDIT also grants READ. Session cookies are accepted only when no bearer credential is supplied.

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Header parameters

X-OnlineOrNot-Organisation:stringoptional
Public organization ID to select from an OAuth grant. Required for grants authorizing multiple organizations. Omit for single-organization grants and API tokens.

Path parameters

webhook_id:string
Webhook ID

Responses

StatusMeaningDescription
200OKReturns the deleted webhook's ID
400Bad RequestInvalid request
401UnauthorizedUnauthorized
403ForbiddenInsufficient permissions
404Not FoundWebhook not found
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

DELETE
/v1/webhooks/{webhook_id}
curl --request DELETE \
  --url https://api.onlineornot.com/v1/webhooks/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'X-OnlineOrNot-Organisation: string'

Response

{
  "result": {
    "id": "a1b2c3d4"
  },
  "success": true,
  "errors": [],
  "messages": []
}

Was this page helpful?