# Checkly

[<mark style="color:blue;">Checkly</mark>](https://checklyhq.com/) is an API monitoring and synthetic monitoring solution aimed at development and operations teams, giving teams broad, deep, and exact control over how APIs and web apps should be monitored.

Route detailed monitoring alerts from Checkly to the right users in Squadcast.

## How to integrate Checkly with Squadcast

### In Squadcast: Using Checkly as an Alert Source

1. Navigate to **Services** -> **Service Overview** -> select or search for your Service. Expand the accordion -> In the Alert Sources section, click **Add**.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-4fbd74e7ca0b30173c47a1d58ed6a0804a0465aa%2FAlert_Sources.png?alt=media\&token=aaca6610-9d18-4dd4-9cf5-320042f326f1)

2\. Select **Checkly**. Copy the displayed **Webhook URL** to [configure](#in-checkly-create-a-squadcast-webhook) it within **Checkly**. Finish by clicking **Add Alert Source** -> **Done**.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-21349eb41c9f2bbe2f8aadd33075216a63f3703d%2FCheckly.png?alt=media\&token=2db1b41a-71e2-418b-b534-552102a9d71a)

{% hint style="warning" %} <mark style="color:orange;">**Important**</mark>**:**

When an alert source turns <mark style="color:green;">Active</mark>, it’ll show up under Configured Alert Sources. You can either generate a test alert from the integration or wait for a real-time alert to be generated by the Alert Source.\
\
An Alert Source is <mark style="color:green;">active</mark> if there is a recorded incident via that Alert Source for the Service.
{% endhint %}

### In Checkly: Create a Squadcast Webhook

1. In the app, navigate to **Alert Settings** on the sidebar

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-2491707e1c5221b7bb22c9e5f9db401f0e9bd6e3%2Fcheckly_2.png?alt=media\&token=484c1983-6d53-466f-a672-524183db5dda)

2. Click on **Add more channels** to add the Webhook. Additionally, configure other Alert Settings that are available on this page based on your requirements

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-ec637de2a75178d93c3032da41b29540c322bb22%2Fcheckly_3.png?alt=media\&token=a2b80f62-657d-483c-af6e-3e1224dc4a09)

3. Select **Add channel** for **Webhook**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-32e9f4783c9ac1853f2af1d64ccf471f269a6f1b%2Fcheckly_4.png?alt=media\&token=10c652fb-6285-4a0f-8fcb-6bf79b4c18a6)

4. Fill in the details as indicated below:

**(a)** Give it a meaningful name, such as *Squadcast Webhook*

**(b)** Choose **POST** from the **Method** drop-down and paste the Webhook URL copied from Squadcast in the **URL** placeholder

**(c)** Copy and paste the below template in **Body**

```json
{
    "check_name": "{{CHECK_NAME}}",
    "check_id": "{{CHECK_ID}}",
    "check_type": "{{CHECK_TYPE}}",
    "message": "{{ALERT_TITLE}}",
    "alert_type": "{{ALERT_TYPE}}",
    "check_result_id": "{{CHECK_RESULT_ID}}",
    "response_time": "{{RESPONSE_TIME}}",
    "api_check_response_status_code": "{{API_CHECK_RESPONSE_STATUS_CODE}}",
    "api_check_response_status_text": "{{API_CHECK_RESPONSE_STATUS_TEXT}}",
    "run_location": "{{RUN_LOCATION}}",
    "link": "{{RESULT_LINK}}",
    "ssl_days_remaining": "{{SSL_DAYS_REMAINING}}",
    "ssl_check_domain": "{{SSL_CHECK_DOMAIN}}",
    "started_at": "{{STARTED_AT}}",
    "tags": [{{#each TAGS}} "{{this}}" {{#unless @last}},{{/unless}} {{/each}}],
    "region": "{{REGION}}",
    "uuid": "{{$UUID}}",
    "random_number": "{{$RANDOM_NUMBER}}"
}
```

{% hint style="warning" %}
**Important:**

**(1)** Checkly auto-reformats the content copied from above that you paste which ruptures the template syntax, resulting in the failure of the **Test webhook** option and hence, alert propagation to Squadcast. Please ensure the copied content is edited to match the syntax in the screenshot below.

<img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-6047b4f43b85016d61ba5a9a77660dd5b898e19f%2Fcheckly_6.png?alt=media&#x26;token=a7815911-7af5-40fe-a2e8-73a61cbc0d89" alt="" data-size="original">

**(2)** It is recommended to add the **Header** `Content-Type` as `application/json`.

<img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-43892b84fc2b580dee4ef777e8fa86179370acfd%2Fcheckly_7.png?alt=media&#x26;token=f9979a82-64ef-483d-bf41-d432b98c549a" alt="" data-size="original">
{% endhint %}

**(d)** Now, you can verify if the integration works fine by clicking on **Test webhook** which will create an incident in Squadcast

**(e)** In the **Send when** section, choose **`a check fails`**, **`a check recovers`** without fail. The other two options, **`a check degrades`** and **`an SSL certificate is due to expire in a few days`** are optional, based on your requirement

**(f)** Select the `checks` and `groups` that you want to add to this webhook channel as **Subscribers**

**(g)** **Save webhook** configuration

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-aadaf4eb61d144331b22b3a1a122002fa0ab427a%2Fcheckly_5.png?alt=media\&token=4090eb76-5b4f-4074-b248-943a2586cbcc)

That is it, you are now good to go! Whenever an alert is triggered in Checkly, an incident will be created automatically in Squadcast. When an alert is resolved in Checkly, the corresponding incident will get **auto-resolved in Squadcast.**

*Have any questions?* [*Ask the community*](https://community.squadcast.com/view/home)*.*
