# Changing your email or password in Checkly Source: https://www.checklyhq.com/docs/admin/changing-your-email-password Learn how to change your email address or password in your Checkly account Changing your email and / or password is handled differently depending on how you signed up for Checkly. Please check below for the scenario that applies to you: ## Changing your email All user authentication management for Checkly is handled by Auth0. This means that changing your email address is not possible directly from the Checkly UI. This means that changing your email address is equivalent to adding a new user (with a different email address) to Checkly and transferring any roles or permissions to the new user. The simplest way to achieve this is to: 1. Go to the [members section of your account settings](https://app.checklyhq.com/settings/account/members). 2. Invite the user with the new email address to your account. That email address will receive an invite email. 3. Sign up with the new email address by clicking the link in the invite email. 4. Transfer any roles or permissions from the old user to the new user. 5. Optionally, remove your "old" user from the account. This method won't work if you're on the Hobby plan or have reached your user limit. If you run into this or other issues, contact [support@checklyhq.com](mailto:support@checklyhq.com) for help. ## Changing your password Changing your password is not available on SSO connections or social login providers like Google and GitHub. Password changes are only available for users who have signed up with an email and password. To change your password, follow these steps: 1. Log out of your current session. 2. Go to the [login page](https://app.checklyhq.com/login). 3. Enter your email address and click the **Log in** button. 4. Click the **Forgot password?** link. 5. Follow the instructions to reset your password. After successfully resetting your password, you can log in with your new password. If your reset password email never arrives, this may be because you originally logged in with Google or Github. If you need help accessing your account, please reach out to [support@checklyhq.com](mailto:support@checklyhq.com). # Creating an API key in Checkly Source: https://www.checklyhq.com/docs/admin/creating-api-key Learn how to create and manage user and service API keys for the Checkly API and CLI The Checkly public API and CLI use API keys to authenticate requests. API keys come in two flavors: **user API keys** and **service API keys**. ## User API keys User API keys are tied to one specific user in your account and inherit the access level of that user, i.e. "read only" or "admin". When a user is removed from your account, that user's API keys are no longer able to access your account through the API. **Steps to create an user API key:** 1. Go to the API keys section in the [User Settings](https://app.checklyhq.com/settings/user/api-keys). 2. Click **Create API key**. 3. Enter a name for the API key in the dialog box and confirm. 4. The new API key is shown and can be copied. Make sure to copy it immediately as it won't be shown again. ### Using a user API key Use the API key as a Bearer token in the Authorization header when calling the Checkly API, e.g. You also need to set your target Account ID, you can find the Checkly Account ID under your [Account Settings](https://app.checklyhq.com/settings/account/general). If you don't have access to account settings, please contact your account owner/admin. ```sh theme={null} curl -H "Authorization: Bearer my_user_api_key" -H "X-Checkly-Account: my_account_ID" https://api.checklyhq.com/v1/checks ``` ### Deleting a user API key Only the user can delete an API key. To delete an API key click on the **Delete** icon in the Api Keys section of the [User Settings](https://app.checklyhq.com/settings/user/api-keys). If you wish to revoke access of a user to an account, remove the user from the team in the [Members section of Account Settings](https://app.checklyhq.com/settings/account/team). ## Service API keys Service API keys are specific to one account and are not tied to a user. This means that service API keys can be used to access your account even if the user that created the API key is removed from your account. Service API keys are available on the [Enterprise plan](https://www.checklyhq.com/pricing/) only Service API keys allow you to set a role access level on the key itself. Available roles are: * **Admin** - Full access to create, update, and delete resources. * **Read & Write** - Can create, update, and delete checks, alert settings, and maintenance windows. * **Read & Run** - Can view all resources and trigger checks and tests, but cannot create, edit, or delete. Ideal for CI/CD pipelines that only need to run tests. * **Read Only** - View-only access to all resources. Prime use cases for service API keys are: * Background services like CI pipelines invoke the [Checkly CLI](/docs/cli/overview). * Any custom integrations that needs to create, update or delete resources through our public API. * Replacing user API keys for customers using our SSO integration and cannot create "service users" in their user directories due to compliance reasons. **Steps to create a service API key:** Only users with the Admin and Owner role can create service API keys. 1. Go to the API keys section in the [Account Settings](https://app.checklyhq.com/settings/account/api-keys). 2. Click **Create service API key**. 3. Enter a name for the API key in the dialog box and select the role. 4. The new API key is shown and can be copied. Make sure to copy it immediately as it won't be shown again. ### Using a service API key Use the service API key as a Bearer token works the same as user API keys. Set the Authorization header and provide the target Account ID, e.g. ```sh theme={null} curl -H "Authorization: Bearer my_service_api_key" -H "X-Checkly-Account: my_account_ID" https://api.checklyhq.com/v1/checks ``` ### Deleting a service API key Only Admin and Owner users can delete an API key. To delete an API key click on the **Delete** icon in the Service Api Keys section of the [Account Settings](https://app.checklyhq.com/settings/account/api-keys). # Adding team members to your Checkly account Source: https://www.checklyhq.com/docs/admin/team-management/adding-team-members Learn how to invite team members to join your Checkly account and manage team collaboration You can invite team members to join your Checkly account to view and manage all checks and related settings; team members can have different [roles](/docs/admin/team-management/overview). ## Inviting team members Go to the [Members section](https://app.checklyhq.com/settings/account/members) of your account overview. Add the email address of each user you want to invite. A pending invite will be added to your list of users. The invite is valid for 30 days, and you can retract it at any moment. Checkly teams The account owner can change the default **account name** under the account settings tab. By default the account name is the owner's email address, but you can change it to reflect a department, product team etc. set account name ## Accepting invites If you're invited by a teammate, you will get an email with a link to an invite page. This link contains a unique, single-use token that allows you to join the team. accept team invite If you already have a Checkly account, you can choose to use that account to join. If you don't have a Checkly account yet, just create a new one. You will automatically join your teammate's account. # Using Microsoft Entra ID for Single Sign-on in Checkly Source: https://www.checklyhq.com/docs/admin/team-management/microsoft-azure-ad This page illustrates the standard procedure to follow in order to get started with Microsoft Entra ID SSO (formerly Azure AD) on Checkly. ## Initial SSO configuration Setting up SSO for your organisation starts with providing [Checkly Support](mailto:support@checklyhq.com) with the following information: * Microsoft Entra ID Domain (e.g. company.com) * [Client ID](https://auth0.com/docs/connections/enterprise/azure-active-directory) * Client Secret ## Testing the SSO integration After configuration has taken place on Checkly's side, you will receive confirmation via e-mail. Once that has happened, you should be able to log in to Checkly via SSO already. Entering an email address associated with the domain you have provided in the login prompt should result in the password field disappearing: checkly login prompt without password screenshot After submitting the Checkly login form, you should be redirected to your SSO login interface. Completing the login procedure will then lead you to your existing Checkly account, if you have one, or to the new account creation screen, in case you don't. Once Microsoft Entra ID has been set up, you will still need to invite new users from your organization to your Checkly account, as they will not be added automatically. # Multi-Factor Authentication in Checkly Source: https://www.checklyhq.com/docs/admin/team-management/multi-factor-authentication Learn how to set up and manage multi-factor authentication for enhanced account security You can add an extra layer of security to your account with an additional verification method, also known as multi-factor authentication, or MFA. Checkly supports MFA using one time passwords generated by a separate authenticator app. ## Setting up multi-factor authentication * Click on your avatar in the upper right corner and select 'User settings'. * Toggle 'Enable multi-factor authentication'. * Log out of your account and log back in. * When prompted, scan the QR code using one of the supported apps: * Twilio Authy ([Google Play](https://play.google.com/store/apps/details?id=com.authy.authy) / [App Store](https://itunes.apple.com/us/app/authy/id494168017)) * Auth0 Guardian ([Google Play](https://play.google.com/store/apps/details?id=com.auth0.guardian) / [App Store](https://itunes.apple.com/us/app/auth0-guardian/id1093447833)) * Google Authenticator ([Google Play](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2) / [App Store](https://itunes.apple.com/us/app/google-authenticator/id388497605)) * Microsoft Authenticator ([Google Play](https://play.google.com/store/apps/details?id=com.azure.authenticator) / [App Store](https://itunes.apple.com/us/app/microsoft-authenticator/id983156458)) * Enter the code provided by your authenticator app. * Record your recovery code, you can use this to log in if you temporarily lose access to your authenticator app. From now on when logging in you will be asked to provide a one time password. ## Removing or changing MFA * To stop using MFA, toggle the 'Enable multi-factor authentication' setting under User Settings. * If you have lost access to your authenticator app or removed the Checkly configuration from it, contact [support@checklyhq.com](mailto:support@checklyhq.com) for help with resetting your configuration. # Admin Overview Source: https://www.checklyhq.com/docs/admin/team-management/overview Comprehensive guide to managing your Checkly account, team members, security, and integrations This section covers all aspects of administering your Checkly account, from managing team members and permissions to setting up advanced security features and API access. ## Team Member Roles When inviting a team member to join your account you can assign one of five roles: **Owner**, **Admin**, **Read & Write**, **Read & Run**, or **Read Only**. Each role inherits all permissions from the roles below it. Only the initial account creator has the Owner role. You can change assigned roles at any time after a teammate joins. | Capability | Owner | Admin | Read & Write | Read & Run | Read Only | | -------------------------- | :---: | :---: | :----------: | :--------: | :-------: | | View all resources | ✓ | ✓ | ✓ | ✓ | ✓ | | Trigger checks and tests | ✓ | ✓ | ✓ | ✓ | ✗ | | Create/edit/delete checks | ✓ | ✓ | ✓ | ✗ | ✗ | | Manage alert settings | ✓ | ✓ | ✓ | ✗ | ✗ | | Manage maintenance windows | ✓ | ✓ | ✓ | ✗ | ✗ | | Access locked variables | ✓ | ✓ | ✓ | ✗ | ✗ | | Manage team members | ✓ | ✓ | ✗ | ✗ | ✗ | | Manage account settings | ✓ | ✓ | ✗ | ✗ | ✗ | | Manage Private Locations | ✓ | ✓ | ✗ | ✗ | ✗ | | Create service API keys | ✓ | ✓ | ✗ | ✗ | ✗ | | Transfer ownership | ✓ | ✗ | ✗ | ✗ | ✗ | ### Choosing the Right Role | Role | Best for | | ---------------- | --------------------------------------------------------------------------------- | | **Owner** | Account creator with full control over billing and ownership | | **Admin** | Team leads who manage members, settings, and infrastructure | | **Read & Write** | Developers who create and maintain checks | | **Read & Run** | QA engineers or CI/CD pipelines that run tests but shouldn't modify configuration | | **Read Only** | Stakeholders who need visibility into monitoring status | ### Adding Team Members Learn how to invite new users to your account and manage their access levels. [Learn more about adding team members](/docs/admin/team-management/adding-team-members) ### Transferring Ownership **Owners** can transfer ownership to another team member from the [General](https://app.checklyhq.com/settings/account/general) section in account settings. Click "Transfer ownership" and follow the instructions. Your role will change to **Admin** after the transfer. ## Account Management ### Email and Password Changes Manage your login credentials and account information securely. [Learn about changing your email or password](/docs/admin/changing-your-email-password) ## Security ### Multi-Factor Authentication Add an extra layer of security to your account with MFA using authenticator apps. [Set up multi-factor authentication](/docs/admin/team-management/multi-factor-authentication) ### Single Sign-On (SSO) For enterprise customers, Checkly supports SSO integration with your existing identity provider. [Learn about SSO options](/docs/admin/team-management/single-sign-on) ## API Access ### Creating API Keys Generate API keys for programmatic access to your Checkly account through the REST API and CLI. [Learn about creating and managing API keys](/docs/admin/creating-api-key) **API Key Types:** * **User API Keys** - Tied to individual users with inherited permissions * **Service API Keys** - Account-level keys for CI/CD and automation (Enterprise only) ## Getting Help If you need assistance with any administrative tasks or have questions about account management, please contact [Checkly Support](mailto:support@checklyhq.com). # SAML for Single Sign-on in Checkly Source: https://www.checklyhq.com/docs/admin/team-management/saml Learn how to configure SAML SSO integration with Checkly for your organization ## Initial SSO setup Setting up SSO for your organisation starts with providing [Checkly Support](mailto:support@checklyhq.com) with the following information: * name / type / brand of your identity provider * email domain * sign in URL * sign out URL * public X509 certificate ## IdP configuration After your configuration has been processed on Checkly's side, you'll receive the following information to configure your IdP: * a redirect URL (e.g. `https://auth.checklyhq.com/login/callback?connection=`) * a signout URL (normally `https://auth.checklyhq.com/logout`) * XML metadata (e.g. `https://auth.checklyhq.com/samlp/metadata?connection=`) Ensure your SSO IdP is sending Checkly the correct email address. Checkly can then map the existing user to your IdP user. The object returned should have an "email" field, e.g.: ```json theme={null} { "email": "", ... } ``` In case of issues, you might want to double-check your **Entity ID**, which should be: `urn:auth0:checkly:` ## Testing the integration Once that is taken care of, logging in to Checkly via SSO is ready. Entering an email address associated with the domain you have provided in the login prompt should result in the password field disappearing: checkly login prompt without password screenshot After submitting the Checkly login form, you should be redirected to your SSO login interface. Completing the login procedure will then lead you to your existing Checkly account, if you have one, or to the new account creation screen, in case you don't. ## JIT User Provisioning Just-in-time user provisioning is now enabled for Enterprise customers using a single Checkly account. This allows all users from your SSO organisation to join your Checkly account by simply by logging in. You don't need to invite anyone manually (although you still can). There are two ways your users can access Checkly: * Go through your SSO provider and access Checkly from the list of your approved apps. * Access the [Checkly Login Page](https://app.checklyhq.com/) directly. * This requires a user to enter their email in the email field, and then click Continue. Both approaches seamlessly allow the user to be added to your Checkly account. ### Default user roles By default, all users provisioned via SSO receive Read & Write permission within Checkly. You are able to modify this behaviour by going to the [SSO Configuration](https://app.checklyhq.com/settings/account/sso-saml) and choosing a different role. ### Removing users If you want to remove users that have been previously provisioned through SSO, there is a two-step process: 1. Remove their access within your SSO provider. 2. Remove them from your [Checkly Team](https://app.checklyhq.com/settings/account/team). # Single Sign-on in Checkly Source: https://www.checklyhq.com/docs/admin/team-management/single-sign-on Overview of Single Sign-On (SSO) options available in Checkly for enterprise security Single Sign-On (SSO) enables businesses to secure employee access across a variety of third-party services. Currently, Checkly supports the following SSO protocols: 1. [SAML](/docs/admin/team-management/saml) 2. [Microsoft Entra ID](/docs/admin/team-management/microsoft-azure-ad) (formerly Azure AD) If you are interested in using Checkly with a different SSO protocol, please [reach out to Support](mailto:support@checklyhq.com). SSO is only available for Checkly's [enterprise plans](https://www.checklyhq.com/pricing/). # llms.txt Source: https://www.checklyhq.com/docs/ai/llms-txt Use the Checkly llms.txt file to discover and crawl all available documentation pages as markdown. The [llms.txt standard](https://llmstxt.org/) provides a machine-readable index of all available documentation pages. Checkly publishes an `llms.txt` file at [`checklyhq.com/llms.txt`](https://www.checklyhq.com/llms.txt) that lists every documentation page with its markdown URL and a short description. ```txt llms.txt (first 15 lines) theme={null} # Checkly Docs ## Docs - [Changing your email or password in Checkly](https://checklyhq.com/docs/admin/changing-your-email-password.md): Learn how to change your email address or password in your Checkly account - [Creating an API key in Checkly](https://checklyhq.com/docs/admin/creating-api-key.md): Learn how to create and manage user and service API keys for the Checkly API and CLI - [Adding team members to your Checkly account](https://checklyhq.com/docs/admin/team-management/adding-team-members.md): Learn how to invite team members to join your Checkly account and manage team collaboration - [Using Microsoft Entra ID for Single Sign-on in Checkly](https://checklyhq.com/docs/admin/team-management/microsoft-azure-ad.md): This page illustrates the standard procedure to follow in order to get started with Microsoft Entra ID SSO (formerly Azure AD) on Checkly. - [Multi-Factor Authentication in Checkly](https://checklyhq.com/docs/admin/team-management/multi-factor-authentication.md): Learn how to set up and manage multi-factor authentication for enhanced account security - [Admin Overview](https://checklyhq.com/docs/admin/team-management/overview.md): Comprehensive guide to managing your Checkly account, team members, security, and integrations - [SAML for Single Sign-on in Checkly](https://checklyhq.com/docs/admin/team-management/saml.md): Learn how to configure SAML SSO integration with Checkly for your organization - [Single Sign-on in Checkly](https://checklyhq.com/docs/admin/team-management/single-sign-on.md): Overview of Single Sign-On (SSO) options available in Checkly for enterprise security - [Team management in Checkly](https://checklyhq.com/docs/admin/team-management.md): Manage your team and collaborate effectively in Checkly ``` Use the `llms.txt` file to crawl and index the entire Checkly documentation. Every link in the file points to [the `.md` version of the page](/docs/ai/markdown-access#md-endpoints), so you can fetch each URL directly to get the markdown content. ```bash theme={null} # Fetch the llms.txt index curl https://www.checklyhq.com/llms.txt # Fetch a specific page from the index curl https://checklyhq.com/docs/detect/synthetic-monitoring/browser-checks/overview.md ``` ## Additional resources * [Markdown Access](/docs/ai/markdown-access) * [Checkly Skills](/docs/ai/skills) # Markdown Access Source: https://www.checklyhq.com/docs/ai/markdown-access Access Checkly documentation as markdown to use with AI assistants and coding agents. Every page in the Checkly documentation is available as markdown. This makes it easy to feed specific documentation pages into AI assistants like Claude, ChatGPT, Cursor, or any other AI tool. Use [Checkly Skills](/docs/ai/skills) to automatically provide your agent with up-to-date, agent-optimized documentation. ## .md endpoints Append `.md` to any documentation URL to get the markdown version of that page. **Example:** * **HTML:** `https://www.checklyhq.com/docs/what-is-checkly/` * **Markdown:** `https://www.checklyhq.com/docs/what-is-checkly.md` The markdown version includes the full page content in plain markdown, code blocks, links preserved as markdown links, and tables formatted as markdown tables. ```bash theme={null} # Fetch documentation content with curl curl https://www.checklyhq.com/docs/what-is-checkly.md # Pipe directly to your clipboard curl https://www.checklyhq.com/docs/what-is-checkly.md | pbcopy ``` ## Content negotiation You can also request markdown by setting the `Accept` header to `text/markdown`: ```bash theme={null} curl -H "Accept: text/markdown" https://www.checklyhq.com/docs/what-is-checkly/ ``` This is useful when integrating with tools or scripts that set request headers programmatically. Modern coding agents set [these headers automatically when querying documentation](https://www.checklyhq.com/blog/state-of-ai-agent-content-negotation/). ## Copy as Markdown button Every documentation page includes a **Copy as Markdown** button at the top of the page. Click it to copy the full page content as markdown to your clipboard. This is the fastest way to grab documentation for a specific topic and paste it into your AI assistant's context. ```text theme={null} Here is the Checkly Browser Checks documentation: [paste markdown content] Based on this, how do I set up a browser check with a custom user agent? ``` ## Additional resources * [Checkly Skills](/docs/ai/skills) # Checkly MCP Server Source: https://www.checklyhq.com/docs/ai/mcp-server Connect MCP clients to Checkly to inspect checks, test sessions, RCA, result assets, status pages, incidents, and account context. The Checkly MCP Server lets MCP clients connect to Checkly over Streamable HTTP and use Checkly tools from your conversation. Use the production MCP endpoint in your client: ```text theme={null} https://api.checklyhq.com/mcp ``` OAuth is the recommended way to connect. The OAuth flow only supports Checkly-approved clients listed in setup. User and service API keys are available for clients that can send custom headers when OAuth is unavailable or a workflow needs a stable service identity. Use it when your agent needs live Checkly account context, check status, check results, test sessions, root cause analyses, result assets, status pages, incidents, account environment variables, or when it needs to trigger existing checks. Use [Checkly Skills](/docs/ai/skills) and the [Checkly CLI](/docs/cli/overview) when your agent needs to create, edit, test, bundle, or deploy check code. The MCP server runs remotely and cannot access your local filesystem. ## What you can do * Inspect account membership, plan, and feature entitlements. * Check which checks are passing, failing, muted, or deactivated. * Read compact check results and test-session results. * Fetch normalized result asset manifests and bounded text assets. * Start or read Rocky AI root cause analyses. * Trigger existing deployed checks on demand. * Manage account-level environment variables and secrets. * Read status pages and manage status page incidents. ## Quick start Before connecting an MCP client, ensure you have: * A Checkly user account. * Access to the Checkly account you want the MCP client to use. * A [supported OAuth MCP client](/docs/ai/mcp-server/setup#supported-oauth-clients), or an MCP client that can send custom HTTP headers for API-key authentication. [Choose an authentication method and add the Checkly MCP endpoint to your client](/docs/ai/mcp-server/setup#choose-an-authentication-method). Complete OAuth or configure an API-key header, then ask your client to verify the connection. ```text title="Prompt" wrap theme={null} Use Checkly to show which accounts I can access. ``` If you belong to more than one Checkly account, tell your client which account to use in your prompt. To always use the same account, set the `X-Checkly-Account` header when your client supports custom MCP headers. See [Set up the MCP server](/docs/ai/mcp-server/setup) for client configuration examples. ## Example prompts Basic prompts: ```text title="Prompt" wrap theme={null} Show me the current status of my Checkly checks. ``` ```text title="Prompt" wrap theme={null} List open status page incidents. ``` ```text title="Prompt" wrap theme={null} What features are available on my current Checkly plan? ``` Advanced prompts: ```text title="Prompt" wrap theme={null} Investigate the latest failed result for the checkout API check. If there is an error group, check whether an RCA already exists before triggering a new one. ``` ```text title="Prompt" wrap theme={null} Trigger the checks tagged production-smoke, then follow the test session until results are available. ``` ```text title="Prompt" wrap theme={null} Create a major status page incident for the API outage, but do not notify subscribers until I confirm the message. ``` ## MCP, Skills, and CLI MCP, Checkly Skills, and the Checkly CLI are complementary. Use the MCP Server for quick access to live Checkly data and account actions. OAuth is the recommended connection method; use an API key when OAuth is unavailable or when automation needs an account-scoped service identity. Use Checkly Skills with the CLI when your agent needs to create, edit, test, or deploy code from your local project. See [Skills, MCP, and the CLI](/docs/ai/overview#skills-mcp-and-the-cli) for a full comparison of when to use each. ## Learn more * [Set up the MCP server](/docs/ai/mcp-server/setup) * [MCP tools reference](/docs/ai/mcp-server/tools) * [Security and permissions](/docs/ai/mcp-server/security-and-permissions) * [Troubleshooting](/docs/ai/mcp-server/troubleshooting) # MCP security and permissions Source: https://www.checklyhq.com/docs/ai/mcp-server/security-and-permissions Understand how the Checkly MCP Server authenticates users, filters tools by permission, handles account context, and protects write actions. The Checkly MCP Server uses bearer-token authentication and Checkly account authorization together. Session permissions decide which tools are visible to your MCP client. Checkly account membership, role, and feature entitlements decide whether a specific tool call can operate on an account. ## Authentication The MCP Server accepts two types of bearer tokens for `https://api.checklyhq.com/mcp`: * OAuth bearer tokens from Checkly-approved MCP clients. * Checkly user API keys starting with `cu_...`, and service API keys starting with `sv_...`, sent as `Authorization: Bearer `. OAuth is recommended for interactive clients. The public MCP Server only supports Checkly-approved OAuth clients. Checkly rejects clients that attempt to use [Dynamic Client Registration (DCR)](https://datatracker.ietf.org/doc/html/rfc7591). See [supported OAuth clients](/docs/ai/mcp-server/setup#supported-oauth-clients) or [set up an API key](/docs/ai/mcp-server/setup#set-up-with-an-api-key). Checkly maps OAuth tokens and user API keys to a Checkly user, then loads that user's account memberships and account context for tool calls. Service API keys map to the key's configured account and role. API keys are long-lived credentials. Use them when OAuth is unavailable or a workflow needs a service identity. Store keys securely and rotate them when they are no longer needed. ## Session permissions | Permission | Description | | ------------------------------------- | ------------------------------------------------------------------------ | | `checkly:account:read` | Read your Checkly account membership and status | | `checkly:account:invite` | Invite members to your Checkly account | | `checkly:checks:read` | List checks, their status and results | | `checkly:checks:run` | Trigger Checkly checks and on-demand test sessions | | `checkly:incidents:read` | Read your Checkly incidents | | `checkly:incidents:write` | Create and update your Checkly incidents | | `checkly:environment-variables:read` | Read your Checkly account environment variables (secret values excluded) | | `checkly:environment-variables:write` | Create, update and delete your Checkly account environment variables | | `checkly:status-pages:read` | Read your Checkly status pages | | `checkly:rca:read` | Read your Checkly root cause analyses | | `checkly:rca:run` | Run Checkly root cause analysis for your account | | `checkly:test-sessions:read` | Read your Checkly test sessions | | `checkly:assets:read` | Read your Checkly assets | OAuth sessions use the permissions granted by the OAuth flow. API-key sessions receive all permissions listed above except `checkly:account:invite`, so `invite-account-member` is only available with OAuth. Tools are filtered from `tools/list` when the MCP session does not include the required permission. Tool calls are also rejected if the session lacks the required permission. ## Account context Most tools operate on one Checkly account. You can select a specific account in your prompt or pin an account in your MCP client configuration. See [Select an account](/docs/ai/mcp-server/setup#select-an-account) for setup examples. Accounts that require mTLS are not available through the public MCP Server. Blocked accounts can be inspected with read-only tools, but write, run, and admin tools are rejected. ## Role checks Some tools require both an MCP session permission and a Checkly account role: | Tool or action | Additional account access required | | ------------------------------------- | ------------------------------------------------- | | `invite-account-member` | Owner or Admin | | `create-account-environment-variable` | Write access | | `update-account-environment-variable` | Write access | | `trigger-checks` | Run access | | `trigger-root-cause-analysis` | Run access | | Status page incident writes | Access required by the underlying incident action | ## Write-action safety Some MCP tools create side effects: * `invite-account-member` sends an invite email and is not idempotent. * `trigger-checks` consumes check-run execution quota. * `trigger-root-cause-analysis` consumes RCA invocation quota. * `create-status-page-incident`, `update-status-page-incident`, and `resolve-status-page-incident` can notify subscribers and are not idempotent. * Environment variable write tools can create or replace account-level variables and secrets. Review write tool calls in your MCP client before approving them. ## Secrets MCP read tools never reveal Checkly secret values. Secret values are returned as `null`. When you create or update a secret through MCP, Checkly encrypts the value and does not echo it back in the tool response. # Set up the Checkly MCP Server Source: https://www.checklyhq.com/docs/ai/mcp-server/setup Choose an authentication method, connect an MCP client, select an account, and verify the Checkly MCP Server connection. Use the production MCP endpoint in your client: ```text theme={null} https://api.checklyhq.com/mcp ``` The Checkly MCP Server supports the `2026-07-28` and `2025-06-18` protocol versions on the same endpoint. Your MCP client negotiates the version automatically, so existing client configurations do not need to change. ## Choose an authentication method | Method | Best for | Checkly access | | ------------------- | ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | | OAuth (recommended) | Interactive use with a [supported OAuth client](#supported-oauth-clients) | Uses your Checkly user and the permissions granted during sign-in. | | User API key | Personal clients that cannot use Checkly OAuth but can send custom HTTP headers | Uses your Checkly user and account memberships. User API keys start with `cu_...`. | | Service API key | Shared or non-interactive clients that need a stable, account-scoped identity | Uses the account and role configured on the key. Service API keys start with `sv_...` and require an Enterprise plan. | OAuth avoids storing a long-lived Checkly credential in your MCP client. Use an API key when OAuth is unavailable or when a non-interactive workflow needs an account-scoped service identity. ## Set up with OAuth Before connecting with OAuth, ensure you have: * A Checkly user account. * Access to the Checkly account you want the MCP client to use. * A [supported OAuth client](#supported-oauth-clients). The Checkly OAuth flow only supports Checkly-approved clients. Clients that rely on [Dynamic Client Registration (DCR)](https://datatracker.ietf.org/doc/html/rfc7591) are rejected. ### Supported OAuth clients | Client | Setup | | -------------- | ---------------------------------------------------------------- | | ChatGPT | [Follow the ChatGPT setup](#chatgpt). | | Claude Desktop | [Follow the Claude Desktop setup](#claude-desktop). | | Claude Code | [Add the server from Claude Code](#claude-code). | | Mistral Vibe | [Configure Mistral Vibe's approved OAuth client](#mistral-vibe). | | Devin CLI | [Add Checkly's approved OAuth client](#devin-cli). | | Antigravity | [Add Checkly's approved OAuth client](#antigravity). | | OpenCode | [Add Checkly's approved OAuth client](#opencode). | | Cursor | [Configure Cursor's approved OAuth client](#cursor). | | VS Code | [Add the server to VS Code](#vs-code). | If you want Checkly to support another compatible OAuth client, [share feedback or requests](https://feedback.checklyhq.com). ### Configure your OAuth client **ChatGPT** Follow OpenAI's [Developer mode and MCP apps in ChatGPT](https://help.openai.com/en/articles/12584461-developer-mode-apps-and-full-mcp-connectors-in-chatgpt-beta) guide. Use the Checkly MCP endpoint from this page as the MCP server endpoint. **Claude Desktop** Follow Claude's [custom connectors using remote MCP](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp) guide. Use the Checkly MCP endpoint from this page as the remote MCP server URL. **Claude Code** Add the server with the HTTP transport: ```bash Terminal theme={null} claude mcp add --transport http checkly https://api.checklyhq.com/mcp ``` Start a Claude Code session and complete the OAuth flow when prompted. A Checkly Connector has been submitted to Anthropic and is awaiting review. Once approved, you can connect Checkly directly from the connector directory instead of adding the server manually. **Mistral Vibe** Add the server to `~/.vibe/config.toml`: ```toml config.toml theme={null} [[mcp_servers]] name = "checkly" transport = "streamable-http" url = "https://api.checklyhq.com/mcp" [mcp_servers.auth] type = "oauth" scopes = [] client_id = "tpc_vXbM9LP3DXcqvWor1SbQu1" ``` Start Mistral Vibe, then authenticate: ```text Vibe theme={null} /mcp login checkly ``` Complete the OAuth flow when prompted. **Devin CLI** Add the server with Checkly's Devin OAuth client ID: ```bash Terminal theme={null} devin mcp add checkly https://api.checklyhq.com/mcp --transport http --oauth-client-id tpc_5apxvvouctRhwLo7ARsjYA ``` Then authenticate: ```bash Terminal theme={null} devin mcp login checkly --oauth-client-id tpc_5apxvvouctRhwLo7ARsjYA ``` Complete the OAuth flow when prompted. **Antigravity** Add the server to `~/.gemini/config/mcp_config.json` for global use, or `.agents/mcp_config.json` in your workspace: ```json mcp_config.json theme={null} { "mcpServers": { "checkly": { "serverUrl": "https://api.checklyhq.com/mcp", "oauth": { "clientId": "tpc_3qGL89LbJQfbt6peyLEUdE" } } } } ``` Open **Settings**, select **Customizations**, and authenticate the Checkly server. Follow Google's [Antigravity MCP integration](https://antigravity.google/docs/mcp) guide for the client workflow. **OpenCode** Before configuring OpenCode, ensure port `19876` is available for the OAuth callback. Add the server to your OpenCode configuration: ```json opencode.json theme={null} { "mcp": { "checkly": { "type": "remote", "url": "https://api.checklyhq.com/mcp", "oauth": { "clientId": "tpc_q3CQpmc7tU8LGwAbTLwDR6", "redirectUri": "http://127.0.0.1:19876/mcp/oauth/callback" } } } } ``` Then authenticate: ```bash Terminal theme={null} opencode mcp auth checkly ``` OpenCode must use the redirect URI shown above. If port `19876` is already in use, this static OAuth client will not work with a different local callback port unless Checkly has approved that redirect URI. **Cursor** Add the server to `.cursor/mcp.json` in your project, or to `~/.cursor/mcp.json` for all projects: ```json mcp.json theme={null} { "mcpServers": { "checkly": { "type": "http", "url": "https://api.checklyhq.com/mcp", "auth": { "CLIENT_ID": "tpc_6UZKE6SnYVKGZKExoSK3FT", "scopes": [ "checkly:account:read", "checkly:account:invite", "checkly:checks:read", "checkly:checks:run", "checkly:incidents:read", "checkly:incidents:write", "checkly:environment-variables:read", "checkly:environment-variables:write", "checkly:status-pages:read", "checkly:rca:read", "checkly:rca:run", "checkly:test-sessions:read", "checkly:assets:read" ] } } } } ``` Restart Cursor after changing the configuration. **VS Code** Add the server to `.vscode/mcp.json` in your workspace, or to your VS Code user profile: ```json mcp.json theme={null} { "servers": { "checkly": { "type": "http", "url": "https://api.checklyhq.com/mcp" } } } ``` Restart VS Code after changing the configuration. ### Known OAuth limitations * **Cline:** Cline is not currently supported for Checkly OAuth. You can follow or upvote the [Checkly Cline support request](https://feedback.checklyhq.com/p/support-cline-as-mcp-client). * **Codex:** Checkly does not currently provide an approved Codex OAuth client. You can [connect Codex with an API key](#codex-with-an-api-key) or follow the [Checkly Codex OAuth support request](https://feedback.checklyhq.com/p/support-codex-for-checkly-mcp). * **Windsurf / Devin Desktop:** Windsurf / Devin Desktop is not currently supported for Checkly OAuth. You can follow or upvote the [Checkly Devin support request](https://feedback.checklyhq.com/p/support-devin-devin-cli-for-checkly-mcp). ## Set up with an API key Before connecting with an API key, ensure you have: * An MCP client that can send custom HTTP headers. * A current Checkly user API key starting with `cu_...`, or a current service API key starting with `sv_...`. * A secure place to store the key outside version control. Send the key as a bearer token in every request: ```text theme={null} Authorization: Bearer ``` Deprecated account API keys and old `sk_...` service-key formats are rejected. ### Choose an API key | Key | Use it when | Access behavior | | -------------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | | User API key (`cu_...`) | You need a personal fallback for a client that cannot use Checkly OAuth. | Inherits your user access and account memberships. Removing your user from an account removes the key's access to that account. | | Service API key (`sv_...`) | A shared or non-interactive client needs a stable identity that is not tied to a user. | Limited to one account and the role selected when the key is created. Available on Enterprise plans. | See [Creating an API key in Checkly](/docs/admin/creating-api-key) for key creation, roles, and revocation. API keys are long-lived credentials. Store them in your client's secret storage or an environment variable, and rotate them when they are no longer needed. API-key sessions cannot use the `invite-account-member` tool. ### Configure an API-key client **Claude Code** Pass the authorization header when you add the server: ```bash Terminal theme={null} claude mcp add --transport http checkly https://api.checklyhq.com/mcp --header "Authorization: Bearer " ``` **Codex** Store the key in an environment variable and tell Codex to use it as the bearer token: ```bash Terminal theme={null} export CHECKLY_API_KEY="" codex mcp add checkly --url https://api.checklyhq.com/mcp --bearer-token-env-var CHECKLY_API_KEY ``` Restart Codex from an environment where `CHECKLY_API_KEY` is set. **OpenCode** Store the key in `CHECKLY_API_KEY`, disable automatic OAuth, and reference the environment variable from your OpenCode configuration: ```json opencode.json theme={null} { "mcp": { "checkly": { "type": "remote", "url": "https://api.checklyhq.com/mcp", "oauth": false, "headers": { "Authorization": "Bearer {env:CHECKLY_API_KEY}" } } } } ``` **VS Code** Use an input variable so the key is not stored in `mcp.json`: ```json mcp.json theme={null} { "inputs": [ { "type": "promptString", "id": "checkly-api-key", "description": "Checkly API key", "password": true } ], "servers": { "checkly": { "type": "http", "url": "https://api.checklyhq.com/mcp", "headers": { "Authorization": "Bearer ${input:checkly-api-key}" } } } } ``` ## Select an account OAuth sessions and user API keys can access each account available to the authenticated user. Service API keys are already limited to the account configured on the key. If you can access multiple accounts, tell your MCP client which account you want to use in your prompt: ```text title="Prompt" wrap theme={null} Use Checkly to show the accounts I can access, then show failing checks for . ``` To make every request from a connection use the same account, set the `X-Checkly-Account` header when your client supports custom MCP headers: ```text theme={null} X-Checkly-Account: ``` For Claude Code, add the header when you register the server: ```bash Terminal theme={null} claude mcp add --transport http checkly https://api.checklyhq.com/mcp --header "X-Checkly-Account: " ``` For other clients, add the same header to the Checkly server entry using that client's custom-header configuration. Use the account ID from Checkly. Omit the header when you want to choose the account in your prompts. You do not need this header with a service API key because the key is already scoped to one account. ## Verify the connection After authentication, ask your MCP client: ```text title="Prompt" wrap theme={null} Use Checkly to show which accounts I can access. ``` Then verify tool access: ```text title="Prompt" wrap theme={null} Use Checkly to list the tools available to this session. ``` The visible tools depend on the permissions granted to your MCP session and the Checkly role associated with the user or service API key. See [Security and permissions](/docs/ai/mcp-server/security-and-permissions) for details. # Checkly MCP tools Source: https://www.checklyhq.com/docs/ai/mcp-server/tools Reference for the tools exposed by the Checkly MCP Server, grouped by workflow. This reference reflects the current MCP Server v1 tool surface. It is not a roadmap or a commitment to future tools. Each tool is shown only when the MCP session has the required permission. Some write tools also require a matching Checkly account role, such as Admin or Read & Write. ## Account tools | Tool | Type | Description | | ------------------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------- | | `whoami` | Read | Return the authenticated user and account memberships visible to the MCP session. | | `get-account-entitlements` | Read | Return the resolved account plan and feature entitlement state. | | `list-account-members` | Read | List account members and pending invites. | | `invite-account-member` | Write | Invite a user to the resolved account. OAuth-only. Requires Owner or Admin access, sends an invite email, and is not idempotent. | | `prepare-local-check-authoring` | Read | Return an account-aware runbook for creating, testing, and deploying check code with the local Checkly CLI. | Example prompts: ```text title="Prompt" wrap theme={null} Use Checkly to show which accounts I can access. ``` ```text title="Prompt" wrap theme={null} Prepare the local Checkly CLI steps to create a browser check for checkout. ``` ## Check tools | Tool | Type | Description | | ------------------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `list-check-stats` | Read | Return a paginated, filterable list of checks with current pass, fail, and degraded status. Set `includeReliability` to also return availability, response-time percentiles, and ICMP latency or packet loss over a quick range. | | `list-check-results` | Read | List recent compact results for one check, including HTTP response status and assertion counts when available. Raw logs, traces, screenshots, videos, and download URLs are omitted. | | `get-check-result` | Read | Return compact detail for one check result. | | `get-check-performance-summary` | Read | Return average, P50, P95, and P99 response-time metrics for one check over a date range when data is available. | | `trigger-checks` | Write | Run existing deployed checks on demand and record the run as a test session. Consumes check-run execution quota. | For large accounts, start with `list-check-stats` filters instead of asking for every check at once. The default response is status-only. The tool supports: * `tag`: filter by one or more tags. * `type` or `checkType`: filter by check type. * `search`: filter by check name. * `status`: filter by `passing`, `failing`, or `degraded`. * `limit` and `page`: page through matching checks. The default page size is 25 and the maximum is 100. * `includeReliability`: set to `true` to include availability, response-time percentiles, and ICMP latency or packet-loss metrics. * `range`: set the analytics range when `includeReliability` is `true`. The default is `last24Hours`. The response includes pagination metadata (`length`, `total`, `page`, `limit`, and `totalPages`) plus the applied `filters`, so your client can continue with the next page only when needed. `list-check-results` stays compact for fast triage. Result rows include `responseStatusCode`, `responseStatusText`, `totalAssertions`, and `failingAssertions` when available, so your client can inspect common URL and API failure signals before fetching full result details or assets. `trigger-checks` only runs checks that already exist on the account. Use `prepare-local-check-authoring` and the Checkly CLI when you need to create, test, or deploy local check code. Example prompts: ```text title="Prompt" wrap theme={null} Show me the first page of failing API checks tagged production, then summarize what changed in their latest results. ``` ```text title="Prompt" wrap theme={null} Trigger the checks tagged production-smoke, then poll the test session until results are available. ``` ## Test session tools | Tool | Type | Description | | --------------------------- | ---- | ----------------------------------------------------------------------------------------------------- | | `list-test-sessions` | Read | List recent test sessions with filters and cursor ordering. | | `get-test-session` | Read | Return one test session and compact result rows. | | `list-test-session-results` | Read | List compact result rows for one test session with bounded pagination and optional result filters. | | `get-test-session-result` | Read | Return compact detail for one test-session result, including useful run metadata and small summaries. | Example prompt: ```text title="Prompt" wrap theme={null} Find the latest failed test session and show me the failed result IDs. ``` ## Result asset tools | Tool | Type | Description | | --------------------------------- | ---- | -------------------------------------------------------------------------------------------------------------------------------------------------- | | `list-check-result-assets` | Read | Return a normalized asset manifest for a check result. | | `fetch-check-result-asset` | Read | Fetch one selected check-result asset. Text assets may be returned inline with a byte limit; binary or large assets return a download link. | | `list-test-session-result-assets` | Read | Return a normalized asset manifest for a test-session result. | | `fetch-test-session-result-asset` | Read | Fetch one selected test-session-result asset. Text assets may be returned inline with a byte limit; binary or large assets return a download link. | Example prompt: ```text title="Prompt" wrap theme={null} For the failed check result, list available assets and fetch the text log if one exists. ``` ## Root cause analysis tools | Tool | Type | Description | | ------------------------------------- | ----- | ----------------------------------------------------------------------------------------------------------------- | | `get-error-group-root-cause-analyses` | Read | Return a check or test-session error group and any existing root cause analyses. | | `get-root-cause-analysis` | Read | Return one root cause analysis by RCA ID. Pending analyses return compact polling status. | | `trigger-root-cause-analysis` | Write | Trigger a new RCA for a check or test-session error group. Requires run access and consumes RCA invocation quota. | Call `get-error-group-root-cause-analyses` before triggering a new RCA so your agent can reuse existing analysis when available. Example prompt: ```text title="Prompt" wrap theme={null} Check whether this error group already has an RCA. If it does not, ask me before triggering a new one. ``` ## Environment variable tools | Tool | Type | Description | | ------------------------------------- | ----- | -------------------------------------------------------------------------------------------- | | `list-account-environment-variables` | Read | List account-level variables and secrets. Secret values are returned as `null`. | | `get-account-environment-variable` | Read | Get one account-level variable by key. Secret values are returned as `null`. | | `create-account-environment-variable` | Write | Create an account-level variable or secret. Secret values are encrypted and not echoed back. | | `update-account-environment-variable` | Write | Update an account-level variable or secret by key. To update a secret, pass `secret: true`. | Example prompt: ```text title="Prompt" wrap theme={null} List account environment variables and tell me whether API_TOKEN is stored as a secret. ``` ## Status page tools | Tool | Type | Description | | ------------------- | ---- | ------------------------------------------------------------------------------ | | `list-status-pages` | Read | List status pages, including cards and services needed for incident targeting. | | `get-status-page` | Read | Get one status page with cards and services. | Example prompt: ```text title="Prompt" wrap theme={null} List my status pages and show the service IDs for the production page. ``` ## Incident tools | Tool | Type | Description | | ------------------------------ | ----- | ------------------------------------------------------------------------------------------------------------ | | `list-status-page-incidents` | Read | List status page incidents, optionally filtered by page and incident status. | | `get-status-page-incident` | Read | Get one status page incident with services and incident updates. | | `create-status-page-incident` | Write | Create a new status page incident and optionally notify subscribers. Not idempotent. | | `update-status-page-incident` | Write | Post a progress update to an existing incident and optionally notify subscribers. Not idempotent. | | `resolve-status-page-incident` | Write | Resolve an incident by posting a final resolved update and optionally notifying subscribers. Not idempotent. | Example prompts: ```text title="Prompt" wrap theme={null} Show open status page incidents and summarize their latest updates. ``` ```text title="Prompt" wrap theme={null} Draft a major status page incident for the API outage and wait for confirmation before notifying subscribers. ``` # Troubleshoot the Checkly MCP Server Source: https://www.checklyhq.com/docs/ai/mcp-server/troubleshooting Resolve common Checkly MCP Server setup, authentication, account selection, and tool access issues. Before troubleshooting, confirm: * Your MCP client is configured with `https://api.checklyhq.com/mcp`. * You chose an authentication method supported by your client. * You restarted your MCP client after editing its configuration. * Your Checkly user or service API key can access the account you want to use. ## Authentication ### OAuth sign-in fails If your client reports that authentication is required or the browser sign-in does not complete: 1. Confirm the client is in the [supported OAuth clients list](/docs/ai/mcp-server/setup#supported-oauth-clients). 2. Confirm the endpoint is exactly `https://api.checklyhq.com/mcp`. 3. Re-run your client's MCP login or authentication flow. 4. Remove stale Checkly MCP credentials from the client if it keeps reusing an old token. 5. Reconnect and call `whoami`. If the browser login page shows a "Something went wrong" error, contact [Checkly Support](mailto:support@checklyhq.com). Include the MCP client, the Checkly account, and the approximate time of the error. ### OAuth client registration fails The Checkly MCP Server only supports Checkly-approved OAuth clients. Checkly does not support Dynamic Client Registration (DCR). If your client reports a dynamic registration error, a failed client registration, or never opens the expected OAuth flow, confirm that the client is in the [supported OAuth clients list](/docs/ai/mcp-server/setup#supported-oauth-clients). A client can support remote MCP servers and still be incompatible with the Checkly OAuth flow. If your client can send custom headers, use [API-key authentication](/docs/ai/mcp-server/setup#set-up-with-an-api-key) as a fallback. ### An API key is rejected If your client reports a missing or invalid bearer token: 1. Confirm the header is exactly `Authorization: Bearer `. 2. Use a current `cu_...` user API key or `sv_...` service API key. Deprecated account API keys and old `sk_...` service-key formats are rejected. 3. Confirm the key has not been revoked. 4. Confirm the client sends the header with remote MCP requests. 5. Reconnect and call `whoami`. For a user API key, confirm the user still belongs to the target account. For a service API key, confirm the key belongs to the target account and has the role needed for the action. If your client reads the bearer token from an environment variable, start the client from an environment where that variable is set. See [Set up with an API key](/docs/ai/mcp-server/setup#set-up-with-an-api-key) for client examples and [Creating an API key in Checkly](/docs/admin/creating-api-key) for key management. ## Tools and permissions ### No tools are listed Visible tools depend on the permissions granted to the MCP session. If no tools appear: 1. Use your MCP client's refresh tools option. 2. Restart the client if the tools list still does not update. 3. Reconnect with OAuth, or confirm your API-key header is still configured. After the tools list refreshes, call `whoami` or ask Checkly which accounts you can access to verify the connection. ### A specific tool is missing Each tool requires an MCP session permission. For example: * Check status and results require permission to list checks, their status, and results. * Test sessions require permission to read your Checkly test sessions. * Asset tools require permission to read Checkly assets plus the related result permission. * Incident write tools require permission to create and update your Checkly incidents. See [MCP tools](/docs/ai/mcp-server/tools) for the full tool list. The `invite-account-member` tool is not available with API-key authentication. Reconnect with OAuth if you need to invite account members through MCP. If the tool you expected is not part of the current MCP Server, [share feedback or requests](https://feedback.checklyhq.com) so we can understand the workflow your agent was trying to complete. ### A tool call is denied Tool visibility and Checkly account access are separate checks. A tool can be visible but reject a call when the selected account does not include the required feature or the authenticated user or service API key has an insufficient role. Confirm the target account and the role returned by `whoami`. User API keys inherit the user's role. Service API keys use the account and role selected when the key was created. See [Security and permissions](/docs/ai/mcp-server/security-and-permissions#role-checks) for the access required by write and run actions. ## Account selection ### A tool asks for an account OAuth sessions and user API keys can access multiple Checkly accounts. Ask your client: ```text title="Prompt" wrap theme={null} Use Checkly to show the accounts I can access, then show failing checks for . ``` To always use the same account, set the `X-Checkly-Account` header in your MCP server configuration. See [Select an account](/docs/ai/mcp-server/setup#select-an-account). Service API keys are already scoped to one account. If a service-key session reports that it cannot access the account in `X-Checkly-Account`, remove the header or set it to the account configured on the key. ## Local check authoring ### The MCP server cannot create or deploy check code The MCP server runs remotely and cannot access your local project files. It cannot author, bundle, test, or deploy check code. Ask for a CLI handoff instead: ```text title="Prompt" wrap theme={null} Use Checkly to prepare the local check authoring runbook for a browser check. ``` Then run the returned Checkly CLI steps in your local project. ## Write actions ### A write tool did more than expected Some write tools are not idempotent. Retrying a call can create another invite, another incident, or another incident update. If a write tool changed more than you expected, contact [Checkly Support](mailto:support@checklyhq.com). Include the MCP client, the Checkly account, the tool name, and the approximate time of the action. Before approving write tool calls, check: * The target account ID. * The target status page or check ID. * Whether subscribers will be notified. * Whether the action consumes check-run or RCA quota. ## Browser-based clients ### A browser client or web IDE cannot connect Some browser-based clients require CORS support and may handle OAuth differently from command-line clients. If a browser-based client cannot connect: 1. If you use OAuth, confirm the client is in the [supported OAuth clients list](/docs/ai/mcp-server/setup#supported-oauth-clients). 2. If you use an API key, confirm the client sends custom headers with remote MCP requests. 3. Try another supported client, such as Claude Code. # AI Agents & Coding Assistants Source: https://www.checklyhq.com/docs/ai/overview Use AI agents and coding assistants with Checkly Skills and the Checkly MCP Server. From the beginning, Checkly has bet on [Monitoring as Code](/docs/concepts/monitoring-as-code) which lets you create and control your monitoring infrastructure entirely using code. By default, [Checkly constructs](/docs/constructs/overview) reflect all your monitoring properties. ```ts api.check.ts theme={null} import { ApiCheck, AssertionBuilder } from "checkly/constructs" new ApiCheck("api-health-check", { name: "API Health Check", request: { url: "https://danube-web.shop/api/books", method: "GET", assertions: [ AssertionBuilder.statusCode().equals(200), ], }, }) ``` All your monitoring resources can be updated, tested and deployed via [the Checkly CLI](/docs/cli/overview). ```bash theme={null} # test your monitoring configuration npx checkly test # deploy and update your monitoring setup npx checkly deploy ``` **The Monitoring as Code workflow is by default AI-native** because LLMs are excellent at writing and editing Checkly constructs code and modern AI agents can execute CLI commands easily. Provide the necessary Checkly context and let your AI agent of choice do the rest. "Can you set up a new `BrowserCheck` for `example.com`?" "Can you change all checks to run every 5 minutes instead of every 10 minutes?" "I just received an alert. Can you tell me details about the failing checks?" "Can you please open an incident and investigate a fix?" ## Add Checkly context to your AI agent conversation Install [Checkly Skills](/docs/ai/skills) or connect the [Checkly MCP Server](/docs/ai/mcp-server) to give your AI agent enough context to perform Checkly-related tasks. For coding agents with repo and code access. Author Monitoring as Code with the Checkly CLI. For desktop or sandboxed agents. Live access to Checkly account data and remote actions. ### Skills, MCP, and the CLI **Use Skills for a CLI-first workflow.** Skills are built for coding agents that have access to your repository and can run commands. The agent edits your Checkly constructs and tests, then uses the [Checkly CLI](/docs/cli/overview) to test and deploy them. Skills load context on demand, keeping your agent's context window lean until Checkly-related tasks arise. This is the recommended approach for agents that support the [Agent Skills](https://agentskills.io) standard. **Use the MCP Server in desktop or sandboxed environments.** Some agents, like Claude Desktop, ChatGPT, or a sandboxed assistant, can't access your repository or filesystem. The [Checkly MCP Server](/docs/ai/mcp-server) connects these clients to Checkly over Streamable HTTP and gives them live data and remote account actions, such as reading check status, inspecting test sessions, triggering existing checks, reading RCA, or managing status page incidents. | Use case | Recommended path | | ----------------------------------------------------------- | ---------------------------------------------------------------------------- | | Ask quick, ad hoc questions from a supported client | [MCP Server](/docs/ai/mcp-server) | | Inspect live Checkly data without local CLI setup | [MCP Server](/docs/ai/mcp-server) | | Trigger existing deployed checks from chat | [MCP Server](/docs/ai/mcp-server) or [Checkly CLI](/docs/cli/overview) | | Create or edit check code | [Checkly Skills](/docs/ai/skills) with the [Checkly CLI](/docs/cli/overview) | | Test, deploy, or automate local Monitoring as Code projects | [Checkly CLI](/docs/cli/overview) | | Add reusable Checkly best practices to an agent | [Checkly Skills](/docs/ai/skills) | ## Feed documentation to your agent Every Checkly documentation page is available as markdown, and an `llms.txt` index lists them all. Both make it easy to pull the exact docs your agent needs into its context. Append `.md` to any docs URL, request markdown with content negotiation, or copy a page as markdown. A machine-readable index of every documentation page for crawling and indexing. # Checkly Plugin for AI Coding Agents Source: https://www.checklyhq.com/docs/ai/plugin Install the Checkly plugin to give your AI coding agent Checkly monitoring skills and Playwright best practices in a single package. The [Checkly plugin](https://github.com/checkly/checkly-plugin) bundles the official Checkly skills and the Checkly MCP server for AI coding agents in a single installable package. It targets Claude Code, OpenAI Codex, Cursor, and any agent supporting the plugins standard. ## Getting started ### Installation Add the Checkly plugin marketplace and install the plugin from within Claude Code: ```txt theme={null} /plugin marketplace add checkly/checkly-plugin /plugin install checkly@checkly ``` 1. Open the plugin settings and click **Add marketplace**. 2. Select **Add from a repository**. 3. Enter `https://github.com/checkly/checkly-plugin/` as the URL and click **Sync**. The 'Add marketplace' dialog with the Checkly plugin repository URL entered and automatic syncing enabled 4. Install the Checkly plugin from the newly added marketplace. The plugin directory listing the Checkly plugin from the checkly-plugin marketplace with an install button 1. Open the plugin settings and click **Add marketplace**. 2. Enter `https://github.com/checkly/checkly-plugin` as the source and click **Add marketplace**. The 'Add plugin marketplace' dialog with the Checkly plugin repository URL entered as the source 3. Install the Checkly plugin from the newly added marketplace and connect it to your Checkly account. The Checkly plugin listed in the plugin directory with an install button 4. Once installed, the plugin registers the [Checkly MCP server](/docs/ai/mcp-server) so you can inspect checks, trigger runs, and investigate failures from Codex. The Checkly plugin has been submitted to Anthropic and OpenAI and is awaiting review. Until it's approved, install it from the GitHub repository as described above. After installation, restart your AI agent to load the plugin. ## What the plugin provides ### MCP server The plugin configures the [Checkly MCP server](/docs/ai/mcp-server), connecting your agent to your Checkly account for live operations like inspecting check status and results, triggering checks, or starting root cause analyses. ### Skills The plugin also ships two skills. Both are synced daily from their source repositories, so you always get the latest guidance. | Skill | Description | | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | `checkly` | Set up, create, test, and manage monitoring checks with the Checkly CLI. See [Checkly Skills](/docs/ai/skills) for details on what the skill covers. | | `playwright-best-practices-for-agents` | Agent-first best practices for writing, structuring, debugging, and stabilizing Playwright tests. | ## Usage Once installed, your agent automatically loads the relevant skill whenever a Checkly or Playwright task comes up — no manual context loading required. ```txt Claude Code Example highlight={3-4} theme={null} ❯ Can you create a new URLMonitor with Checkly for example.com? ⏺ Skill(checkly:checkly) ⎿ Successfully loaded skill · 3 tools allowed ⏺ Let me read more references and check the existing project structure ``` In agents supporting slash commands, you can also invoke the bundled skills explicitly: ```txt theme={null} /checkly:checkly /checkly:playwright-best-practices-for-agents ``` If you only want the Checkly monitoring skill without the plugin wrapper, install it directly via the Checkly CLI. See [Checkly Skills](/docs/ai/skills). ## Reporting issues If a skill gives incorrect advice or the plugin doesn't behave as expected, [file an issue on GitHub](https://github.com/checkly/checkly-plugin/issues). ## Additional resources * [checkly/checkly-plugin on GitHub](https://github.com/checkly/checkly-plugin) * [Checkly Skills](/docs/ai/skills) * [Agent Skills Specification](https://agentskills.io/specification.md) # Rocky AI Source: https://www.checklyhq.com/docs/ai/rocky-ai Learn about Rocky AI — Checkly's AI agent — and configuring and using AI features Rocky AI is Checkly's AI agent. Rocky AI can help you automatically determine user impact and root cause on any failing check using error messages, code, metrics, OTeL traces, trace routes, packet captures: essentially all artefact generated by a check or test. ## Rocky AI Capabilities ### Root Cause and User Impact Analysis * **User Impact**: Rocky AI analyzes the failure and provides you with a list of impacted user groups and features. * **Root Cause**: Rocky AI analyzes the failure and provides you with a root cause analysis. * **Step Summary**: Rocky AI summarizes the steps in the check script, making it easier to understand what the check is doing and where it failed. This typically works for any Playwright based check. [**Learn More**](/docs/resolve/ai-root-cause-analysis/overview) ## Consumption and Invocations Every AI analysis — whether triggered automatically or manually — counts as one invocation against your plan's quota. If the same analysis result is pushed to multiple alert channels, it is still counted as a single invocation. When your invocation quota is reached, no overages are charged. Invocations refresh at the start of your next billing cycle. You can monitor your current usage and configure automatic analysis in the [AI settings](https://app.checklyhq.com/accounts/rocky-ai). By default, Rocky AI automatically analyzes every new error group, which consumes invocations. You can disable automatic analysis in the [AI settings](https://app.checklyhq.com/accounts/rocky-ai) to only use invocations for manual analyses. ## Data Privacy and Security * All AI features are designed to operate on the data you provide or the data generated by your checks. This data is already stored in Checkly, and we do not send any additional data to third-party AI providers. * Any provided [environment secrets](/docs/platform/variables) are scrubbed before being sent to the AI provider. * We do not train any custom models on your data. * Any data used by the AI features is processed in real-time and not stored for future training. ## Built-in and Custom Models By default, Checkly uses OpenAI's GPT-5.1 model for AI features. However, you can also bring your own model (BYOM) and provider to Checkly. To do this, you need to set up a custom AI provider in the [AI settings screen](https://app.checklyhq.com/settings/account/ai). Note that custom model providers need to have the following capabilities: * Able to handle tool calling. * Able to stream responses. * Available for the Node.js-based AI SDK, [see the list of providers here](https://ai-sdk.dev/providers/ai-sdk-providers) The Bring Your Own Model (BYOM) feature is available for Enterprise customers only. # Checkly Skills Source: https://www.checklyhq.com/docs/ai/skills Official Checkly skills to give any AI agent on-demand best practices, context, and product capabilities. [Agent Skills](https://agentskills.io) are an open standard supported by many AI agents and coding assistants including Claude Code, Cursor, OpenAI Codex, and others. Skills are reusable and modular capabilities for AI agents. They provide procedural knowledge that helps agents accomplish Checkly tasks more effectively. Think of Checkly Skills as an extension of your AI agent that enhances it with Checkly specific best practices and capabilities. ### Installation Use [the Checkly CLI `skills` command](/docs/cli/checkly-skills#checkly-skills-install) to install [Checkly skills](https://github.com/checkly/checkly-cli/tree/main/skills/checkly) globally or in your project: ```bash theme={null} npx checkly skills install # or if you prefer the `skills` CLI npx skills add checkly/checkly-cli ``` After installation, restart your AI agent to load the skills. Prefer a plugin? The [Checkly plugin](/docs/ai/plugin) bundles this skill together with Playwright best practices for Claude Code, OpenAI Codex, Cursor, and other agents. ## Usage Now when your agent needs to perform a Checkly-related task, it can automatically pull in the relevant context and use the provided instructions and resources to execute the task effectively. ```txt Claude Code Example highlight={3-4, 8-9} theme={null} ❯ Can you create a new URLMonitor with Checkly for example.com? ⏺ Skill(checkly) ⎿ Successfully loaded skill · 3 tools allowed ⏺ Let me read more references and check the existing project structure ⏺ Bash(npx checkly skills configure) ⏺ Bash(npx checkly skills configure url-monitors) ⏺ Searched for 1 pattern, executed 2 commands ⏺ I'll create a new URLMonitor for example.com! ``` ### Examples **The Monitoring as Code workflow is by default AI-native** because LLMs are excellent at writing and editing Checkly constructs code and modern AI agents can execute CLI commands easily. Provide the necessary Checkly context and let your AI agent of choice do the rest. "Can you set up a new `BrowserCheck` for `example.com`?" "Can you change all checks to run every 5 minutes instead of every 10 minutes?" "I just received an alert. Can you tell me details about the failing checks?" "Can you please open an incident and investigate a fix?" Using Checkly, you can now control your monitoring setup with AI agents without needing a specific MCP server or API for your monitoring. Tell your agent what you want to do and it will access the necessary context and use the CLI to manage your monitoring setup effectively. ## Skill Details Create and manage monitoring checks, alert channels, dashboards, status pages, and other Checkly constructs using the CLI. **Invoke explicitly:** ```bash theme={null} npx checkly skills configure ``` **Example prompts:** * "Create a URL monitor for api.example.com that checks every 5 minutes" * "Set up a browser check that logs into my app and verifies the dashboard loads" * "Add a Slack alert channel for my production check group" **CLI usage:** ```bash theme={null} # List all configure sub-actions npx checkly skills configure # Get reference for a specific check type npx checkly skills configure api-checks npx checkly skills configure browser-checks npx checkly skills configure url-monitors # Other constructs npx checkly skills configure alert-channels npx checkly skills configure check-groups npx checkly skills configure supporting-constructs ``` Access check status, analyze failures, trigger on-demand runs, and debug errors across your monitoring setup. **Invoke explicitly:** ```bash theme={null} npx checkly skills investigate ``` **Example prompts:** * "Show me which checks are currently failing" * "Investigate why the login browser check started failing yesterday" * "Trigger an on-demand run of my API health check" **CLI usage:** ```bash theme={null} # Get full investigate reference npx checkly skills investigate # Check inspection and on-demand runs npx checkly skills investigate checks ``` Open and manage incidents and lead customer communications via status pages. **Invoke explicitly:** ```bash theme={null} npx checkly skills communicate ``` **Example prompts:** * "Create a new incident for the API outage and post it to the status page" * "Update the current incident with a resolution message" * "List all open incidents" **CLI usage:** ```bash theme={null} # Get full communicate reference npx checkly skills communicate # Incident lifecycle management npx checkly skills communicate incidents ``` Understand your account plan, entitlements, feature limits, and available monitoring locations. **Invoke explicitly:** ```bash theme={null} npx checkly skills manage ``` **Example prompts:** * "What features are available on my current Checkly plan?" * "Which monitoring locations can I use?" * "Check if my plan supports private locations" **CLI usage:** ```bash theme={null} # Get full manage reference npx checkly skills manage # Check plan details and entitlements npx checkly skills manage plan ``` ## Additional resources * [`checkly skills` CLI Reference](/docs/cli/checkly-skills) * [Checkly CLI Documentation](/docs/cli/overview/) * [Checkly Constructs Reference](/docs/constructs/overview/) * [Agent Skills Specification](https://agentskills.io/specification.md) # Get details for a specific account Source: https://www.checklyhq.com/docs/api-reference/accounts/fetch-a-given-account-details get /v1/accounts/{accountId} Get details from a specific account. # Fetch account entitlements Source: https://www.checklyhq.com/docs/api-reference/accounts/fetch-account-entitlements get /v1/accounts/{accountId}/entitlements Fetch the entitlements for the account, including feature access and limits based on the current plan. # Get details for the current account Source: https://www.checklyhq.com/docs/api-reference/accounts/fetch-current-account-details get /v1/accounts/me Get details from the current account. # Fetch current account entitlements Source: https://www.checklyhq.com/docs/api-reference/accounts/fetch-current-account-entitlements get /v1/accounts/me/entitlements Fetch the entitlements for the account, including feature access and limits based on the current plan. # Get details for all accounts Source: https://www.checklyhq.com/docs/api-reference/accounts/fetch-user-accounts get /v1/accounts List account details based on supplied API key. # List account members and pending invites Source: https://www.checklyhq.com/docs/api-reference/accounts/list-account-members-and-pending-invites get /v1/accounts/{accountId}/members # List current account members and pending invites Source: https://www.checklyhq.com/docs/api-reference/accounts/list-current-account-members-and-pending-invites get /v1/accounts/me/members # Remove a current account member Source: https://www.checklyhq.com/docs/api-reference/accounts/remove-a-current-account-member delete /v1/accounts/me/members/{userId} # Remove an account member Source: https://www.checklyhq.com/docs/api-reference/accounts/remove-an-account-member delete /v1/accounts/{accountId}/members/{userId} # Update a current account member role Source: https://www.checklyhq.com/docs/api-reference/accounts/update-a-current-account-member-role patch /v1/accounts/me/members/{userId} # Update an account member role Source: https://www.checklyhq.com/docs/api-reference/accounts/update-an-account-member-role patch /v1/accounts/{accountId}/members/{userId} # Create an alert channel Source: https://www.checklyhq.com/docs/api-reference/alert-channels/create-an-alert-channel post /v1/alert-channels Creates a new alert channel # Delete an alert channel Source: https://www.checklyhq.com/docs/api-reference/alert-channels/delete-an-alert-channel delete /v1/alert-channels/{id} Permanently removes an alert channel # List all alert channels Source: https://www.checklyhq.com/docs/api-reference/alert-channels/list-all-alert-channels get /v1/alert-channels Lists all configured alert channels and their subscribed checks. # Retrieve an alert channel Source: https://www.checklyhq.com/docs/api-reference/alert-channels/retrieve-an-alert-channel get /v1/alert-channels/{id} Show details of a specific alert channel. # Update an alert channel Source: https://www.checklyhq.com/docs/api-reference/alert-channels/update-an-alert-channel put /v1/alert-channels/{id} Update an alert channel # Update the subscriptions of an alert channel Source: https://www.checklyhq.com/docs/api-reference/alert-channels/update-the-subscriptions-of-an-alert-channel put /v1/alert-channels/{id}/subscriptions Update the subscriptions of an alert channel. Use this to add a check to an alert channel so failure and recovery alerts are send out for that check. Note: when passing the subscription object, you can only specify a "checkId" or a "groupId, not both. # Lists all alert notifications Source: https://www.checklyhq.com/docs/api-reference/alert-notifications/lists-all-alert-notifications get /v1/alert-notifications Lists the alert notifications that have been sent for your account. You can filter by alert channel ID or limit to only failing notifications. Use the `to` and `from` parameters to specify a date range (UNIX timestamp in seconds). This endpoint will return data within a 24-hour timeframe. If the `from` and `to` params are set, they must be at most 24 hours apart. If none are set, we will consider the `to` param to be now and the `from` param to be 24 hours earlier. If only the `to` param is set we will set `from` to be 24 hours earlier. If only the `from` param is set we will consider the `to` param to be 24 hours later. **Rate-limiting is applied to this endpoint, you can send 5 requests / 10 seconds at most.** # API checks Source: https://www.checklyhq.com/docs/api-reference/analytics/api-checks get /v1/analytics/api-checks/{id} Fetch detailed availability metrics and aggregated or non-aggregated API Check metrics across custom time ranges. For example, you can get the p99 and p95 of all the DNS phases of your API check together with the availability percentage for any time range. **Rate-limiting is applied to this endpoint, you can send 30 requests / 60 seconds at most.** # Browser checks Source: https://www.checklyhq.com/docs/api-reference/analytics/browser-checks get /v1/analytics/browser-checks/{id} Fetch detailed availability metrics and aggregated or non-aggregated Browser Check metrics across custom time ranges. For example, you can get the average amount of console errors, the p99 of your FCP and the standard deviation of your TTFB for the second page in your Browser check with one API call. **Rate-limiting is applied to this endpoint, you can send 30 requests / 60 seconds at most.** # DNS monitors Source: https://www.checklyhq.com/docs/api-reference/analytics/dns-monitors get /v1/analytics/dns/{id} Fetch detailed availability metrics and aggregated or non-aggregated DNS Monitor metrics across custom time ranges. For example, you can get the p99 and p95 of the total DNS query time together with the availability percentage for any time range. **Rate-limiting is applied to this endpoint, you can send 30 requests / 60 seconds at most.** # Get analytics summary for multiple checks Source: https://www.checklyhq.com/docs/api-reference/analytics/get-analytics-summary-for-multiple-checks post /v1/analytics/checks Returns availability, response times, and latency metrics for the given checks. Response shape is polymorphic per check type: fields are present only when the metric applies to that type. A null value means no data in the requested time range; an absent field means the metric does not apply to that check type. Currently only `quickRange` is supported for time filtering. Arbitrary `from`/`to` date ranges are not yet supported but may be added in a future release. **Rate-limiting is applied to this endpoint, you can send 30 requests / 60 seconds at most.** # Heartbeat monitors Source: https://www.checklyhq.com/docs/api-reference/analytics/heartbeat-checks get /v1/analytics/heartbeat-checks/{id} Fetch detailed availability metrics and aggregated or non-aggregated Heartbeat Check metrics across custom time ranges. **Rate-limiting is applied to this endpoint, you can send 30 requests / 60 seconds at most.** # ICMP monitors Source: https://www.checklyhq.com/docs/api-reference/analytics/icmp-monitors get /v1/analytics/icmp/{id} Fetch detailed availability metrics and aggregated or non-aggregated ICMP Monitor metrics across custom time ranges. For example, you can get the p99 and p95 of latency metrics together with the packet loss percentage for any time range. **Rate-limiting is applied to this endpoint, you can send 30 requests / 60 seconds at most.** # List all available reporting metrics. Source: https://www.checklyhq.com/docs/api-reference/analytics/list-all-available-reporting-metrics get /v1/analytics/metrics List all available reporting metrics. # Multistep checks Source: https://www.checklyhq.com/docs/api-reference/analytics/multistep-checks get /v1/analytics/multistep-checks/{id} Fetch detailed availability metrics and aggregated or non-aggregated Multistep Check metrics across custom time ranges. **Rate-limiting is applied to this endpoint, you can send 30 requests / 60 seconds at most.** # Playwright checks Source: https://www.checklyhq.com/docs/api-reference/analytics/playwright-checks get /v1/analytics/playwright-checks/{id} Fetch detailed availability metrics and aggregated or non-aggregated Playwright Check metrics across custom time ranges. **Rate-limiting is applied to this endpoint, you can send 30 requests / 60 seconds at most.** # SSL monitors Source: https://www.checklyhq.com/docs/api-reference/analytics/ssl-monitors get /v1/analytics/ssl/{id} Fetch detailed availability metrics and aggregated or non-aggregated SSL Monitor metrics across custom time ranges. For example, you can get the p99 and p95 of the TLS handshake time together with the availability percentage for any time range. **Rate-limiting is applied to this endpoint, you can send 30 requests / 60 seconds at most.** # TCP monitors Source: https://www.checklyhq.com/docs/api-reference/analytics/tcp-checks get /v1/analytics/tcp-checks/{id} Fetch detailed availability metrics and aggregated or non-aggregated TCP Check metrics across custom time ranges. For example, you can get the p99 and p95 of all the check phases of your TCP check together with the availability percentage for any time range. **Rate-limiting is applied to this endpoint, you can send 30 requests / 60 seconds at most.** # URL monitors Source: https://www.checklyhq.com/docs/api-reference/analytics/url-monitors get /v1/analytics/url-monitors/{id} Fetch detailed availability metrics and aggregated or non-aggregated API Check metrics across custom time ranges. For example, you can get the p99 and p95 of all the DNS phases of your API check together with the availability percentage for any time range. **Rate-limiting is applied to this endpoint, you can send 30 requests / 60 seconds at most.** # Get badge for a check Source: https://www.checklyhq.com/docs/api-reference/badges/get-v1badgeschecks get /v1/badges/checks/{checkId} Get check status badge. You can enable the badges feature in [account settings](https://app.checklyhq.com/settings/account/general) # Get badge for a group Source: https://www.checklyhq.com/docs/api-reference/badges/get-v1badgesgroups get /v1/badges/groups/{groupId} Get group status badge. You can enable the badges feature in [account settings](https://app.checklyhq.com/settings/account/general) # List alerts for a specific check Source: https://www.checklyhq.com/docs/api-reference/check-alerts/list-alerts-for-a-specific-check get /v1/check-alerts/{checkId} Lists all the alerts for a specific check. Use the `to` and `from` parameters to specify a date range (UNIX timestamp in seconds). This endpoint will return data within a 6-hour timeframe. If the `from` and `to` params are set, they must be at most 6 hours apart. If none are set, we will consider the `to` param to be now and the `from` param to be 6 hours earlier. If only the `to` param is set we will set `from` to be 6 hours earlier. If only the `from` param is set we will consider the `to` param to be 6 hours later. # List all alerts for your account Source: https://www.checklyhq.com/docs/api-reference/check-alerts/list-all-alerts-for-your-account get /v1/check-alerts Lists all alerts that have been sent for your account. Use the `to` and `from` parameters to specify a date range (UNIX timestamp in seconds). This endpoint will return data within a 6-hour timeframe. If the `from` and `to` params are set, they must be at most 6 hours apart. If none are set, we will consider the `to` param to be now and the `from` param to be 6 hours earlier. If only the `to` param is set we will set `from` to be 6 hours earlier. If only the `from` param is set we will consider the `to` param to be 6 hours later. # Create a check group Source: https://www.checklyhq.com/docs/api-reference/check-groups/create-a-check-group post /v1/check-groups Creates a new check group. You can add checks to the group by setting the "groupId" property of individual checks. Groups created with this endpoint will always override its member check settings (i.e. location, alerting, etc.). We recommend using the [V2 endpoint](/docs/api-reference/check-groups/create-a-check-group-v2) instead for more flexibility. # Create a check group (V2) Source: https://www.checklyhq.com/docs/api-reference/check-groups/create-a-check-group-v2 post /v2/check-groups Creates a new check group. You can add checks to the group by setting the "groupId" property of individual checks. # Delete a check group. Source: https://www.checklyhq.com/docs/api-reference/check-groups/delete-a-check-group delete /v1/check-groups/{id} Permanently removes a check group. You cannot delete a check group if it still contains checks. # List all check groups Source: https://www.checklyhq.com/docs/api-reference/check-groups/list-all-check-groups get /v1/check-groups Lists all current check groups in your account. The "checks" property is an array of check UUID's for convenient referencing. It is read only and you cannot use it to add checks to a group. # Retrieve a check group Source: https://www.checklyhq.com/docs/api-reference/check-groups/retrieve-a-check-group get /v1/check-groups/{id} Show details of a specific check group # Retrieve all checks in a specific group with group settings applied Source: https://www.checklyhq.com/docs/api-reference/check-groups/retrieve-all-checks-in-a-specific-group-with-group-settings-applied get /v1/check-groups/{id}/checks Lists all checks in a specific check group with the group settings applied. # Retrieve all checks in a specific group with group settings applied (V2) Source: https://www.checklyhq.com/docs/api-reference/check-groups/retrieve-all-checks-in-a-specific-group-with-group-settings-applied-v2 get /v2/check-groups/{id}/checks Lists all checks in a specific check group with the group settings applied. Unlike `/v1`, this endpoint does not return the flat `project`, `logicalId`, `member` and `pending` fields. A check can be managed by more than one project and each of those fields can name only one of them; `projectBindings` reports every binding, and is identical on `/v1` and `/v2`. Versioning is per endpoint. Only endpoints whose response or payload changed have a `/v2`; everything else remains on `/v1` and is unaffected. In particular the check groups themselves, and creating, updating and deleting checks, are unchanged and stay on `/v1`. # Retrieve one check in a specific group with group settings applied Source: https://www.checklyhq.com/docs/api-reference/check-groups/retrieve-one-check-in-a-specific-group-with-group-settings-applied get /v1/check-groups/{groupId}/checks/{checkId} Show details of one check in a specific check group with the group settings applied. # Retrieve one check in a specific group with group settings applied (V2) Source: https://www.checklyhq.com/docs/api-reference/check-groups/retrieve-one-check-in-a-specific-group-with-group-settings-applied-v2 get /v2/check-groups/{groupId}/checks/{checkId} Show details of one check in a specific check group with the group settings applied. Unlike `/v1`, this endpoint does not return the flat `project`, `logicalId`, `member` and `pending` fields. A check can be managed by more than one project and each of those fields can name only one of them; `projectBindings` reports every binding, and is identical on `/v1` and `/v2`. Versioning is per endpoint. Only endpoints whose response or payload changed have a `/v2`; everything else remains on `/v1` and is unaffected. In particular the check groups themselves, and creating, updating and deleting checks, are unchanged and stay on `/v1`. # Update a check group Source: https://www.checklyhq.com/docs/api-reference/check-groups/update-a-check-group put /v1/check-groups/{id} Updates a check group. Groups updated with this endpoint will always override its member check settings (i.e. location, alerting, etc.). We recommend using the [V2 endpoint](/docs/api-reference/check-groups/update-a-check-group-v2) instead for more flexibility. # Update a check group (V2) Source: https://www.checklyhq.com/docs/api-reference/check-groups/update-a-check-group-v2 put /v2/check-groups/{id} Updates a check group. # Lists all check results Source: https://www.checklyhq.com/docs/api-reference/check-results/lists-all-check-results get /v1/check-results/{checkId} **[DEPRECATED] This endpoint will be removed soon. Please use the `GET /v2/check-results/{checkId}` endpoint instead.** Lists the full, raw check results for a specific check. We keep raw results for 30 days. After 30 days they are erased. However, we keep the rolled up results for an indefinite period. You can filter by check type and result type to narrow down the list. Use the `to` and `from` parameters to specify a date range (UNIX timestamp in seconds). Depending on the check type, some fields might be null. This endpoint will return data within a 6-hour timeframe. If the `from` and `to` params are set, they must be at most six hours apart. If none are set, we will consider the `to` param to be now and the `from` param to be six hours earlier. If only the `to` param is set we will set `from` to be six hours earlier. On the contrary, if only the `from` param is set we will consider the `to` param to be six hours later. **Rate-limiting is applied to this endpoint, you can send 60 requests / 60 seconds at most.** # Lists all check results Source: https://www.checklyhq.com/docs/api-reference/check-results/lists-all-check-results-1 get /v2/check-results/{checkId} Lists the full, raw check results for a specific check. We keep raw results for 30 days. After 30 days they are erased. However, we keep the rolled up results for an indefinite period. You can filter by check type and result type to narrow down the list. Use the `to` and `from` parameters to specify a date range (UNIX timestamp in seconds). Depending on the check type, some fields might be null. **Rate-limiting is applied to this endpoint, you can send 60 requests / 60 seconds at most.** # Retrieve a check result Source: https://www.checklyhq.com/docs/api-reference/check-results/retrieve-a-check-result get /v1/check-results/{checkId}/{checkResultId} Show details of a specific check result. # Retrieve a normalized asset manifest for a check result Source: https://www.checklyhq.com/docs/api-reference/check-results/retrieve-a-normalized-asset-manifest-for-a-check-result get /v1/check-results/{checkId}/{checkResultId}/assets Returns a normalized manifest of downloadable assets for the check result. # Await the completion of a check session Source: https://www.checklyhq.com/docs/api-reference/check-sessions/await-the-completion-of-a-check-session get /v1/check-sessions/{checkSessionId}/completion Call this endpoint to await the completion of a check session. A successful response will be returned once the check session reaches its final state (i.e. when it passes or fails). If the check session takes a long time to complete, the endpoint will return a timeout error code. You should keep calling the endpoint until you receive a successful response, or a non-timeout related error code. If using *curl*, its `--retry` option is suitable. The successful response of this endpoint is equivalent to the `GET /v1/check-sessions/{checkSessionId}` endpoint's response for a completed check session. # Await the completion of a check session (v2) Source: https://www.checklyhq.com/docs/api-reference/check-sessions/await-the-completion-of-a-check-session-v2 get /v2/check-sessions/{checkSessionId}/completion Call this endpoint to await the completion of a check session. A successful response will be returned once the check session reaches its final state (i.e. when it passes, fails, degrades, or is cancelled). If the check session takes a long time to complete, the endpoint will return a timeout error code. You should keep calling the endpoint until you receive a successful response, or a non-timeout related error code. If using *curl*, its `--retry` option is suitable. The successful response of this endpoint is equivalent to the `GET /v2/check-sessions/{checkSessionId}` endpoint's response for a completed check session. The `status` field may return `CANCELLED` for sessions cancelled via `POST /v1/check-sessions/{checkSessionId}/cancel`, and each per-result object includes an `isCancelled` boolean. # Cancel a check session Source: https://www.checklyhq.com/docs/api-reference/check-sessions/cancel-a-check-session post /v1/check-sessions/{checkSessionId}/cancel Cancels in-progress Playwright Check Suite runs within the specified check session. Use the optional `sequenceId` field in the request body to cancel only specific parallel runs within the session; omit it to cancel everything still running. Returns `204 No Content` once the cancellation requests have been dispatched. Returns `404 Not Found` if the check session does not exist. Check sessions are started by the UI "Schedule now" button and `checkly deploy`. See [Cancellation](/docs/concepts/cancellation) for how cancelled runs affect alerts, metrics, and the `CANCELLED` session status. # Retrieve a check session Source: https://www.checklyhq.com/docs/api-reference/check-sessions/retrieve-a-check-session get /v1/check-sessions/{checkSessionId} Retrieves a check session. Results may be incomplete if the check session is still in progress. Once a check session has finished, results will include at least one check result for each run location: one result with `resultType` equal to `"FINAL"`, and zero or more results with `resultType` equal to `"ATTEMPT"` (one for each failed attempt, if any). Each result contains just enough information to quickly determine whether the check run was successful or not. To dive even deeper into individual results, use the `GET /v1/check-results/{checkId}/{checkResultId}` endpoint to retrieve detailed data about a specific result. # Retrieve a check session (v2) Source: https://www.checklyhq.com/docs/api-reference/check-sessions/retrieve-a-check-session-v2 get /v2/check-sessions/{checkSessionId} Retrieves a check session. Results may be incomplete if the check session is still in progress. Once a check session has finished, results will include at least one check result for each run location: one result with `resultType` equal to `"FINAL"`, and zero or more results with `resultType` equal to `"ATTEMPT"` (one for each failed attempt, if any). Each result contains just enough information to quickly determine whether the check run was successful or not. To dive even deeper into individual results, use the `GET /v1/check-results/{checkId}/{checkResultId}` endpoint to retrieve detailed data about a specific result. The `status` field may return `CANCELLED` for sessions cancelled via `POST /v1/check-sessions/{checkSessionId}/cancel`, and each per-result object includes an `isCancelled` boolean. # Trigger a new check session Source: https://www.checklyhq.com/docs/api-reference/check-sessions/trigger-a-new-check-session post /v1/check-sessions/trigger Starts a check session for each check that matches the provided target filters. If no filters are given, matches all eligible checks. This endpoint does not wait for the check session to complete. Use the `GET /v1/check-sessions/{checkSessionId}/completion` or `GET /v1/check-sessions/{checkSessionId}` endpoints to track progress if needed. Standard alerting rules apply to finished check runs. Equivalent to the _Schedule Now_ button in the UI. # Trigger a new check session (v2) Source: https://www.checklyhq.com/docs/api-reference/check-sessions/trigger-a-new-check-session-v2 post /v2/check-sessions/trigger Starts a check session for each check that matches the provided target filters. If no filters are given, matches all eligible checks. This endpoint does not wait for the check session to complete. Use the `GET /v2/check-sessions/{checkSessionId}/completion` or `GET /v2/check-sessions/{checkSessionId}` endpoints to track progress. Use `POST /v1/check-sessions/{checkSessionId}/cancel` to cancel an in-progress check session. Standard alerting rules apply to finished check runs. Equivalent to the _Schedule Now_ button in the UI. # List all check statuses Source: https://www.checklyhq.com/docs/api-reference/check-status/list-all-check-statuses get /v1/check-statuses Shows the current status information for all checks in your account. The check status records are continuously updated as new check results come in. # Retrieve check status details Source: https://www.checklyhq.com/docs/api-reference/check-status/retrieve-check-status-details get /v1/check-statuses/{checkId} Show the current status information for a specific check. # Create a browser check Source: https://www.checklyhq.com/docs/api-reference/checks/create-a-browser-check post /v1/checks/browser Creates a new browser check. Will return a `402` when you are over the limit of your plan. When using the `globalAlertSetting`, the `alertSetting` can be `null` # Create a check Source: https://www.checklyhq.com/docs/api-reference/checks/create-a-check post /v1/checks **[DEPRECATED] This endpoint will be removed soon. Instead use `POST /checks/api` or `POST /checks/browser`.** Creates a new API or browser check. Will return a `402` when you are over the limit of your plan. When using the `globalAlertSettings`, the `alertSettings` can be `null` # Create a multi-step check Source: https://www.checklyhq.com/docs/api-reference/checks/create-a-multi-step-check post /v1/checks/multistep Creates a new Multi-Step check. Will return a `402` when you are over the limit of your plan. When using the `globalAlertSetting`, the `alertSetting` can be `null` # Create a TCP monitor Source: https://www.checklyhq.com/docs/api-reference/checks/create-a-tcp-check post /v1/checks/tcp Creates a new TCP check. Will return a `402` when you are over the limit of your plan. When using the `globalAlertSetting`, the `alertSetting` can be `null` # Create an API check Source: https://www.checklyhq.com/docs/api-reference/checks/create-an-api-check post /v1/checks/api Creates a new API check. Will return a `402` when you are over the limit of your plan. When using the `globalAlertSetting`, the `alertSetting` can be `null` # Delete a check Source: https://www.checklyhq.com/docs/api-reference/checks/delete-a-check delete /v1/checks/{id} Permanently removes a API or browser check and all its related status and results data. # List all checks Source: https://www.checklyhq.com/docs/api-reference/checks/list-all-checks get /v1/checks Lists all current checks in your account. # List all checks (v2) Source: https://www.checklyhq.com/docs/api-reference/checks/list-all-checks-v2 get /v2/checks Lists all current checks in your account. Unlike `/v1`, this endpoint does not return the flat `project`, `logicalId`, `member` and `pending` fields. A check can be managed by more than one project and each of those fields can name only one of them; `projectBindings` reports every binding, and is identical on `/v1` and `/v2`. Versioning is per endpoint. Only endpoints whose response or payload changed have a `/v2`; everything else remains on `/v1` and is unaffected. In particular the check groups themselves, and creating, updating and deleting checks, are unchanged and stay on `/v1`. # List all checks (v3) Source: https://www.checklyhq.com/docs/api-reference/checks/list-all-checks-v3 get /v3/checks Lists all current checks in your account. This `/v3` read returns check intent as a `constraints` array with typed `REQUIRED_OUTCOME` and `MUST_PRESERVE` entries. `/v1` and `/v2` keep the legacy `requiredOutcomes` and `mustPreserve` arrays. Like `/v2`, `/v3` does not return the flat `project`, `logicalId`, `member` and `pending` fields; use `projectBindings` for the complete project ownership state. Creating, updating and deleting checks remain on `/v1`. # Retrieve a check Source: https://www.checklyhq.com/docs/api-reference/checks/retrieve-a-check get /v1/checks/{id} Show details of a specific API or browser check # Retrieve a check (v2) Source: https://www.checklyhq.com/docs/api-reference/checks/retrieve-a-check-v2 get /v2/checks/{id} Show details of a specific API or browser check. Unlike `/v1`, this endpoint does not return the flat `project`, `logicalId`, `member` and `pending` fields. A check can be managed by more than one project and each of those fields can name only one of them; `projectBindings` reports every binding, and is identical on `/v1` and `/v2`. Versioning is per endpoint. Only endpoints whose response or payload changed have a `/v2`; everything else remains on `/v1` and is unaffected. In particular the check groups themselves, and creating, updating and deleting checks, are unchanged and stay on `/v1`. # Retrieve a check (v3) Source: https://www.checklyhq.com/docs/api-reference/checks/retrieve-a-check-v3 get /v3/checks/{id} Show details of a specific API or browser check. This `/v3` read returns check intent as a `constraints` array with typed `REQUIRED_OUTCOME` and `MUST_PRESERVE` entries. `/v1` and `/v2` keep the legacy `requiredOutcomes` and `mustPreserve` arrays. Like `/v2`, `/v3` does not return the flat `project`, `logicalId`, `member` and `pending` fields; use `projectBindings` for the complete project ownership state. Creating, updating and deleting checks remain on `/v1`. # Update a browser check Source: https://www.checklyhq.com/docs/api-reference/checks/update-a-browser-check put /v1/checks/browser/{id} Updates a browser check. # Update a check Source: https://www.checklyhq.com/docs/api-reference/checks/update-a-check put /v1/checks/{id} **[DEPRECATED] This endpoint will be removed soon. Instead use `PUT /checks/api/{id}` or `PUT /checks/browser/{id}`.** Updates a new API or browser check. # Update a multi-step check Source: https://www.checklyhq.com/docs/api-reference/checks/update-a-multi-step-check put /v1/checks/multistep/{id} Updates a Multi-Step check. # Update an API check Source: https://www.checklyhq.com/docs/api-reference/checks/update-an-api-check put /v1/checks/api/{id} Updates an API check. # Update a TCP monitor Source: https://www.checklyhq.com/docs/api-reference/checks/update-an-tcp-check put /v1/checks/tcp/{id} Updates an TCP check. # Create a client certificate Source: https://www.checklyhq.com/docs/api-reference/client-certificates/creates-a-new-client-certificate post /v1/client-certificates # Delete a client certificate Source: https://www.checklyhq.com/docs/api-reference/client-certificates/deletes-a-client-certificate delete /v1/client-certificates/{id} Permanently removes a client certificate. # List all client certificates Source: https://www.checklyhq.com/docs/api-reference/client-certificates/lists-all-client-certificates get /v1/client-certificates # Retrieve a client certificate Source: https://www.checklyhq.com/docs/api-reference/client-certificates/shows-one-client-certificate get /v1/client-certificates/{id} # Create a dashboard Source: https://www.checklyhq.com/docs/api-reference/dashboards/create-a-dashboard post /v1/dashboards Creates a new dashboard. Will return a 409 when attempting to create a dashboard with a custom URL or custom domain that is already taken. # Delete a dashboard Source: https://www.checklyhq.com/docs/api-reference/dashboards/delete-a-dashboard delete /v1/dashboards/{dashboardId} Permanently removes a dashboard. # List all dashboards Source: https://www.checklyhq.com/docs/api-reference/dashboards/list-all-dashboards get /v1/dashboards Lists all current dashboards in your account. # Retrieve a dashboard Source: https://www.checklyhq.com/docs/api-reference/dashboards/retrieve-a-dashboard get /v1/dashboards/{dashboardId} Show details of a specific dashboard. **Rate-limiting is applied to this endpoint, you can send 20 requests / 20 seconds at most.** # Update a dashboard Source: https://www.checklyhq.com/docs/api-reference/dashboards/update-a-dashboard put /v1/dashboards/{dashboardId} Updates a dashboard. Will return a 409 when attempting to create a dashboard with a custom URL or custom domain that is already taken. # Create a deployment trigger Source: https://www.checklyhq.com/docs/api-reference/deployment-triggers/create-a-deployment-trigger post /v1/deployment-triggers Create a GitHub deployment trigger for a Checkly check or check group. # List deployment triggers Source: https://www.checklyhq.com/docs/api-reference/deployment-triggers/list-all-deployment-triggers get /v1/deployment-triggers List the GitHub deployment triggers configured for your Checkly account. # Create an environment variable Source: https://www.checklyhq.com/docs/api-reference/environment-variables/create-an-environment-variable post /v1/variables Creates a new environment variable. # Delete an environment variable Source: https://www.checklyhq.com/docs/api-reference/environment-variables/delete-an-environment-variable delete /v1/variables/{key} Permanently removes an environment variable. Uses the "key" field as the ID for deletion. # List all environment variables Source: https://www.checklyhq.com/docs/api-reference/environment-variables/list-all-environment-variables get /v1/variables Lists all current environment variables in your account. # Retrieve an environment variable Source: https://www.checklyhq.com/docs/api-reference/environment-variables/retrieve-an-environment-variable get /v1/variables/{key} Show details of a specific environment variable. Uses the "key" field for selection. # Update an environment variable Source: https://www.checklyhq.com/docs/api-reference/environment-variables/update-an-environment-variable put /v1/variables/{key} Updates an environment variable. Uses the "key" field as the ID for updating. Only updates value, locked, and secret properties. Once a value is set to secret, it cannot be unset. # List all error groups in your account. Source: https://www.checklyhq.com/docs/api-reference/error-groups/list-all-error-groups get /v1/error-groups List all error groups in your account. # List all error groups for a specific check. Source: https://www.checklyhq.com/docs/api-reference/error-groups/list-all-error-groups-for-a-specific-check get /v1/error-groups/checks/{checkId} List all error groups for a specific check. # Retrieve one error group. Source: https://www.checklyhq.com/docs/api-reference/error-groups/retrieve-an-error-group get /v1/error-groups/{id} Retrieve one error group. # Update an error group Source: https://www.checklyhq.com/docs/api-reference/error-groups/update-an-error-group patch /v1/error-groups/{id} Update an error group. Mainly used for archiving error groups. # Create a heartbeat monitor Source: https://www.checklyhq.com/docs/api-reference/heartbeats/create-a-heartbeat-check post /v1/checks/heartbeat Creates a new Heartbeat check. Will return a `402` when you are over the limit of your plan. When using the `globalAlertSetting`, the `alertSetting` can be `null` # List all events for a heartbeat monitor Source: https://www.checklyhq.com/docs/api-reference/heartbeats/get-a-list-of-events-for-a-heartbeat get /v1/checks/heartbeats/{checkId}/events Get all events from a heartbeat. # List a specific event for a heartbeat monitor Source: https://www.checklyhq.com/docs/api-reference/heartbeats/get-a-specific-heartbeat-event get /v1/checks/heartbeats/{checkId}/events/{id} Get a specific event by its id. # Get heartbeat monitor availability Source: https://www.checklyhq.com/docs/api-reference/heartbeats/get-heartbeat-availability get /v1/checks/heartbeats/{checkId}/availability Get heartbeat availability. # Update a heartbeat monitor Source: https://www.checklyhq.com/docs/api-reference/heartbeats/update-a-heartbeat-check put /v1/checks/heartbeat/{id} Updates a Heartbeat check. # Create an incident update Source: https://www.checklyhq.com/docs/api-reference/incident-updates/create-an-incident-update post /v1/incidents/{incidentId}/updates Creates a new update for an incident. # Delete an incident update Source: https://www.checklyhq.com/docs/api-reference/incident-updates/delete-an-incident-update delete /v1/incidents/{incidentId}/updates/{id} Permanently removes an incident update. # Update an incident update Source: https://www.checklyhq.com/docs/api-reference/incident-updates/update-an-incident-update put /v1/incidents/{incidentId}/updates/{id} Modifies an incident update. # Create an incident Source: https://www.checklyhq.com/docs/api-reference/incidents/create-an-incident post /v1/incidents Creates a new incident. # Delete an incident Source: https://www.checklyhq.com/docs/api-reference/incidents/delete-an-incident delete /v1/incidents/{id} Permanently removes an incident and all its updates. # Retrieve an incident Source: https://www.checklyhq.com/docs/api-reference/incidents/retrieve-an-incident get /v1/incidents/{id} Shows details of a specific incident. Uses the "includeAllIncidentUpdates" query parameter to obtain all updates. # Update an incident Source: https://www.checklyhq.com/docs/api-reference/incidents/update-an-incident put /v1/incidents/{id} Updates an incident. # Lists all supported locations Source: https://www.checklyhq.com/docs/api-reference/location/lists-all-supported-locations get /v1/locations Lists all supported locationss. # Create a maintenance window Source: https://www.checklyhq.com/docs/api-reference/maintenance-windows/create-a-maintenance-window post /v1/maintenance-windows Creates a new maintenance window. Status-page-only fields live under `statusPageVisibility` and only take effect when `statusPageVisibility.enabled: true`. # Create a maintenance window status update Source: https://www.checklyhq.com/docs/api-reference/maintenance-windows/create-a-maintenance-window-status-update post /v1/maintenance-windows/{id}/maintenances/{maintenanceId}/updates Creates a new status update for a status-page-visible maintenance window. # Delete a maintenance Source: https://www.checklyhq.com/docs/api-reference/maintenance-windows/delete-a-maintenance delete /v1/maintenance-windows/{id}/maintenances/{maintenanceId} # Delete a maintenance window Source: https://www.checklyhq.com/docs/api-reference/maintenance-windows/delete-a-maintenance-window delete /v1/maintenance-windows/{id} Permanently removes a maintenance window. # Delete a maintenance window status update Source: https://www.checklyhq.com/docs/api-reference/maintenance-windows/delete-a-maintenance-window-status-update delete /v1/maintenance-windows/{id}/maintenances/{maintenanceId}/updates/{updateId} Permanently removes a status update from a maintenance window. # List all maintenance windows Source: https://www.checklyhq.com/docs/api-reference/maintenance-windows/list-all-maintenance-windows get /v1/maintenance-windows Lists all maintenance windows in your account. # List maintenances for a maintenance window Source: https://www.checklyhq.com/docs/api-reference/maintenance-windows/list-maintenances-for-a-maintenance-window get /v1/maintenance-windows/{id}/maintenances # Retrieve a maintenance Source: https://www.checklyhq.com/docs/api-reference/maintenance-windows/retrieve-a-maintenance get /v1/maintenance-windows/{id}/maintenances/{maintenanceId} # Retrieve a maintenance window Source: https://www.checklyhq.com/docs/api-reference/maintenance-windows/retrieve-a-maintenance-window get /v1/maintenance-windows/{id} Show details of a specific maintenance window. # Update a maintenance window Source: https://www.checklyhq.com/docs/api-reference/maintenance-windows/update-a-maintenance-window put /v1/maintenance-windows/{id} Partially updates a maintenance window. Only fields included in the request body are modified; omitted fields are left unchanged. Status-page-only fields live under `statusPageVisibility` and only take effect when `statusPageVisibility.enabled: true`. # Update a maintenance window status update Source: https://www.checklyhq.com/docs/api-reference/maintenance-windows/update-a-maintenance-window-status-update put /v1/maintenance-windows/{id}/maintenances/{maintenanceId}/updates/{updateId} Updates a status update for a status-page-visible maintenance window. # Update maintenance dates Source: https://www.checklyhq.com/docs/api-reference/maintenance-windows/update-maintenance-dates patch /v1/maintenance-windows/{id}/maintenances/{maintenanceId} # Create an DNS monitor Source: https://www.checklyhq.com/docs/api-reference/monitors/create-a-dns-monitor post /v1/checks/dns Creates a new DNS monitor. Will return a `402` when you are over the limit of your plan. When using the `globalAlertSetting`, the `alertSetting` can be `null` # Create a URL monitor Source: https://www.checklyhq.com/docs/api-reference/monitors/create-a-url-monitor post /v1/checks/url Creates a new URL monitor. Will return a `402` when you are over the limit of your plan. When using the `globalAlertSetting`, the `alertSetting` can be `null` # Create an ICMP monitor Source: https://www.checklyhq.com/docs/api-reference/monitors/create-an-icmp-monitor post /v1/checks/icmp Creates a new ICMP monitor. Will return a `402` when you are over the limit of your plan. When using the `globalAlertSetting`, the `alertSetting` can be `null` # Create an SSL monitor Source: https://www.checklyhq.com/docs/api-reference/monitors/create-an-ssl-monitor post /v1/checks/ssl Creates a new SSL monitor. Will return a `402` when you are over the limit of your plan. When using the `globalAlertSetting`, the `alertSetting` can be `null` # Update an DNS Monitor Source: https://www.checklyhq.com/docs/api-reference/monitors/update-a-dns-monitor put /v1/checks/dns/{id} Updates an DNS monitor. # Update an ICMP Monitor Source: https://www.checklyhq.com/docs/api-reference/monitors/update-an-icmp-monitor put /v1/checks/icmp/{id} Updates an ICMP monitor. # Update an SSL Monitor Source: https://www.checklyhq.com/docs/api-reference/monitors/update-an-ssl-monitor put /v1/checks/ssl/{id} Updates an SSL monitor. # Update a URL monitor Source: https://www.checklyhq.com/docs/api-reference/monitors/update-an-url-monitor put /v1/checks/url/{id} Updates an URL monitor. # Using the Checkly API Source: https://www.checklyhq.com/docs/api-reference/overview Use the Checkly Public API to manage monitoring resources, retrieve account information, and export analytics. The Checkly API enables you to manage your monitoring infrastructure, retrieve account information, and export analytics using HTTP requests. For creating and updating resources, we recommend using the [Checkly CLI](/docs/cli/overview) or another [Monitoring as Code](/docs/learn/monitoring/monitoring-as-code/) option. Managing resources using the Checkly API is possible, but Monitoring as Code generally provides a better experience for this. ## API specification Use `https://api.checklyhq.com/openapi.json` for the current Checkly Public API specification. The legacy `https://api.checklyhq.com/swagger.json` specification is deprecated and no longer receives updates. If you generate API clients, validate requests, or inspect the latest API contract, update your tooling to use `openapi.json`. ## Authentication The Checkly Public API uses API keys to authenticate requests. You can get a API Key in your [user settings](https://app.checklyhq.com/settings/user/api-keys). Your API key is like a password: keep it secure! Authentication to the API is performed using the Bearer auth method in the Authorization header and using the Account ID. For example, set the `Authorization` and `X-Checkly-Account` headers when using cURL: ```bash Bash icon="square-terminal" theme={null} curl -H "Authorization: Bearer [apiKey]" -H "X-Checkly-Account: [accountId]" ``` [More information about managing API keys](/docs/admin/creating-api-key), including service API keys. ## Rate Limits The Checkly Public API uses rate limits to help manage the sheer volume of requests we receive. The rate limit is characterized by allowing a maximum number of requests within a time interval. For most of our routes, that limit is **600 requests every 60 seconds**. However, we also have **routes with custom rate limits**. If the endpoint you are using has a custom rate limit, you will find that information in the documentation of that route. # Create a private location Source: https://www.checklyhq.com/docs/api-reference/private-locations/create-a-private-location post /v1/private-locations Creates a new private location. # Generate a new API Key for a private location Source: https://www.checklyhq.com/docs/api-reference/private-locations/generate-a-new-api-key-for-a-private-location post /v1/private-locations/{id}/keys Creates an api key on the private location. # Get private location health metrics from a window of time. Source: https://www.checklyhq.com/docs/api-reference/private-locations/get-private-location-health-metrics-from-a-window-of-time get /v1/private-locations/{id}/metrics Get private location health metrics from a window of time. **Rate-limiting is applied to this endpoint, you can send 300 requests per day at most.** # List all private locations Source: https://www.checklyhq.com/docs/api-reference/private-locations/list-all-private-locations get /v1/private-locations Lists all private locations in your account. # Remove a private location Source: https://www.checklyhq.com/docs/api-reference/private-locations/remove-a-private-location delete /v1/private-locations/{id} Permanently removes a private location. # Remove an existing API key for a private location Source: https://www.checklyhq.com/docs/api-reference/private-locations/remove-an-existing-api-key-for-a-private-location delete /v1/private-locations/{id}/keys/{keyId} Permanently removes an api key from a private location. # Retrieve a private location Source: https://www.checklyhq.com/docs/api-reference/private-locations/retrieve-a-private-location get /v1/private-locations/{id} Show details of a specific private location. # Update a private location Source: https://www.checklyhq.com/docs/api-reference/private-locations/update-a-private-location put /v1/private-locations/{id} Updates a private location. # Generate report Source: https://www.checklyhq.com/docs/api-reference/reporting/generates-a-report-with-aggregate-statistics-for-checks-and-check-groups get /v1/reporting Generates a report with aggregated statistics for all checks or a filtered set of checks over a specified time window. ## Generate bucketed reports Granular reporting is generally available. Set `granularity` to `day`, `week`, or `month` to return per-bucket results in `aggregates` instead of a single result in `aggregate`. ```http theme={null} GET /v1/reporting?from=&to=&granularity=day&timezone=America%2FNew_York ``` You can set `timezone` only when you set `granularity`. It accepts [named IANA time zones](https://data.iana.org/time-zones/tzdb/zone1970.tab) such as `America/New_York`, but not UTC offset identifiers such as `+05:00`. If you omit `timezone`, bucket boundaries use `UTC`. Bucket boundaries follow calendar boundaries in the selected time zone. Daily buckets can therefore span 23 or 25 hours around daylight saving time transitions. Granular queries support reporting windows of up to 400 days and up to 120 buckets. The `successRatio` field can contain up to four decimal places in both granular and non-granular reports. # Generate a Root Cause Analysis for a test session error group Source: https://www.checklyhq.com/docs/api-reference/rocky-ai/generate-a-root-cause-analysis-for-a-test-session-error-group post /v1/root-cause-analyses/test-session-error-groups/{testSessionErrorGroupId} Asynchronously generates a root cause analysis for a specific test session error group. Returns an `id` which you can use to poll the `/root-cause-analyses/{id}` endpoint. # Generate a Root Cause Analysis for a check error group Source: https://www.checklyhq.com/docs/api-reference/rocky-ai/generate-a-root-cause-analysis-for-an-error-group post /v1/root-cause-analyses/error-groups/{errorGroupId} Asynchronously generates a root cause analysis for a specific check error group. Returns an `id` which you can use to poll the `/root-cause-analyses/{id}` endpoint. # Retrieve a Root Cause Analysis Source: https://www.checklyhq.com/docs/api-reference/rocky-ai/retrieve-one-root-cause-analysis get /v1/root-cause-analyses/{id} Retrieves a specific root cause analysis. Use the `id` returned from either POST endpoint and poll until the response is HTTP 200. While the analysis is being generated the endpoint returns HTTP 202 with `{"id":"","status":"PENDING"}`. A genuine HTTP 404 means the ID does not exist. Works for both check error group and test session error group analyses. # List all supported runtimes Source: https://www.checklyhq.com/docs/api-reference/runtimes/lists-all-supported-runtimes get /v1/runtimes Lists all supported runtimes and the included NPM packages for Browser checks and setup & teardown scripts for API checks. # List details for a runtime Source: https://www.checklyhq.com/docs/api-reference/runtimes/shows-details-for-one-specific-runtime get /v1/runtimes/{id} Shows the details of all included NPM packages and their version for one specific runtime # Lists readable configuration values that look like inline credentials. Source: https://www.checklyhq.com/docs/api-reference/secret-scans/lists-readable-configuration-values-that-look-like-inline-credentials get /v1/secret-scans Scans the account's checks (request headers, query parameters, basic auth, URLs, bodies, gRPC metadata, scripts, environment variables), check groups, snippets, alert channels, integrations, and account environment variables for readable values that look like credentials stored inline. Locked and secret-backed values are not inspected or reported. Each finding points at the exact field so the report can guide migration to secret environment variables. Detected values are never returned — only a redacted preview. # Create a snippet Source: https://www.checklyhq.com/docs/api-reference/snippets/create-a-snippet post /v1/snippets Creates a new snippet. # Delete a snippet Source: https://www.checklyhq.com/docs/api-reference/snippets/delete-a-snippet delete /v1/snippets/{id} Permanently removes a snippet. # List all snippets Source: https://www.checklyhq.com/docs/api-reference/snippets/list-all-snippets get /v1/snippets Lists all current snippets in your account. # Retrieve a snippet Source: https://www.checklyhq.com/docs/api-reference/snippets/retrieve-a-snippet get /v1/snippets/{id} Show details of a specific snippet. # Update a snippet Source: https://www.checklyhq.com/docs/api-reference/snippets/update-a-snippet put /v1/snippets/{id} Updates a snippet. # List IPs for check runs Source: https://www.checklyhq.com/docs/api-reference/static-ips/lists-all-source-ips-for-check-runs get /v1/static-ips Lists all source IPs for check runs as a single JSON array. # List IPs for check runs by region Source: https://www.checklyhq.com/docs/api-reference/static-ips/lists-all-source-ips-for-check-runs-1 get /v1/static-ips-by-region Lists all source IPs for check runs as object with regions as keys and an array of IPs as value. # List IPs for check runs as a TXT file Source: https://www.checklyhq.com/docs/api-reference/static-ips/lists-all-source-ips-for-check-runs-as-txt-file get /v1/static-ips.txt Lists all IPs for check runs as a TXT file. Each line has one IP. # List IPv6s for check runs Source: https://www.checklyhq.com/docs/api-reference/static-ips/lists-all-source-ipv6s-for-check-runs get /v1/static-ipv6s Lists all source IPv6s for check runs as a single JSON array. # List IPv6s for check runs by region Source: https://www.checklyhq.com/docs/api-reference/static-ips/lists-all-source-ipv6s-for-check-runs-1 get /v1/static-ipv6s-by-region Lists all source IPs for check runs as an object with regions as keys and an Ipv6 as value. # List IPv6s for check runs as a TXT file Source: https://www.checklyhq.com/docs/api-reference/static-ips/lists-all-source-ipv6s-for-check-runs-as-a-txt-file get /v1/static-ipv6s.txt Lists all IPv6s for check runs as a TXT file. Each line has one IP. # Add a new incident update to a specific incident. Source: https://www.checklyhq.com/docs/api-reference/status-page-incidents/add-a-new-incident-update-to-a-specific-incident post /v1/status-pages/incidents/{incidentId}/incident-updates Creates a new update for an incident. # Create a new incident. Source: https://www.checklyhq.com/docs/api-reference/status-page-incidents/create-a-new-incident post /v1/status-pages/incidents Creates a new incident. # Delete an incident. Source: https://www.checklyhq.com/docs/api-reference/status-page-incidents/delete-an-incident delete /v1/status-pages/incidents/{incidentId} Permanently removes an incident and all its updates. # Delete an incident update. Source: https://www.checklyhq.com/docs/api-reference/status-page-incidents/delete-an-incident-update delete /v1/status-pages/incidents/{incidentId}/incident-updates/{incidentUpdateId} Permanently removes an incident update. # Retrieve an incident by id. Source: https://www.checklyhq.com/docs/api-reference/status-page-incidents/retrieve-an-incident-by-id get /v1/status-pages/incidents/{incidentId} Get incident details including incident history and affected services. # Retrieve an incident update by id. Source: https://www.checklyhq.com/docs/api-reference/status-page-incidents/retrieve-an-incident-update-by-id get /v1/status-pages/incidents/{incidentId}/incident-updates/{incidentUpdateId} Shows details of a specific incident update. # Retrieve the 100 latest incident updates of a specific incident. Source: https://www.checklyhq.com/docs/api-reference/status-page-incidents/retrieve-the-100-latest-incident-updates-of-a-specific-incident get /v1/status-pages/incidents/{incidentId}/incident-updates Lists all updates for a specific incident. # Retrieve the latest incidents with pagination. Source: https://www.checklyhq.com/docs/api-reference/status-page-incidents/retrieve-the-latest-incidents-with-pagination get /v1/status-pages/incidents Get the latest 100 incidents for all services. # Update an existing incident. Source: https://www.checklyhq.com/docs/api-reference/status-page-incidents/update-an-existing-incident put /v1/status-pages/incidents/{incidentId} Updates an incident. # Update an existing incident update. Source: https://www.checklyhq.com/docs/api-reference/status-page-incidents/update-an-existing-incident-update put /v1/status-pages/incidents/{incidentId}/incident-updates/{incidentUpdateId} Modifies an incident update. # Create a service Source: https://www.checklyhq.com/docs/api-reference/status-page-services/create-a-service post /v1/status-pages/services # Delete a service Source: https://www.checklyhq.com/docs/api-reference/status-page-services/delete-a-service delete /v1/status-pages/services/{serviceId} # Get a single service Source: https://www.checklyhq.com/docs/api-reference/status-page-services/get-a-single-service get /v1/status-pages/services/{serviceId} # Get all services Source: https://www.checklyhq.com/docs/api-reference/status-page-services/get-all-services get /v1/status-pages/services # Update a service Source: https://www.checklyhq.com/docs/api-reference/status-page-services/update-a-service put /v1/status-pages/services/{serviceId} # Create a component on a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/create-a-component-on-a-v3-status-page post /v3/status-pages/{statusPageId}/components Add a SERVICE or GROUP component to a v3 status page. Nest it under a GROUP via parentId. # Create a new v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/create-a-new-v3-status-page post /v3/status-pages Create a new v3 status page. Add components afterwards via the components endpoints. # Create an automation rule on a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/create-an-automation-rule-on-a-v3-status-page post /v3/status-pages/{statusPageId}/automation-rules Create an automation rule. A failing check whose tags (or group tags) overlap with the rule tags opens one incident impacting the listed components. # Delete a component of a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/delete-a-component-of-a-v3-status-page delete /v3/status-pages/{statusPageId}/components/{componentId} Delete a component. Child components are detached from it, not deleted. # Delete a subscriber of a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/delete-a-subscriber-of-a-v3-status-page delete /v3/status-pages/{statusPageId}/subscribers/{subscriberId} Remove a subscriber from a v3 status page. # Delete a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/delete-a-v3-status-page delete /v3/status-pages/{statusPageId} Delete a v3 status page together with its components and automation rules. # Delete an automation rule of a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/delete-an-automation-rule-of-a-v3-status-page delete /v3/status-pages/{statusPageId}/automation-rules/{ruleId} Delete an automation rule. An incident it opened stays. # Delete an incident of a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/delete-an-incident-of-a-v3-status-page delete /v3/status-pages/{statusPageId}/incidents/{incidentId} Permanently remove an incident and all its updates. # Delete an incident update. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/delete-an-incident-update delete /v3/status-pages/{statusPageId}/incidents/{incidentId}/incident-updates/{incidentUpdateId} Delete an incident update. The last remaining update cannot be deleted. # Edit an incident update. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/edit-an-incident-update put /v3/status-pages/{statusPageId}/incidents/{incidentId}/incident-updates/{incidentUpdateId} Edit an incident update. # List the automation rules of a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/list-the-automation-rules-of-a-v3-status-page get /v3/status-pages/{statusPageId}/automation-rules List the automation rules of a v3 status page, newest first. # List the components of a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/list-the-components-of-a-v3-status-page get /v3/status-pages/{statusPageId}/components List the components of a v3 status page in display order. # List the incidents of a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/list-the-incidents-of-a-v3-status-page get /v3/status-pages/{statusPageId}/incidents List the incidents of a v3 status page, most recently updated first. # List the subscribers of a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/list-the-subscribers-of-a-v3-status-page get /v3/status-pages/{statusPageId}/subscribers List the email subscribers of a v3 status page, newest first. # List the updates of an incident. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/list-the-updates-of-an-incident get /v3/status-pages/{statusPageId}/incidents/{incidentId}/incident-updates List the updates of an incident, newest first (at most 100). # List v3 status pages. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/list-v3-status-pages get /v3/status-pages List the v3 (components-based) status pages of an account. v2 pages are served by /v1/status-pages. # Open an incident on a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/open-an-incident-on-a-v3-status-page post /v3/status-pages/{statusPageId}/incidents Open an incident on a v3 status page with its first update and the current status of the impacted components. # Post an update to an incident. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/post-an-update-to-an-incident post /v3/status-pages/{statusPageId}/incidents/{incidentId}/incident-updates Post an update to an incident. A RESOLVED update closes the incident. # Re-check the custom domain verification of a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/re-check-the-custom-domain-verification-of-a-v3-status-page post /v3/status-pages/{statusPageId}/custom-domain-verifications/recheck Ask Cloudflare to re-check the custom domain verification and return the latest state. # Replace an incident's component impact timeline. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/replace-an-incidents-component-impact-timeline put /v3/status-pages/{statusPageId}/incidents/{incidentId}/component-impacts Replace the full impact timeline of an incident with explicit per-component windows (retroactive editing). # Retrieve a single automation rule of a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/retrieve-a-single-automation-rule-of-a-v3-status-page get /v3/status-pages/{statusPageId}/automation-rules/{ruleId} Get a single automation rule. # Retrieve a single component of a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/retrieve-a-single-component-of-a-v3-status-page get /v3/status-pages/{statusPageId}/components/{componentId} Get a single component of a v3 status page. # Retrieve a single v3 status page by id. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/retrieve-a-single-v3-status-page-by-id get /v3/status-pages/{statusPageId} Get a v3 (components-based) status page. Components and automation rules have their own endpoints. # Retrieve an incident of a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/retrieve-an-incident-of-a-v3-status-page get /v3/status-pages/{statusPageId}/incidents/{incidentId} Get an incident of a v3 status page, including its updates and component impacts. # Retrieve an incident update. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/retrieve-an-incident-update get /v3/status-pages/{statusPageId}/incidents/{incidentId}/incident-updates/{incidentUpdateId} Get a single incident update. # Retrieve custom domain verification details for a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/retrieve-custom-domain-verification-details-for-a-v3-status-page get /v3/status-pages/{statusPageId}/custom-domain-verifications Get DNS records for verification purposes related to your custom domain. # Subscribe multiple email addresses to a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/subscribe-multiple-email-addresses-to-a-v3-status-page post /v3/status-pages/{statusPageId}/subscribers/bulk Subscribe up to 100 email addresses at once. Each subscriber can be limited to specific components via config.subscribedComponents; addresses already subscribed are skipped. # Update a component of a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/update-a-component-of-a-v3-status-page put /v3/status-pages/{statusPageId}/components/{componentId} Update a component. This is a full replacement: omitted optional fields are reset. # Update an automation rule of a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/update-an-automation-rule-of-a-v3-status-page put /v3/status-pages/{statusPageId}/automation-rules/{ruleId} Update an automation rule. The component list is replaced as a whole. # Update an existing v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/update-an-existing-v3-status-page put /v3/status-pages/{statusPageId} Update a v3 status page. This is a full replacement: omitted optional fields are reset. # Update an incident of a v3 status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages-v3/update-an-incident-of-a-v3-status-page put /v3/status-pages/{statusPageId}/incidents/{incidentId} Rename an incident and/or reconcile the current status of its components. Post progress through the incident-updates endpoints. # Bulk create subscriptions for a specific status page Source: https://www.checklyhq.com/docs/api-reference/status-pages/bulk-create-subscriptions-for-a-specific-status-page post /v1/status-pages/{statusPageId}/subscriptions/bulk Bulk create subscriptions for a specific status page. # Create a new status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages/create-a-new-status-page post /v1/status-pages Create a new status page with its related services and cards. # Delete a status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages/delete-a-status-page delete /v1/status-pages/{statusPageId} Delete a status page. # Delete a subscription belonging to a specific status page Source: https://www.checklyhq.com/docs/api-reference/status-pages/delete-a-subscription-belonging-to-a-specific-status-page delete /v1/status-pages/{statusPageId}/subscriptions/{subscriptionId} Delete a subscription belonging to a specific status page using the subscription id # Get all subscriptions for a specific status page Source: https://www.checklyhq.com/docs/api-reference/status-pages/get-all-subscriptions-for-a-specific-status-page get /v1/status-pages/{statusPageId}/subscriptions Get all subscriptions for a specific status page # Retrieve a single status page by id. Source: https://www.checklyhq.com/docs/api-reference/status-pages/retrieve-a-single-status-page-by-id get /v1/status-pages/{statusPageId} **[DEPRECATED] This endpoint will be removed soon. Please use the `GET /v3/status-pages/{statusPageId}` endpoint instead.** Get status page data, including cards and services. # Retrieve all status pages. Source: https://www.checklyhq.com/docs/api-reference/status-pages/retrieve-all-status-pages get /v1/status-pages Get all status pages for an account. # Update an existing status page. Source: https://www.checklyhq.com/docs/api-reference/status-pages/update-an-existing-status-page put /v1/status-pages/{statusPageId} Update a status page with its related services and cards. # List all test session error groups Source: https://www.checklyhq.com/docs/api-reference/test-session-error-groups/list-all-test-session-error-groups get /v1/test-session-error-groups/ # List all test session error groups for a specific project. Source: https://www.checklyhq.com/docs/api-reference/test-session-error-groups/list-all-test-session-error-groups-for-a-project get /v1/test-session-error-groups/projects/{projectId} List all test session error groups for a specific project. # Retrieve one test session error group. Source: https://www.checklyhq.com/docs/api-reference/test-session-error-groups/retrieve-a-test-session-error-group get /v1/test-session-error-groups/{id} Retrieve one test session error group. # Update an error group Source: https://www.checklyhq.com/docs/api-reference/test-session-error-groups/update-a-test-session-error-group patch /v1/test-session-error-groups/{id} Update a test session error group. Mainly used for archiving test session error groups. # Await the completion of a test session Source: https://www.checklyhq.com/docs/api-reference/test-sessions/await-the-completion-of-a-test-session get /v1/test-sessions/{testSessionId}/completion Call this endpoint to await the completion of a test session. A successful response code will be returned once the test session reaches its final state (i.e. when it passes or fails). If the test session takes a long time to complete, the endpoint will return a timeout error code. You should keep calling the endpoint until you receive a successful response, or a non-timeout related error code. If using *curl*, its `--retry` option is suitable. The successful response of this endpoint is equivalent to the `GET /v1/test-sessions/{testSessionId}` endpoint's response for a completed test session. # Cancel a test session Source: https://www.checklyhq.com/docs/api-reference/test-sessions/cancel-a-test-session post /v1/test-sessions/{testSessionId}/cancel Cancels in-progress Playwright runs within the specified test session. Use the optional `sequenceId` field in the request body to cancel only specific results within the session; omit it to cancel everything still running. Returns `204 No Content` once the cancellation requests have been dispatched. Returns `404 Not Found` if the test session does not exist. Test sessions are recorded with `checkly test`, `checkly trigger`, and `checkly pw-test`. Cancellation applies only to the session's Playwright Check Suite runs — any URL, API, Browser, Multistep, Heartbeat, TCP, DNS, or ICMP runs continue until they finish normally. See [Cancellation](/docs/concepts/cancellation) for how cancelled runs affect alerts, metrics, and the `CANCELLED` session status. # List test sessions Source: https://www.checklyhq.com/docs/api-reference/test-sessions/list-test-sessions get /v1/test-sessions Retrieves test sessions for the selected account. Use the optional query parameters to filter by creation time, status, branch, user, provider, text, or error group. # Retrieve a normalized asset manifest for a test-session result Source: https://www.checklyhq.com/docs/api-reference/test-sessions/retrieve-a-normalized-asset-manifest-for-a-test-session-result get /v1/test-sessions/{testSessionId}/results/{testSessionResultId}/assets Returns a normalized manifest of downloadable assets for the test-session result. # Retrieve a test session Source: https://www.checklyhq.com/docs/api-reference/test-sessions/retrieve-a-test-session get /v1/test-sessions/{testSessionId} Retrieves a test session. Note that the returned data may be incomplete if the test session is still in progress. # Retrieve a test session result Source: https://www.checklyhq.com/docs/api-reference/test-sessions/retrieve-a-test-session-result get /v1/test-sessions/{testSessionId}/results/{testSessionResultId} Retrieves detailed data for a single result within a test session, including check-type details and uploaded asset references when available. # Trigger a new test session Source: https://www.checklyhq.com/docs/api-reference/test-sessions/trigger-a-new-test-session post /v1/test-sessions/trigger Starts a tests session with checks matching the provided target filters. If no filters are given, matches all eligible checks. This endpoint does not wait for the test session to complete. Use the `GET /v1/test-sessions/{testSessionId}/completion` or `GET /v1/test-sessions/{testSessionId}` endpoints to track progress if needed. Test sessions do not produce alerts. Equivalent to the `npx checkly trigger` command of the Checkly CLI. # Create the check group trigger Source: https://www.checklyhq.com/docs/api-reference/triggers/create-the-check-group-trigger post /v1/triggers/check-groups/{groupId} **[DEPRECATED]** This endpoint will be removed soon. Please use the [Checkly CLI](https://www.checklyhq.com/docs/cli) to test and trigger checks. Creates the check group trigger # Create the check trigger Source: https://www.checklyhq.com/docs/api-reference/triggers/create-the-check-trigger post /v1/triggers/checks/{checkId} **[DEPRECATED]** This endpoint will be removed soon. Please use the [Checkly CLI](https://www.checklyhq.com/docs/cli) to test and trigger checks. Creates the check trigger # Delete the check group trigger Source: https://www.checklyhq.com/docs/api-reference/triggers/delete-the-check-group-trigger delete /v1/triggers/check-groups/{groupId} **[DEPRECATED]** This endpoint will be removed soon. Please use the [Checkly CLI](https://www.checklyhq.com/docs/cli) to test and trigger checks. Deletes the check groups trigger # Delete the check trigger Source: https://www.checklyhq.com/docs/api-reference/triggers/delete-the-check-trigger delete /v1/triggers/checks/{checkId} **[DEPRECATED]** This endpoint will be removed soon. Please use the [Checkly CLI](https://www.checklyhq.com/docs/cli) to test and trigger checks. Deletes the check trigger # Get the check group trigger Source: https://www.checklyhq.com/docs/api-reference/triggers/get-the-check-group-trigger get /v1/triggers/check-groups/{groupId} **[DEPRECATED]** This endpoint will be removed soon. Please use the [Checkly CLI](https://www.checklyhq.com/docs/cli) to test and trigger checks. Finds the check group trigger # Get the check trigger Source: https://www.checklyhq.com/docs/api-reference/triggers/get-the-check-trigger get /v1/triggers/checks/{checkId} **[DEPRECATED]** This endpoint will be removed soon. Please use the [Checkly CLI](https://www.checklyhq.com/docs/cli) to test and trigger checks. Finds the check trigger. # Attaching Git metadata Source: https://www.checklyhq.com/docs/cli/attaching-git-metadata Attach git metadata like branch, commit SHA, and owner to your Checkly test sessions and deployments so you can cross-reference monitoring with code changes. The CLI can attach git metadata like `branch`, `commit sha`, `owner` and more when executing the `test --record` and `deploy` commands. This way you can keep track of your test sessions and deployed resources in the UI and cross-reference them with any updates to your code. For example, in the screenshot below we ran a **test session** from our CI server after the project was deployed to our Staging environment with the `npx checkly test` command. test session with git info After the test succeeds, we **deploy** this check so it runs as a monitor with `npx checkly deploy`. browser check with git info ## Environment variables The CLI will attempt to auto-detect and parse git specific information from your local machine or CI environment, but you can also set these data items specifically by using environment variables. | Item | Auto | Variable | Description | | ------------------ | ----- | ------------------------------------------------------ | ------------------------------------------- | | **Repository** | false | `repoUrl` in `checkly.config.ts` or `CHECKLY_REPO_URL` | The URL of your repo on GitHub, GitLab etc. | | **Commit hash** | true | `CHECKLY_REPO_SHA` | The SHA of the commit. | | **Branch** | true | `CHECKLY_REPO_BRANCH` | The branch name. | | **Commit owner** | true | `CHECKLY_REPO_COMMIT_OWNER` | The committer's name or email. | | **Commit message** | true | `CHECKLY_REPO_COMMIT_MESSAGE` | The commit message. | | **Environment** | false | `CHECKLY_TEST_ENVIRONMENT` | The environment name, e.g. "staging" | For example, if you want to specifically set the Environment you invoke: ```bash Terminal theme={null} CHECKLY_TEST_ENVIRONMENT=Production npx checkly test ``` Or, if you want to set repo URL you invoke: ```bash Terminal theme={null} CHECKLY_REPO_URL="https://my.git.solution/project/" npx checkly test ``` # Authentication Source: https://www.checklyhq.com/docs/cli/authentication How to authenticate with the Checkly CLI Before you can use the Checkly CLI, you need to authenticate with your Checkly account. There are different ways to authenticate depending on the environment where you are running the CLI from. ## Interactive When **running the CLI interactively** from your dev environment, just use the built-in `login` command. If you have multiple Checkly accounts, it will prompt which account you want to target. ```bash Terminal theme={null} npx checkly login ``` Once authenticated, you can switch between accounts using: ```bash Terminal theme={null} npx checkly switch ``` ... or quickly find out which account you are currently targeting with: ```bash Terminal theme={null} npx checkly whoami ``` To log out and clear your stored credentials: ```bash Terminal theme={null} npx checkly logout ``` ## From CI You can also authenticate using environment variables, which is useful for CI/CD pipelines and automated environments. You will need to export two environment variables in the shell: * `CHECKLY_API_KEY` * `CHECKLY_ACCOUNT_ID` To get your API key, go to your Settings page in Checkly and grab a API key from [the API keys tab](https://app.checklyhq.com/settings/user/api-keys) and your Account ID from the [Account settings tab](https://app.checklyhq.com/settings/account/general). Set the account ID and API key as follows: ```bash Terminal theme={null} # Set your Checkly API key export CHECKLY_API_KEY=your_api_key_here # Set your Checkly account ID export CHECKLY_ACCOUNT_ID=your_account_id_here ``` To verify you're properly authenticated: ```bash Terminal theme={null} npx checkly whoami ``` This will display your account information and confirm your authentication status. ## Troubleshooting If `npx checkly login` doesn't automatically open a browser window to authenticate, you can generate a direct link instead. When prompted with: > Do you want to open a browser window to continue with login? (Y/n) Enter "n". The CLI will provide a link that you can copy and paste into your browser to authenticate. # checkly account Source: https://www.checklyhq.com/docs/cli/checkly-account View your Checkly account plan, entitlements, feature limits, and available locations. Available since CLI v7.7.0. The `checkly account` command lets you view account-level information directly from the terminal. Use it to check which features are available on your plan, inspect metered limits, and discover available check locations. Before using `checkly account`, ensure you have: * Checkly CLI installed * Valid Checkly account authentication (run `npx checkly login` if needed) For additional setup information, see [CLI overview](/docs/cli/overview). ## Usage ```bash Terminal theme={null} npx checkly account [arguments] [options] ``` ## Subcommands | Subcommand | Description | | ---------- | --------------------------------------------------------- | | `plan` | Show your account plan, entitlements, and feature limits. | ## `checkly account plan` Show your account plan, entitlements, and feature limits. The default view displays a summary of metered entitlements with their limits. Use `--output=json` for the full response including locations, feature flags, and upgrade URLs. **Usage:** ```bash Terminal theme={null} npx checkly account plan [key] [options] ``` **Arguments:** | Argument | Description | | -------- | --------------------------------------------------------------------------------------------- | | `key` | Entitlement key to look up (e.g. `BROWSER_CHECKS`). Shows a detail view for that entitlement. | **Options:** | Option | Required | Description | | -------------- | -------- | ---------------------------------------------------------- | | `--type, -t` | - | Filter entitlements by type: `metered` or `flag`. | | `--search, -s` | - | Search entitlements by name or description. | | `--disabled` | - | Show only entitlements not included in your plan. | | `--output, -o` | - | Output format: `table`, `json`, or `md`. Default: `table`. | ### Plan Options Pass an entitlement key as a positional argument to see a detail view for that specific entitlement, including its type, status, limit, and upgrade URL if applicable. **Usage:** ```bash Terminal theme={null} npx checkly account plan BROWSER_CHECKS npx checkly account plan PRIVATE_LOCATIONS ``` Filter entitlements by type. Use `metered` to see entitlements with numeric limits, or `flag` to see boolean feature flags. **Usage:** ```bash Terminal theme={null} npx checkly account plan --type=metered npx checkly account plan -t flag ``` Search entitlements by name or description using a case-insensitive match. **Usage:** ```bash Terminal theme={null} npx checkly account plan --search="browser" npx checkly account plan -s "alert" ``` Show only entitlements that are not included in your current plan. Each disabled entitlement includes the required plan and an upgrade URL. **Usage:** ```bash Terminal theme={null} npx checkly account plan --disabled npx checkly account plan --disabled --type=flag ``` Set the output format. Use `json` for the full response including locations, all entitlements, and upgrade URLs. Use `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly account plan --output=json npx checkly account plan -o md ``` ### Plan Examples ```bash Terminal theme={null} # Show account plan summary (metered limits + flag count) npx checkly account plan # Get the full response as JSON (recommended for agents) npx checkly account plan --output=json # Show only metered entitlements npx checkly account plan --type=metered # Show only feature flags npx checkly account plan --type=flag # Search for specific entitlements npx checkly account plan --search="browser" # Show features not included in your plan npx checkly account plan --disabled # Look up a specific entitlement npx checkly account plan BROWSER_CHECKS ``` ### JSON Response The `--output=json` format returns a structured response useful for programmatic access and AI agents. ```json theme={null} { "plan": "hobby", "planDisplayName": "Hobby", "checkoutUrl": "https://app.checklyhq.com/accounts/.../billing/checkout", "contactSalesUrl": "https://www.checklyhq.com/contact-sales/", "locations": { "all": [ { "id": "us-east-1", "name": "N. Virginia", "available": true }, { "id": "eu-west-1", "name": "Ireland", "available": false } ], "maxPerCheck": 3 }, "entitlements": [ { "key": "BROWSER_CHECKS", "type": "metered", "enabled": true, "quantity": 10 }, { "key": "PRIVATE_LOCATIONS", "type": "metered", "enabled": false, "requiredPlan": "TEAM", "requiredPlanDisplayName": "Team", "upgradeUrl": "https://app.checklyhq.com/accounts/.../billing/checkout" } ] } ``` Key fields: * **`locations.all`** — filter to entries where `available` is `true` to get valid locations for your checks. Respect `maxPerCheck` as the upper bound per check. * **`entitlements`** — metered entitlements include a `quantity` limit. Disabled entitlements include `requiredPlan` and `upgradeUrl`. ## Related Commands * [`checkly members`](/docs/cli/checkly-members) - List and manage account members * [`checkly skills manage`](/docs/cli/checkly-skills#checkly-skills-manage-resource) - Account management context for AI agents * [`checkly whoami`](/docs/cli/checkly-whoami) - Display current account information * [`checkly switch`](/docs/cli/checkly-switch) - Switch between Checkly accounts # checkly alert-channels Source: https://www.checklyhq.com/docs/cli/checkly-alert-channels List and inspect alert channels and their notification logs from the Checkly CLI. Available since CLI v8.5.0. The `checkly alert-channels` commands let you inspect the alert channels in your account and troubleshoot notification delivery from the terminal. These commands are read-only and don't change your [alert channel configuration](/docs/communicate/alerts/channels). Before using `checkly alert-channels`, ensure you have: * Checkly CLI installed * Valid Checkly account authentication (run `npx checkly login` if needed) For additional setup information, see [CLI overview](/docs/cli/overview). ## Usage ```bash Terminal theme={null} npx checkly alert-channels [arguments] [options] ``` ## Subcommands | Subcommand | Description | | ---------- | -------------------------------------------- | | `list` | List all alert channels in your account. | | `get` | Get details of an alert channel. | | `logs` | List notification logs for an alert channel. | ## `checkly alert-channels list` List the alert channels in your account. The default table includes each channel's ID, type, name, subscription count, and creation date. **Usage:** ```bash Terminal theme={null} npx checkly alert-channels list [options] ``` **Options:** | Option | Required | Description | | -------------- | -------- | ---------------------------------------------------------- | | `--limit, -l` | - | Number of alert channels to return (1-100). Default: `25`. | | `--page, -p` | - | Page number. Default: `1`. | | `--output, -o` | - | Output format: `table`, `json`, or `md`. Default: `table`. | ### List Options Set the number of alert channels to return per page, between 1 and 100. **Usage:** ```bash Terminal theme={null} npx checkly alert-channels list --limit=50 npx checkly alert-channels list -l 10 ``` Select the page of alert channels to return. **Usage:** ```bash Terminal theme={null} npx checkly alert-channels list --limit=10 --page=2 ``` Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly alert-channels list --output=json npx checkly alert-channels list -o md ``` ### List Examples ```bash Terminal theme={null} # List the first page of alert channels npx checkly alert-channels list # List the second page with 50 channels per page npx checkly alert-channels list --limit=50 --page=2 # Get alert channels as JSON npx checkly alert-channels list --output=json ``` ## `checkly alert-channels get` Get the configuration and subscriptions for a specific alert channel. **Usage:** ```bash Terminal theme={null} npx checkly alert-channels get [options] ``` **Arguments:** | Argument | Description | | -------- | ------------------------------------------------ | | `id` | The numeric ID of the alert channel to retrieve. | **Options:** | Option | Required | Description | | -------------- | -------- | ------------------------------------------------------------ | | `--output, -o` | - | Output format: `detail`, `json`, or `md`. Default: `detail`. | ### Get Options Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly alert-channels get 12345 --output=json npx checkly alert-channels get 12345 -o md ``` ### Get Examples ```bash Terminal theme={null} # View alert channel details and subscriptions npx checkly alert-channels get 12345 # Get the alert channel as JSON npx checkly alert-channels get 12345 --output=json ``` ## `checkly alert-channels logs` List [notification log](/docs/communicate/alerts/notification-log) entries for a specific alert channel. Use this command to identify failed deliveries or inspect notifications from a specific time window. **Usage:** ```bash Terminal theme={null} npx checkly alert-channels logs [options] ``` **Arguments:** | Argument | Description | | -------- | -------------------------------------------------------------------- | | `id` | The numeric ID of the alert channel whose logs you want to retrieve. | **Options:** | Option | Required | Description | | -------------- | -------- | ---------------------------------------------------------- | | `--limit, -l` | - | Number of logs to return (1-100). Default: `25`. | | `--page, -p` | - | Page number. Default: `1`. | | `--from` | - | Start of the log window as a Unix timestamp, inclusive. | | `--to` | - | End of the log window as a Unix timestamp, exclusive. | | `--status, -s` | - | Filter logs by status. Supported value: `failed`. | | `--output, -o` | - | Output format: `table`, `json`, or `md`. Default: `table`. | If you omit `--from` and `--to`, the command returns logs from the preceding 24 hours. An explicit time window can span at most 24 hours. ### Logs Options Set the number of notification logs to return per page, between 1 and 100. **Usage:** ```bash Terminal theme={null} npx checkly alert-channels logs 12345 --limit=50 ``` Select the page of notification logs to return. **Usage:** ```bash Terminal theme={null} npx checkly alert-channels logs 12345 --limit=10 --page=2 ``` Set the inclusive start of the log window as a Unix timestamp. **Usage:** ```bash Terminal theme={null} npx checkly alert-channels logs 12345 --from=1772359200 ``` Set the exclusive end of the log window as a Unix timestamp. The interval between `--from` and `--to` can't exceed 24 hours. **Usage:** ```bash Terminal theme={null} npx checkly alert-channels logs 12345 --from=1772359200 --to=1772445600 ``` Filter the logs to failed notification deliveries. **Usage:** ```bash Terminal theme={null} npx checkly alert-channels logs 12345 --status=failed npx checkly alert-channels logs 12345 -s failed ``` Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly alert-channels logs 12345 --output=json npx checkly alert-channels logs 12345 -o md ``` ### Logs Examples ```bash Terminal theme={null} # List recent notification logs for an alert channel npx checkly alert-channels logs 12345 # Show only failed deliveries npx checkly alert-channels logs 12345 --status=failed # Inspect a specific 24-hour window npx checkly alert-channels logs 12345 --from=1772359200 --to=1772445600 # Get failed deliveries as paginated JSON npx checkly alert-channels logs 12345 --status=failed --limit=100 --output=json ``` ## JSON pagination The `list` and `logs` commands return JSON in a stable pagination envelope when you use `--output=json`: ```json theme={null} { "data": [], "pagination": { "page": 1, "limit": 25, "total": 0, "totalPages": 0 } } ``` ## Related Commands * [`checkly checks`](/docs/cli/checkly-checks) - List and inspect checks * [`checkly api`](/docs/cli/checkly-api) - Make authenticated Checkly API requests * [`checkly whoami`](/docs/cli/checkly-whoami) - Display current account information # checkly api Source: https://www.checklyhq.com/docs/cli/checkly-api Make authenticated HTTP requests to the Checkly API from the command line. Available since CLI v8.3.0. This command is primarily designed for agentic workflows — when you need to interact with the Checkly API but a dedicated CLI command doesn't exist yet for that operation. Make sure your [Checkly skills](/docs/cli/checkly-skills) are up to date so your AI agent has the context it needs to use this command effectively. The `checkly api` command makes authenticated HTTP requests to the Checkly API. It handles authentication automatically using your current login credentials, so you can query or update your account without manually managing API keys in request headers. For available endpoints, refer to the [API reference](/docs/api-reference/overview) or the [OpenAPI spec](https://api.checklyhq.com/openapi.json). Before using `checkly api`, ensure you have: * Checkly CLI installed * Valid Checkly account authentication (run `npx checkly login` if needed) See the [Authentication section](/docs/cli/authentication) for other authentication options. ## Usage The basic command takes an API endpoint path and optional flags. ```bash Terminal theme={null} npx checkly api [options] ``` ## Arguments The command takes a single required argument. | Argument | Description | | ---------- | ------------------------------------- | | `ENDPOINT` | API endpoint path, e.g. `/v1/checks`. | ## Options All flags are optional. | Option | Description | | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `-X, --method` | HTTP method: `GET`, `POST`, `PUT`, `PATCH`, or `DELETE`. Defaults to `GET`, or `POST` when fields are present. | | `-F, --field` | Add a field as `key=value` (string) or `key:=value` (JSON-parsed). Sent as a query parameter for `GET` requests and in the request body otherwise. Can be used multiple times. | | `-H, --header` | Add a custom HTTP header as `"Key: Value"`. Can be used multiple times. | | `--input` | Read the request body from a file path, or `-` to read from stdin. | | `--jq` | Filter JSON output using a [jq](https://jqlang.org/) expression. Requires `jq` to be installed. | | `-i, --include` | Include HTTP status line and response headers in the output. | | `--verbose` | Print request and response headers to stderr. | ## Examples ### List all checks Returns all checks in your account as JSON. ```bash Terminal theme={null} npx checkly api /v1/checks ``` ### Extract specific fields with jq Use `--jq` to filter or reshape the JSON response inline. `--jq` requires [jq](https://jqlang.org/) to be installed on your system. ```bash Terminal theme={null} npx checkly api /v1/checks --jq '.[].name' ``` ``` "My first check" "Homepage availability" "Login flow" ``` ### Paginate results Use `-F` to pass query parameters. The API returns 10 results per page by default. Set `-X GET` explicitly, since the command otherwise switches to `POST` when fields are present. ```bash Terminal theme={null} # Get the first 5 checks npx checkly api /v1/checks -X GET -F limit=5 # Get the second page npx checkly api /v1/checks -X GET -F limit=5 -F page=2 ``` ### Get a single resource Append the resource ID to the endpoint path to fetch a specific item. ```bash Terminal theme={null} npx checkly api /v1/checks/ ``` ### List alert channels Use `--jq` to extract only the fields you need from the response. ```bash Terminal theme={null} npx checkly api /v1/alert-channels --jq '[.[] | {id, type}]' ``` ```json theme={null} [ { "id": 263584, "type": "SMS" }, { "id": 263585, "type": "EMAIL" }, { "id": 263586, "type": "SLACK" } ] ``` ### Update a resource via stdin Pipe JSON directly into the command using `--input -`: ```bash Terminal theme={null} echo '{"activated": false}' | npx checkly api /v1/checks/ -X PUT --input - ``` Or read from a file: ```bash Terminal theme={null} npx checkly api /v1/checks/ -X PUT --input ./payload.json ``` ### Add custom request headers Use `-H` to pass additional HTTP headers with the request. You can repeat the flag for multiple headers. ```bash Terminal theme={null} npx checkly api /v1/checks -H "Accept: application/json" -H "X-Custom-Header: value" ``` ### Inspect response headers Use `-i` to include the HTTP status and headers in the output: ```bash Terminal theme={null} npx checkly api /v1/checks -i ``` ``` HTTP/1.1 200 OK content-type: application/json; charset=utf-8 content-range: 0-9/11 ... ``` The `content-range` header tells you the total number of results (`0-9/11` means items 0–9 of 11 total). ### Debug a request Use `--verbose` to print request and response headers to stderr: ```bash Terminal theme={null} npx checkly api /v1/checks --verbose ``` ``` > GET /v1/checks < 200 OK < content-type: application/json; charset=utf-8 < content-range: 0-9/11 ... ``` ## Related Commands These commands are commonly used alongside `checkly api`. * [`checkly login`](/docs/cli/checkly-login) - Sign in to your Checkly account * [`checkly whoami`](/docs/cli/checkly-whoami) - Display current account and user information ## API Reference For available endpoints, see the [Checkly API reference](/docs/api-reference/overview). # checkly assets Source: https://www.checklyhq.com/docs/cli/checkly-assets List and download result assets such as logs, traces, videos, and screenshots. Available since CLI v8.8.0. The `checkly assets` command lets you list and download result assets from the terminal. Assets are the artifacts produced by a check run or [test session](/docs/detect/testing/overview/) result, such as logs, Playwright traces, videos, screenshots, packet captures, and reports. Every asset belongs to a single result. Identify that result with `--result-id` together with either `--check-id` (for a scheduled check result) or `--test-session-id` (for a test-session result). Before using `checkly assets`, ensure you have: * Checkly CLI installed * Valid Checkly account authentication (run `npx checkly login` if needed) * A check result ID or test-session result ID, and its corresponding check ID or test session ID For additional setup information, see [CLI overview](/docs/cli/overview). ## Usage ```bash Terminal theme={null} npx checkly assets [options] ``` ## Subcommands | Subcommand | Description | | ---------- | ----------------------- | | `list` | List result assets. | | `download` | Download result assets. | ## `checkly assets list` List the assets available for a check result or a test-session result. Use filters to narrow by asset type or name, then copy the exact `Asset` value to use with `checkly assets download`. **Usage:** ```bash Terminal theme={null} npx checkly assets list --result-id= (--check-id= | --test-session-id=) [options] ``` **Options:** | Option | Required | Description | | ------------------- | -------- | ----------------------------------------------------------------------------------------------------------------- | | `--result-id` | Yes | Check result ID or test-session result ID. | | `--check-id` | - | Check ID for a scheduled check result. Use one of `--check-id` or `--test-session-id`. | | `--test-session-id` | - | Test session ID for a test-session result. Use one of `--check-id` or `--test-session-id`. | | `--type` | - | Filter assets by type: `log`, `trace`, `video`, `screenshot`, `pcap`, `report`, `file`, or `all`. Default: `all`. | | `--asset` | - | Filter assets by exact `Asset`/`Name` value or glob. | | `--view` | - | Human output view: `table` or `tree`. Ignored with `--output json`. Default: `table`. | | `--output, -o` | - | Output format: `table`, `json`, or `md`. Default: `table`. | ### List Options The check result ID or test-session result ID to list assets for. **Usage:** ```bash Terminal theme={null} npx checkly assets list --result-id= --check-id= ``` The check ID for a scheduled check result. Use exactly one of `--check-id` or `--test-session-id`. **Usage:** ```bash Terminal theme={null} npx checkly assets list --result-id= --check-id= ``` The test session ID for a test-session result. Use exactly one of `--check-id` or `--test-session-id`. **Usage:** ```bash Terminal theme={null} npx checkly assets list --result-id= --test-session-id= ``` Filter assets by type. Available values: `log`, `trace`, `video`, `screenshot`, `pcap`, `report`, `file`, `all`. **Usage:** ```bash Terminal theme={null} npx checkly assets list --result-id= --check-id= --type=trace ``` Filter assets by their exact `Asset`/`Name` value, or by a glob pattern. **Usage:** ```bash Terminal theme={null} npx checkly assets list --result-id= --check-id= --asset="trace.zip" npx checkly assets list --result-id= --check-id= --asset="*.png" ``` Choose the human-readable view. Use `table` to see exact `Asset` values for download, or `tree` for a hierarchical overview. This flag is ignored when `--output=json`. **Usage:** ```bash Terminal theme={null} npx checkly assets list --result-id= --check-id= --view=tree ``` Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly assets list --result-id= --check-id= --output=json npx checkly assets list --result-id= --check-id= -o md ``` ### List Examples ```bash Terminal theme={null} # List all assets for a check result npx checkly assets list --result-id= --check-id= # List all assets for a test-session result npx checkly assets list --result-id= --test-session-id= # Show only traces npx checkly assets list --result-id= --check-id= --type=trace # Filter assets by name with a glob npx checkly assets list --result-id= --check-id= --asset="*.png" # Show a hierarchical tree view npx checkly assets list --result-id= --check-id= --view=tree # Get the asset list as JSON npx checkly assets list --result-id= --check-id= --output=json ``` ## `checkly assets download` Download assets for a check result or a test-session result. You must select assets with `--type` or `--asset` — use `--type all` to download everything. By default, files are written to `./checkly-assets/-`. **Usage:** ```bash Terminal theme={null} npx checkly assets download --result-id= (--check-id= | --test-session-id=) (--type= | --asset=) [options] ``` **Options:** | Option | Required | Description | | ------------------- | -------- | ------------------------------------------------------------------------------------------------- | | `--result-id` | Yes | Check result ID or test-session result ID. | | `--check-id` | - | Check ID for a scheduled check result. Use one of `--check-id` or `--test-session-id`. | | `--test-session-id` | - | Test session ID for a test-session result. Use one of `--check-id` or `--test-session-id`. | | `--type` | - | Select assets by type: `log`, `trace`, `video`, `screenshot`, `pcap`, `report`, `file`, or `all`. | | `--asset` | - | Select an asset by exact `Asset`/`Name` value or glob. | | `--dir` | - | Directory to write assets into. Default: `./checkly-assets/-`. | | `--force` | - | Overwrite existing files. Mutually exclusive with `--skip-existing`. | | `--skip-existing` | - | Skip files that already exist. Mutually exclusive with `--force`. | | `--output, -o` | - | Output format: `table` or `json`. Default: `table`. | Pass `--type` or `--asset` to select which assets to download. Use `--type all` to download all assets for the result. ### Download Options The check result ID or test-session result ID to download assets from. **Usage:** ```bash Terminal theme={null} npx checkly assets download --result-id= --check-id= --type=all ``` The check ID for a scheduled check result. Use exactly one of `--check-id` or `--test-session-id`. **Usage:** ```bash Terminal theme={null} npx checkly assets download --result-id= --check-id= --type=all ``` The test session ID for a test-session result. Use exactly one of `--check-id` or `--test-session-id`. **Usage:** ```bash Terminal theme={null} npx checkly assets download --result-id= --test-session-id= --type=all ``` Select assets by type. Available values: `log`, `trace`, `video`, `screenshot`, `pcap`, `report`, `file`, `all`. Use `--type all` to download every asset. **Usage:** ```bash Terminal theme={null} npx checkly assets download --result-id= --check-id= --type=video ``` Select a single asset by its exact `Asset`/`Name` value, or by a glob pattern. **Usage:** ```bash Terminal theme={null} npx checkly assets download --result-id= --check-id= --asset="trace.zip" npx checkly assets download --result-id= --check-id= --asset="*.png" ``` Directory to write the downloaded assets into. When omitted, assets are written to `./checkly-assets/-`. **Usage:** ```bash Terminal theme={null} npx checkly assets download --result-id= --check-id= --type=all --dir=./artifacts ``` Overwrite existing files in the target directory. Cannot be combined with `--skip-existing`. **Usage:** ```bash Terminal theme={null} npx checkly assets download --result-id= --check-id= --type=all --force ``` Skip files that already exist in the target directory. Cannot be combined with `--force`. **Usage:** ```bash Terminal theme={null} npx checkly assets download --result-id= --check-id= --type=all --skip-existing ``` Set the output format. Use `json` for programmatic access, including the resolved directory and downloaded file paths. **Usage:** ```bash Terminal theme={null} npx checkly assets download --result-id= --check-id= --type=all --output=json ``` ### Download Examples ```bash Terminal theme={null} # Download all assets for a check result npx checkly assets download --result-id= --check-id= --type=all # Download all assets for a test-session result npx checkly assets download --result-id= --test-session-id= --type=all # Download only traces npx checkly assets download --result-id= --check-id= --type=trace # Download a single asset by name npx checkly assets download --result-id= --check-id= --asset="trace.zip" # Write assets to a custom directory npx checkly assets download --result-id= --check-id= --type=all --dir=./artifacts # Re-run without overwriting already-downloaded files npx checkly assets download --result-id= --check-id= --type=all --skip-existing # Get the download result as JSON npx checkly assets download --result-id= --check-id= --type=all --output=json ``` ## Related Commands * [`checkly test-sessions`](/docs/cli/checkly-test-sessions) - Inspect recorded test sessions and their results * [`checkly checks`](/docs/cli/checkly-checks) - List, inspect, and analyze checks and their results * [`checkly rca`](/docs/cli/checkly-rca) - Trigger root cause analysis for error groups # checkly checks Source: https://www.checklyhq.com/docs/cli/checkly-checks List, inspect, run, and analyze checks in your Checkly account. Available since CLI v7.3.0. Analytics stats available since v7.6.0. The `checkly checks` command lets you list, inspect, run, and analyze checks in your Checkly account directly from the terminal. You can filter, search, run deployed checks on demand, and drill into individual check details, recent results, error groups, and analytics stats. Before using `checkly checks`, ensure you have: * Checkly CLI installed * Valid Checkly account authentication (run `npx checkly login` if needed) For additional setup information, see [CLI overview](/docs/cli/overview). ## Usage ```bash Terminal theme={null} npx checkly checks [arguments] [options] ``` ## Subcommands | Subcommand | Description | | ---------- | ------------------------------------------------------------------------------ | | `list` | List all checks in your account. | | `get` | Get details of a specific check, including recent results and analytics stats. | | `run` | Run deployed checks now using their configured locations and alerting rules. | | `stats` | Show analytics stats for your checks. | | `delete` | Delete a check by ID. | ## `checkly checks list` List all checks in your account with optional filtering by name, tag, check type, or status. **Usage:** ```bash Terminal theme={null} npx checkly checks list [options] ``` **Options:** | Option | Required | Description | | -------------- | -------- | ------------------------------------------------------------ | | `--limit, -l` | - | Number of checks to return (1-100). Default: `25`. | | `--page, -p` | - | Page number. Default: `1`. | | `--search, -s` | - | Filter checks by name (case-insensitive). | | `--tag, -t` | - | Filter by tag. Can be specified multiple times. | | `--type` | - | Filter by check type. | | `--status` | - | Filter by check status: `passing`, `failing`, or `degraded`. | | `--hide-id` | - | Hide check IDs in table output. | | `--output, -o` | - | Output format: `table`, `json`, or `md`. Default: `table`. | ### List Options Number of checks to return per page, between 1 and 100. **Usage:** ```bash Terminal theme={null} npx checkly checks list --limit=50 npx checkly checks list -l 10 ``` Page number for paginated results. **Usage:** ```bash Terminal theme={null} npx checkly checks list --page=2 npx checkly checks list -p 3 ``` Filter checks by name using a case-insensitive search. **Usage:** ```bash Terminal theme={null} npx checkly checks list --search="homepage" npx checkly checks list -s "api" ``` Filter checks by tag. Specify multiple times to filter by multiple tags. **Usage:** ```bash Terminal theme={null} npx checkly checks list --tag=production npx checkly checks list -t production -t critical ``` Filter checks by type. Available types: `API`, `BROWSER`, `MULTI_STEP`, `HEARTBEAT`, `PLAYWRIGHT`, `TCP`, `DNS`, `ICMP`, `URL`. **Usage:** ```bash Terminal theme={null} npx checkly checks list --type=API npx checkly checks list --type=BROWSER ``` Filter checks by current status. Available values: `passing`, `failing`, `degraded`. **Usage:** ```bash Terminal theme={null} npx checkly checks list --status=failing npx checkly checks list --status=degraded ``` Hide check IDs in table output for a cleaner view. **Usage:** ```bash Terminal theme={null} npx checkly checks list --hide-id ``` Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly checks list --output=json npx checkly checks list -o md ``` ### List Examples ```bash Terminal theme={null} # List all checks with default settings npx checkly checks list # Search for checks by name npx checkly checks list --search="homepage" # Filter by tag and type npx checkly checks list --tag=production --type=API # Show only failing checks npx checkly checks list --status=failing # Get results as JSON npx checkly checks list --output=json # Page through results npx checkly checks list --limit=10 --page=2 ``` ## `checkly checks run` The `checkly checks run` command is available since CLI v8.18.0. Run deployed checks immediately using their configured locations and alerting rules. This is the CLI equivalent of selecting **Schedule now** in the Checkly dashboard. These are normal monitoring runs. They update check health and can trigger configured alerts. To run checks in a test session without affecting monitoring state or sending alerts, use [`checkly trigger`](/docs/cli/checkly-trigger). **Usage:** ```bash Terminal theme={null} npx checkly checks run [options] ``` Without a selector, the command runs all eligible checks in your account. By default, it waits up to 600 seconds for every check session to finish and exits with a failing status code if a session fails, times out, or is cancelled. **Options:** | Option | Required | Description | | ---------------------------- | -------- | ---------------------------------------------------------------------------------------------------- | | `--tags, -t` | - | Select checks by tag. Use commas to require multiple tags, or repeat the option to match any filter. | | `--check-id` | - | Run specific checks by ID. Accepts comma-separated values and can be repeated. | | `--refresh-cache` | - | Refresh the selected checks cache before running. | | `--timeout` | - | Number of seconds to wait for all check sessions to finish. Default: `600`. | | `--detach, -d` | - | Start the check sessions and exit without waiting for results. | | `--[no-]fail-on-no-matching` | - | Fail when no checks match. Enabled by default. | | `--output, -o` | - | Output format: `table`, `json`, or `md`. Default: `table`. | ### Run Examples ```bash Terminal theme={null} # Run one deployed check and wait for its result npx checkly checks run --check-id= # Run checks that have both the production and api tags npx checkly checks run --tags=production,api # Run checks matching either tag filter npx checkly checks run --tags=production,api --tags=critical # Schedule matching checks and exit immediately npx checkly checks run --tags=production --detach # Return machine-readable results npx checkly checks run --check-id= --output=json # Exit successfully when no checks match npx checkly checks run --tags=optional --no-fail-on-no-matching ``` The `--timeout` option only controls how long the CLI waits. Check sessions continue running in Checkly after the CLI times out. Use `--detach` when you do not need to wait for results. ## `checkly checks get` Get details of a specific check, including recent results and analytics stats. Use `--result` to drill into a specific result, `--error-group` to view error details, or the stats flags to customize the analytics view. **Usage:** ```bash Terminal theme={null} npx checkly checks get [options] ``` **Arguments:** | Argument | Description | | -------- | -------------------------------- | | `id` | The ID of the check to retrieve. | **Options:** | Option | Required | Description | | ------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `--result, -r` | - | Show details for a specific result ID. | | `--error-group, -e` | - | Show full details for a specific error group ID. | | `--results-limit` | - | Number of recent results to show. Default: `10`. | | `--results-cursor` | - | Cursor for results pagination (from previous output). | | `--stats-range` | - | Time range for stats: `last24Hours`, `last7Days`, `last30Days`, `thisWeek`, `thisMonth`, `lastWeek`, `lastMonth`. Default: `last24Hours`. | | `--group-by` | - | Group stats by dimension: `location` or `statusCode`. | | `--metrics` | - | Comma-separated list of metrics to show (overrides defaults). | | `--filter-status` | - | Only include runs with this status in stats: `success` or `failure`. | | `--output, -o` | - | Output format: `detail`, `json`, or `md`. Default: `detail`. | ### Get Options Drill into a specific check result by its result ID. Shows detailed information including logs and timing data. **Usage:** ```bash Terminal theme={null} npx checkly checks get --result= npx checkly checks get -r ``` Show full details for a specific error group, including error messages and affected results. **Usage:** ```bash Terminal theme={null} npx checkly checks get --error-group= npx checkly checks get -e ``` If your account has [Rocky AI Root Cause Analysis](/docs/resolve/ai-root-cause-analysis/overview/) enabled, the returned error group details include the AI-generated root cause analysis for that error group. Number of recent results to display. **Usage:** ```bash Terminal theme={null} npx checkly checks get --results-limit=20 ``` Cursor for paginating through results. The cursor value is provided in the output of a previous `checks get` command. **Usage:** ```bash Terminal theme={null} npx checkly checks get --results-cursor= ``` Time range for the analytics stats section. Available ranges: `last24Hours`, `last7Days`, `last30Days`, `thisWeek`, `thisMonth`, `lastWeek`, `lastMonth`. **Usage:** ```bash Terminal theme={null} npx checkly checks get --stats-range=last7Days ``` Group analytics stats by a specific dimension. Use `location` to break down metrics by geographic region, or `statusCode` to group by HTTP status code. **Usage:** ```bash Terminal theme={null} npx checkly checks get --group-by=location npx checkly checks get --group-by=statusCode ``` Comma-separated list of metrics to display, overriding the defaults. When omitted, a sensible set of defaults is used based on the check type. You can also retrieve the full list of available metrics from the [List all available reporting metrics](/docs/api-reference/analytics/list-all-available-reporting-metrics) API endpoint. **Available metrics by check type:** | Metric | Applies to | Unit | | ------------------ | ----------------------------------------- | ----- | | `availability` | All check types | % | | `responseTime_avg` | API, Browser, Playwright, Multi-Step, URL | ms | | `responseTime_p50` | API, Browser, Playwright, Multi-Step, URL | ms | | `responseTime_p95` | API, Browser, Playwright, Multi-Step, URL | ms | | `responseTime_p99` | API, Browser, Playwright, Multi-Step, URL | ms | | `total_avg` | TCP, DNS | ms | | `total_p50` | TCP, DNS | ms | | `total_p95` | TCP, DNS | ms | | `total_p99` | TCP, DNS | ms | | `latencyAvg_avg` | ICMP | ms | | `latencyAvg_p50` | ICMP | ms | | `latencyAvg_p95` | ICMP | ms | | `latencyAvg_p99` | ICMP | ms | | `packetLoss_avg` | ICMP | % | | `LCP_avg` | Browser, Playwright | ms | | `CLS_avg` | Browser, Playwright | score | | `TBT_avg` | Browser, Playwright | ms | **Default metrics per check type:** | Check type | Default metrics | | -------------------- | -------------------------------------------------------------------------------------------------------- | | API, Multi-Step, URL | `availability`, `responseTime_avg`, `responseTime_p50`, `responseTime_p95`, `responseTime_p99` | | Browser, Playwright | `availability`, `LCP_avg`, `CLS_avg`, `TBT_avg`, `responseTime_avg`, `responseTime_p95` | | TCP, DNS | `availability`, `total_avg`, `total_p50`, `total_p95`, `total_p99` | | ICMP | `availability`, `packetLoss_avg`, `latencyAvg_avg`, `latencyAvg_p50`, `latencyAvg_p95`, `latencyAvg_p99` | | Heartbeat | `availability` | **Usage:** ```bash Terminal theme={null} npx checkly checks get --metrics=availability,responseTime_avg,responseTime_p95 ``` Only include runs with a specific status in the analytics stats. Use `success` to see stats for passing runs only, or `failure` for failing runs. **Usage:** ```bash Terminal theme={null} npx checkly checks get --filter-status=failure npx checkly checks get --filter-status=success ``` Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly checks get --output=json npx checkly checks get -o md ``` ### Get Examples ```bash Terminal theme={null} # View check details, recent results, and stats npx checkly checks get 12345 # View stats for the last 7 days npx checkly checks get 12345 --stats-range=last7Days # Break down stats by location npx checkly checks get 12345 --group-by=location # Show only specific metrics npx checkly checks get 12345 --metrics=availability,responseTime_avg,responseTime_p95 # Show stats for failed runs only npx checkly checks get 12345 --filter-status=failure # Drill into a specific result npx checkly checks get 12345 --result=abc-123 # View an error group npx checkly checks get 12345 --error-group=err-456 # Get check details as JSON npx checkly checks get 12345 --output=json # Show more results npx checkly checks get 12345 --results-limit=25 ``` ## `checkly checks stats` Show analytics stats for your checks. View availability, response times, and other metrics across multiple checks at once, with filtering by tag, type, or name. **Usage:** ```bash Terminal theme={null} npx checkly checks stats [checkIds...] [options] ``` **Arguments:** | Argument | Description | | ---------- | ----------------------------------------------------------------------------------- | | `checkIds` | One or more check IDs to get stats for. If omitted, stats are shown for all checks. | **Options:** | Option | Required | Description | | -------------- | -------- | -------------------------------------------------------------------------------------------------------------- | | `--range, -r` | - | Time range for stats: `last24Hours`, `last7Days`, `thisWeek`, `lastWeek`, `lastMonth`. Default: `last24Hours`. | | `--limit, -l` | - | Number of checks to return (1-100). Default: `25`. | | `--page, -p` | - | Page number. Default: `1`. | | `--search, -s` | - | Filter checks by name (case-insensitive). | | `--tag, -t` | - | Filter by tag. Can be specified multiple times. | | `--type` | - | Filter by check type. | | `--output, -o` | - | Output format: `table`, `json`, or `md`. Default: `table`. | ### Stats Options Time range for the analytics stats. Available ranges: `last24Hours`, `last7Days`, `thisWeek`, `lastWeek`, `lastMonth`. **Usage:** ```bash Terminal theme={null} npx checkly checks stats --range=last7Days npx checkly checks stats -r lastMonth ``` Number of checks to return per page, between 1 and 100. **Usage:** ```bash Terminal theme={null} npx checkly checks stats --limit=50 npx checkly checks stats -l 10 ``` Page number for paginated results. **Usage:** ```bash Terminal theme={null} npx checkly checks stats --page=2 npx checkly checks stats -p 3 ``` Filter checks by name using a case-insensitive search. **Usage:** ```bash Terminal theme={null} npx checkly checks stats --search="homepage" npx checkly checks stats -s "api" ``` Filter checks by tag. Specify multiple times to filter by multiple tags. **Usage:** ```bash Terminal theme={null} npx checkly checks stats --tag=production npx checkly checks stats -t production -t critical ``` Filter checks by type. Available types: `API`, `BROWSER`, `MULTI_STEP`, `HEARTBEAT`, `PLAYWRIGHT`, `TCP`, `DNS`, `ICMP`, `URL`. **Usage:** ```bash Terminal theme={null} npx checkly checks stats --type=API npx checkly checks stats --type=BROWSER ``` Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly checks stats --output=json npx checkly checks stats -o md ``` ### Stats Examples ```bash Terminal theme={null} # Show stats for all checks (last 24 hours) npx checkly checks stats # Show stats for specific checks npx checkly checks stats 12345 67890 # Show stats for the last 7 days npx checkly checks stats --range=last7Days # Filter by tag and type npx checkly checks stats --tag=production --type=API # Search by name and output as JSON npx checkly checks stats --search="homepage" --output=json # Page through results npx checkly checks stats --limit=10 --page=2 ``` ## `checkly checks delete` The `checkly checks delete` command is only available since CLI v8.8.0. Delete a check by ID. By default, the command shows the check to be deleted and prompts for confirmation before proceeding. Checks managed by a CLI project are recreated on the next `checkly deploy`. To permanently remove a project-managed check, delete it from your project code instead of using this command. **Usage:** ```bash Terminal theme={null} npx checkly checks delete [options] ``` **Arguments:** | Argument | Description | | -------- | ------------------------------ | | `id` | The ID of the check to delete. | **Options:** | Option | Required | Description | | ------------- | -------- | ----------------------------------------------------- | | `--force, -f` | - | Skip the confirmation prompt. | | `--dry-run` | - | Preview what would happen without deleting the check. | ### Delete Options Skip the confirmation prompt and delete the check immediately. Useful in scripts and CI. **Usage:** ```bash Terminal theme={null} npx checkly checks delete 12345 --force npx checkly checks delete 12345 -f ``` Preview the deletion without making any changes. Shows the check that would be deleted. **Usage:** ```bash Terminal theme={null} npx checkly checks delete 12345 --dry-run ``` ### Delete Examples ```bash Terminal theme={null} # Delete a check with a confirmation prompt npx checkly checks delete 12345 # Preview the deletion without making changes npx checkly checks delete 12345 --dry-run # Delete without a confirmation prompt npx checkly checks delete 12345 --force ``` ## Related Commands * [`checkly status-pages`](/docs/cli/checkly-status-pages) - List and inspect status pages * [`checkly trigger`](/docs/cli/checkly-trigger) - Run deployed checks in a test session without affecting monitoring state * [`checkly whoami`](/docs/cli/checkly-whoami) - Display current account information # checkly deploy Source: https://www.checklyhq.com/docs/cli/checkly-deploy Deploy checks and resources to your Checkly account. The `checkly deploy` command deploys all your checks and associated resources like alert channels to your Checkly account. This command synchronizes your local monitoring-as-code configuration with your Checkly account. Before using , ensure you have: * An initialized Checkly CLI project * At least one check or resource defined in your project * Valid Checkly account authentication (run `npx checkly login` if needed) * A `checkly.config.ts` or `checkly.config.js` configuration file For additional setup information, see [CLI overview](/docs/cli/overview). ## Usage The basic command deploys all resources to your Checkly account, synchronizing your local monitoring-as-code configuration with the Checkly monitoring infrastructure. ```bash Terminal theme={null} npx checkly deploy [options] ``` | Option | Required | Description | | ------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `--config, -c` | - | The Checkly CLI configuration file. If not passed, uses the `checkly.config.ts\|js` file in the current directory. | | `--force, -f` | - | Force mode. Skips the confirmation dialog. | | `--debug-bundle` | - | Generate a JSON file containing the data sent to our servers when you deploy. **Note**: This flag is in beta. The bundle’s structure is not considered a stable format and may change without notice. It’s intended for one-off troubleshooting, and note it may contain secrets before sharing. | | `--output, -o` | - | Show the changes made after the deploy command. | | `--preview, -p` | - | Show a preview of the changes made by the deploy command. | | `--preserve-resources` | - | Detach resources removed from code (keeping them and their run history) instead of deleting them. | | `--[no-]schedule-on-deploy` | - | Enables automatic check scheduling after a deploy. | | `--[no-]verify-runtime-dependencies` | - | Return an error if checks import dependencies that are not supported by the selected runtime. | ## Command Options Specify a configuration file to use instead of the `checkly.config.ts` or `checkly.config.js` in the current directory. **Usage:** ```bash Terminal theme={null} npx checkly deploy --config="./checkly.staging.config.ts" npx checkly deploy -c="./checkly.staging.config.ts" ``` Skip the interactive confirmation dialog and proceed with the operation. Use `--force` to set up automated CI/CD pipelines testing preview environments and deploying monitoring changes automatically. **Usage:** ```bash Terminal theme={null} npx checkly deploy --force npx checkly deploy -f ``` **Examples** ```bash Terminal theme={null} $ npx checkly deploy --force Parsing your project... ✅ Validating project resources... ✅ Bundling project resources... ✅ Successfully deployed project "Website Monitoring" to account "Monitoring as Code". ``` Show applied differences after deploying, providing a summary of what was changed. **Usage:** ```bash Terminal theme={null} npx checkly deploy --output npx checkly deploy -o ``` **Examples:** ```bash Terminal theme={null} $ npx checkly deploy --output --force Parsing your project... ✅ Validating project resources... ✅ Bundling project resources... ✅ Create: UrlMonitor:: homepage-uptime MultiStepCheck: auth-api-flow Delete: Check: legacy-api-check Update and Unchanged: SmsAlertChannel: sms-channel-1 Successfully deployed project "Website Monitoring" to account "Monitoring as Code". ``` Show a preview of the changes that would be made by the deploy command. **Usage:** ```bash Terminal theme={null} npx checkly deploy --preview npx checkly deploy -p ``` **Examples** ```bash Terminal theme={null} $ npx checkly deploy --preview Parsing your project... ✅ Validating project resources... ✅ Bundling project resources... ✅ Create: UrlMonitor:: homepage-uptime MultiStepCheck: auth-api-flow Delete: Check: legacy-api-check Update and Unchanged: SmsAlertChannel: sms-channel-1 ``` When a resource is removed from your code, `checkly deploy` deletes it from your account by default, which also **permanently deletes its run history**. Pass `--preserve-resources` to **detach** those resources instead: the project stops managing them, but the resources and their run history remain in your Checkly account as regular account-level resources. Detached resources can be re-attached later by adding them back to your code. This mirrors [`checkly destroy --preserve-resources`](/docs/cli/checkly-destroy), but applies per-deploy to only the resources removed in that deploy rather than the whole project. **Usage:** ```bash Terminal theme={null} npx checkly deploy --preserve-resources ``` In the deploy output, detached resources are listed under a `Detached (kept in account, now managed in the Checkly Webapp):` section instead of `Delete:`. Prevent checks from running automatically when they are deployed. **Usage:** ```bash Terminal theme={null} npx checkly deploy --schedule-on-deploy npx checkly deploy --no-schedule-on-deploy ``` Useful when you want to deploy changes but delay monitoring execution until later. Return an error if checks import dependencies that are not supported by the selected runtime. **Usage:** ```bash Terminal theme={null} npx checkly deploy --verify-runtime-dependencies npx checkly deploy --no-verify-runtime-dependencies ``` Runtime-dependent checks run in a specific runtime with a pre-defined set of dependencies. If you're using private locations and want to provide your own dependencies, disable the built-in dependency validation. You can provide custom dependencies in [Playwright Check Suites](/docs/detect/synthetic-monitoring/playwright-checks/overview) because they don't rely on a specific runtime. ## Deleting vs. detaching removed resources When you remove a resource from your code and deploy, the CLI reconciles your account with your local configuration. By default, resources that no longer exist in code are **deleted** from your account, which also **permanently deletes their run history**. Before performing any deletes, a non-forced `checkly deploy` first lists the resources that would be permanently deleted and asks you to confirm: ```bash Terminal theme={null} $ npx checkly deploy The following resources were removed from code and will be DELETED, losing their run history: Check: legacy-api-check Pass --preserve-resources to detach and keep them (and their run history) instead. This will: - Permanently delete 1 resource(s) removed from code, losing their run history - Delete Check: legacy-api-check ? Proceed? › (y/N) ``` This confirmation is skipped when you pass `--force` (for CI/CD), and it does not appear when you pass `--preserve-resources`. In agent or CI environments the CLI instead returns a `confirmation_required` JSON envelope and exits with code `2` rather than prompting. To keep removed resources and their run history, deploy with [`--preserve-resources`](#command-options). Instead of deleting them, the CLI **detaches** them — they remain in your Checkly account as regular account-level resources, managed from the UI, and can be re-attached later by adding them back to your code: ```bash Terminal theme={null} $ npx checkly deploy --preserve-resources --output Detached (kept in account, now managed in the Checkly Webapp): Check: legacy-api-check Successfully deployed project "Website Monitoring" to account "Monitoring as Code". ``` Detach-on-deploy requires a recent Checkly backend. Against older backends, `--preserve-resources` still keeps your resources, but they may be reported under `Delete:` rather than `Detach:` in the deploy output. ## Git Integration When you deploy a project, you can attach Git-specific information so changes to any resources are displayed in the Checkly web UI with the correct commit, branch, and author information. The Checkly CLI evaluates Git information from your local or CI environment on a best effort basis. Override any automatically detected values by setting the corresponding environment variables. | Item | Auto | Variable | Description | | ------------------ | ----- | ------------------------------------------------------ | ------------------------------------------- | | **Repository** | false | `repoUrl` in `checkly.config.ts` or `CHECKLY_REPO_URL` | The URL of your repo on GitHub, GitLab etc. | | **Commit hash** | true | `CHECKLY_REPO_SHA` | The SHA of the commit. | | **Branch** | true | `CHECKLY_REPO_BRANCH` | The branch name. | | **Commit owner** | true | `CHECKLY_REPO_COMMIT_OWNER` | The committer's name or email. | | **Commit message** | true | `CHECKLY_REPO_COMMIT_MESSAGE` | The commit message. | | **Environment** | false | `CHECKLY_TEST_ENVIRONMENT` | The environment name, e.g. "staging" | ## Related Commands * [`checkly login`](/docs/cli/checkly-login) - Log in to your Checkly account * [`checkly test`](/docs/cli/checkly-test) - Test your setup before deployment # checkly destroy Source: https://www.checklyhq.com/docs/cli/checkly-destroy Destroy all project resources from your Checkly account. The `checkly destroy` command removes all resources associated with your project from your Checkly account, including checks, check groups, alert channels, maintenance windows, and other project-defined resources. Before using , ensure you have: * An initialized Checkly CLI project * At least one check or resource defined in your project * Valid Checkly account authentication (run `npx checkly login` if needed) * A `checkly.config.ts` or `checkly.config.js` configuration file For additional setup information, see [CLI overview](/docs/cli/overview). This command permanently deletes resources from your Checkly account. This action cannot be undone. ## Usage The basic command destroys all project resources with a confirmation prompt. ```bash Terminal theme={null} npx checkly destroy [options] ``` | Option | Required | Description | | ---------------------- | -------- | ------------------------------------------------------------------------------------------------------------------ | | `--config, -c` | - | The Checkly CLI configuration file. If not passed, uses the `checkly.config.ts\|js` file in the current directory. | | `--force, -f` | - | Force mode. Skips the confirmation dialog. | | `--preserve-resources` | - | Delete only the project, detaching its resources so they remain in your Checkly account. | ## Command Options Specify a particular configuration file to use instead of the default `checkly.config.ts` or `checkly.config.js`. **Usage:** ```bash Terminal theme={null} npx checkly destroy --config= npx checkly destroy -c= ``` **Examples:** ```bash Terminal theme={null} $ npx checkly destroy --config="./checkly.staging.config.ts" ``` Skip confirmation dialogs and proceed with the operation. **Usage:** ```bash Terminal theme={null} npx checkly destroy --force npx checkly destroy -f ``` Use with extreme caution as this command option bypasses safety prompts. Available since CLI version `7.10.0`. Delete the project but preserve all of its resources (checks, groups, alert channels, dashboards, etc.) in your Checkly account. The resources are detached from the CLI project and become regular account-level resources that are no longer managed by the CLI. Use this when you want to stop managing resources as code but keep them running in your account. **Usage:** ```bash Terminal theme={null} npx checkly destroy --preserve-resources ``` **Examples:** ```bash Terminal theme={null} $ npx checkly destroy --preserve-resources --force ``` ## What Gets Destroyed The `destroy` command removes the all the resources managed by the specified project. These resources could include: * **Checks** (API, Browser, Heartbeat, etc.) * **Monitors** (URL, TCP, DNC, etc.) * **Check Groups** and their configurations * **Alert Channels** defined in your project * **Maintenance Windows** created via CLI * **Private Locations** (if managed by the project) When run with `--preserve-resources`, only the project itself is deleted. All of the above resources remain in your Checkly account as regular account-level resources and are no longer tracked by the CLI. ## Safety Considerations By default, the command prompts for confirmation: ```bash Terminal theme={null} $ npx checkly destroy ? Are you sure you want to delete all resources in project "Website Monitoring" for account "Monitoring as Code"? Please confirm by typing the project name "Website Monitoring": ``` ## Related Commands * [`checkly deploy`](/docs/cli/checkly-deploy) - Deploy resources to Checkly * [`checkly test`](/docs/cli/checkly-test) - Test your setup before deployment # checkly env Source: https://www.checklyhq.com/docs/cli/checkly-env Manage the global variables of a Checkly account. The `checkly env` command manages global environment variables in your Checkly account. Create, update, list, export, and remove variables that are available across all checks in your account. Before using , ensure you have: * An initialized Checkly CLI project * At least one check or resource defined in your project * Valid Checkly account authentication (run `npx checkly login` if needed) * A `checkly.config.ts` or `checkly.config.js` configuration file For additional setup information, see [CLI overview](/docs/cli/overview). ## Usage The basic command structure uses subcommands to manage environment variables. ```bash Terminal theme={null} npx checkly env [arguments] [options] ``` ## Subcommands | Subcommand | Description | | ---------- | ------------------------------------------ | | `add` | Create and add a new environment variable. | | `update` | Update an existing environment variable. | | `ls` | List all global environment variables. | | `pull` | Export variables to a local file. | | `rm` | Remove an environment variable. | ## `checkly env add` Create a new global environment variable. **Usage:** ```bash Terminal theme={null} npx checkly env add [options] ``` **Options:** | Option | Required | Description | | -------------- | -------- | ---------------- | | `--locked, -l` | - | Lock variable. | | `--secret, -s` | - | Store as secret. | **Examples:** ```bash Terminal theme={null} # Add regular variable npx checkly env add ENVIRONMENT "production" # Add locked variable npx checkly env add INTERNAL_API_URL "https://internal.api.com" --locked # Add secret variable npx checkly env add API_SECRET "super-secret-key" --secret ``` ## `checkly env update` Update an existing global environment variable. **Usage:** ```bash Terminal theme={null} npx checkly env update [options] ``` **Options:** | Option | Required | Description | | -------------- | -------- | ---------------- | | `--locked, -l` | - | Lock variable. | | `--secret, -s` | - | Store as secret. | **Examples:** ```bash Terminal theme={null} # Update regular variable npx checkly env update ENVIRONMENT "staging" # Update and convert to locked npx checkly env update API_KEY "new-secret-key" --locked # Update existing secret npx checkly env update DATABASE_PASSWORD "new-password" --secret ``` ## `checkly env ls` List all global environment variables in your account. **Usage:** ```bash Terminal theme={null} npx checkly env ls ``` **Examples:** ```bash Terminal theme={null} # List all variables npx checkly env ls ``` Shows variable keys and their values. Secret values are hidden for security. ## `checkly env pull` Export global variables from your Checkly account to a local file. **Usage:** ```bash Terminal theme={null} npx checkly env pull [filename] [options] ``` **Options:** | Option | Required | Description | | ------------- | -------- | -------------------------------------------- | | `--force, -f` | - | Overwrite existing file without confirmation | **Examples:** ```bash Terminal theme={null} # Pull to default .env file npx checkly env pull # Pull to specific file npx checkly env pull .env.production # Force overwrite existing file npx checkly env pull .env.production --force ``` ## `checkly env rm` Remove a global environment variable. **Usage:** ```bash Terminal theme={null} npx checkly env rm [options] ``` **Options:** | Option | Required | Description | | ------------- | -------- | ------------------------ | | `--force, -f` | - | Skip confirmation dialog | **Examples:** ```bash Terminal theme={null} # Remove with confirmation npx checkly env rm ENVIRONMENT # Remove without confirmation npx checkly env rm OLD_VARIABLE --force ``` ## Variable Types ### Regular Variables Standard key-value pairs visible to all team members: ```bash Terminal theme={null} npx checkly env add ENVIRONMENT "production" ``` ### Locked Variables Locked environment variables can only be accessed by team members with "Read & Write" access or above. ```bash Terminal theme={null} npx checkly env add INTERNAL_API_URL "https://internal.api.com" --locked ``` ### Secrets Once saved, secrets are never shown in the UI or in logs. The secret value cannot be accessed via the CLI or API. ```bash Terminal theme={null} npx checkly env add API_SECRET "super-secret-key" --secret ``` ## Variable Scope Environment variables managed by `checkly env` are **global** and available to: * All checks in your account * All check groups * All team members (unless locked) For check-specific or group-specific variables, use the web UI or configure them directly in your monitoring-as-code setup. ## Best Practices 1. **Use secrets for sensitive data** like API keys, passwords, and tokens 2. **Lock internal variables** that shouldn't be visible to read-only users 3. **Use descriptive names** following standard conventions (UPPER\_SNAKE\_CASE) 4. **Document variables** and their purposes for team collaboration 5. **Regular cleanup** of unused variables to maintain security ## Related Commands * [`checkly test`](/docs/cli/checkly-test) - Test your setup before deployment * [`checkly deploy`](/docs/cli/checkly-deploy) - Deploy your Checkly configuration # checkly import Source: https://www.checklyhq.com/docs/cli/checkly-import Import existing resources into your CLI-managed project. Available since CLI v5.4.0. Learn more about importing existing Checkly resources in [the "Importing Existing Resources" guide](/docs/cli/importing). The `checkly import plan` command imports existing resources from your Checkly account into your CLI-managed project. This allows you to bring existing checks, alert channels, and other resources under code management using a structured three-phase workflow. You can use `npx checkly import` as a shorthand for `npx checkly import plan`. Before using `checkly import`, ensure you have: * An initialized Checkly CLI project * A Checkly account with existing resources to import * Valid Checkly account authentication (run `npx checkly login` if needed) ## Usage Import all resources from your account into the current project. ```bash Terminal theme={null} npx checkly import plan [resources] [options] ``` **Examples:** ```bash Terminal theme={null} # Import a specific resource by its ID npx checkly import plan check:2ce8... ``` **Available resource types to import**: * `check` - Individual monitoring checks * `check-group` - Collections of related checks * `alert-channel` - Notification channels * `maintenance-window` - Scheduled maintenance periods * `private-location` - Custom monitoring locations * `dashboard` - Public status dashboards * `snippet` - Reusable code snippets * `status-page` - Status page configurations * `status-page-service` - Status page service definitions `npx checkly import plan` starts an interactive process that generates an import plan, applies it to create Check files, and commits the changes to mark resources as managed by your CLI project. | Option | Required | Description | | | -------------- | -------- | ------------------------------------------------------------------------------- | ----------------------------------- | | `--config, -c` | - | The Checkly CLI configuration file. If not passed, uses the \`checkly.config.ts | js\` file in the current directory. | | `--root` | - | Root folder in which to write generated code files. Default: `__checks__`. | | | `--preview` | - | Preview generated code without creating an import plan. | | ## Command Options Specify a particular configuration file to use instead of the default `checkly.config.ts` or `checkly.config.js`. **Usage:** ```bash Terminal theme={null} npx checkly import plan --config= npx checkly import plan -c= ``` **Examples:** ```bash Terminal theme={null} $ npx checkly import plan --config="./checkly.staging.config.ts" ``` Set the root folder in which to write generated code files. The default is `__checks__`. **Usage:** ```bash Terminal theme={null} npx checkly import plan --root= ``` **Examples:** ```bash Terminal theme={null} $ npx checkly import plan --root="./src/checks" ``` Generate a code preview without creating an import plan or linking resources to your project. **Usage:** ```bash Terminal theme={null} npx checkly import plan --preview ``` ## Import Workflow The import process follows a three-phase workflow for safe resource migration: ### 1. Plan Generation Analyze your account, generate an import plan and create code files for your resources. ```bash Terminal theme={null} npx checkly import plan ``` ### 2. Plan Application Apply the generated plan and link the imported resources to your CLI project, but keeps the mapping in a pending state. ```bash Terminal theme={null} npx checkly import apply ``` ### 3. Plan Commitment Commit the applied changes and mark resources as CLI-managed. ```bash Terminal theme={null} npx checkly import commit ``` ## Subcommands ### `checkly import plan` Generate code and create an import plan for resources in your account. Use `--preview` to inspect generated code without creating a plan. ```bash Terminal theme={null} npx checkly import plan [resources] [options] ``` ### `checkly import apply` Apply a previously generated import plan to create the actual code files in your project structure. ```bash Terminal theme={null} npx checkly import apply ``` ### `checkly import commit` Commit an applied import plan to finalize the import and mark resources as managed by your CLI project. ```bash Terminal theme={null} npx checkly import commit ``` ### `checkly import cancel` Cancel a generated plan that hasn't been committed to discard any pending import operations. ```bash Terminal theme={null} npx checkly import cancel ``` ## Best Practices ### Before Importing 1. **Rely on version control and git** to track changes 2. **Review your account** resources to understand what will be imported 3. **Plan directory structure** using `--root` if needed 4. **Import specific resources** using `resource-type:id` syntax ### After Importing 1. **Review generated code** for accuracy and style consistency 2. **Test imported checks** using `checkly test` 3. **Commit to version control** to track changes 4. **Deploy to verify** everything works as expected ## Related Commands * [`checkly deploy`](/docs/cli/checkly-deploy) - Deploy imported resources * [`checkly test`](/docs/cli/checkly-test) - Test imported checks locally # checkly incidents Source: https://www.checklyhq.com/docs/cli/checkly-incidents Create, update, and resolve incidents on your status pages from the CLI. Available since CLI v7.5.0. The `checkly incidents` command lets you manage incidents on your status pages directly from the terminal. You can list, create, update, and resolve incidents, and optionally notify subscribers with each action. Before using `checkly incidents`, ensure you have: * Checkly CLI installed * Valid Checkly account authentication (run `npx checkly login` if needed) * At least one status page configured in your Checkly account For additional setup information, see [CLI overview](/docs/cli/overview). ## Usage ```bash Terminal theme={null} npx checkly incidents [arguments] [options] ``` ## Subcommands | Subcommand | Description | | ---------- | ------------------------------------------------------------- | | `list` | List incidents, optionally filtered by status page or status. | | `create` | Declare a new incident on a status page. | | `update` | Post a progress update to an incident. | | `resolve` | Resolve an incident. | ## `checkly incidents list` List incidents, optionally filtered by status page or status. **Usage:** ```bash Terminal theme={null} npx checkly incidents list [options] ``` **Options:** | Option | Required | Description | | ------------------ | -------- | ------------------------------------------------------------------------- | | `--limit, -l` | - | Number of incidents to return (1-100). Default: `25`. | | `--status-page-id` | - | Filter incidents by status page ID. | | `--status` | - | Filter by incident status: `open`, `resolved`, or `all`. Default: `open`. | | `--output, -o` | - | Output format: `table`, `json`, or `md`. Default: `table`. | ### List Options Number of incidents to return, between 1 and 100. **Usage:** ```bash Terminal theme={null} npx checkly incidents list --limit=50 npx checkly incidents list -l 10 ``` Filter incidents to only those associated with a specific status page. **Usage:** ```bash Terminal theme={null} npx checkly incidents list --status-page-id= ``` Filter incidents by status. Available values: `open`, `resolved`, `all`. **Usage:** ```bash Terminal theme={null} npx checkly incidents list --status=open npx checkly incidents list --status=resolved npx checkly incidents list --status=all ``` Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly incidents list --output=json npx checkly incidents list -o md ``` ### List Examples ```bash Terminal theme={null} # List all open incidents (default) npx checkly incidents list # List resolved incidents npx checkly incidents list --status=resolved # Filter by status page npx checkly incidents list --status-page-id= # Get results as JSON npx checkly incidents list --output=json ``` ## `checkly incidents create` Declare a new incident on a status page. By default, all services on the status page are affected. Use `--services` to specify individual services. **Usage:** ```bash Terminal theme={null} npx checkly incidents create [options] ``` **Options:** | Option | Required | Description | | ---------------------- | -------- | ------------------------------------------------------------------------------------------ | | `--status-page-id` | yes | Target status page ID. | | `--title` | yes | Incident title. | | `--services` | - | Affected service IDs. Repeat the flag for multiple services. | | `--severity` | - | Incident severity: `minor`, `medium`, `major`, or `critical`. Default: `minor`. | | `--message` | - | Initial incident update message. | | `--notify-subscribers` | - | Notify status page subscribers. Default: `true`. Use `--no-notify-subscribers` to disable. | | `--output, -o` | - | Output format: `table`, `json`, or `md`. Default: `table`. | ### Create Options The ID of the status page to create the incident on. You can find status page IDs using `checkly status-pages list`. **Usage:** ```bash Terminal theme={null} npx checkly incidents create --status-page-id= --title="..." ``` The title of the incident. **Usage:** ```bash Terminal theme={null} npx checkly incidents create --status-page-id= --title="API degraded performance" ``` Specify affected service IDs. Repeat the flag to affect multiple services. If omitted, all services on the status page are affected. **Usage:** ```bash Terminal theme={null} npx checkly incidents create --status-page-id= --title="..." --services= --services= ``` Set the incident severity. Available values: `minor`, `medium`, `major`, `critical`. **Usage:** ```bash Terminal theme={null} npx checkly incidents create --status-page-id= --title="..." --severity=major ``` Provide an initial incident update message. If omitted, a default message is used. **Usage:** ```bash Terminal theme={null} npx checkly incidents create --status-page-id= --title="..." --message="We are investigating elevated error rates." ``` Notify status page subscribers about this incident. Use `--no-notify-subscribers` to suppress notifications. **Usage:** ```bash Terminal theme={null} npx checkly incidents create --status-page-id= --title="..." --no-notify-subscribers ``` Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly incidents create --status-page-id= --title="..." --output=json ``` ### Create Examples ```bash Terminal theme={null} # Create a minor incident affecting all services npx checkly incidents create --status-page-id= --title="Elevated error rates" # Create a major incident with a custom message npx checkly incidents create --status-page-id= --title="API outage" --severity=major --message="Our API is currently unavailable." # Create an incident affecting specific services without notifying subscribers npx checkly incidents create --status-page-id= --title="Degraded performance" --services= --no-notify-subscribers ``` ## `checkly incidents update` Post a progress update to an existing incident. You can change the status and severity of the incident at the same time. **Usage:** ```bash Terminal theme={null} npx checkly incidents update [options] ``` **Arguments:** | Argument | Description | | -------- | --------------------------------- | | `id` | The ID of the incident to update. | **Options:** | Option | Required | Description | | ---------------------- | -------- | --------------------------------------------------------------------------------------------------- | | `--message` | yes | Update message. | | `--status` | - | Incident progress status: `investigating`, `identified`, or `monitoring`. Default: `investigating`. | | `--severity` | - | Update the overall incident severity: `minor`, `medium`, `major`, or `critical`. | | `--notify-subscribers` | - | Notify status page subscribers. Default: `true`. Use `--no-notify-subscribers` to disable. | | `--output, -o` | - | Output format: `table`, `json`, or `md`. Default: `table`. | ### Update Options The progress update message. **Usage:** ```bash Terminal theme={null} npx checkly incidents update --message="We have identified the root cause." ``` Set the incident progress status. Available values: `investigating`, `identified`, `monitoring`. **Usage:** ```bash Terminal theme={null} npx checkly incidents update --message="..." --status=identified npx checkly incidents update --message="..." --status=monitoring ``` Update the overall incident severity. Available values: `minor`, `medium`, `major`, `critical`. **Usage:** ```bash Terminal theme={null} npx checkly incidents update --message="..." --severity=critical ``` Notify status page subscribers about this update. Use `--no-notify-subscribers` to suppress notifications. **Usage:** ```bash Terminal theme={null} npx checkly incidents update --message="..." --no-notify-subscribers ``` Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly incidents update --message="..." --output=json ``` ### Update Examples ```bash Terminal theme={null} # Post an investigating update npx checkly incidents update --message="We are looking into the issue." # Mark the root cause as identified npx checkly incidents update --message="Root cause identified: database connection pool exhaustion." --status=identified # Escalate severity and post an update npx checkly incidents update --message="Impact is wider than initially assessed." --severity=critical # Post a monitoring update without notifying subscribers npx checkly incidents update --message="Fix deployed, monitoring for stability." --status=monitoring --no-notify-subscribers ``` ## `checkly incidents resolve` Resolve an incident. This posts a final update with status `RESOLVED`. **Usage:** ```bash Terminal theme={null} npx checkly incidents resolve [options] ``` **Arguments:** | Argument | Description | | -------- | ---------------------------------- | | `id` | The ID of the incident to resolve. | **Options:** | Option | Required | Description | | ---------------------- | -------- | ------------------------------------------------------------------------------------------ | | `--message` | - | Optional closing note. If omitted, a default message is used. | | `--notify-subscribers` | - | Notify status page subscribers. Default: `true`. Use `--no-notify-subscribers` to disable. | | `--output, -o` | - | Output format: `table`, `json`, or `md`. Default: `table`. | ### Resolve Options Provide a closing note for the incident. If omitted, a default resolution message is used. **Usage:** ```bash Terminal theme={null} npx checkly incidents resolve --message="Root cause fixed and deployed. No further action needed." ``` Notify status page subscribers about the resolution. Use `--no-notify-subscribers` to suppress notifications. **Usage:** ```bash Terminal theme={null} npx checkly incidents resolve --no-notify-subscribers ``` Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly incidents resolve --output=json ``` ### Resolve Examples ```bash Terminal theme={null} # Resolve an incident with default message npx checkly incidents resolve # Resolve with a custom closing note npx checkly incidents resolve --message="Database connection pool issue resolved. Monitoring confirms normal operations." # Resolve without notifying subscribers npx checkly incidents resolve --no-notify-subscribers ``` ## Related Commands * [`checkly status-pages`](/docs/cli/checkly-status-pages) - List and inspect status pages * [`checkly checks`](/docs/cli/checkly-checks) - List and inspect checks * [`checkly whoami`](/docs/cli/checkly-whoami) - Display current account information # checkly init Source: https://www.checklyhq.com/docs/cli/checkly-init Initialize Checkly in your project with interactive or AI-assisted onboarding. Available since CLI v7.8.0. The `checkly init` command sets up Checkly in your project. It detects your project's existing configuration — package.json, Playwright, and Checkly config files — and walks you through the setup accordingly. You can set up Checkly manually or let your AI coding agent handle the configuration. The command adapts its behavior based on the environment: interactive terminals get guided prompts, CI environments get non-interactive setup, and AI agents receive structured output. Before using `checkly init`, ensure you have: * Node.js installed * A project directory (an existing `package.json` is optional — the command can create one) No existing Checkly account or configuration is required. ## Usage ```bash Terminal theme={null} npx checkly init [options] ``` | Option | Required | Description | | -------------- | -------- | ----------------------------------------------------------- | | `--target, -t` | - | Install the Checkly skill for a specific AI agent platform. | ## Command Options Install the [Checkly agent skill](/docs/ai/skills) for a specific AI agent platform. Available platforms: `claude`, `cursor`, `windsurf`, `github-copilot`, `gemini-cli`, `codex`, `amp`. **Usage:** ```bash Terminal theme={null} npx checkly init --target=claude npx checkly init -t cursor ``` ## What to Expect The `init` command detects your project context and adjusts its flow: * **No `package.json`** — prompts you to create one before continuing. * **No Checkly config** — creates a `checkly.config.ts` and installs `checkly` as a dev dependency. * **Playwright detected** — provides context-aware setup that accounts for your existing test infrastructure. * **Existing Checkly project** — refreshes your agent skill to the latest version. ### AI-Assisted Setup When you choose the AI-assisted path (or pass `--target`), the command: 1. Installs the [Checkly agent skill](/docs/ai/skills) for your platform 2. Creates a `checkly.config.ts` if one doesn't exist 3. Installs dependencies 4. Generates a starter prompt you can paste into your AI agent to begin configuring checks The starter prompt gives your AI agent all the context it needs about your project and Checkly's capabilities. Copy it into your agent's chat to start creating checks. ### Manual Setup When you choose the manual path, the command: 1. Creates a `checkly.config.ts` if one doesn't exist 2. Installs dependencies 3. Optionally copies example checks (API, browser, heartbeat, URL monitor) into a `__checks__` directory ### CI Mode In CI environments (when `CI=true`), the command runs non-interactively and outputs setup instructions. ```bash Terminal theme={null} CI=true npx checkly init ``` ## Examples ```bash Terminal theme={null} # Interactive setup npx checkly init # Set up with Claude Code agent skill npx checkly init --target=claude # Non-interactive CI setup CI=true npx checkly init ``` ## Next Steps After initialization, the typical workflow is: 1. **Log in** — `npx checkly login` to authenticate with your Checkly account 2. **Test** — `npx checkly test` to dry-run your checks 3. **Deploy** — `npx checkly deploy` to deploy checks to Checkly ## Related Commands * [`checkly skills`](/docs/cli/checkly-skills) - Print project context and install agent skills * [`checkly login`](/docs/cli/checkly-login) - Log in to your Checkly account * [`checkly deploy`](/docs/cli/checkly-deploy) - Deploy checks to Checkly # checkly login Source: https://www.checklyhq.com/docs/cli/checkly-login Sign up for a new Checkly account or log in to your existing account. The `checkly login` command authenticates with Checkly by signing up for a new account or logging in to your existing account. This command opens a browser window or provides a URL for secure OAuth authentication. Before using `checkly login`, ensure you have: * Checkly CLI installed * A web browser available (for OAuth authentication) * Internet connection for authentication flow No existing Checkly account is required - you can sign up during the login process. ## Usage The basic command initiates the login process and authenticates with your Checkly account. ```bash Terminal theme={null} npx checkly login ``` Use environment variables in environments without interactive prompts. See the [Authentication section](/docs/cli/authentication#other-authentication-options) for more info. ## Examples ```bash Terminal theme={null} npx checkly login ✔ Do you want to log in or sign up to Checkly? › I want to sign up for a new Checkly account ✔ Do you want to open a browser window to continue with sign up? … yes ✔ Which account do you want to use? › Monitoring as Code Successfully logged in as raccoon@checklyhq.com. Welcome to the Checkly CLI. ``` ## Authentication Flow The login process is interactive and will: 1. **Open your default browser** to the Checkly authentication page 2. **Prompt for account selection** if you have multiple accounts 3. **Store authentication tokens** locally for future CLI usage 4. **Display confirmation** with your account information ### New Users If you don't have a Checkly account: 1. Click "Sign up" on the authentication page 2. Complete account registration 3. Return to the CLI - you'll be automatically logged in ### Existing Users If you already have an account: 1. Enter your credentials on the authentication page 2. Complete any two-factor authentication if enabled 3. Return to the CLI - authentication will complete automatically ## Authentication Storage After successful login, the CLI stores authentication tokens locally in: * **macOS**: `~/Library/Preferences/@checkly/cli/auth.json` * **Linux**: `~/.config/@checkly/cli/auth.json` * **Windows**: `%APPDATA%\@checkly\cli\Config\auth.json` The file is plain JSON and is not encrypted. The stored tokens are used for subsequent CLI operations without requiring re-authentication. ## Troubleshooting ### Browser doesn't open automatically If the authentication browser window doesn't open: 1. Decline to open a new browser window in the CLI dialog 2. Manually open the displayed URL in your preferred browser 3. Complete authentication and return to the CLI ### Multiple accounts If you have access to multiple Checkly accounts, you'll be prompted to select which account to use as the active account for CLI operations. You can also switch accounts later using [`checkly switch`](/docs/cli/checkly-switch). ## Related Commands * [`checkly logout`](/docs/cli/checkly-logout) - Sign out of your Checkly account * [`checkly whoami`](/docs/cli/checkly-whoami) - Display current account information * [`checkly switch`](/docs/cli/checkly-switch) - Switch between multiple accounts # checkly logout Source: https://www.checklyhq.com/docs/cli/checkly-logout Log out of your Checkly account. The `checkly logout` command signs out of your current Checkly account and removes stored authentication tokens from your local machine. Before using `checkly logout`, ensure you have: * Checkly CLI installed * Currently authenticated with Checkly CLI No internet connection is required as logout works locally. ## Usage The basic command logs out of your current Checkly account and removes stored authentication tokens. ```bash Terminal theme={null} npx checkly logout [options] ``` | Option | Required | Description | | ------------- | -------- | ------------------------------------------ | | `--force, -f` | - | Force mode. Skips the confirmation dialog. | ## Command Options Skip confirmation dialogs and proceed with the operation. Usage: ```bash Terminal theme={null} npx checkly logout --force npx checkly logout -f ``` **Examples:** ```bash Terminal theme={null} # Standard logout npx checkly logout --force # Output See you soon! 👋 ``` ## What Happens During Logout ### Session Invalidation The logout process will: 1. **Remove local tokens** from your machine 2. **Require re-authentication** for future CLI usage ### Token Removal The command removes authentication tokens stored locally in: * **macOS**: `~/Library/Preferences/@checkly/cli/auth.json` * **Linux**: `~/.config/@checkly/cli/auth.json` * **Windows**: `%APPDATA%\@checkly\cli\Config\auth.json` The same directory holds a `config.json` with the selected account ID and name, which is cleared as well. ## After Logout Once logged out, you'll need to run [`checkly login`](/docs/cli/checkly-login) before using other CLI commands that require authentication. ## Related Commands * [`checkly login`](/docs/cli/checkly-login) - Authenticate with your Checkly account * [`checkly whoami`](/docs/cli/checkly-whoami) - Display current account information * [`checkly switch`](/docs/cli/checkly-switch) - Switch between multiple accounts # checkly members Source: https://www.checklyhq.com/docs/cli/checkly-members List, update, and delete members in your Checkly account. The canonical `checkly members` commands are available since CLI v8.7.0. Earlier versions use `checkly account members`, which remains available as a compatibility alias. The `checkly members` commands let you list account members and pending invites, update member roles, and remove members from the currently selected account. Before using `checkly members`, ensure you have: * Checkly CLI installed * Valid Checkly account authentication (run `npx checkly login` if needed) * Account admin access for role updates or member deletion For additional setup information, see [CLI overview](/docs/cli/overview). ## Usage ```bash Terminal theme={null} npx checkly members [options] npx checkly members [arguments] [options] ``` ## Commands | Command | Description | | ---------------- | ----------------------------------------- | | `members` | List account members and pending invites. | | `members update` | Update an account member role. | | `members delete` | Delete an account member. | ## `checkly members` List members and pending invites for the currently selected account. You can filter the results or enable cursor pagination for larger accounts. **Usage:** ```bash Terminal theme={null} npx checkly members [options] ``` **Options:** | Option | Required | Description | | -------------- | -------- | --------------------------------------------------------------------------- | | `--search, -s` | - | Search members and invites by name or email. | | `--type` | - | Filter by item type: `member` or `invite`. | | `--role` | - | Filter by role: `owner`, `admin`, `read_write`, `read_run`, or `read_only`. | | `--status` | - | Filter by status: `active`, `pending`, or `expired`. | | `--limit, -l` | - | Number of results to return (1-100). Enables cursor pagination. | | `--next-id` | - | Cursor for the next page. Requires `--limit`. | | `--hide-id` | - | Hide member and invite IDs in formatted output. | | `--output, -o` | - | Output format: `table`, `json`, or `md`. Default: `table`. | ### List Examples ```bash Terminal theme={null} # List members and pending invites npx checkly members # Search by name or email npx checkly members --search="alex@example.com" # List pending invites npx checkly members --type=invite --status=pending # Find account admins npx checkly members --role=admin # Get the first 10 results as JSON npx checkly members --limit=10 --output=json # Get the next page using the cursor from the previous response npx checkly members --limit=10 --next-id= ``` ### JSON pagination When you use `--output=json`, the command returns the members and invites together with cursor pagination fields: ```json theme={null} { "members": [], "length": 0, "nextId": null } ``` Use a non-null `nextId` value with `--limit` and `--next-id` to retrieve the next page. ## `checkly members update` Update an account member's role. Identify the member by email or user ID. The command shows the proposed change and asks for confirmation by default. **Usage:** ```bash Terminal theme={null} npx checkly members update --role= [options] ``` **Arguments:** | Argument | Description | | -------- | ------------------------------------ | | `member` | The account member email or user ID. | **Options:** | Option | Required | Description | | -------------- | -------- | ------------------------------------------------------------------------------ | | `--role, -r` | Yes | New role: `admin`, `read_write`, `read_run`, or `read_only`. | | `--email` | - | Treat the member argument as an email address. Mutually exclusive with `--id`. | | `--id` | - | Treat the member argument as a user ID. Mutually exclusive with `--email`. | | `--force, -f` | - | Skip the confirmation prompt. | | `--dry-run` | - | Preview the change without updating the member. | | `--output, -o` | - | Output format: `table`, `json`, or `md`. Default: `table`. | ### Update Examples ```bash Terminal theme={null} # Update a member by email and confirm interactively npx checkly members update alex@example.com --role=read_write # Update a member by user ID npx checkly members update usr_123 --id --role=admin # Preview the change without applying it npx checkly members update alex@example.com --role=admin --dry-run # Update without a confirmation prompt and return JSON npx checkly members update alex@example.com --role=admin --force --output=json ``` ## `checkly members delete` Delete an account member by email or user ID. The command shows the member to remove and asks for confirmation by default. Deleting a member removes their access to the account. Use `--dry-run` to preview the operation before confirming it. **Usage:** ```bash Terminal theme={null} npx checkly members delete [options] ``` **Arguments:** | Argument | Description | | -------- | ------------------------------------ | | `member` | The account member email or user ID. | **Options:** | Option | Required | Description | | ------------- | -------- | ------------------------------------------------------------------------------ | | `--email` | - | Treat the member argument as an email address. Mutually exclusive with `--id`. | | `--id` | - | Treat the member argument as a user ID. Mutually exclusive with `--email`. | | `--force, -f` | - | Skip the confirmation prompt. | | `--dry-run` | - | Preview the deletion without removing the member. | ### Delete Examples ```bash Terminal theme={null} # Delete a member by email and confirm interactively npx checkly members delete alex@example.com # Delete a member by user ID npx checkly members delete usr_123 --id # Preview the deletion npx checkly members delete alex@example.com --dry-run # Delete without a confirmation prompt npx checkly members delete alex@example.com --force ``` ## Related Commands * [`checkly account`](/docs/cli/checkly-account) - View plan entitlements and limits * [`checkly whoami`](/docs/cli/checkly-whoami) - Display the current account and user * [`checkly switch`](/docs/cli/checkly-switch) - Switch between Checkly accounts # checkly pw-test Source: https://www.checklyhq.com/docs/cli/checkly-pw-test Run Playwright tests with Checkly monitoring features Available since CLI v6.1.0. The `checkly pw-test` command runs Playwright tests on Checkly's cloud infrastructure and supports standard Playwright CLI arguments. This command records test sessions by default. Before using `checkly pw-test`, ensure you have: * An initialized Checkly CLI project * Valid Checkly account authentication (run `npx checkly login` if needed) * Playwright tests in your project * A `playwright.config.ts` or `playwright.config.js` file. ## Basic Usage Use `--` to separate Checkly flags from Playwright test options. ```bash Terminal theme={null} npx checkly pw-test [checkly options] -- [playwright options] ``` Define `checkly pw-test` specific options before the `--` separator: | Option | Required | Description | | --------------------- | -------- | ------------------------------------------------------------------------------------------------------------------ | | `--config` | - | The Checkly CLI configuration file. If not passed, uses the `checkly.config.ts\|js` file in the current directory. | | `--create-check` | - | Create a Checkly check from the Playwright test. | | `--detach, -d` | - | Keep checks running in the cloud when you stop the CLI with Ctrl+C, instead of cancelling the run. | | `--env, -e` | - | Env vars to be passed to the test run. Default: \[] | | `--env-file` | - | dotenv file path to be passed. For example `--env-file="./.env"` | | `--include, -i` | - | File patterns to include when bundling the test project (e.g., `"utils/**/*"`). Can be repeated. | | `--install-command` | - | Override the command used to install dependencies before running tests. | | `--location, -l` | - | The location to run the checks at. | | `--private-location` | - | The private location to run checks at. | | `--[no-]record` | - | Record test results in Checkly as a test session with full logs, traces and videos. | | `--refresh-cache` | - | Force a fresh install of dependencies and update the cached version. | | `--reporter` | - | One or more custom reporters for the test output. Supports comma-separated values and repeated flags. | | `--stream-logs` | - | Stream logs from the test run to the console. | | `--test-session-name` | - | A name to use when storing results in Checkly | | `--timeout` | - | A timeout (in seconds) to wait for checks to complete. | | `--verbose` | - | Always show the full logs of the checks. | Define Playwright test runner flags after the `--` separator: | Option | Required | Description | | --------------- | -------- | -------------------------- | | `--project` | - | Select Playwright projects | | `--grep` | - | Filter tests by pattern | | `--grep-invert` | - | Exclude tests by pattern | The `--reporter` and `--headed` options are not supported. Find more Playwright options in the [Playwright test runner docs](https://playwright.dev/docs/test-cli). ### Checkly Command Options Specify a configuration file to use instead of the `checkly.config.ts` or `checkly.config.js` in the current directory. **Usage:** ```bash Terminal theme={null} npx checkly pw-test --config="./checkly.staging.config.ts" ``` Add a new [Playwright Check Suite](/docs/detect/synthetic-monitoring/playwright-checks/overview) with your Playwright configuration to your `checkly.config`. **Usage:** ```bash Terminal theme={null} npx checkly pw-test --create-check ``` **Examples:** Running this command: ```bash Terminal theme={null} npx checkly pw-test --create-check -- --project="Mobile Chrome" --grep="@critical" ``` Adds a new Playwright Check Suite to your `checkly.config.ts`: ```typescript checkly.config.ts highlight={9-16} theme={null} import { defineConfig } from 'checkly' const config = defineConfig({ projectName: "Playwright Project", logicalId: "playwright-project", checks: { playwrightConfigPath: "./playwright.config.ts", playwrightChecks: [ { logicalId: "playwright-check-project-mobile-chrome-grep-critical", name: 'Playwright Test: "--project=Mobile Chrome" --grep=@critical', testCommand: 'npx playwright test "--project=Mobile Chrome" --grep=@critical', locations: ["eu-central-1"], frequency: 10, }, ], }, }) ``` If there's no existing `checkly.config.ts` file, the `--create-check` option will create one. By default, pressing Ctrl+C during a `pw-test` run cancels the recorded test session. With `--detach`, Ctrl+C exits the CLI immediately instead, leaving the checks running in the cloud. **Usage:** ```bash Terminal theme={null} npx checkly pw-test --detach ``` Pass environment variables to the test run. Can be specified multiple times to set multiple variables. **Usage:** ```bash Terminal theme={null} npx checkly pw-test --env API_KEY=123 --env BASE_URL=https://example.com npx checkly pw-test -e NODE_ENV=production -e DEBUG=true ``` Load environment variables from a dotenv file. **Usage:** ```bash Terminal theme={null} npx checkly pw-test --env-file="./.env" ``` File patterns to include when bundling the test project. Use this to add files that aren't automatically detected as dependencies, such as fixtures, helpers, or assets referenced at runtime. Can be specified multiple times to include multiple patterns. If not provided, falls back to the `checks.include` value in your `checkly.config`. **Usage:** ```bash Terminal theme={null} npx checkly pw-test --include="utils/**/*" npx checkly pw-test -i="fixtures/**/*" -i="data/*.json" ``` Override the command used to install dependencies before running tests. By default, Checkly runs `npm install --dev`. Use this to customize the install step, for example to skip lifecycle scripts or use a different package manager. **Usage:** ```bash Terminal theme={null} npx checkly pw-test --install-command='npm install --no-scripts' npx checkly pw-test --install-command='pnpm install --frozen-lockfile' ``` Specify the geographic location where the checks should run. This determines which Checkly data center executes your tests. **Usage:** ```bash Terminal theme={null} npx checkly pw-test --location="us-east-1" npx checkly pw-test -l="eu-west-1" ``` Run checks at a specific private location. Private locations allow you to test internal applications or services behind a firewall. **Usage:** ```bash Terminal theme={null} npx checkly pw-test --private-location="office-network" npx checkly pw-test --private-location="staging-vpc" ``` Force a fresh install of dependencies and update the cached version. Use this when you've changed your project's dependencies and need Checkly to pick up the latest versions instead of using the cache from a previous run. **Usage:** ```bash Terminal theme={null} npx checkly pw-test --refresh-cache ``` The `pw-test` automatically records your test results as a [test session](/docs/detect/testing/overview) with full logs, traces, and videos. Use `--no-record` to disable recording. **Usage:** ```bash Terminal theme={null} npx checkly pw-test --record npx checkly pw-test --no-record ``` One or more custom reporters for the test output. Options: `list`, `dot`, `ci`, `github`, `json`. You can combine multiple reporters by passing multiple `--reporter` flags or using a comma-separated list. **Usage:** ```bash Terminal theme={null} npx checkly pw-test --reporter="json" npx checkly pw-test --reporter="github" ``` **Examples:** ```bash Terminal theme={null} # Multiple reporters using comma-separated values npx checkly pw-test --reporter list,json # Multiple reporters using repeated flags npx checkly pw-test --reporter list --reporter json ``` Logs appear in real time as tests run. **Usage:** ```bash Terminal theme={null} npx checkly pw-test --stream-logs ``` Provide a custom name for the test session when storing results in Checkly. This helps identify and organize test runs. **Usage:** ```bash Terminal theme={null} npx checkly pw-test --test-session-name="Release v1.2.3 tests" npx checkly pw-test --test-session-name="Daily regression suite" ``` Set a timeout (in seconds) to wait for checks to complete. **Usage:** ```bash Terminal theme={null} npx checkly pw-test --timeout="300" npx checkly pw-test --timeout="1200" ``` The current maximum timeout is 1200 seconds (20 minutes). Show full logs for every check, including passing ones. **Usage:** ```bash Terminal theme={null} npx checkly pw-test --verbose ``` ### Common Playwright Test Options The `pw-test` command reuses your `playwright.config` settings. To overwrite these values from the command line, [Playwright Check Suites](/docs/detect/synthetic-monitoring/playwright-checks/overview) supports most [Playwright test runner options](https://playwright.dev/docs/test-cli). Select specific Playwright projects to run. This allows you to run only a subset of your configured projects from your Playwright configuration. **Usage:** ```bash Terminal theme={null} npx checkly pw-test -- --project="chromium" npx checkly pw-test -- --project="firefox" ``` You can only run projects specified in your `playwright.config` file. Filter tests to run based on a pattern match against test titles. Only tests matching the pattern will be executed. **Usage:** ```bash Terminal theme={null} npx checkly pw-test -- --grep="@smoke" npx checkly pw-test -- --grep="login|authentication" ``` Exclude tests from running based on a pattern match against test titles. Tests matching the pattern will be skipped. **Usage:** ```bash Terminal theme={null} npx checkly pw-test -- --grep-invert="@slow" npx checkly pw-test -- --grep-invert="flaky|unstable" ``` ## Playwright Configuration vs. Applied Command Line Options [Playwright Check Suites](/docs/detect/synthetic-monitoring/playwright-checks/overview) and the `pw-test` command read and parse your existing `playwright.config` to apply your configuration. To differentiate between your local testing setup and the Checkly monitoring environment, you can rely on the set `CI` environment variable or override specific settings using command line options. ```ts playwright.config.ts theme={null} export default defineConfig({ retries: process.env.CI ? 2 : 0, workers: process.env.CI ? 1 : undefined, use: { trace: 'on-first-retry', }, projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, // ... ] }); ``` If you run `npx checkly pw-test` without additional arguments, the test suite will: * run with `2` retries * use `1` worker * run all defined projects including `chromium` All these options can be further customized by passing command line arguments to `pw-test`. ```bash Terminal theme={null} # Run with 4 workers, only in chromium, and 3 retries npx checkly pw-test -- --workers=4 --project="chromium" --retries=3 ``` ## Examples ### Validate smoke tagged tests from `us-east-1` ```bash Terminal theme={null} npx checkly pw-test --location="us-east-1" -- --grep="@smoke" ``` ### Debug production issues ```bash Terminal theme={null} npx checkly pw-test --verbose -- tests/checkout.spec.ts ``` ### Test from different locations ```bash Terminal theme={null} npx checkly pw-test --location="ap-southeast-1" npx checkly pw-test --location="eu-west-1" ``` ### Run critical tests only ```bash Terminal theme={null} npx checkly pw-test --env ENVIRONMENT=production -- --grep="@critical" ``` ### Run tests in multiple browsers ```bash Terminal theme={null} npx checkly pw-test -- --project=chromium --project=firefox ``` ### Run a specific test file ```bash Terminal theme={null} npx checkly pw-test -- test.spec.ts ``` ## Key Features * Your Playwright configuration applies automatically (traces, videos, screenshots) * Test sessions are recorded by default with full logs, traces, and videos * View all artifacts in Checkly's UI ## Cancelling a run Available in CLI v8.0.0+. Cancellation is available only for recorded test sessions. Press Ctrl+C during a `checkly pw-test` run to cancel the test session. The CLI keeps running to report the cancelled results; press Ctrl+C again to exit immediately without waiting. Pass the `--detach` flag to keep the checks running in the cloud instead — Ctrl+C then exits the CLI immediately without cancelling. See [Cancellation](/docs/concepts/cancellation) for the full flow. ## Related Commands * [`checkly test`](/docs/cli/checkly-test) - Test your setup before deployment * [`checkly deploy`](/docs/cli/checkly-deploy) - Deploy your Checkly configuration # checkly rca Source: https://www.checklyhq.com/docs/cli/checkly-rca Trigger and retrieve AI-powered root cause analyses for error groups. Available since CLI v7.8.0. The `checkly rca` command lets you trigger and retrieve [AI-powered root cause analyses (RCA)](/docs/resolve/ai-root-cause-analysis/overview/) for error groups directly from the terminal. An RCA examines an error group and returns a classification, root cause explanation, user impact assessment, and suggested code fixes when available. Before using `checkly rca`, ensure you have: * Checkly CLI installed * Valid Checkly account authentication (run `npx checkly login` if needed) * A Checkly plan that includes root cause analysis For additional setup information, see [CLI overview](/docs/cli/overview). Existing root cause analysis results are also available via [`checkly checks get`](/docs/cli/checkly-checks/#checkly-checks-get). Use `checkly rca run` to trigger a new analysis for an error group that doesn't have one yet. ## Usage ```bash Terminal theme={null} npx checkly rca [arguments] [options] ``` ## Subcommands | Subcommand | Description | | ---------- | ---------------------------------------------------------------------- | | `run` | Trigger a root cause analysis for a check or test session error group. | | `get` | Retrieve a root cause analysis by ID. | ## `checkly rca run` Trigger a new root cause analysis for a check or test session error group. The analysis runs asynchronously — use `--watch` to wait for the result in your terminal. **Usage:** ```bash Terminal theme={null} npx checkly rca run [options] ``` **Options:** | Option | Required | Description | | --------------------------------- | -------- | ------------------------------------------------------------ | | `--error-group, -e` | yes\* | The check error group ID to analyze. | | `--test-session-error-group, -te` | yes\* | The test session error group ID to analyze. | | `--user-context` | - | Extra context to pass into the root cause analysis. | | `--watch, -w` | - | Wait for the analysis to complete and display the result. | | `--output, -o` | - | Output format: `detail`, `json`, or `md`. Default: `detail`. | \*Pass either `--error-group` or `--test-session-error-group`. ### Run Options The check error group ID to trigger the analysis for. You can find error group IDs in the output of [`checkly checks get`](/docs/cli/checkly-checks) when viewing a check with errors. **Usage:** ```bash Terminal theme={null} npx checkly rca run --error-group= npx checkly rca run -e ``` Available since CLI v8.0.0. The test session error group ID to trigger the analysis for. You can find these IDs in the output of [`checkly test-sessions get`](/docs/cli/checkly-test-sessions). **Usage:** ```bash Terminal theme={null} npx checkly rca run --test-session-error-group= npx checkly rca run -te ``` Available in CLI v8.5.0+. Extra context to pass into the root cause analysis. Use this to add details the error group does not contain, such as recent deploy changes or known service incidents. **Usage:** ```bash Terminal theme={null} npx checkly rca run --error-group= --user-context="Started after the checkout deploy" ``` Wait for the analysis to complete and display the full result. Without this flag, the command returns immediately with the RCA ID and a pending status. Only works with `--output detail`. **Usage:** ```bash Terminal theme={null} npx checkly rca run --error-group= --watch npx checkly rca run -e -w ``` Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly rca run --error-group= --output=json npx checkly rca run -e -o md ``` ### Run Examples ```bash Terminal theme={null} # Trigger an RCA and wait for the result npx checkly rca run --error-group=err-abc-123 --watch # Trigger an RCA without waiting npx checkly rca run --error-group=err-abc-123 # Trigger an RCA for a test session error group npx checkly rca run --test-session-error-group=err-abc-123 # Add extra context for the analysis npx checkly rca run --error-group=err-abc-123 --user-context="Started after the checkout deploy" # Get the result as JSON npx checkly rca run --error-group=err-abc-123 --output=json ``` ## `checkly rca get` Retrieve an existing root cause analysis by its ID. If the analysis is still generating, use `--watch` to wait for completion. **Usage:** ```bash Terminal theme={null} npx checkly rca get [options] ``` **Arguments:** | Argument | Description | | -------- | ----------------------- | | `id` | The RCA ID to retrieve. | **Options:** | Option | Required | Description | | -------------- | -------- | ------------------------------------------------------------ | | `--watch, -w` | - | Wait for the analysis to complete if still generating. | | `--output, -o` | - | Output format: `detail`, `json`, or `md`. Default: `detail`. | ### Get Options Wait for the analysis to complete if it is still generating. Without this flag, the command returns the current status immediately. Only works with `--output detail`. **Usage:** ```bash Terminal theme={null} npx checkly rca get --watch npx checkly rca get -w ``` Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly rca get --output=json npx checkly rca get -o md ``` ### Get Examples ```bash Terminal theme={null} # Retrieve a completed RCA npx checkly rca get rca-xyz-789 # Wait for a pending RCA to complete npx checkly rca get rca-xyz-789 --watch # Get the result as JSON npx checkly rca get rca-xyz-789 --output=json ``` ## RCA Output A completed root cause analysis includes: * **Classification** — the category of the error * **Root cause** — explanation of what caused the error * **User impact** — how the error affects end users * **Code fix** — suggested fix when available * **Evidence** — supporting artifacts from the analysis * **Reference links** — relevant external resources ## Related Commands * [`checkly checks`](/docs/cli/checkly-checks) - List, inspect, and analyze checks (includes error groups) * [`checkly test-sessions`](/docs/cli/checkly-test-sessions) - Inspect recorded test sessions and test session error groups # checkly runtimes Source: https://www.checklyhq.com/docs/cli/checkly-runtimes List all available runtimes and their dependencies. The `checkly runtimes` command displays all available runtime environments and their installed dependencies. This helps you understand what packages and versions are available for your checks in the Checkly cloud infrastructure. Learn more about Checkly runtimes in our [Runtimes documentation](/docs/platform/runtimes/overview). ## Usage List all available runtimes with their dependency versions. ```bash Terminal theme={null} npx checkly runtimes ``` Example output: ```bash Terminal theme={null} [ { "name": "2025.04", "description": "The main update is Playwright 1.51.1. The Node.js version is v22.11.0.", "stage": "CURRENT", "dependencies": { "@playwright/test": "1.51.1", "@axe-core/playwright": "4.10.1", "@azure/identity": "4.9.1", "@azure/keyvault-secrets": "4.9.0", "@checkly/playwright-helpers": "1.0.3" ... ... ``` ## Runtime Information ### Runtime Versions Each runtime environment includes: * **Runtime name** (e.g., `2025.04`) * **Description** and release information (highlights and Node.js version) * **Playwright version** for browser automation * **Built-in packages** and their versions ### Package Availability Common packages included in Checkly runtimes: * **HTTP clients**: axios * **Utilities**: lodash, moment, date-fns * **Testing**: expect * **Cryptography**: crypto-js, jsonwebtoken * **Environment**: dotenv ## Configuration ### Setting Runtime in Configuration Specify a runtime version in your `checkly.config.ts`: ```typescript checkly.config.ts highlight={6} theme={null} import { defineConfig } from 'checkly' export default defineConfig({ projectName: 'My Project', checks: { runtimeId: '2025.04', } /* More options... */ }) ``` Or in your runtime-dependent checks: ```typescript apicheck.ts highlight={5} theme={null} import { ApiCheck } from 'checkly/constructs' new ApiCheck('books-api-check-2', { name: 'Books API', runtimeId: '2025.04', /* More options... */ ``` Or in your check groups: ```typescript checkgroup.check.ts highlight={5} theme={null} import { CheckGroupV2 } from 'checkly/constructs' const syntheticGroup = new CheckGroupV2('check-group-synthetics', { name: 'Synthetic Monitors Group', runtimeId: '2025.04', /* More options... */ }) ``` ### Runtime Compatibility When selecting a runtime, consider: * **Package versions** your code depends on * **Node.js features** you're using * **Playwright compatibility** for browser checks * **Long-term support** for production environments Use the latest runtime for new projects to benefit from the newest features and security updates. ## Runtime Updates Checkly regularly updates runtimes with: * **Security patches** for Node.js and dependencies * **New package versions** and additional utilities * **Performance improvements** and bug fixes * **Extended browser support** via Playwright updates Check the [Checkly changelog](https://feedback.checklyhq.com/changelog) for runtime update announcements. ## Related Commands * [`checkly test`](/docs/cli/checkly-test) - Test checks with current runtime * [`checkly deploy`](/docs/cli/checkly-deploy) - Deploy checks to specified runtime # checkly skills Source: https://www.checklyhq.com/docs/cli/checkly-skills Print Checkly project, CLI and workflow context as Markdown for AI agents and LLMs. Available since CLI v7.5.0. The `checkly skills` command outputs Markdown-formatted context about your Checkly project, describing monitoring capabilities and how to use them programmatically. **This context is designed to be discovered and consumed by AI agents and LLMs**, giving them the information they need to work with your monitoring setup. You can also install [Checkly Skills as an agent skill](/docs/ai/skills) to let your AI agent automatically discover and use the `checkly skills` command. `checkly rules` is deprecated and only prints a migration message. Use `checkly skills` instead. Before using `checkly skills`, ensure you have: * Checkly CLI installed No existing Checkly account is required to access Checkly skills and documentation. ## Usage `checkly skills` provides your agent with all the required information to manage your Checkly monitoring setup. All resources and workflows are discoverable to provide your agent the right information at the right time. ```bash Terminal theme={null} npx checkly skills npx checkly skills [resource] ``` ## Actions | Action | Description | | ------------- | -------------------------------------------------------------------------------- | | `install` | Install [the Checkly agent skill (SKILL.md)](/docs/ai/skills) into your project. | | `initialize` | Let your agent initialize [a new Checkly project](/docs/constructs/project). | | `configure` | Let your agent configure [Checkly constructs](/docs/constructs/overview). | | `investigate` | Access check status, analyze failures, and investigate errors. | | `communicate` | Open incidents and lead customer communications via status pages. | | `manage` | Understand your account plan, entitlements, and feature limits. | ## Commands | Command | Description | | --------- | ------------------------------------------------------------- | | `install` | Install the Checkly agent skill (SKILL.md) into your project. | ## `checkly skills initialize` (experimental) The `initialize` action outputs LLM-optimized Markdown with all the context an agent needs to set up a new Checkly project from scratch. The context will instruct your agent to install required packages, create config files and scan your current project for resources to monitor. **Usage:** ```bash Terminal theme={null} npx checkly skills initialize ``` You can prompt your agent with **"run `npx checkly skills initialize` and follow the instructions"** and the agent will have everything it needs to scaffold your Checkly monitoring setup. ## `checkly skills configure [resource]` The `configure` action is an umbrella command that provides Markdown context about all available Checkly resources. The CLI outputs everything your agent needs to configure [Checkly constructs](/docs/constructs/overview) directly — no additional docs fetching or file reading required. Run `configure` without arguments to see all available resources, or pass a specific resource name to get targeted context. **Usage:** ```bash Terminal theme={null} npx checkly skills configure npx checkly skills configure api-checks npx checkly skills configure browser-checks # ...and more ``` ## `checkly skills investigate [resource]` The `investigate` action provides context for inspecting check status, analyzing failures, and investigating errors across your Checkly account. Run `investigate` without arguments to see all available resources, or pass a specific resource name for targeted context. **Usage:** ```bash Terminal theme={null} npx checkly skills investigate npx checkly skills investigate checks ``` **Available resources:** | Resource | Description | | -------- | ------------------------------------------------------------------------------ | | `checks` | Inspecting checks (`checks list`, `checks get`) and triggering on-demand runs. | ## `checkly skills communicate [resource]` The `communicate` action provides context for managing incidents and customer communications through status pages. Write commands like `incidents create`, `incidents update`, and `incidents resolve` follow a confirmation protocol — the CLI returns a JSON envelope for agent review before execution. Run `communicate` without arguments to see all available resources, or pass a specific resource name for targeted context. **Usage:** ```bash Terminal theme={null} npx checkly skills communicate npx checkly skills communicate incidents ``` **Available resources:** | Resource | Description | | ----------- | -------------------------------------------------------------------------------------- | | `incidents` | Incident lifecycle (`incidents create`, `update`, `resolve`, `list`) and status pages. | ## `checkly skills manage [resource]` The `manage` action provides context about your account's plan, entitlements, and limits. Use this to understand what features and locations are available before configuring checks. Run `manage` without arguments to see all available resources, or pass a specific resource name for targeted context. **Usage:** ```bash Terminal theme={null} npx checkly skills manage npx checkly skills manage plan ``` **Available resources:** | Resource | Description | | -------- | ------------------------------------------------------------------------------------------------------------------------ | | `plan` | Check account plan, entitlements, feature limits, and available locations ([`account plan`](/docs/cli/checkly-account)). | The `manage plan` resource documents the [`checkly account plan`](/docs/cli/checkly-account) command. Your agent can use the `account plan` command to query entitlements and available locations before writing check configurations. ## `checkly skills install` The `install` command installs the Checkly agent skill file (SKILL.md) into your project. This file lets your AI agent automatically discover and use the `checkly skills` command. **Usage:** ```bash Terminal theme={null} npx checkly skills install npx checkly skills install --target npx checkly skills install --path ``` **Options:** | Option | Required | Description | | -------------- | -------- | -------------------------------------------------- | | `--target, -t` | - | Platform to install the skill for. | | `--path, -p` | - | Custom target directory to install the skill into. | | `--force, -f` | - | Overwrite existing SKILL.md without confirmation. | ### Install Options The target platform determines where and how the skill file is installed. Available platforms: `amp`, `claude`, `cline`, `codex`, `continue`, `cursor`, `gemini-cli`, `github-copilot`, `goose`, `opencode`, `roo`, `windsurf`. **Usage:** ```bash Terminal theme={null} npx checkly skills install --target=claude npx checkly skills install -t cursor ``` Custom target directory to install the skill file into. Use this when the default location for your platform does not match your project structure. **Usage:** ```bash Terminal theme={null} npx checkly skills install --path=./my-agent-config ``` Overwrite an existing SKILL.md without asking for confirmation. **Usage:** ```bash Terminal theme={null} npx checkly skills install --force ``` ### Install Examples ```bash Terminal theme={null} # Install for Claude Code npx checkly skills install --target=claude # Install for Cursor npx checkly skills install --target=cursor # Install to a custom directory npx checkly skills install --path=./agents # Overwrite an existing skill file npx checkly skills install --target=claude --force ``` ## Related Commands * [`checkly account`](/docs/cli/checkly-account) - View and manage your Checkly account * [`checkly checks`](/docs/cli/checkly-checks) - List, inspect, and analyze checks * [`checkly incidents`](/docs/cli/checkly-incidents) - Create, update, and resolve incidents # checkly status-pages Source: https://www.checklyhq.com/docs/cli/checkly-status-pages List and inspect status pages in your Checkly account. Available since CLI v7.3.0. The `checkly status-pages` command lets you list and inspect status pages in your Checkly account directly from the terminal. You can view status page configurations, cards, and services. Before using `checkly status-pages`, ensure you have: * Checkly CLI installed * Valid Checkly account authentication (run `npx checkly login` if needed) For additional setup information, see [CLI overview](/docs/cli/overview). ## Usage ```bash Terminal theme={null} npx checkly status-pages [arguments] [options] ``` ## Subcommands | Subcommand | Description | | ---------- | --------------------------------------------------------------- | | `list` | List all status pages in your account. | | `get` | Get details of a status page, including its cards and services. | ## `checkly status-pages list` List all status pages in your account. **Usage:** ```bash Terminal theme={null} npx checkly status-pages list [options] ``` **Options:** | Option | Required | Description | | -------------- | -------- | ---------------------------------------------------------- | | `--limit, -l` | - | Number of status pages to return (1-100). Default: `25`. | | `--cursor` | - | Cursor for next page (from previous output). | | `--compact` | - | Show one row per status page instead of per service. | | `--output, -o` | - | Output format: `table`, `json`, or `md`. Default: `table`. | ### List Options Number of status pages to return per page, between 1 and 100. **Usage:** ```bash Terminal theme={null} npx checkly status-pages list --limit=50 npx checkly status-pages list -l 10 ``` Cursor for paginating through results. The cursor value is provided in the output of a previous `status-pages list` command. **Usage:** ```bash Terminal theme={null} npx checkly status-pages list --cursor= ``` Show one row per status page instead of expanding services. Displays the number of cards and whether the status page is private. **Usage:** ```bash Terminal theme={null} npx checkly status-pages list --compact ``` Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly status-pages list --output=json npx checkly status-pages list -o md ``` ### List Examples ```bash Terminal theme={null} # List all status pages with services expanded npx checkly status-pages list # Compact view with one row per status page npx checkly status-pages list --compact # Get results as JSON npx checkly status-pages list --output=json # Page through results npx checkly status-pages list --limit=10 --cursor= ``` ## `checkly status-pages get` Get details of a specific status page, including its cards and services. **Usage:** ```bash Terminal theme={null} npx checkly status-pages get [options] ``` **Arguments:** | Argument | Description | | -------- | -------------------------------------- | | `id` | The ID of the status page to retrieve. | **Options:** | Option | Required | Description | | -------------- | -------- | ------------------------------------------------------------ | | `--output, -o` | - | Output format: `detail`, `json`, or `md`. Default: `detail`. | ### Get Options Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly status-pages get --output=json npx checkly status-pages get -o md ``` ### Get Examples ```bash Terminal theme={null} # View status page details with cards and services npx checkly status-pages get 12345 # Get status page details as JSON npx checkly status-pages get 12345 --output=json ``` ## Related Commands * [`checkly checks`](/docs/cli/checkly-checks) - List and inspect checks * [`checkly whoami`](/docs/cli/checkly-whoami) - Display current account information # checkly switch Source: https://www.checklyhq.com/docs/cli/checkly-switch Switch between multiple Checkly accounts. The `checkly switch` command switches between multiple Checkly accounts that you have access to with your current credentials. Useful when you need to manage monitoring across different organizations or environments. Before using `checkly switch`, ensure you have: * Valid Checkly account authentication (run `npx checkly login` if needed) * Access to multiple Checkly accounts (team memberships, client projects, etc.) If you only have access to one account, this command will indicate no alternative accounts are available. ## Usage The basic command displays available accounts and provides an interactive selection interface. ```bash Terminal theme={null} npx checkly switch [options] ``` | Option | Required | Description | | ------------------ | -------- | -------------------------------------------- | | `--account-id, -a` | - | The id of the account you want to switch to. | ## Command Options The `switch` command asks you to select an account interactively by default. Use this option to switch accounts non-interactively by specifying the target account ID directly. **Usage:** ```bash Terminal theme={null} npx checkly switch --account-id="a43....." npx checkly switch -a="a43....." ``` ## Examples ```bash Terminal theme={null} # Standard account switching npx checkly switch # Output ? Which account do you want to use? Production Staging Demo ... ``` ```bash Terminal theme={null} # Verbose account switching with details npx checkly switch --account-id="a43....." # Output Account switched to "a43....." ``` ## Troubleshooting ### No Alternative Accounts If you see "No alternative accounts available": * You only have access to one Checkly account * Contact account administrators to request access to additional accounts * Consider using separate authentication for different accounts ### Account Not Listed If an expected account doesn't appear: * Verify you have active access to that account * Check that your user hasn't been removed from the account * Try logging out and back in to refresh account permissions ## Related Commands * [`checkly login`](/docs/cli/checkly-login) - Sign in to your Checkly account * [`checkly whoami`](/docs/cli/checkly-whoami) - Display current account information # checkly sync-playwright Source: https://www.checklyhq.com/docs/cli/checkly-sync-playwright Synchronize Playwright configuration with Checkly settings. Available since CLI v4.6.0. The `checkly sync-playwright` command synchronizes your Playwright configuration (`playwright.config`) with your Checkly project configuration (`checkly.config`). Keeping your configuration in sync ensures consistency between local testing and cloud monitoring environments. The applied [`playwrightConfig` configuration](/docs/constructs/project#param-checks-playwright-config) is applied to all Browser and MultiStep Checks defined in your Checkly project. Before using `checkly sync-playwright`, ensure you have: * An initialized Checkly CLI project * A `checkly.config.ts` or `checkly.config.js` configuration file * A `playwright.config.ts` or `playwright.config.js` ## Usage Copy supported Playwright configuration settings to your Checkly config automatically. ```bash Terminal theme={null} npx checkly sync-playwright ``` ## Supported Playwright Configuration The `sync-playwright` command parses your existing `playwright.config` file and extracts `global`, `use` and `expect` settings. ```ts playwright.config.ts theme={null} export default defineConfig({ // Global Playwright config (global) timeout: 10_000, // Settings applied to all tests (use) use: { trace: 'on-first-retry', colorScheme: 'light', viewport: { width: 1280, height: 720 }, actionTimeout: 30000, navigationTimeout: 30000, }, // Custom assertion settings (expect) expect: { timeout: 5000, }, }); ``` The following Playwright config values are supported and will be synced: | Option | Supported | | ---------------- | --------- | | `timeout` | ✅ | | `use` | ✅ | | `expect` | ✅ | | `testDir` | ❌ | | `fullyParallel` | ❌ | | `forbidOnly` | ❌ | | `retries` | ❌ | | `workers` | ❌ | | `reporter` | ❌ | | `testMatch` | ❌ | | `testIgnore` | ❌ | | `outputDir` | ❌ | | `globalSetup` | ❌ | | `globalTeardown` | ❌ | | `projects` | ❌ | | `webServer` | ❌ | | Option | Supported | | -------------------- | --------- | | `baseURL` | ✅ | | `colorScheme` | ✅ | | `geolocation` | ✅ | | `locale` | ✅ | | `permissions` | ✅ | | `timezoneId` | ✅ | | `viewport` | ✅ | | `deviceScaleFactor` | ✅ | | `hasTouch ` | ✅ | | `isMobile ` | ✅ | | `javaScriptEnabled ` | ✅ | | `extraHTTPHeaders` | ✅ | | `httpCredentials` | ✅ | | `ignoreHTTPSErrors` | ✅ | | `offline` | ✅ | | `actionTimeout` | ✅ | | `navigationTimeout ` | ✅ | | `testIdAttribute` | ✅ | | `connectOptions` | ✅ | | `contextOptions` | ✅ | | `bypassCSP` | ✅ | | `proxy` | ✅ | | `launchOptions` | ❌ | | `storageState` | ❌ | | `browserName` | ❌ | | `channel` | ❌ | | `headless` | ❌ | | `screenshot` | ❌ | | `trace` | ❌ | | `video` | ❌ | | Option | Supported | | ------------------- | --------- | | `timeout` | ✅ | | `toHaveScreenshot ` | ✅ | | `toMatchSnapshot ` | ✅ | ## Related Commands * [`checkly test`](/docs/cli/checkly-test) - Test with synchronized configuration * [`checkly deploy`](/docs/cli/checkly-deploy) - Deploy with updated settings # checkly test Source: https://www.checklyhq.com/docs/cli/checkly-test Run checks in your project using the Checkly CLI. The `checkly test` command executes all checks in your project on the Checkly cloud infrastructure. This command provides a dry-run capability for testing your monitoring setup before deployment, with support for different environments and configurations. Before using , ensure you have: * An initialized Checkly CLI project * At least one check or resource defined in your project * Valid Checkly account authentication (run `npx checkly login` if needed) * A `checkly.config.ts` or `checkly.config.js` configuration file For additional setup information, see [CLI overview](/docs/cli/overview). ## Basic Usage The basic command runs all checks in your project as a test run without deploying them to your account as monitors. ```bash Terminal theme={null} npx checkly test [arguments] [options] ``` | Option | Required | Description | | ------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------ | | `--config, -c` | - | The Checkly CLI configuration file. If not passed, uses the `checkly.config.ts\|js` file in the current directory. | | `--detach, -d` | - | Keep checks running in the cloud when you stop the CLI with Ctrl+C, instead of cancelling the run. | | `--env, -e` | - | Env vars to be passed to the test run. Can be used multiple times. | | `--env-file` | - | dotenv file path to be passed. For example `--env-file="./.env"` | | `--grep, -g` | - | Only run checks where the check name matches a regular expression. Default: `.*` | | `--list` | - | List all checks but don't run them. | | `--location, -l` | - | The location to run the checks at. | | `--private-location` | - | The private location to run checks at. | | `--[no-]record` | - | Record test session results in Checkly with full logs, traces and videos. Records by default since CLI v8.0.0. | | `--refresh-cache` | - | Force a fresh install of dependencies and update the cached version. | | `--reporter, -r` | - | One or more custom reporters for the test output. Supports comma-separated values and repeated flags. | | `--retries` | - | How many times to retry a failing test run. | | `--tags, -t` | - | Filter the checks to be run using a comma separated list of tags. | | `--test-session-name, -n` | - | A name to use when recording results in Checkly. | | `--timeout` | - | A timeout (in seconds) to wait for checks to complete. | | `--update-snapshots, -u` | - | Update any snapshots using the actual result of this test run. | | `--verbose, -v` | - | Always show the full logs of the checks. | | `--[no-]verify-runtime-dependencies` | - | Return an error if checks import dependencies that are not supported by the selected runtime. | ## Command Options The Checkly CLI configuration file. If not passed, uses the `checkly.config.ts|js` file in the current directory. **Usage:** ```bash Terminal theme={null} npx checkly test --config="./checkly.staging.config.ts" npx checkly test -c="./checkly.staging.config.ts" ``` By default, pressing Ctrl+C during a recorded run cancels the test session. With `--detach`, Ctrl+C exits the CLI immediately instead, leaving the checks running in the cloud. **Usage:** ```bash Terminal theme={null} npx checkly test --detach ``` [Environment variables](/docs/cli/environment-variables) to be passed to the test run. Can be used multiple times. **Usage:** ```bash Terminal theme={null} npx checkly test --env KEY=value npx checkly test -e KEY=value ``` **Examples:** ```bash Terminal theme={null} # Single environment variable npx checkly test --env "API_KEY=123456" # Multiple environment variables npx checkly test --env "API_KEY=123456" --env "BASE_URL=https://api.example.com" ``` Path to a dotenv file containing environment variables. **Usage:** ```bash Terminal theme={null} npx checkly test --env-file="./.env" npx checkly test --env-file="./config/.env.production" ``` Only run checks where the check name matches a regular expression. Default: `.*` **Usage:** ```bash Terminal theme={null} npx checkly test --grep="api-.*" npx checkly test -g="^production-.*" ``` The location to run the checks at. **Usage:** ```bash Terminal theme={null} npx checkly test --location="us-east-1" npx checkly test -l="eu-west-1" ``` The private location to run checks at. **Usage:** ```bash Terminal theme={null} npx checkly test --private-location="my-private-location" ``` **Examples:** ```bash Terminal theme={null} # Use private location npx checkly test --private-location="datacenter-1" # Combine with tags npx checkly test --private-location="office-network" --tags="internal" # With custom config npx checkly test --private-location="office-network" --config="./checkly.office.config.ts" ``` Filter the checks to be run using a comma separated list of tags. Checks will only be run if they contain all of the specified tags. Multiple `--tags` flags can be passed, in which case checks will be run if they match any of the `--tags` filters. **Usage:** ```bash Terminal theme={null} npx checkly test --tags="tag1,tag2" npx checkly test -t="tag1,tag2" ``` **Examples:** ```bash Terminal theme={null} # Single tag npx checkly test --tags="production" # Multiple tags (AND condition) npx checkly test --tags="production,webapp" # Multiple tag groups (OR condition) npx checkly test --tags="critical,api" --tags="critical,ui" # Runs checks with (critical AND api) OR (critical AND ui) ``` List all checks to be run but don't run them. **Usage:** ```bash Terminal theme={null} # List checks npx checkly test --list # List checks with `api-` in the name npx checkly test --list --grep="api-.*" # List checks with the `production` tag npx checkly test --list --tags="production" ``` One or more custom reporters for the test output. Options: `list`, `dot`, `ci`, `github`, `json`. You can combine multiple reporters by passing multiple `--reporter` flags or using a comma-separated list. When no `--reporter` flag is provided, the CLI falls back to the `cli.reporters` array in `checkly.config.ts`, then defaults to `list` (or `ci` in CI environments). **Usage:** ```bash Terminal theme={null} npx checkly test --reporter=list npx checkly test -r=list ``` **Examples:** ```bash Terminal theme={null} # List reporter (default) npx checkly test --reporter list # Dot reporter for minimal output npx checkly test --reporter dot # CI-optimized reporter npx checkly test --reporter ci # GitHub Actions reporter npx checkly test --reporter github # JSON output for programmatic use npx checkly test --reporter json > results.json # Multiple reporters using comma-separated values npx checkly test --reporter list,json # Multiple reporters using repeated flags npx checkly test --reporter list --reporter json # Short form with multiple reporters npx checkly test -r github -r json ``` Record test results in Checkly as [a test session](/docs/detect/testing/overview) with full logs, traces and videos. Recording is enabled by default; use `--no-record` to disable it. Recording defaults to enabled since CLI v8.0.0. In earlier versions, recording was opt-in via `--record`. **Usage:** ```bash Terminal theme={null} npx checkly test npx checkly test --no-record npx checkly test --test-session-name="CI Build #123" ``` Force a fresh install of dependencies and update the cached version. Use this when you've changed your project's dependencies and need Checkly to pick up the latest versions instead of using the cache from a previous run. **Usage:** ```bash Terminal theme={null} npx checkly test --refresh-cache ``` How many times to retry a failing test run. Default: 0, max: 3 **Usage:** ```bash Terminal theme={null} npx checkly test --retries=2 ``` **Examples:** ```bash Terminal theme={null} # No retries (default) npx checkly test --retries 0 # Retry twice on failure npx checkly test --retries 2 # Maximum retries npx checkly test --retries 3 ``` A name to use when recording results in Checkly. **Usage:** ```bash Terminal theme={null} npx checkly test --test-session-name="Release v1.2.3" npx checkly test -n="Nightly Test Run" ``` A timeout (in seconds) to wait for checks to complete. **Usage:** ```bash Terminal theme={null} npx checkly test --timeout=300 ``` Update any snapshots using the actual result of this test run. **Usage:** ```bash Terminal theme={null} npx checkly test --update-snapshots npx checkly test -u ``` Snapshots are essential for [visual regression testing in Browser Checks](/docs/detect/synthetic-monitoring/browser-checks/visual-regressions). Always show the full logs of the checks. **Usage:** ```bash Terminal theme={null} npx checkly test --verbose npx checkly test -v ``` Return an error if checks import dependencies that are not supported by the selected runtime. Default: true **Usage:** ```bash Terminal theme={null} npx checkly test --verify-runtime-dependencies npx checkly test --no-verify-runtime-dependencies ``` Runtime-dependent checks run in a specific runtime with a pre-defined set of dependencies. If you're using private locations and want to provide your own dependencies, disable the built-in dependency validation. You can provide custom dependencies in [Playwright Check Suites](/docs/detect/synthetic-monitoring/playwright-checks/overview) because they don't rely on a specific runtime. ## Examples Dry run all your project checks and monitors: ```bash Terminal theme={null} npx checkly test ``` Dry run checks that have `product` and `api` in the file name: ```bash Terminal theme={null} npx checkly test product api ``` Run a test session in Checkly with git branch info, full logging, videos and traces: ```bash Terminal theme={null} npx checkly test ``` Dry run all checks against a specific location: ```bash Terminal theme={null} npx checkly test --location eu-west-1 ``` Specify [environment variables](/docs/cli/environment-variables) to dry run checks with a specific URL and a password. These variables are available on `process.env`: ```bash Terminal theme={null} npx checkly test --env ENVIRONMENT_URL="https://preview.acme.com" --env PASSWORD=doremiabc123 ``` ## Cancelling a run Available in CLI v8.0.0+. `checkly test` records a test session by default, so pressing Ctrl+C cancels it. Cancellation applies only to Playwright Check Suite runs inside the session; other check types finish normally. Runs started with `--no-record` cannot be cancelled. The CLI keeps running after the first Ctrl+C to report the cancelled results. Press Ctrl+C again to exit immediately without waiting. Pass the `--detach` flag to keep the checks running in the cloud instead — Ctrl+C then exits the CLI immediately without cancelling. See [Cancellation](/docs/concepts/cancellation) for the full flow. ## Related Commands * [`checkly pw-test`](/docs/cli/checkly-pw-test) - Run Playwright tests in the Checkly cloud * [`checkly trigger`](/docs/cli/checkly-trigger) - Run deployed checks on-demand * [`checkly deploy`](/docs/cli/checkly-deploy) - Deploy your application # checkly test-sessions Source: https://www.checklyhq.com/docs/cli/checkly-test-sessions Inspect recorded test sessions and their error groups. Available since CLI v8.4.0. The `checkly test-sessions` command lets you inspect recorded [test sessions](/docs/detect/testing/overview/) from the terminal. Use it to list recent sessions, review a session, wait for a running session to finish, or inspect a test session error group before starting root cause analysis. Before using `checkly test-sessions`, ensure you have: * Checkly CLI installed * Valid Checkly account authentication (run `npx checkly login` if needed) * A recorded test session ID For additional setup information, see [CLI overview](/docs/cli/overview). ## Usage ```bash Terminal theme={null} npx checkly test-sessions [arguments] [options] ``` ## Subcommands | Subcommand | Description | | ---------- | --------------------------------------- | | `list` | List recorded test sessions. | | `get` | Get details of a recorded test session. | ## `checkly test-sessions list` The `checkly test-sessions list` command is only available since CLI v8.5.0. List recorded test sessions for the currently selected account. Use filters to narrow by status, branch, user, or provider, and cursor pagination to page through results. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions list [options] ``` **Options:** | Option | Required | Description | | --------------- | -------- | ------------------------------------------------------------------------------------------------------------ | | `--limit, -l` | - | Number of test sessions to return (1-100). Default: `20`. | | `--cursor` | - | Cursor for the next page (from previous output). | | `--from` | - | Only include test sessions created at or after this ISO date or Unix timestamp. | | `--to` | - | Only include test sessions created before this ISO date or Unix timestamp. | | `--status` | - | Filter by status: `running`, `failed`, `passed`, or `cancelled`. Can be specified multiple times. | | `--branch` | - | Filter by Git branch name. Can be specified multiple times. | | `--user` | - | Filter by commit owner or invoking user ID. Can be specified multiple times. | | `--no-users` | - | Include sessions with no commit owner and no invoking user. | | `--provider` | - | Filter by provider: `github`, `vercel`, `api`, `trigger`, or `pw_reporter`. Can be specified multiple times. | | `--search, -s` | - | Search test session text fields (3-200 characters). | | `--error-group` | - | Filter by test-session error group ID. | | `--output, -o` | - | Output format: `table`, `json`, or `md`. Default: `table`. | ### List Options Number of test sessions to return, between 1 and 100. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions list --limit=50 npx checkly test-sessions list -l 10 ``` Cursor for paginating through results. Use the cursor value from the previous output, or the next-page command shown in table output. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions list --limit=20 --cursor= ``` Only include test sessions created at or after this point in time. Accepts an ISO date (such as `2026-06-01`) or a Unix timestamp in seconds. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions list --from=2026-06-01 ``` Only include test sessions created before this point in time. Accepts an ISO date or a Unix timestamp in seconds. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions list --from=2026-06-01 --to=2026-06-15 ``` Filter sessions by status. Available values: `running`, `failed`, `passed`, `cancelled`. Specify multiple times to match more than one status. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions list --status=failed npx checkly test-sessions list --status=failed --status=running ``` Filter sessions by Git branch name. Specify multiple times to match more than one branch. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions list --branch=main npx checkly test-sessions list --branch=main --branch=staging ``` Filter sessions by commit owner or invoking user ID. Specify multiple times to match more than one user. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions list --user= ``` Include sessions that have no commit owner and no invoking user. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions list --no-users ``` Filter sessions by the provider that triggered them. Available values: `github`, `vercel`, `api`, `trigger`, `pw_reporter`. Specify multiple times to match more than one provider. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions list --provider=github npx checkly test-sessions list --provider=trigger --provider=api ``` Search test session text fields. The query must be between 3 and 200 characters. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions list --search="checkout flow" npx checkly test-sessions list -s "homepage" ``` Filter sessions by a test-session error group ID. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions list --error-group= ``` Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions list --output=json npx checkly test-sessions list -o md ``` ### List Examples ```bash Terminal theme={null} # List recent test sessions npx checkly test-sessions list # Show only failed sessions npx checkly test-sessions list --status=failed # Filter by branch and provider npx checkly test-sessions list --branch=main --provider=github # Filter by a time range npx checkly test-sessions list --from=2026-06-01 --to=2026-06-15 # Get results as JSON npx checkly test-sessions list --output=json # Page through results npx checkly test-sessions list --limit=20 --cursor= ``` ## `checkly test-sessions get` Get details of a recorded test session, including result error groups for RCA. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions get [options] ``` **Arguments:** | Argument | Description | | -------- | --------------------------------------- | | `id` | The ID of the test session to retrieve. | **Options:** | Option | Required | Description | | ---------------------- | -------- | ----------------------------------------------------------------------- | | `--result, -r` | - | Show details for a specific test session result ID. | | `--error-group` | - | Show details for a test session error group ID from this session. | | `--error-groups-limit` | - | Number of error group IDs to show in the session summary. Default: `5`. | | `--full-error` | - | Print the complete raw error when showing a test session error group. | | `--watch, -w` | - | Watch a running test session until it completes before rendering. | | `--output, -o` | - | Output format: `detail`, `json`, or `md`. Default: `detail`. | ### Get Options Available in CLI v8.7.0+. Drill into a specific test session result by its result ID. Shows detailed information for that result, including logs and timing data. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions get --result= npx checkly test-sessions get -r ``` Show details for a test session error group from the selected session. Use this after the session summary shows one or more error group IDs. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions get --error-group= ``` Set how many error group IDs to show in the session summary. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions get --error-groups-limit=10 ``` Print the complete raw error when you inspect a test session error group. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions get --error-group= --full-error ``` Available in CLI v8.5.0+. Watch a running test session until it reaches a final state before rendering the result. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions get --watch npx checkly test-sessions get -w ``` Set the output format. Use `json` for programmatic access or `md` for markdown. **Usage:** ```bash Terminal theme={null} npx checkly test-sessions get --output=json npx checkly test-sessions get -o md ``` ### Get Examples ```bash Terminal theme={null} # View a recorded test session npx checkly test-sessions get # Wait for a running test session to complete npx checkly test-sessions get --watch # Drill into a specific result npx checkly test-sessions get --result= # Inspect a test session error group npx checkly test-sessions get --error-group= # Get the session as JSON npx checkly test-sessions get --output=json ``` ## Related Commands * [`checkly trigger`](/docs/cli/checkly-trigger) - Trigger deployed checks as a test session * [`checkly test`](/docs/cli/checkly-test) - Test local checks as a test session * [`checkly rca`](/docs/cli/checkly-rca) - Trigger root cause analysis for error groups * [`checkly assets`](/docs/cli/checkly-assets) - List and download result assets from a test session # checkly trigger Source: https://www.checklyhq.com/docs/cli/checkly-trigger Trigger checks already in your Checkly account. The `checkly trigger` command executes checks that are already deployed in your Checkly account as [a test session](/docs/detect/testing/overview/). Unlike the `test` command, `trigger` works with any checks in your account regardless of how they were created - via CLI constructs, the web UI, or Terraform. Before using , ensure you have: * An initialized Checkly CLI project * At least one check or resource defined in your project * Valid Checkly account authentication (run `npx checkly login` if needed) * A `checkly.config.ts` or `checkly.config.js` configuration file For additional setup information, see [CLI overview](/docs/cli/overview). ## Usage The basic command triggers all checks in your account that are already deployed. ```bash Terminal theme={null} npx checkly trigger [options] ``` | Option | Required | Description | | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------ | | `--config, -c` | - | The Checkly CLI configuration file. If not passed, uses the `checkly.config.ts\|js` file in the current directory. | | `--check-id` | - | Trigger specific checks by ID. Supports comma-separated values and repeated flags. | | `--detach, -d` | - | Keep checks running in the cloud when you stop the CLI with Ctrl+C, instead of cancelling the run. | | `--env, -e` | - | Env vars to be passed to the check run. Default: empty. Multiple values can be passed. | | `--env-file` | - | dotenv file path to be passed. For example `--env-file="./.env"` | | `--fail-on-no-matching` | - | Exit with a failing status code when there are no matching tests. | | `--location, -l` | - | The location to run the checks at. | | `--private-location` | - | The private location to run checks at. | | `--[no-]record` | - | Record test session results in Checkly with full logs, traces and videos. Records by default since CLI v8.0.0. | | `--refresh-cache` | - | Force a fresh install of dependencies and update the cached version. | | `--reporter, -r` | - | One or more custom reporters for the test output. Supports comma-separated values and repeated flags. | | `--retries` | - | How many times to retry a check run. | | `--tags, -t` | - | Filter the checks to be run using a comma separated list of tags. | | `--test-session-name, -n` | - | A name to use when recording results in Checkly. | | `--timeout` | - | A timeout (in seconds) to wait for checks to complete. | | `--verbose, -v` | - | Always show the full logs of the checks. | ## Command Options Specify a configuration file to use instead of the `checkly.config.ts` or `checkly.config.js` in the current directory. **Usage:** ```bash Terminal theme={null} npx checkly trigger --config checkly.config.ts npx checkly trigger -c="./checkly.staging.config.ts" ``` Available since CLI v8.4.0. Trigger specific checks by ID. You can pass a comma-separated list or repeat the flag. Combine `--check-id` with `--tags` to further filter the matching checks. **Usage:** ```bash Terminal theme={null} npx checkly trigger --check-id= npx checkly trigger --check-id=, npx checkly trigger --check-id= --check-id= ``` By default, pressing Ctrl+C during a recorded run cancels the test session. With `--detach`, Ctrl+C exits the CLI immediately instead, leaving the checks running in the cloud. **Usage:** ```bash Terminal theme={null} npx checkly trigger --detach ``` [Environment variables](/docs/cli/environment-variables) to be passed to the check run. Multiple values can be passed and passed variables overwrite any existing variables stored in your Checkly account. **Usage:** ```bash Terminal theme={null} npx checkly trigger --env KEY=value npx checkly trigger -e KEY=value ``` **Examples:** ```bash Terminal theme={null} # Single environment variable npx checkly trigger --env ENVIRONMENT_URL="https://staging.acme.com" # Multiple environment variables npx checkly trigger --env API_URL=https://api.example.com --env API_KEY=secret123 ``` Path to a dotenv file containing environment variables. **Usage:** ```bash Terminal theme={null} npx checkly trigger --env-file=".env" npx checkly trigger -e=".env" ``` **Examples:** ```bash Terminal theme={null} # Use default .env file npx checkly trigger --env-file=".env" # Use environment-specific file npx checkly trigger --env-file=".env.production" # Use file from different directory npx checkly trigger --env-file="./config/.env.staging" ``` The dotenv file should contain KEY=value pairs, one per line. The location to run the checks at. **Usage:** ```bash Terminal theme={null} npx checkly trigger --location="us-east-1" npx checkly trigger -l="us-east-1" ``` Choose from available Checkly public locations like us-east-1, eu-west-1, ap-southeast-1, etc. The private location to run checks at. **Usage:** ```bash Terminal theme={null} npx checkly trigger --private-location="my-private-location" ``` **Examples:** ```bash Terminal theme={null} # Use private location npx checkly trigger --private-location="datacenter-1" # Combine with tags npx checkly trigger --private-location="internal-network" --tags="internal" # With custom config npx checkly trigger --private-location"vpc-location" --config="internal.config.js" ``` Private locations must be configured in your Checkly account before use. Filter checks using tags. Checks run if they contain all specified tags in a single --tags flag. Multiple --tags flags create OR conditions. **Usage:** ```bash Terminal theme={null} npx checkly trigger --tags="tag1,tag2" npx checkly trigger -t="tag1,tag2" ``` **Examples:** ```bash Terminal theme={null} # Single tag npx checkly trigger --tags="production" # Multiple tags (AND condition) npx checkly trigger --tags="production,webapp" # Multiple tag groups (OR condition) npx checkly trigger --tags="production,webapp" --tags="production,backend" # Runs checks with (production AND webapp) OR (production AND backend) ``` Tags are comma-separated within a single flag for AND logic, multiple flags for OR logic. A name to use when recording results in Checkly. **Usage:** ```bash Terminal theme={null} npx checkly trigger --test-session-name="Custom session name" ``` One or more custom reporters for the test output. Options: `list`, `dot`, `ci`, `github`, `json`. You can combine multiple reporters by passing multiple `--reporter` flags or using a comma-separated list. **Usage:** ```bash Terminal theme={null} npx checkly trigger --reporter list npx checkly trigger -r list ``` **Examples:** ```bash Terminal theme={null} # List reporter (default) npx checkly trigger --reporter list # Dot reporter for minimal output npx checkly trigger --reporter dot # CI-optimized reporter npx checkly trigger --reporter ci # GitHub Actions reporter npx checkly trigger --reporter github # JSON output for programmatic use npx checkly trigger --reporter json > results.json # Multiple reporters using comma-separated values npx checkly trigger --reporter list,json # Multiple reporters using repeated flags npx checkly trigger --reporter list --reporter json # Short form with multiple reporters npx checkly trigger -r github -r json ``` Always show the full logs of the checks. **Usage:** ```bash Terminal theme={null} npx checkly trigger --verbose npx checkly trigger -v ``` Exit with a failing status code when there are no matching tests. **Usage:** ```bash Terminal theme={null} npx checkly trigger --fail-on-no-matching npx checkly trigger --no-fail-on-no-matching ``` **Examples:** ```bash Terminal theme={null} # Default behavior (enabled) npx checkly trigger --tags non-existent-tag # Exits with error if no checks match # Disable the behavior npx checkly trigger --no-fail-on-no-matching --tags optional-tag # Exits successfully even if no checks match ``` Enabled by default. Use `--no-fail-on-no-matching` to allow zero matches without failure. Record check results in Checkly as a test session with full logs, traces and videos. Recording is enabled by default; use `--no-record` to disable it. Recording defaults to enabled since CLI v8.0.0. In earlier versions, recording was opt-in via `--record`. **Usage:** ```bash Terminal theme={null} npx checkly trigger npx checkly trigger --no-record ``` **Examples:** ```bash Terminal theme={null} # Run with a custom session name npx checkly trigger --test-session-name "Deploy validation" # Run specific checks npx checkly trigger --tags critical # Run selected checks by ID npx checkly trigger --check-id= # Run without recording npx checkly trigger --no-record ``` Records provide full visibility including logs, traces, and videos for debugging failed checks. Force a fresh install of dependencies and update the cached version. Use this when you've changed your project's dependencies and need Checkly to pick up the latest versions instead of using the cache from a previous run. **Usage:** ```bash Terminal theme={null} npx checkly trigger --refresh-cache ``` How many times to retry a failed check run. **Usage:** ```bash Terminal theme={null} npx checkly trigger --retries="2" ``` **Examples:** ```bash Terminal theme={null} # No retries (default) npx checkly trigger --retries 0 # Retry twice on failure npx checkly trigger --retries 2 # Maximum retries npx checkly trigger --retries 3 ``` Default: 0, Maximum: 3. Useful for handling transient failures. Timeout in seconds to wait for checks to complete. **Usage:** ```bash Terminal theme={null} npx checkly trigger --timeout 300 ``` **Examples:** ```bash Terminal theme={null} # Quick timeout for fast checks npx checkly trigger --timeout 60 # Default timeout npx checkly trigger --timeout 600 # Extended timeout for slow checks npx checkly trigger --timeout 1200 ``` Default: 600 seconds (10 minutes). Adjust based on your longest-running checks. ## Key Differences from `checkly test` `npx checkly test` and `npx checkly trigger` serve different purposes in the Checkly ecosystem. Here's a comparison of their key features: | Feature | `checkly test` | `checkly trigger` | | ------------------ | ------------------------ | -------------------------- | | **Source** | Local project files | Deployed checks in account | | **File patterns** | Supports file matching | Not applicable | | **Check creation** | Can run checks from code | Uses existing checks only | | **Snapshots** | Can update snapshots | Cannot update snapshots | | **Dependencies** | Requires local project | Works independently | ## Use Cases ### Pre-deployment Validation Run your deployed checks before promoting code to production: ```bash Terminal theme={null} npx checkly trigger --tags staging --test-session-name "Pre-prod validation" ``` If your production deployment includes monitoring changes and updates, [use `npx checkly test`](/docs/cli/checkly-test) to validate your preview environment with the updated monitoring configuration. ## Cancelling a run Available in CLI v8.0.0+. `checkly trigger` records a test session by default, so pressing Ctrl+C cancels it. Cancellation applies only to Playwright Check Suite runs inside the session; other check types finish normally. Runs started with `--no-record` cannot be cancelled. The CLI keeps running after the first Ctrl+C to report the cancelled results. Press Ctrl+C again to exit immediately without waiting. Pass the `--detach` flag to keep the checks running in the cloud instead — Ctrl+C then exits the CLI immediately without cancelling. See [Cancellation](/docs/concepts/cancellation) for the full flow. ## Related Commands * [`checkly deploy`](/docs/cli/checkly-deploy) - Deploy your Checkly configuration * [`checkly test`](/docs/cli/checkly-test) - Test your setup before deployment # checkly whoami Source: https://www.checklyhq.com/docs/cli/checkly-whoami Display current account and user information. The `checkly whoami` command displays detailed information about your current Checkly authentication, including the logged-in user account and active Checkly account details. This command can also be run without authentication to check your current status. ## Usage The basic command shows current authentication status and account information. ```bash Terminal theme={null} npx checkly whoami ``` ### Authenticated If you're logged in, you'll see: ```bash Terminal theme={null} npx checkly whoami You are currently on account "Monitoring as Code" (b2f...) as raccoon@checklyhq.com. ``` ### Not Authenticated If not logged in, you'll see: ```bash Terminal theme={null} npx checkly whoami Error: Run `npx checkly login` or manually set `CHECKLY_API_KEY` & `CHECKLY_ACCOUNT_ID` environment variables to setup authentication. ``` ## Related Commands * [`checkly login`](/docs/cli/checkly-login) - Sign in to your Checkly account * [`checkly logout`](/docs/cli/checkly-logout) - Sign out of your Checkly account * [`checkly switch`](/docs/cli/checkly-switch) - Switch between multiple accounts # CLI vs. Terraform & Pulumi Source: https://www.checklyhq.com/docs/cli/cli-vs-terraform-pulumi Comparing your options for Monitoring as Code Creating, debugging and managing E2E and synthetic monitoring at scale is best done "as code". Currently, Checkly supports three tools you can use for your **monitoring as code** (MaC) workflow: 1. The Checkly CLI. 2. Terraform (through our [Terraform provider](/docs/integrations/iac/terraform/overview/)) 3. Pulumi (through our [Pulumi provider](/docs/integrations/iac/pulumi/overview/)) In most cases, the choice depends on what your goals are and how your organization is set up. We believe the **Checkly CLI delivers the best-of-breed workflow**. However, there are always trade-offs. Let's list some pros and cons based on our own experience and user feedback. ## Terraform vs. Checkly CLI If you are a Terraform shop, you can use Checkly to its full capacity. The Checkly CLI adds core capabilities like TS/JS coding, simple Git integration and test execution. **Pros** `+` Terraform integrates very well with Checkly. We have a well maintained Terraform provider. `+` Terraform is comfortable for many Devops engineers used to writing HCL scripts. `+` Checkly can be configured almost completely through Terraform resources. **Cons** `-` Terraform does not allow you to test checks or use TS/JS programming. `-` Terraform and its HCL syntax is hard to learn for many app developers. `-` Using Terraform with Git is non-trivial. ## Pulumi vs. Checkly CLI **Pros** `+` Pulumi integrates well with Checkly. We have a maintained Pulumi provider. `+` Pulumi is comfortable with app developers across many languages. `+` Checkly can be configured almost completely through Pulumi resources. **Cons** `-` Pulumi does not really work without signing up for a Pulumi account. `-` Pulumi does not allow you to run and debug checks from your local dev environment. `-` Pulumi is not optimized for testing and monitoring use cases. # Using npm packages and local dependencies Source: https://www.checklyhq.com/docs/cli/dependencies Use npm packages and local JavaScript or TypeScript files in your checks, and see how dependencies differ between Checkly runtimes and Playwright Check Suites. Checkly lets you use JavaScript and TypeScript in your [Browser](/docs/detect/synthetic-monitoring/browser-checks/overview) and [Multistep](/docs/detect/synthetic-monitoring/multistep-checks/overview) checks, [API check setup and teardown scripts](/docs/detect/synthetic-monitoring/api-checks/setup-and-teardown), and [Playwright Check Suites](/docs/detect/synthetic-monitoring/playwright-checks/overview). Checks can use npm packages and import local JavaScript and TypeScript files. How dependencies work depends on the check type: | Check type | Dependency model | Environment field | | ----------------------------------- | ----------------------------------------------------------------------------------------- | ----------------- | | Browser Checks and Multistep Checks | Run in a Checkly runtime with fixed Checkly-provided dependencies | `runtimeId` | | Playwright Check Suites | Install dependencies from your project files, including `package.json` and your lock file | `engine` | Use `runtimeId` to choose a custom Checkly runtime for Browser Checks and Multistep Checks. Use `engine` only for Playwright Check Suites, where it overrides the JavaScript engine version that runs your own Playwright project. ## npm packages ### Browser, Multistep, and API Checks Not all npm packages are available in a Checkly runtime. The JavaScript code for these check types executes in a runtime environment managed by Checkly. Runtime versions can be selected by setting a `runtimeId`. You can configure `runtimeId` at the check and group level using constructs, and set a project default in the [project configuration file](/docs/constructs/project#param-checks-runtime-id). A runtime includes fixed dependencies such as: * Node.js 22+ * `@playwright/test 1.51.1` * `axios 0.28.0` * `lodash 4.17.21` * `moment 2.30.1` Runtimes also include other popular npm packages to help you write and assert checks. * [Browse the latest runtime specs](/docs/platform/runtimes/runtime-specification) * [Learn more about runtimes](/docs/platform/runtimes/overview) * [Why can't I import any npm package or other third-party dependencies?](/docs/platform/runtimes/overview) ### Playwright Check Suites Playwright Check Suites do not use Checkly runtimes. Instead, Checkly installs your project's dependencies from your `package.json` and lock file. This lets you use [custom dependencies](/docs/detect/synthetic-monitoring/playwright-checks/custom-dependencies/), including private packages or packages from a custom registry. Use the `engine` field to override the JavaScript engine version for a Playwright Check Suite. `engine` does not select a Checkly runtime or a fixed package set. ## Local Dependencies Your checks can also import other JavaScript and TypeScript files as dependencies. This is useful for defining helper functions to be reused across multiple checks. The Checkly CLI automatically detects these dependencies and bundles them with the check. No additional configuration is needed. Here is a [Browser Check](/docs/detect/synthetic-monitoring/browser-checks/overview) example of how this works in practice. The directory tree looks like the following: ``` __checks__ ├── login.check.ts ├── login.spec.ts └── login-helper.ts ``` `login-helper.ts` defines a function `gitHubLogin` that can be used by multiple Browser Checks. ```ts login-helper.ts theme={null} export async function gitHubLogin (page, username, password) { await page.goto('https://github.com/login') await page.getByLabel('Username or email address').type(username) await page.getByLabel('Password').type(password) await page.getByRole('button', { name: 'Sign in' }) } ``` In `login.spec.ts` we define the actual Playwright test. This file can import the `gitHubLogin` function from `login-helper.ts`. It also reads the username and password from [remote environment variables](/docs/cli/environment-variables#remote-environment-variables). ```ts login.spec.ts theme={null} // @ts-ignore import { test } from '@playwright/test' import { gitHubLogin } from './login-helper' test('Github login', async ({ page }) => { await gitHubLogin(page, process.env.GITHUB_USER, process.env.GITHUB_PWD) // your normal check code await page.click('.header-search-input') }) ``` `login.check.ts` initializes a new [BrowserCheck construct](/docs/constructs/browser-check). Note that it's only necessary to configure the main Playwright file `login.spec.ts`. The `login-helper.ts` dependency is automatically detected by the CLI. ```ts login.check.ts theme={null} import { BrowserCheck } from 'checkly/constructs' new BrowserCheck('login-check', { name: 'Login Check', code: { entrypoint: './login.spec.ts' } }) ``` After running [`npx checkly deploy`](/docs/cli/checkly-deploy), you can see in the Web UI that the helper file `login-helper.ts` was also uploaded for this Check. login check with helper file in dependencies The maximum total size of a Checkly project when deploying or running a test session, including local dependencies, is 40 MB. # Environment Variables Source: https://www.checklyhq.com/docs/cli/environment-variables Learn how to use environment variables in your Checkly project There are two types of environment variables (env vars) in the Checkly CLI context. * Local environment variables. * Remote environment variables. To get a quick overview of when to use which, checkout this video 👇 ## Local Environment Variables Local environment variables exist on your local machine, your CI environment, or anywhere you run the Checkly CLI. They normally are part of your shell session or stored in a `.env` file in your app's Git repo. Here is what you need to remember: 1. Use local environment variables to replace values in your constructs before `test` and `deploy` invocations. 2. Local environment variables are not interpreted in code dependencies like `.spec.ts` files or setup and teardown scripts. Use local environment variables to inject or replace values in your `Check`, `AlertChannel` or other constructs at **build time** when the CLI compiles your constructs for testing and deploying. Here is an example of setting up an `SmsAlertChannel` where we pass in the actual phone number from a local environment variable. Note the exclamation mark `!` at the end. This is to tell the Typescript compiler the value will be set. Alternatively you can use a string template. ```ts Alert-Channel.check.ts theme={null} import { SmsAlertChannel } from 'checkly/constructs' export const smsChannel = new SmsAlertChannel('sms-channel-1', { phoneNumber: process.env.PHONE_NUMBER! // phoneNumber: `${process.env.PHONE_NUMBER}` this also works }) ``` When you execute `test` or `deploy` the variable needs to part of the parent process `env` object. This is typically done by just prepending the variable to the command. ``` PHONE_NUMBER=0987654321 npx checkly deploy ``` The above command will replace `process.env.PHONE_NUMBER` with the actual `PHONE_NUMBER` you prepended and then create that SMS channel in your Checkly account. ## Remote Environment Variables Checkly also stores environment variables in your Checkly account. These can exist at [the Global, Group or Check level](/docs/platform/variables). Here is what you need to remember: 1. Use remote environment variables to dynamically inject or replace values during runtime of a check. 2. Remote variables can be set and overridden when invoking the `test` command. You will typically use remote environment variables inside the code dependencies you write, e.g. Playwright tests, setup and teardown scripts. The point is that the `process.env.SOME_VARIABLE` stays in your code and are only interpreted when a check executes on the Checkly cloud. ### Using the `-e` flag Values passed to `checkly test` with `--env` or `--env-file` apply only to that test session. They do not update variables used by scheduled monitors. To continuously monitor more than one long-lived environment, deploy a separate CLI project for each environment and define its runtime values at the check or group level. See [Monitor multiple environments](/docs/concepts/environments). Here is an example of a Playwright script using an `ENVIRONMENT_URL` variable to define the page to visit. We also added a fallback value in case that variable is not defined for some reason. ```ts home.check.ts theme={null} import { test } from '@playwright/test' test('Check Home Page', async ({ page }) => { const response = await page.goto(process.env.ENVIRONMENT_URL! || 'https://wwww.checklyhq.com') await page.screenshot({ path: 'home.jpg' }) }) ``` Here is an example of a Checkly [ApiCheck construct](/docs/constructs/api-check) using an `ENVIRONMENT_URL` variable to define the page to visit. Notice the `{{ENVIRONMENT_URL}}` is wrapped in double handlebars and must be written this way for a remote environment variable to be parsed within an ApiCheck construct. ```ts api.check.ts theme={null} import * as path from 'path' import { ApiCheck, AssertionBuilder } from 'checkly/constructs' import { websiteGroup } from './website-group.check' new ApiCheck('books-api-check-1', { name: 'Books API', group: websiteGroup, degradedResponseTime: 10000, maxResponseTime: 20000, setupScript: { entrypoint: path.join(__dirname, './utils/setup.ts'), }, request: { url: '{{ENVIRONMENT_URL}}', method: 'GET', followRedirects: true, skipSSL: false, assertions: [AssertionBuilder.statusCode().equals(200)], }, runParallel: true, }) ``` You can now test this check and temporarily set the environment variable as follows. ```bash Terminal theme={null} npx checkly test -e ENVIRONMENT_URL="https://staging.checklyhq.com" ``` * Notice that we pass in the variable using the `-e` flag. This means it will be passed to the cloud environment and made available during runtime. * After deploying this check, the `ENVIRONMENT_URL` needs to be set at the Account, Group or Check level. Handlebars variables have no fallback, so the check will not work until the variable is set. Only script code, like the Playwright example above, can provide a fallback value. * Prepending the variable like `ENVIRONMENT_URL="https://staging.checklyhq.com" npx checkly test` has no effect as local environment variables are not replaced in code dependencies. ### Using the `--env-file` flag If you have a lot of variables, it makes sense to store them in a `.env` file. Make sure to add that to your `.gitignore` file! ```bash Terminal theme={null} ENVIRONMENT_URL=https://checklyhq.com USER_NAME=admin PASSWORD=admin ``` You can reference that file in the `test` as follows: ```bash Terminal theme={null} npx checkly test --env-file="./.env" ``` You can also pull in the variables from your account and store them in a file using [the `npx checkly env pull` command](/docs/cli/checkly-env#pull). See the examples below. ### Managing Remote Environment Variables Manage your remote environment variables with the CLI using the [`checkly env` command](/docs/cli/checkly-env). You can list, add, update, remove and export your global variables. List all your stored variables and lock it. ```bash theme={null} npx checkly env ls ``` Create a new variable. ```bash theme={null} npx checkly env add MY_PASSWORD 123test ``` Pull in the variables from your account and store them in a file. ```bash theme={null} npx checkly env pull .env.prod ``` Reference that file in your `test` command. [See the full reference documentation for the `checkly env` command](/docs/cli/checkly-env). ## Securing Environment Variables For storing and securing environment variables, we advise the following: 1. Store local environment variables in your shell or in `.env` files that are not committed to your git repo. Add those files to your `.gitignore` file. 2. In a CI context, load sensitive values from your CI secret store or an external secrets manager. For large secret sets, see [Manage secrets at scale](/docs/platform/manage-secrets-at-scale). 3. For remote variables, store sensitive data as secrets in Checkly. For more information on how to manage secrets in Checkly see [variables and secrets](/docs/platform/variables). All variables are stored encrypted at rest and in transfer. # Importing existing Checks into your CLI project Source: https://www.checklyhq.com/docs/cli/importing Learn how to import checks from the UI into the CLI If you got started with Checkly working in the webapp you can use the `import` CLI command to download all your UI-managed resources as code and start managing your entire Checkly setup from the CLI. ## How `import` works When importing an existing resource the CLI will both generate the code neccessary to manage the resource through code, and mark the resource itself as managed by the CLI, and not the UI. This allows you to start editing, and also deleting the resource through the CLI. To ensure that you can go through this process safely, and test your setup along the way the import process is done in three separate steps: Plan, apply and commit. * `npx checkly import`: This generates the code for all resources in your account not already managed through the CLI, allowing for a review of all resources that will be imported. At this point no mapping have been created between imported resources and the existing ones in your account. A `deploy` in this state will duplicate your UI-managed resources as CLI-managed ones. If you cancel here, nothing will change for existing resources that are managed through the UI on your account. * `npx checkly import apply`: Links the imported resources to your CLI project, but keeps the mapping in a **pending** state. You can now make changes to resources in your account via the CLI, as the mapping has been established. As long as this mapping is **pending** you cannot delete any of the imported resources via the CLI. You are free to test your setup and deploy changes, but you will be prevented from deleting any resources until you commit your plan. You can cancel your import at this stage, but any changes made to resources through a `deploy` will persist. * `npx checkly import commit`: Commits the plan, removing the **pending** state from all imported resources. Imported resources can now be deleted through the CLI by removing their constructs. At this point the `import` is completed and cannot be canceled. ## Importing step-by-step [Install the CLI](/docs/cli/overview). At the end of the process ensure you have a `checkly.config.ts/js` file, and that you have logged in to the account you want to import resources from. You can verify the current account with `npx checkly whoami`. If you already have installed the CLI but don't have a Checkly config file, one will be created for you as part of the import process. Run `npx checkly import` and select `import everything` to import all resources from your account. You can also [import individual resources](#importing-individual-resources). You can specify where the generated code should be placed using `--root`. If your Checkly config file is not in the current directory, specify the path using `--config`. Review the imported code before continuing. You can verify imported checks with `npx checkly test`. At this point, avoid running `npx checkly deploy` as this will duplicate your UI-managed resources as CLI-managed ones. Run `npx checkly import apply` to create the link between the imported resources and your CLI project. You can try out editing resources and pushing these updates to your account with `npx checkly deploy`. When you are satisfied with your setup, run `npx checkly import commit` to finalize the import. Remember that you can cancel your import with `npx checkly import cancel` at any point before running `npx checkly import commit`, but changes made to existing resources after the apply-stage will persist after cancelling. ## Importing individual resources There are two ways to import individual resources: * Run `npx checkly import` and in the first step select `Let me choose resources manually`. In the following menu use `space` to select/deselect resources for import and `return` to finalize your selection. From there, follow steps 3 - 5 in the [Importing step-by-step guide](#importing-step-by-step). * Specify a single resource as part of the `import` command with the following syntax: `npx checkly import resource-type:resource-id`. ## Using `export` when creating CLI resources The import process will automatically `export` resouces to make them available in other constructs. It is recommended to also export manually created resources so that future import processes can take advantage of the same process. Here is an example of an exported alert channel: ```ts Alert-Channel.check.ts theme={null} import { EmailAlertChannel } from 'checkly/constructs' // This resource can be accessed by other imported resources. export const emailAlert1 = new EmailAlertChannel('email-example', { address: 'john-doe@acme-company.com', sendDegraded: true, }) ``` Since the channel has been exported, the CLI code generation would automatically add the `import` and refer to it directly in the `alertChannels` section: ```ts Alert-Channel.check.ts theme={null} import { AlertEscalationBuilder, BrowserCheck, RetryStrategyBuilder } from 'checkly/constructs' import { emailAlert1 } from '../../alert-channels/email-example.check' new BrowserCheck('check-landing-page-3eNrQgOb', { name: 'Check landing page', code: { entrypoint: './check-landing-page.spec.ts', }, ... alertChannels: [ // Note the usage of the imported alert channel here emailAlert1, ], ... }) ``` If `export` is not used, the CLI code generation will still reference the correct resources when generating code, but will use `fromId` instead. ## Next steps Once you have a fully CLI managed setup you are ready to leverage Monitoring as Code to improve your setup. Learn how to [dynamically create monitors](/docs/constructs/dynamic-monitor-creation), [add git metadata to Checkly](/docs/cli/attaching-git-metadata), and [integrate Checkly in your CI/CD process](/docs/integrations/ci-cd/overview). # Intallation Source: https://www.checklyhq.com/docs/cli/installation Creating a CLI project from scratch To kickstart a new project with the CLI, we recommend running `npx checkly init`. But you can also add the CLI from scratch with the following steps. ## Prerequisites * Node.js `20.19+` or `22.12+`. * A text editor like [Visual Studio Code](https://code.visualstudio.com/). ## Installation First, install the CLI. ```bash Terminal theme={null} npm i --save-dev checkly ``` Built-in TypeScript support requires Checkly CLI `v8` or later. On earlier versions, also install a TypeScript loader with `npm install --save-dev jiti` (preferred) or `npm install --save-dev ts-node typescript`. Create a minimal `checkly.config.ts` (or `checkly.config.js`) at the root of your project. We recommend using TypeScript. ```ts {title="checkly.config.ts"} theme={null} import { defineConfig } from 'checkly' import { Frequency } from 'checkly/constructs' export default defineConfig({ projectName: 'Website Monitoring', logicalId: 'website-monitoring-1', repoUrl: 'https://github.com/acme/website', checks: { activated: true, muted: false, runtimeId: '2025.04', frequency: Frequency.EVERY_5M, locations: ['us-east-1', 'eu-central-1'], tags: ['website', 'api'], checkMatch: '**/__checks__/**/*.check.ts', ignoreDirectoriesMatch: [], browserChecks: { frequency: Frequency.EVERY_10M, testMatch: '**/__checks__/**/*.spec.ts', }, }, cli: { runLocation: 'eu-central-1', } }) ``` ```js {title="checkly.config.js"} theme={null} const defineConfig = require('checkly') const { Frequency } = require('checkly/constructs') const config = { projectName: 'Website Monitoring', logicalId: 'website-monitoring-1', repoUrl: 'https://github.com/acme/website', checks: { activated: true, muted: false, runtimeId: '2025.04', frequency: Frequency.EVERY_5M, locations: ['us-east-1', 'eu-central-1'], tags: ['website', 'api'], checkMatch: '**/__checks__/**/*.check.js', ignoreDirectoriesMatch: [], browserChecks: { frequency: Frequency.EVERY_10M, testMatch: '**/__checks__/**/*.spec.js', }, }, cli: { runLocation: 'eu-central-1', } } module.exports = config; ``` Use the CLI to [authenticate](/docs/cli/authentication) and pick a Checkly account. Make sure you have [signed up for a free account on checklyhq.com](https://www.checklyhq.com/) before hand or just sign up for a new account straight from the terminal. ```bash Terminal theme={null} npx checkly login ``` ## Direct download If you cannot access the npm registry directly, you can also download the Checkly CLI via our CDN. * [MacOS / Darwin](https://cdn.checklyhq.com/downloads/checkly-cli/4.9.0/darwin/checkly-cli.zip) * [Windows](https://cdn.checklyhq.com/downloads/checkly-cli/4.9.0/windows/checkly-cli.zip) * [Linux](https://cdn.checklyhq.com/downloads/checkly-cli/4.9.0/linux/checkly-cli.tar.gz) The download is a zipped folder containing a full installation of [the boilerplate example project](https://github.com/checkly/checkly-cli/tree/main/examples/boilerplate-project). You will find the following files and folders: * a `checkly.config.ts` file. * a `package.json` file including the necessary Typescript dependencies. * a `node_modules` directory with all dependencies pre-installed. * a `__checks__` folder with some example checks. If you want to move the CLI and its constructs to a different, already existing Node.js project, just copy the full contents of the `node_modules` folder to your project and manually add a `checkly.config.ts` file. ## Using a Proxy Server The CLI respects the common `HTTP_PROXY` environment variable for any outbound traffic, like running `npx checkly test` or `npx checkly deploy`. ```bash Terminal theme={null} HTTP_PROXY=https://proxy-url npx checkly test ``` The CLI communicates with the following domains if you need to allow-list them in your proxy: * `api.checklyhq.com` * `events.checklyhq.com` # Checkly CLI Source: https://www.checklyhq.com/docs/cli/overview Code, test, and deploy synthetic monitoring at scale with the Checkly CLI. The Checkly CLI gives you a JavaScript/TypeScript-native workflow for coding, testing and deploying synthetic monitoring at scale, from your code base. The Checkly CLI comes with **native `@playwright/test` support.** No lock-in, just write standard `*.spec.ts` files. ## Starting your first project Get started by installing the CLI using the following command which will guide you through the required steps to set up a fully working example. ```bash Terminal theme={null} npx checkly init ``` Now, login to your Checkly account or sign up for a new account right from the terminal. ```bash Terminal theme={null} npx checkly login ``` After this, let's dry run the Checks in your new project against the global Checkly infrastructure. ```bash Terminal theme={null} npx checkly test ``` This should report the following output to your terminal ``` Running 4 checks in eu-west-1. src/__checks__/api.check.ts ✔ Books API (222ms) src/__checks__/home.check.ts ✔ Home page (24s) ✔ Login Check (5s) src/__checks__/multi-step-spacex.check.ts ✔ SpaceX MS (4s) 4 passed, 4 total ``` Lastly, you deploy your Checks and related alert channels to Checkly, so we run your checks around the clock. ```bash Terminal theme={null} npx checkly deploy ``` You just created your entire synthetic monitoring setup with API and Playwright-based Browser Checks from your code base! Open up [your Checkly dashboard](https://app.checklyhq.com) and you should see your check, ready to start monitoring around the clock. For a custom installation check out [our installation docs](/docs/cli/installation/). ## Using Agents, AI IDEs and Copilots Checkly is designed to work with Agents, AI IDEs, and Copilots. You can use your preferred provider to generate code for API Checks, Browser Checks and all other constructs. Install Checkly Skills and let AI agents generate Checkly monitoring code for you. Connect desktop or sandboxed agents to live Checkly account data and actions. ## Integrating with CI/CD After kicking the tires, you should delegate the testing and deploying of your checks to your CI/CD pipeline. Check our docs on [setting up the Checkly CLI with your favourite CI/CD platform](/docs/integrations/ci-cd/overview). Run Checkly test sessions from GitHub Actions and report results in pull requests. Run the Checkly CLI from GitLab CI pipelines, using separate e2e-test and deploy jobs. Run the Checkly CLI from a Jenkins pipeline using a Jenkinsfile. # Alert Channels Source: https://www.checklyhq.com/docs/communicate/alerts/channels Configure notification channels to receive alerts when checks fail, degrade, or recover. Choose from email, Slack, webhooks, PagerDuty, SMS, and custom integrations. Alert channels determine **how** alert notifications reach your team when checks fail, degrade, or recover. Checkly supports a wide range of notification methods to fit your team's communication preferences and operational workflows. ## Available Alert Channels ### Communication Platforms * [Email](/docs/integrations/alerts/email) * [Slack](/docs/integrations/alerts/slack) * [Discord](/docs/integrations/alerts/discord) * [Telegram](/docs/integrations/alerts/telegram) * [SMS](/docs/integrations/alerts/sms) * [Phone Call](/docs/integrations/alerts/phone-calls) * [Microsoft Teams](/docs/integrations/alerts/msteams) * [GitLab Alerts](/docs/integrations/alerts/gitlab_alerts) ### Incident Management * [PagerDuty](/docs/integrations/incident-management/pagerduty) * [Opsgenie](/docs/integrations/incident-management/opsgenie) * [FireHydrant](/docs/integrations/incident-management/firehydrant) * [Incident.io](/docs/integrations/incident-management/incidentio) * [Rootly](/docs/integrations/incident-management/rootly) * [ilert](/docs/integrations/incident-management/ilert) * [Splunk On-Call](/docs/integrations/incident-management/splunk-on-call) * [Spike.sh](/docs/integrations/incident-management/spike) * [StatusPage](/docs/integrations/incident-management/statuspage) ### Custom Integrations * [Webhooks](/docs/integrations/alerts/webhooks) ## Managing Alert Channels ### Channel Configuration Overview Configure channels with flexible subscription and filtering options: Alert channels management interface Choose your notification method and provide connection details Select which types of events should trigger notifications Choose which checks and check groups use this channel Verify the channel works correctly with test notifications ## Using variables and secrets in channel configs Any literal-secret field in an alert-channel configuration — webhook URL, API key, bearer token, PagerDuty service key, and so on — accepts a reference to an account [environment variable](/docs/platform/variables) or [secret](/docs/platform/secrets) using `{{NAME}}` syntax. The channel UI also lets you promote an inline value to a secret without leaving the page. **Using environment variables and secrets in this channel's config** Any literal-secret field in this alert channel — webhook URL, API key, bearer token, service key, etc. — accepts a [variable](/docs/platform/variables) or [secret](/docs/platform/secrets) reference using the familiar Handlebars syntax: `{{MY_VARIABLE}}`. You can also promote a value to a secret directly from the field: type the literal value, click the lock icon next to the input, and choose a name. The value is stored as an encrypted account secret and is never re-displayed in the UI. Use Checkly's alert notification log to track delivery success rates and identify any channels that frequently fail to deliver notifications. # Alert Configuration Source: https://www.checklyhq.com/docs/communicate/alerts/configuration Complete guide to configuring alert settings, escalation strategies, retry mechanisms, and threshold alerting in Checkly for optimal incident response. Alert configuration controls **when** and **how often** you receive notifications when checks fail, degrade, or recover. Proper configuration minimizes alert fatigue while ensuring critical issues receive immediate attention. ## Configuration Hierarchy Checkly provides a three-tier configuration system that allows for flexible alert management across your organization: * Applied to all checks unless overridden * Organization-wide defaults * Simplifies management at scale * Consistent baseline behavior * Override account defaults for checks within Groups * Team-based alert preferences * Service-specific requirements * Departmental escalation policies * Fine-tune specific check behavior * Handle special requirements * Debug and testing scenarios * Legacy system accommodations ### Configuration Inheritance Understanding how settings cascade through the hierarchy: 1. **Check-level settings** always take highest precedence 2. **Group-level settings** override account defaults for member checks 3. **Account-level settings** provide the baseline for all other configurations 4. **Explicit overrides** can be enabled/disabled at group level Runs you [cancel](/docs/concepts/cancellation) never trigger alerts. No failure, degraded, or recovery notification is sent for a cancelled run, regardless of the settings above. ## Alert Configuration ### Account-Level Configure organization-wide defaults that apply to all checks: Account-level alert settings **Account Settings Benefits:** * Consistency: Uniform alerting behavior across all monitoring * Efficiency: Configure once, apply everywhere * Compliance: Meet organizational alerting requirements * Scalability: Easy to manage large numbers of checks ### Group-Level Configure alerts for teams and service categories: Group-level alert settings ### Group Override Configure how group settings interact with individual checks: **If checked, Group settings override individual check settings** * Group settings take precedence * Ensures consistency within teams * Prevents individual check drift * Simplifies management **If unchecked, individual check settings take precedence** * Check-level customization allowed * Handle special cases easily * Legacy system accommodation * Granular control when needed ### Check-Level Fine-tune alerting for specific checks with unique requirements: Check-level alert settings Start with conservative alert settings and gradually tune based on your team's response patterns and service reliability characteristics. Too many alerts can be worse than too few. ## Escalation Configuration **Monitoring as Code**: Learn more about [configuring escalation strategies for your Checkly constructs](/docs/constructs/alert-escalation-policy). The escalation box allows you to decide when an alert should be triggered. We give you three options that are applied to all checks: Light mode interface Dark mode interface ### Run-Based Escalation Get alerted when a check has failed a number of times consecutively. We call this a *Run Based* escalation. Note that failed checks retried from a different region are not considered "consecutive". Light mode interface Dark mode interface **How it works:** * Consecutive Failure Counting * Counts failed check runs in sequence * Resets counter on successful run * Cross-location failures count as one run * Retries don't count as separate runs **Best for: Stable Systems** * Predictable failure patterns * Clear success/failure states * Services with known reliability * APIs with consistent behavior ### Time-Based Escalation We alert you when a check is still failing after a period of time, regardless of the amount of check runs that are failing. This option should mostly be used when checks are run very regularly, i.e. once every minute or five minutes. Light mode interface Dark mode interface **How it works:** * Monitors failure duration, not count * Ideal for high-frequency checks * Ignores individual run results * Focuses on sustained problems **Best for: High-Frequency Monitoring** * Checks running every 1-5 minutes * Services with intermittent issues * Rate-limited APIs * Network-dependent services ### Location-Based Escalation This option can be selected in addition to the run or time-based escalation settings and only affect checks running in [parallel](/docs/concepts/scheduling#parallel) with two or more locations selected. When enabled, alerts will only be sent when the specified percentage of locations are failing. Use this setting to reduce alert noise and fatigue for services that can handle being unavailable from some locations before action is required. Light mode interface Dark mode interface **Benefits:** * Reduces false positives from regional issues * Focuses on global service problems * Accommodates CDN and geo-distributed services * Filters out single-location network problems ## Reminder Configuration Configure follow-up notifications for unresolved incidents. Light mode interface Dark mode interface Checkly automatically manages reminder lifecycle: Primary alert sent to configured channels when escalation threshold is met Reminder countdown begins based on configuration Follow-up alerts sent at configured intervals All pending reminders cancelled when check recovers Optional escalation to different teams/channels after maximum reminders When a check failure is resolved, we cancel any outstanding reminders so you don't get mixed signals. ## Muting and Temporary Controls Toggling the "mute" checkbox on a check stops the sending of all alerts but keeps the check running. This is useful when your check might be flapping or showing other unpredictable behavior. Just mute the alerts but keep the check going while you troubleshoot. Light mode interface Dark mode interface Always test your alert configuration changes in non-production environments first. Failed alert delivery during an actual incident can significantly impact response time. Use Checkly's alert notification log to analyze delivery patterns and identify optimization opportunities. Look for channels with high failure rates or excessive alert volume. # Alert Notification Log Source: https://www.checklyhq.com/docs/communicate/alerts/notification-log Browse and filter the Alert Notification Log to troubleshoot failed alert deliveries, inspect status codes, and see the exact configuration used per channel. Checkly tries to deliver all your failure, degradation and recovery notifications as reliably as possible, but sometimes life happens. A token expires, a URL has a typo or some other unforeseen issue causes a notification to get lost. To troubleshoot any delivery issues, browse and filter the **[Alert Notification Log](https://app.checklyhq.com/alerts/notifications)** for any failed messages. You can also directly access the notifications for a specific channel by clicking the small "log" icon next to the configured channel name. Here's an example: alert notification log In the above example, we see: 1. SMS and Email were correctly delivered. 2. The OpsGenie notification failed though. The notification result shows we got a `422` status code back and the error message states our API key was invalid. 3. We also see the configuration used to instrument our call to the OpsGenie API. 4. We see some extra meta data about the notification: What channel was used, what check triggered the alert, when it was sent etc. ## Known limitations There are some limits to how we track notifications currently. 1. SMS delivery can not be tracked up to your phone correctly receiving the SMS. We currently only track if our SMS provider ([AWS SNS](https://docs.aws.amazon.com/sns/latest/dg/sns-mobile-phone-number-as-subscriber.html)) has correctly received our request to send the SMS. 2. Email delivery is tracked up to our request to our email provider. We use [Postmark](https://postmarkapp.com/) to send our emails. 3. Many alert channels are retried transparently: we only show you the result of the last retry. 4. SSL certificate expiration alerts are not shown in the notification log. # Alerting With Checkly Source: https://www.checklyhq.com/docs/communicate/alerts/overview Comprehensive alerting and retry strategies to minimize false positives and ensure reliable incident response when your checks fail or recover. Checkly alerts you when your checks or monitors transition between states such as **passing** to **failing**, **degraded performance**, or **recovery**. The system is designed to provide actionable notifications while minimizing noise through intelligent retry strategies and flexible escalation policies. Checkly alerting dashboard overview ### Benefits * Configurable alert thresholds and escalation * Reduce false positives with intelligent retries * Fixed, linear, and exponential backoff options * Multiple notification channels and integrations * Location-based failure filtering ## Alert Settings The [alert settings screen](https://app.checklyhq.com/alerts/settings) gives you the options to tailor when, how and how often you want to be alerted when a check fails at the Account Level. This is also sometimes referred to as **threshold alerting**. For example: * Get an alert on the second or third failure. * Get an alert after 5 minutes of failures. * Get one or more reminders after a failure is triggered. Your alert notifications can be configured at three levels: 1. **Account** level: This is the default level and applies to all of your check unless you override these settings at the check level. 2. **Group** level: You can explicitly override the alert settings at the group level. 3. **Check** level: You can explicitly override the account alert settings per check. Very handy for debugging or other one-off cases. You can select whether group settings will override individual check settings for alerts, retries, scheduling, and location alert settings check / threshold alerting ## Alert Channels When adding an alert channel, you can select which checks to subscribe to the channel. This way you can create specific routings for specific checks. alert channels You can also select which types of alerts should be send to your channel: * **Failure**: When a check encounters a hard error. * **Degradation**: When a checks is just slow, but still working. * **Recovery**: When a check recovers from either failing or being degraded. * [**SSL certificate expirations**](/docs/communicate/alerts/ssl-expiration/) Configuring alert channels is mostly self explanatory except for our [advanced webhook builder](/docs/integrations/alerts/webhooks). After adding the channels, you either **edit** or **delete** them, or change which checks are subscribed to that specific channel. > If you are using [Terraform](/docs/integrations/iac/terraform/overview) or the [CLI](/docs/cli/overview), you will need to specify alert channel subscriptions *explicitly* for each check / group. ## Alert States Sending out alert notifications like emails and Slack hooks depends on four factors: 1. The **alert state** of the check, e.g. "passing", "degraded" or "failing". 2. The **transition** between these states. 3. Your **threshold alerting** preferences, e.g. "alert after two failures" or "alert after 5 minutes of failures". 4. Your **notification preferences** per alert channel. As you can see, 1 and 2 are how Checkly works in the backend; you have no influence on this. But 3 and 4 are user configurable. We can even add a fifth factor: if the check is muted, no alerts are send out at all. > Note: Browser checks currently do not have a degraded state. ### States & Transitions The following table shows all states and their transitions. There are some exceptions to some of the more complex states, as the history or "vector" of the state transition influences how we alert. ✅ = passing ⚠️ = degraded ❌ = "hard" failing | transition | notification | threshold | code | notes | | ---------- | ------------ | --------- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | | ✅ --> ✅ | None | - | `NO_ALERT` | Nothing to see here, keep moving | | ✅ --> ⚠️ | Degraded | x | `ALERT_DEGRADED` | Send directly, if threshold is *"alert after 1 failure"* | | ✅ --> ❌ | Failure | x | `ALERT_FAILURE` | Send directly, if threshold is *"alert after 1 failure"* | | ⚠️ --> ⚠️ | Degraded | x | `ALERT_DEGRADED_REMAIN` | i.e. when threshold is *"alert after 2 failures"* or *"after 5 minutes"* | | ⚠️ --> ✅ | Recovery | - | `ALERT_DEGRADED_RECOVERY` | Send but only if you received a degraded notification before | | ⚠️ --> ❌ | Failure | - | `ALERT_DEGRADED_FAILURE` | This is an **escalation**, it overrides any threshold setting. We send this even if you already received degraded notifications | | ❌ --> ❌ | Failure | x | `ALERT_FAILURE_REMAIN` | i.e. when threshold is *"alert after 2 failures"* or *"after 5 minutes"* | | ❌ --> ⚠️ | Degraded | - | `ALERT_FAILURE_DEGRADED` | This is a **deescalation**, it overrides any thresholds settings. We send this even if you already received failure notifications | | ❌️ --> ✅ | Recovery | - | `ALERT_RECOVERY` | Send directly | Use Checkly's alert notification log to analyze your alerting patterns and identify opportunities to reduce noise while maintaining coverage of critical issues. # Alert Retries Source: https://www.checklyhq.com/docs/communicate/alerts/retries Use retries to guard against flaky failures and alert fatigue, choosing between scheduled retry strategies for checks, check groups, and test sessions. **Monitoring as Code**: Learn more about [the retry strategies construct](/docs/constructs/retry-strategy). Sometimes the internet is flaky, or your app is just having a hiccup not worth pinging your on-call team about. Retries are your first line of defense against these types of false positives, leading to alert fatigue. Whether you need to retry a check or a test session, there are different retries available. Use **Retries** instead of the deprecated "double check" option. ## Check retry strategies All check types and check groups, except for Heartbeat monitors, have a **Retries & Alerting** section available, where you can define the number of retries and which retry strategy your check or check group uses. Click **Edit check** or **Edit group** on the 3-dot menu on your [Checkly Home page](https://app.checklyhq.com/) and select the **Retries & Alerting** tab: configure retry strategy ### Scheduled check retries There are three distinct retry strategies based on the time between retry attempts, and each one comes with different retry/backoff characteristics. * **Single** — retry once after a fixed interval, e.g. 5s. * **Fixed** — a fixed time between retries, e.g. 5s, 5s, 5s etc. * **Linear** — a linearly increasing time between retries, e.g. 5s, 10s, 15s etc. * **Exponential** — an exponentially increasing time between retries, e.g. 5s, 25s, 125s (2m and 5s) etc. On top of the time between attempts, you can also set: * **maximum number of retries** - the maximum number of retries for this check or check group. * **maximum total retry duration** - the maximum time a check can be in a retrying state. This is a timeout to ensure the check finishes on a timely manner. > Make sure to include the time your check needs to run when setting the **maximum total retry duration**. For example, if you set a maximum to 2 minutes, and your check takes 1.5 minutes, you have 30 seconds left for retries. #### How often should I retry? **For checks that run on lower frequencies**, e.g. once per hour, it makes sense to pick a strategy that retries more often, over longer stretches of time. Let's look at an example: 1. A check with a 1-hour frequency breaks at 13:00 CET. 2. An exponential retry strategy with 3 retries and a 5-second interval is configured. 3. This generates retries spaced apart by 5 seconds, 25 seconds, 125 seconds. 4. Your check is now retried at about 13:00:05, 13:00:30 and 13:02:35. If in that \~3-minute period your app / system recovers, and this was just a fluke, you will not be alerted. If the issue persists, Checkly will alert you as per your alert settings. **For checks that run on higher frequencies**, e.g. once per minute, it makes sense to pick a strategy that retries less often, and spaced apart by shorter intervals. Of course, picking the right strategy depends on your use case, tolerance for intermittent failures, SLO levels and other factors. ### Location-based check retries You can decide if a check should be retried from the same location or not with the checkbox: **Always retry from the same location the check failed in** * If enabled, a check that fails will be retried in the same location. * If disabled, a check that fails will be retried in a different location, from the locations your check runs at. There are some tradeoffs to consider: * Retrying from the same location makes sense if you care strongly about the uptime of your app in one specific location, compared to other locations. * Retrying from a different location makes sense, if you want to make sure your app is up in at least one location. ### Network retries For API checks & URL monitors, you can enable network retries to automatically retry a check run only if it fails due to a network error—such as a timeout, DNS resolution issue, or connection reset. When network retries are enabled: * The check will retry on: ECONNRESET, ENOTFOUND, ETIMEDOUT, EAI\_AGAIN, ECONNREFUSED, and similar network errors. * The check will not retry on: Any HTTP response that includes a status code (4xx or 5xx), failed assertions, or any other type of check failure. ## Test sessions retries Sporadically failing tests may be caused by a variety of reasons such as issues with the underlying infrastructure, and sometimes, simply re-running the test is enough to make it succeed again. Use retries to reduce noise in your [test session results](/docs/detect/testing/overview) while providing information about the retry attempts. Specify the number of retries between 0 and 3 that you’d like Checkly to attempt when running `npx checkly test` or `npx checkly trigger`. The default number of retries is 0. You can configure the number of test session retries as a global setting in your Checkly configuration file: ```bash theme={null} # Checkly configuration file cli: { retries: 2, } ``` Using the CLI and the `--retries=` flag takes precedence over your Checkly configuration file. ```bash theme={null} # retry npx checkly test twice npx checkly test --retries=2 # retry npx checkly trigger 3 times npx checkly trigger --retries=3 ``` All retry attempts are be visible on the web interface at Checkly and in your command line as they’re happening: ```bash theme={null} 1 retrying, 5 passed, 6 total ``` ### Test session retries in your CI/CD pipeline Use the `--reporter=ci` flag to run test session retries from your CI/CD pipeline. The `ci` reporter will print out all retry attempts in the prompt output, instead of live-updating the prompt. For example: ```bash theme={null} npx checkly test --retries=2 --reporter=ci ``` # SSL Certificate Expiration Alerts Source: https://www.checklyhq.com/docs/communicate/alerts/ssl-expiration Get alerted up to 30 days before an SSL certificate expires. Checkly checks your certificate hourly and can notify any alert channel at your chosen threshold. An expired SSL certificate can cause havoc to sites and APIs. Checkly performs an hourly check on your certificate and can alert you up to 30 days before your certificate expires. All alert channels (e-mail, SMS, OpsGenie, Webhook etc.) can be used for this alert. Simply create or pick an existing alert channel that your check subscribes to and enable *SSL certificate expiration* and set the day threshold to your preference. If you don't have your alert channels set up yet, see [Alert Channels](/docs/communicate/alerts/channels). Example alert channel form Some tips on using SSL alerts * You can create specific alert channels for certificate expirations and subscribe all checks/groups to that channel. * You can create multiple alert channels with different thresholds if you want to be alerted at multiple thresholds. ## API checks The domain for the certificate is parsed from the `URL` in the HTTP request settings so it does not require any setup. When you update your check's URL or your SSL cert, allow up to an hour for the SSL expiration date to update on Checkly’s end. When using [environment variables in the URL](/docs/platform/variables#accessing-variables-in-api-checks), make sure that the domain is fully specified. SSL monitoring cannot parse the domain from a URL like `{{BASE_URL}}/test-endpoint`, but using environment variables in other parts of the URL like `https://checklyhq.com/{{TEST_PATH}}` works. ### Getting `Error: unable to verify the first certificate` If prompted with this error, the usual cause is the certificate chain of the given website being incomplete. This will not happen with a browser check, because the browser will complete the certificate chain on its own. When running an API check, though, no browser is involved - therefore the error takes place. You can use an online SSL checker (e.g.: [SSL Shopper](https://www.sslshopper.com/ssl-checker.html)) to help you diagnose issues with your certificate. ## Browser checks Since browser checks can connect to multiple domains, you need to set the SSL certificate domain to receive certificate alerts for them. When you change this setting or update your SSL cert, allow up to an hour for the SSL expiration date to update on Checkly’s end. SSL checks for browser checks # Dashboard Configuration Source: https://www.checklyhq.com/docs/communicate/dashboards/configuration Add checks to your dashboard, control who has access, and customize your dashboard's look and feel. Light mode interface Dark mode interface ## Setting Up Your Dashboard Add relevant tags to all the checks and monitors that you'd like to display on your dashboard. Create a new dashboard and configure basic settings. Add tags to your dashboard to specify which checks to show. Customize your dashboard's look and feel using custom CSS rules. Optionally configure a custom domain for professional branding. Once your dashboard is ready, you can share it with anyone using its URL. ## Basic Settings * **Title:** Add a title like "ACME status dash". This is separate from your Checkly URL or custom domain. * **Description:** Add a clarifying text to explain to visitors what they are looking at. * **Checks:** Specify the tags of the checks you want to show on the dashboard. By default we show all checks. You can also choose to hide the tags from the dashboard. ## Checkly URL Every dashboard comes with a configurable custom subdomain under the `checkly-dashboards.com` domain. By default, we generate a random ID. You can change this subdomain to anything you like as long as it is unique among all Checkly users. Typically, a company name works best, e.g. `acme.checkly-dashboards.com` Light mode interface Dark mode interface ## Custom Domain You can host your dashboard under your own domain. To make this work, you need to do two things: 1. Add a valid custom domain to your dashboard setting. Light mode interface Dark mode interface 2. Create a CNAME record in your DNS that points to **checkly-dashboards.com** Any DNS provider will have the option to easily add CNAME records. For example, on AWS Route 53 this looks as follows. Light mode interface Dark mode interface In some cases, our provider will ask you to verify you are the owner of the domain by adding another `TXT` record to your DNS. You will see a notice similar to the one below. Light mode interface Dark mode interface ## Access Control By default, Checkly dashboards are public and visible to anyone who knows the URL. You can set a dashboard to private, limiting access to users with a password or Checkly account. ### Enabling Authentication Private dashboards are only available on certain plans. For more details, see our [Pricing page](https://www.checklyhq.com/pricing). To enable authentication on a dashboard: 1. Navigate to the settings of the dashboard you wish to modify. 2. Toggle on the "Password Protection" setting. 3. Click "Save" to apply the changes. 4. Next, the "Generate Password" button will appear, click this. It will open a modal which shows you your new private dashboard password. Be careful, **this is the only time you will see this password in plaintext**. We do not store the password in plaintext, so if it is ever lost, you will need to regenerate a new one and inform any users of the new credentials. ### Accessing Private Dashboards After enabling password protection for your dashboard, you can continue to visit it via any custom domain you may have enabled, as well as the default `https://[dashboardId].checkly-dashboards.com` domain. The password authentication will work via both channels. Checkly account login is only available to Enterprise customers. If visiting via the `https://[dashboardId].checkly-dashboards.com` domain, you can also select "Login with Checkly" and sign in with your existing Checkly account via any of the supported methods (i.e. Google, Github, Username and Password). This is an Enterprise-only feature. ## Look and Feel * **Logo:** Display your company logo (or any image) on the top left side of your dashboard. * **Logo link:** Add a clickable destination URL for your logo. When visitors click the logo, they’ll be redirected to your specified website (typically your company homepage). * **Favicon:** Set a custom favicon for browser tabs and bookmarks. * **Auto paginate:** Automatically switch between dashboard pages when you have multiple pages of checks. * **Auto refresh:** Set how often the dashboard refreshes—choose between 1, 5, or 10 minutes. * **Show header:** Toggle visibility of the dashboard’s title and description. * **Show check run links:** Adds a clickable link to each check result so team members can inspect them. Off by default. * **Show and hide P-stats:** Toggle the visibility of the performance stats for all checks on the dashboard. Next to the preset tweaks you can do to your dashboard, you can also apply [custom CSS styles](/docs/communicate/dashboards/custom-css). # Customizing Your Dashboard with CSS Source: https://www.checklyhq.com/docs/communicate/dashboards/custom-css Match a Checkly dashboard to your company branding with custom CSS rules, edited directly in the Look & Feel section of the dashboard settings. You can completely customize the look & feel of your dashboard using custom CSS rules so the dashboard fits your company's branding guidelines. You can find the CSS editor at the bottom of the Look & Feel section. Light mode interface Dark mode interface Editing works like this. * Start by opening your dashboards in a separate browser tab. * Generate some boilerplate CSS code by hitting the **Generate boilerplate** button. * Open the **hints** tab so see all the classes available for you to target. * Make some edits, hit **Save dashboard** and reload your dashboard. Custom CSS is only available on certain plans. For more details, see our [Pricing page](https://www.checklyhq.com/pricing). ### CSS Classes The following table lists the CSS classes available for customizing your dashboard appearance: | Name | Class name | | --------------------- | -------------------------- | | Dashboard header | `.header` | | Logo | `.logo` | | Status summary | `.status-summary` | | Status passing | `.status-summary--passing` | | Status failing | `.status-summary--failing` | | Main content | `.main` | | Incidents summary | `.incidents-summary` | | Check | `.check` | | Check result | `.check__result` | | Passing check | `.check__result--passing` | | Failing check | `.check__result--failure` | | Degraded check | `.check__result--degraded` | | Check metrics | `.check__metrics` | | Check list | `.check-list` | | Empty check list | `.check-list--empty` | | Time range | `.period` | | Active time range | `.period--active` | | Time range selector | `.period-selector` | | Pagination | `.pagination` | | Incident | `.incident` | | Incidents page | `.incidents-page` | | Incidents detail page | `.incidents-detail-page` | | Incident list | `.incident-list` | | Incident list date | `.incident-list__date` | | Active incident list | `.active-incident-list` | | Active incident card | `.active-incident` | | Major incident | `.active-incident--major` | | Minor incident | `.active-incident--minor` | | Incident header | `.active-incident__header` | | Metric | `.metric` | | Metric improved | `.metric--improved` | | Metric worsened | `.metric--worsened` | | Metric badge | `.metric__badge` | | Dashboard footer | `.footer` | | Error 500 | `.error-500` | | Error 400 | `.error-400` | | Login background | `.login-background` | | Login box | `.login-box` | | Login input | `.login-input` | | Login button | `.login-button` | | Login social button | `.login-social-button` | | Logout button | `.logout-button` | | Logout icon | `.logout-button__icon` | ## Styling examples We created some examples of how you can style your dashboard using the brand colors from well known brands. This should help you explore the possibilities you have available. ### Amazon Web Services style In this example we aim to replicate the brand style of [Amazon Web Services (AWS)](https://aws.amazon.com/). Light mode interface Dark mode interface Note the following: * We set a dark `background` for the header with light `color` text. We also tweak the status and incident summary. * We set the link `color` to the orange brand color. * We remove the `border-radius` on the check cards and add a `box-shadow`. ```css theme={null} .header { background: #232e3e; } .header .logo a { color: #fca311; } .header h1 { color: #FFFFFF; } .header h2 { color: #FFFFFF; } .status-summary--passing { color: #70ab4a; } .status-summary--passing svg { fill: #70ab4a; } .incidents-summary { color: #f95a53; } .main { color: #1f3d5c; background: #FFFFFF; font-family: Helvetica; } .check { box-shadow: 0 1px 3px 0 rgb(0 0 0 / 30%), 0 0 0 1px rgb(0 0 0 / 4%); border-width: 0; border-radius: 0; } .active-incident article { border-radius: 0 !important; } .period-selector a { color: #fca311; } .period-selector .period--active { background-color: #fca311; color: #FFFFFF; } .metric { color: #1f3d5c; } .incident-list a { color: #0972d3; } .footer { background: #232e3e; } .footer .logo a { color: #e47911; } .footer h1 { color: #FFFFFF; } .footer h2 { color: #FFFFFF; } ``` ### Linear style In this example we aim to replicate the dark style of [Linear](https://linear.app/). Light mode interface Dark mode interface Note the following: * We set a dark `background` for both the header and main sections. * We set a lighter `color` for a range of text elements to contract with the dark background * We set a new color pattern for the big red incident alert at the top of the page. * We tweak the brand "red" and "green" colors to better match the palette. ```css theme={null} .header { background: #080808; border-bottom-color: #313035; font-family: "SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu, Cantarell,"Open Sans","Helvetica Neue",sans-serif; } .header .logo a { color: #f7f8f8; } .header h1 { color: #f7f8f8; } .header h2 { color: #8a8f98; } .status-summary--passing { color: #68b487; } .status-summary--passing svg { fill: #68b487; } .incidents-summary { color: #db615f; } .main { color: #1f3d5c; background: #080808; font-family: "SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu, Cantarell,"Open Sans","Helvetica Neue",sans-serif; } .check { color: #f7f8f8; background-color: #222326; border: 1px solid #313035; } .check > div > div span { color: #8a8f98; } .active-incident--major article { background-color: #db615f!important; color: #fff5f9; border-width: 0; } .active-incident--major article > .active-incident__header div { background-color: #db615f; color: #fff5f9; } .active-incident--major article p { color: #fff5f9; } .period-selector a { color: #5E6AD2; } .period-selector .period--active { background-color: #5E6AD2; color: #f7f8f8; } .checks-stat.metric > div { color: #8a8f98; } .checks-stat.metric > div > div { color: #f7f8f8; } .checks-stat.metric span { color: #8a8f98; } .metric--improved .metric__badge { background-color: #3b5546 !important; } .metric--worsened .metric__badge { background-color: #734746 !important; } .metric__badge { color: #f7f8f8 !important; } .check__result--passing::before { background-color: #68b487; } .check__result--failure::before { background-color: #db615f; } .incidents-list-date { color: #f7f8f8; border-bottom-color: #313035; } .incident-list p { color: #8a8f98; } .footer { background: #080808; } .footer .logo a { color: #f7f8f8; } .footer h1 { color: #f7f8f8; } .footer h2 { color: #f7f8f8; } ``` ### Hello Kitty style "Why so serious?" you might ask. No reason, you can go crazy with styling, adding repeating backgrounds and images. Light mode interface Dark mode interface ```css theme={null} .main { background: url("https://media.istockphoto.com/id/973856976/vector/simple-seamless-pattern-with-irregular-polka-dot-endless-print.jpg?s=612x612&w=0&k=20&c=ieek3r4Th_CyV73WsfoCYUhpz7-INHqWRZ6ZpRmASrs="); } .header { background: red; border-bottom: 3px solid black; } .status-summary { color: white; } .status-summary--passing { color: white; } .status-summary--failing { color: white; } .incidents-summary { color: white; } .footer { background: red; border-top: 3px solid black; } .footer span { color: white; } .period { color: black; } .period--active { background: red; } .incident-list { background: white; padding: 0px 30px; border: 2px solid black; } .check { border: 2px red solid; } ``` # Incident & Maintenance messages Source: https://www.checklyhq.com/docs/communicate/dashboards/incidents Communicate outages and planned maintenance to your audience by publishing incidents on a Checkly dashboard, turning it into a status page. Using **Incidents** you can communicate outages and planned maintenance to your audience — customers, co-workers, partners — or whoever might be lucky enough to visit one of your dashboards. This turns your dashboard into a status page! Note that incidents are nested under dashboards. This means you can have multiple dashboards for different audiences (with different custom domains). Use cases are: 1. You run an agency with multiple customers. 2. You have multiple internal teams, managing different services in your stack. 3. You have a staging and production environment you want to keep tabs on. Incidents are only available on certain plans. For more details, see our [Pricing page](https://www.checklyhq.com/pricing). ## Creating incidents You can quickly create an incident directly from the [dashboard's overview page](https://app.checklyhq.com/dashes) and publish it to your dashboard in seconds. Things might be on fire. You want to be quick! create an incident ## Incident types You can create three types of incidents: * **Major impact**: use this for breaking outages that have a major impact. Things are on fire. * **Minor impact**: use this to indicate performance degradation, partial failures, etc. * **Maintenance**: use this for typical planned maintenance. Nothing on fire, just letting you know. Each type of incident will render differently on your dashboard, indicating a different level of severity. Here is an example: incident types major, minor, maintenance ## Incident updates For the **major impact** and **minor impact** incidents, you can add updates as you resolve the matter at hand. At each stage you can add an updated message, which will show up on your dashboard to keep your audience in the loop. It's very simple: 1. Pick the status with the slider: **Investigating**, **Identified**, **Monitoring** and **Resolved**. 2. Add some clarifying text in the **Update Message** text field. You can edit any updates later to correct typos. You can also add more updates within the same category of updates, for instance, if the "Investigating" phase is taking longer than expected and you want to post an update. Here's an example of what that would look like while typing out the update messages. updating an incident All incidents and their updates will show up on your dashboard (if you have Incidents enabled for the relevant dashboard) in a chronological list for later reference. dashboard incident list # Dashboards Overview Source: https://www.checklyhq.com/docs/communicate/dashboards/overview Use dashboards to instantly communicate the health and performance of your checks. **Monitoring as Code**: Learn more about [the Dashboard construct](/docs/constructs/dashboard). Dashboards provide a detailed way to communicate the status of your checks and monitors to internal and external audiences. Create professional, branded status displays for customers, internal teams, or specific stakeholders. Light mode interface Dark mode interface Dashboards allow you to do the following: * Show the status of all your checks, or a subset by filtering by `tag`. * Show the availability and p95 / p99 metrics over the last 24 hours, 7 days and 30 days. * Communicate custom incident messages and maintenance messages. You can create multiple, distinct dashboards based on your plan. Edit your dashboard by clicking on the **Dashboards** button on the Checkly dashboard page. *Check out our [Checkly Production Dashboard](https://status.checkly-dashboards.com) for a live example* ## Available metrics Dashboards show the following metrics, depending on the check type: | Metric | Description | Supported check types | | ---------------- | ----------------------------- | --------------------------------------- | | **Availability** | Percentage of successful runs | All check types | | **P95** | 95th percentile response time | All check types except Heartbeat & ICMP | | **P99** | 99th percentile response time | All check types except Heartbeat & ICMP | | **P95 Latency** | 95th percentile ping latency | ICMP | | **P95 Loss** | 95th percentile packet loss | ICMP | Metrics can be viewed over 1h, 3h, 24h, 7d, or 30d, based on your selected time range. # Maintenance Windows Source: https://www.checklyhq.com/docs/communicate/maintenance-windows/overview Schedule planned maintenance periods to prevent false alerts and control check behavior during downtime. **Monitoring as Code**: Learn more about the [Maintenance Window Construct](/docs/constructs/maintenance-window). Maintenance windows allow you to schedule planned downtime for your services, preventing false alerts and preserving accurate availability metrics during system updates, deployments, and infrastructure maintenance activities. During a maintenance window you can pause check execution, silence alert notifications, or both. You can also [show the maintenance on your status pages](/docs/communicate/status-pages/maintenance-windows) to keep your users informed. Manual and triggered check runs (e.g. via the API or the Checkly UI) always execute, even when check execution is paused. However, if alert silencing is enabled, alerts from these runs will still be suppressed. ## Creating a maintenance window Navigate to the Maintenance Windows page indicated by the wrench icon on the menu. Then click "create new" in the top right corner. After giving your window an appropriate name, the core options you have are: ### Setting a schedule Maintenance window schedule Set the **start** date and time, then choose how long the window **lasts** by entering a duration in hours and minutes. Quick-duration presets (30m, 1h, 4h, 24h) and a **Now** shortcut are available. Pick the **timezone** your times are entered in. The builder shows the equivalent **UTC** time underneath as a reference. Existing windows created before timezones were introduced stay on UTC, and their schedules are unchanged. #### Setting repeats If your maintenance window repeats at a certain cadence, toggle the **repeat** option. Here you can set 1. The amount of repetitions. 2. The unit of repetition, i.e. **Day**, **Week** or **Month**. 3. The date on which the repetition cycle should end. > If you schedule a window on the 31st and add a **monthly repeat cycle**, your schedule will also activate on > the 30th of the relevant months and the 28th or 29th of February depending on the leap year. #### Timezones and daylight saving A repeating window keeps the **local time you entered**. A window set to 4:00 AM in `Europe/Paris` runs at 4:00 AM local all year. We shift the underlying UTC time by an hour when daylight saving starts and ends, so you never have to reschedule it. A clock change adds or removes an hour from the day. If your window starts inside that hour, we resolve it like this: * When clocks jump **forward**, that hour disappears: where 2:00 AM becomes 3:00 AM, a 2:30 AM window starts at 3:30 AM. * When clocks fall **back**, that hour happens twice: where 3:00 AM becomes 2:00 AM, a 2:30 AM window runs at the **first** 2:30 AM, not the second. ### Check behavior Each maintenance window lets you configure how checks behave during the maintenance period. Toggle the behaviors you need: #### Pause check execution When enabled, scheduled check runs are skipped for the duration of the window. You can scope which checks are paused: * **All checks** — every check in the account is paused. * **Checks matching tags** — only checks (and check groups) with matching tags are paused. #### Silence alerts When enabled, alert channel notifications are suppressed while checks continue to run and collect data. This is useful when you want to keep monitoring but avoid noisy alerts during expected degradation. You can scope which checks are silenced: * **All checks** — alerts are silenced for every check in the account. * **Checks matching tags** — only checks (and check groups) with matching tags have their alerts silenced. If a check starts failing during the maintenance window and continues failing after the window ends, Checkly will **not** retroactively send an alert once the window is over — the alert is suppressed. After maintenance, check the **Firewatch** section on the home dashboard — it shows checks that started failing recently. Firewatch can be enabled and configured in your account preferences. You can use different tag sets for pausing and silencing. For example, pause your `api` checks while silencing alerts for `frontend` checks that might be affected by the same deployment. ### Adding checks via tags You scope which checks are affected by adding tags to the pause or silence configuration. Any checks or check groups with matching tags will be included. This way, any checks or check groups created *after* creating your maintenance window can still be made part of the window; no need to update the maintenance window configuration. Just set the correct tags. ## Maintenance lifecycle and updates A maintenance window is a template. Each time it runs it creates a **maintenance**: a single occurrence with its own status and its own timeline of updates. A one-off window has one maintenance, while a recurring window creates one maintenance per cycle, each tracked separately. A maintenance moves through these statuses: * **Scheduled**: planned but not started. Checks are not paused or silenced yet. * **In progress**: active. The check behavior you configured (pause, silence, or both) is now in effect. * **Verifying**: an optional active state for when the work is done but you are still confirming. Check behavior stays in effect. * **Completed**: finished. Checks resume and alerts are sent again. * **Cancelled**: called off. Like completing, this ends any pausing or silencing. By default a maintenance **starts and completes automatically** at its scheduled start and end times. You can still act early from the maintenance's page: start it, complete or extend it, cancel it, or reopen a finished one (reopening brings it back to In progress and extends the end time). Turning *off* automatic start or completion, so a maintenance only advances when you act on it, is available on [status-page windows](/docs/communicate/status-pages/maintenance-windows). Windows that are not shown on a status page always start and complete automatically. ### Updates Each maintenance has a timeline of **updates**. Posting an update records a message and can move the maintenance to a new status, similar to updating an incident. If the window is [shown on a status page](/docs/communicate/status-pages/maintenance-windows), these updates are what your visitors see or get notified about. ## Showing maintenance on your status page If you publish a [status page](/docs/communicate/status-pages/overview), you can show a maintenance window on it so visitors and subscribers know what to expect. Enable **Status page visibility** on the window to choose which pages and services it appears on, set a severity, automatically post start and end updates, and notify subscribers ahead of time. See [Status page maintenance](/docs/communicate/status-pages/maintenance-windows) for the full guide. Showing maintenance on a status page is part of the Communicate add-on. [View pricing](https://checklyhq.com/pricing). ## Monitoring maintenance status While a maintenance window is active: * The **Maintenance Windows page** shows a **banner** at the top summarizing the active maintenance, with a quick link to post an update. * The **home dashboard** shows a **Maintenance badge** on each affected check row, with a tooltip showing the maintenance window name and whether the check is paused, silenced, or both. * The home dashboard status filter includes an **Under maintenance** option, letting you quickly find all checks currently affected by a maintenance window. * The **check overview page** shows a tag if the check is currently affected by a maintenance window. # Checkly Communicate Source: https://www.checklyhq.com/docs/communicate/overview Share monitoring insights and keep stakeholders informed with alerts, status pages, and dashboards. **Checkly Communicate** provides comprehensive notification and visibility tools to keep your team and users informed about system status and incidents. From instant alerts to public status pages, Communicate ensures the right people have the right information at the right time. Receive instant notifications when issues are detected across multiple channels Keep users informed with public status pages and incident communication Create custom views of your monitoring data for teams and stakeholders Schedule and communicate planned maintenance to reduce alert noise ## Key Benefits * **Multi-Channel Alerting** — Send notifications through email, SMS, Slack, webhooks, and more to ensure critical issues reach the right people. * **Transparent Status Communication** — Build trust with users through branded status pages that provide real-time system status and incident updates. * **Customizable Dashboards** — Create tailored views of monitoring data that match your team's workflow and stakeholder needs. * **Intelligent Alert Management** — Reduce alert fatigue with escalation policies, maintenance windows, and smart notification routing. ## How It Works Set up notification channels for your team: * Add email, SMS, and phone call recipients * Connect Slack, Microsoft Teams, and other integrations * Configure webhooks for custom notification systems Build public-facing status communication: * Design branded status pages for your services * Configure automatic status updates from monitoring * Set up subscriber notifications for incidents Create visibility for stakeholders: * Design dashboards for different audiences * Configure custom domains and branding * Share monitoring insights with teams and customers Plan and communicate scheduled maintenance: * Schedule maintenance windows to suppress alerts * Automatically update status pages during maintenance * Keep stakeholders informed of planned downtime ## Getting Started Ready to start communicating monitoring insights? Choose the approach that best fits your current needs: Begin with instant notifications for critical issues Build transparency with public status communication Create custom views for monitoring data Plan and communicate scheduled maintenance # Creating a Status Page Source: https://www.checklyhq.com/docs/communicate/status-pages/creating-a-status-page Create a Status Page. To set up a status page, select **New status page** on the [Status pages overview](https://app.checklyhq.com/status-pages). 1. Enter a name for your page. This name is used in the page header and in emails to subscribers. 2. Customize the subdomain slug for your page. Status pages use the domain `.checkly-status-page.com` by default. See [Custom domains](/docs/communicate/status-pages/customization#custom-domain) to use your own domain. 3. Add **components** for the parts of your product you want to report on. Use **Add group** to nest components under a shared heading, and drag to reorder. See [Components](/docs/communicate/status-pages/overview#components). 4. Optionally set a logo, favicon, and theme. See [Customization](/docs/communicate/status-pages/customization). 5. Click **Create status page**. You will see your page's details, and a link to the public version of the page below the title. Status page editor You can now share the link to your status page, and your users can subscribe to receive notifications when incidents are posted. To open incidents automatically when checks fail, add an [automation rule](/docs/communicate/status-pages/incidents#incident-automation). You can restrict access to your status page so only authorized users can view it. See [Password Protection](/docs/communicate/status-pages/password-protection) for details. # Status Page Customization Source: https://www.checklyhq.com/docs/communicate/status-pages/customization Add a custom domain and look & feel to your Status Page. ## Custom domain Custom domains are available on Communicate Starter, Team and Enterprise plans. [View pricing](https://checklyhq.com/pricing) You can host your Status Page on your own domain. To set it up, add the domain in Checkly and create the required DNS records with your DNS provider. Custom domain configuration Create a CNAME record with your DNS provider and point it to `custom-domain.checkly-status-page.com` For example, in Cloudflare, the configuration looks like this: Custom domain CNAME
    configuration If your provider is Cloudflare, you must disable the proxy on the CNAME, it should always be set to DNS only. After you've added your custom domain and saved the page, one or more TXT records will be displayed depending on the domain you're using. Example custom domain TXT configuration Update your DNS settings to match the TXT record(s) displayed on your Status Page to prove the ownership of the domain. Search engines require this verification to index and list your Status Page. ## Customize your Status Page to match your brand identity * Upload your company logo and the link it should open * Upload a custom favicon * Choose the default theme: auto (system), light or dark * Customize the color theme to match your brand Theme customization is available on Communicate Team and Enterprise plans. [View pricing](https://checklyhq.com/pricing) # Incident Management Source: https://www.checklyhq.com/docs/communicate/status-pages/incidents Guide to creating, managing, and automating incidents on Checkly status pages including subscriber notifications and incident backfilling capabilities. Incidents communicate downtime on one or more components. You can open incidents manually as part of your incident management process, or automatically with [automation rules](#incident-automation). When an incident is posted, a notification will be sent to all users subscribed to the Status Page, unless you opt out of notifications when creating the incident update. ## Creating an incident Create an incident when you want to communicate downtime or known issues to users via your Status Page. 1. Click ‘Status pages’ in the sidebar and open your Status Page. 2. Click ‘Add incident’ at the top right. 3. Enter the name of the incident. 4. Select which components are impacted, and the [impact](/docs/communicate/status-pages/overview#component-status-and-impacts) each one gets: under maintenance, degraded performance, partial outage, or major outage. 5. Write the initial incident update message, and set the status of the incident. 6. If you want to backfill the incident, select `Use custom date`. See [Backfilling incidents for more information](/docs/communicate/status-pages/incidents#backfilling-an-incident). 7. Select if you want to notify subscribers of your Status Page about the incident. 8. Click ‘Create incident’ The incident now appears on your status page, and the impacted components show their new status. If you selected the option to notify subscribers, they receive the update message by email. Creating an incident ## Incident duration and downtime Downtime is tracked per component, not per incident. Each affected component has an impact timeline made of phases: * A phase starts when you give a component a non-operational impact, and ends when you change the impact, set it back to operational, remove the component from the incident, or resolve the incident. * Changing the impact (e.g. major outage → partial outage) closes the current phase and starts a new one, so the full history is kept. * A component can only be non-operational while an active incident impacts it. Resolving the incident closes all open phases. * Phases of an ongoing incident count up to the current time. [Uptime](/docs/communicate/status-pages/overview#uptime-calculation) is calculated from these phases over the last 90 days. Phase time is weighted by impact: | Impact | Counts as downtime | | -------------------- | ------------------ | | Major outage | 100% | | Partial outage | 30% | | Degraded performance | 0% | | Under maintenance | 0% | Overlapping phases never double-count: when several incidents impact the same component at the same time, the overlapping time counts once, and partial outage time that overlaps a major outage is already covered by the major outage. For example, a component with a 2-hour major outage and a separate 10-hour partial outage in the 90-day window accumulates 2 + (0.3 × 10) = 5 hours of downtime. You can correct the record after the fact by editing a component's impact timeline on the incident, or by [backfilling an incident](/docs/communicate/status-pages/incidents#backfilling-an-incident). Edited timelines must stay consistent: a phase ends after it starts, phases of the same component never overlap, and a resolved incident has no open phases. ## Incident notifications Whenever you post an incident update, Checkly can automatically send email notifications to users subscribed to your Status Page. Emails are sent out only when an update is first posted. Notifications are not sent again if the incident update is edited. If you want to post an incident update without notifying your subscribers you can uncheck the ‘Notifications’ checkbox when updating the incident. Incident notifications contain the incident name and status, and the impacted components with their impact. Example notification ## Subscribing to incident notifications Subscribing to incident notifications is done on your Status Page. To subscribe, a user needs to enter a valid email address. A verification email will be sent to the registered email, and the user will be ready to receive incident notifications after confirming the subscription. ## Incident automation Incident automation is available on Communicate Team and Enterprise plans. [View pricing](https://checklyhq.com/pricing) Automation rules open incidents automatically when checks fail. A rule matches checks by **tag**: when a check carrying one of the rule's tags fails and triggers an alert, the rule opens one incident impacting the components it lists. The incident resolves automatically when the check recovers. To create an automation rule: 1. Open your Status Page and go to the ‘Automation’ tab. 2. Click ‘Add rule’ and name the rule. 3. Add one or more tags. Any check or group carrying one of these tags can trigger the rule. 4. Select the components the incident should impact, and the impact each one gets. 5. Write the first status update (posted when the incident opens) and the last update (posted when it resolves). 6. Select if subscribers should be notified, and optionally adjust the cool down between automated incidents. 7. Save the rule. Automation rules can also be managed in code with the [`StatusPageV3AutomationRule`](/docs/constructs/status-page-v3-automation-rule) construct. On deprecated v2 pages, automation works through per-check incident triggers instead. See [Status pages v2 (deprecated)](/docs/communicate/status-pages/v2-deprecated#incident-automation-with-check-triggers). # Status Page Maintenance Source: https://www.checklyhq.com/docs/communicate/status-pages/maintenance-windows Show planned maintenance windows on your status page so visitors and subscribers know what to expect, with automatic updates and subscriber notifications. Showing maintenance windows on a status page is part of the Communicate add-on. [View pricing](https://checklyhq.com/pricing). [Maintenance windows](/docs/communicate/maintenance-windows/overview) let you schedule planned downtime so checks don't create false alerts. When you also publish a status page, you can show that maintenance to your users: the window appears on the page before, during, and after it runs, affected components are flagged as under maintenance, and subscribers can be notified automatically. * A [status page](/docs/communicate/status-pages/creating-a-status-page) with at least one component. * The Communicate add-on, which unlocks status page maintenance. Without it, the **Status page visibility** section of the maintenance window stays locked. * Access to the maintenance window feature. ## Showing a maintenance window on your status page You configure status page visibility from the maintenance window itself. Go to the **Maintenance Windows** page (the wrench icon in the sidebar) and create a window, or open an existing one. Set its schedule and [check behavior](/docs/communicate/maintenance-windows/overview#check-behavior) as usual. In the **Status page visibility** section, turn on the toggle. This is the master switch for everything below it. * **Show on**: select one or more status pages the maintenance should appear on. * **Components affected**: choose **All components on this page**, or pick **Specific components**. With "All components", components you add to the page later are automatically covered. (On deprecated v2 pages, this selection uses services instead.) * **Show affected components**: on by default. Turn it off to publish the window without naming the components it covers. See [Hiding affected components](#hiding-affected-components). Pick a severity (**Minor**, **Medium**, **Major**, or **Critical**) to show your users how impactful the maintenance is. Save the maintenance window. It now appears on the selected status pages. Status page visibility settings on a maintenance window All maintenance times on a status page are displayed in **UTC**, the same as incidents. ## What your visitors see Once a window is visible, it appears on your status page in several places depending on its state: * **Upcoming**: a collapsible "scheduled maintenances" section on the status page lists maintenance that hasn't started yet. * **Active**: while maintenance is running, a banner at the top shows the affected components as under maintenance, and each affected component is marked with a maintenance icon. * **History**: completed maintenance appears in the **Activity** timeline alongside incidents, and on the 90-day availability chart. Scheduled (upcoming) maintenance is shown only in the upcoming section, not in the activity history. * **Detail page**: every maintenance has its own page with the full timeline of updates. ## Hiding affected components To announce planned work without revealing which parts of your system it touches, turn **Show affected components** off in the **Status page visibility** section. The window still appears on your status page as a general event, with its name, schedule, severity, and updates. With the setting off: * The maintenance card and its detail page list no components, and no component on the page is marked as under maintenance. * Subscriber notifications leave out the affected components. * Incident downtime that overlaps the maintenance counts as regular downtime in your status page uptime. ## Posting updates to your status page A maintenance moves through a [lifecycle of statuses](/docs/communicate/maintenance-windows/overview#maintenance-lifecycle-and-updates) (Scheduled, In progress, Verifying, Completed, Cancelled) and carries a timeline of **updates**. On a status-page window, those statuses and updates are exactly what your visitors see, and each update can notify subscribers. Updates are posted automatically when the maintenance starts and completes. You can also post your own from the maintenance's page, with a message and a new status, to keep visitors informed while the work is happening (for example "running longer than expected, extending by 30 minutes"). On a status-page window you can turn **off** automatic start or completion, so the maintenance only advances when you act on it. (Windows that are not shown on a status page always start and complete automatically.) If you turn off automatic completion and never close the maintenance yourself, it stays active past its scheduled end and keeps pausing checks or silencing alerts until you mark it **Completed** or **Cancelled**. ## Notifying subscribers You can notify your status page subscribers about maintenance, the same way you do for incidents. * **Notify on start** and **Notify on end** send a notification when the maintenance starts and ends automatically. * **Reminders** send up to three advance emails before the maintenance starts, each between 1 hour and 7 days ahead. * When you post a manual update, you can also choose whether to notify subscribers for that specific update. Only [verified subscribers](/docs/communicate/status-pages/subscriber-notifications) receive these emails. Leave the notification options off for low-impact or internal maintenance to avoid emailing subscribers about work they don't need to know about. ## Recurring maintenance If your maintenance window [repeats](/docs/communicate/maintenance-windows/overview#setting-repeats), each occurrence is tracked separately on your status page, with its own status and its own updates. This keeps the history of each individual maintenance run accurate for your users. ## Suppressing automatic incidents If you use [incident automation](/docs/communicate/status-pages/incidents#incident-automation) to open incidents when a check fails, you can prevent those automatic incidents during planned maintenance. Turn on **Don't open incidents** in the status page visibility settings. While the maintenance is active, a failing check covered by an automation rule will not automatically open an incident on that status page. Incidents you open manually are unaffected. This option applies only to the components covered by the maintenance on the pages it is shown on. Incident downtime that overlaps a published maintenance period is excluded from your status page **uptime**. Windows with [**Show affected components**](#hiding-affected-components) turned off are the exception: their overlapping downtime still counts. # Status Pages Overview Source: https://www.checklyhq.com/docs/communicate/status-pages/overview Create status pages to communicate service health, incidents, and maintenance to your customers, with automated incidents and custom branding. Status pages communicate the health of your services to customers, users, and stakeholders. A status page shows the current status and 90-day history of each component, plus open incidents and planned maintenance. Status page example Older pages built from cards and services are deprecated but keep working — see [Status pages v2 (deprecated)](/docs/communicate/status-pages/v2-deprecated). You can migrate a v2 page from its page settings in the Checkly app. ## Components A status page is built from **components**. A component represents a part of your product as your users see it: the web app, the API, email delivery. Components come in two types: * **Service**: a monitored thing with its own status and uptime history. * **Group**: a container that nests services under a shared heading. A group shows the average uptime of its children. Components belong to one status page. You manage them in the page's settings, where you can add, nest, reorder, hide, and delete them. Component editor ## Component status and impacts Each component has one of five statuses: | Status | Meaning | | -------------------- | --------------------------------- | | Operational | Everything works | | Under maintenance | Planned maintenance is running | | Degraded performance | Slow, but working | | Partial outage | Some functionality is unavailable | | Major outage | The component is down | A component's status is set by open [incidents](/docs/communicate/status-pages/incidents): each incident declares an impact per affected component. The page header shows the worst status across all components. ## Automatically creating incidents Automation rules open and resolve incidents based on your checks. A rule matches failing checks by **tag**: when a check carrying one of the rule's tags fails, Checkly opens one incident impacting the components the rule lists, and resolves it when the check recovers. Manage rules on the **Automation** tab of your status page, or in code with the [`StatusPageV3AutomationRule`](/docs/constructs/status-page-v3-automation-rule) construct. Incident automation is available on Communicate Team and Enterprise plans. [View pricing](https://checklyhq.com/pricing) ## Uptime calculation Uptime is calculated over the **last 90 days**, per component, from incident impacts: * **Major outage** time counts as full downtime. * **Partial outage** time counts as 30% downtime. * **Degraded performance** and **under maintenance** do not lower uptime. ``` Uptime = ((Total time - Weighted downtime) / Total time) × 100 ``` A group shows the average uptime of its child components. Uptime is driven by incidents, not directly by check results: without an automation rule or a manually created incident, a failing check does not lower uptime. ## Monitoring as code Status pages, components, and automation rules can be fully managed with the Checkly CLI. See the [`StatusPageV3`](/docs/constructs/status-page-v3) construct. `checkly import status-page:` imports an existing page with its components and rules into your project. ## Best practices * Keep the component list short. A page with a handful of user-facing components reads better than one mirroring your service map. * Use groups to aggregate regions or subsystems. * Write incident updates in plain language and update them as you learn more. Close incidents with a short explanation of the fix. # Password Protection Source: https://www.checklyhq.com/docs/communicate/status-pages/password-protection Restrict access to your status page so only authorized users can view your service health and incidents. Password protection is available as a Communicate Team add-on. [View pricing](https://checklyhq.com/pricing) Password protection makes your status page private. Visitors must authenticate before they can view service health, uptime data, or incidents. This is useful when your status page contains sensitive operational information intended for internal teams or select customers. ## Enabling password protection 1. Open your status page from the [Status Pages overview](https://app.checklyhq.com/status-pages). 2. In the status page settings, enable the **Private** toggle. 3. A password is automatically generated. Copy it and store it somewhere safe — it is only displayed once. 4. Save your status page. Your status page is now private. Share the password with external users who need access — members of your Checkly account can sign in directly with their Checkly credentials. ## How visitors access a private status page When someone visits a password-protected status page, they see a login form with two ways to authenticate: * **Password**: Enter the shared password provided by the status page owner. * **Checkly account**: Members of the Checkly account that owns the status page can click **Sign in with Checkly account** to log in with their existing Checkly credentials. This does not require the shared password. After authenticating with either method, visitors are authenticated for **30 days** before needing to sign in again. If your status page uses both a subdomain (`your-page.checkly-status-page.com`) and a [custom domain](/docs/communicate/status-pages/customization#custom-domain), visitors need to log in separately on each domain. Authentication does not carry over between domains. Only members of the Checkly account that owns the status page can use the **Sign in with Checkly account** option. Other Checkly users will be rejected. ## Rotating the password You can regenerate the password at any time from the status page settings. When you do: * A new password is generated and displayed once — store it somewhere safe. * All existing sessions are invalidated, including those authenticated via **Sign in with Checkly account**. Every viewer will need to re-authenticate. Use password rotation when someone who had access no longer should, if the password is lost, or as a routine security practice. ## Disabling password protection To make your status page public again, turn off the **Private** toggle in your status page settings and save. The password is deleted and anyone can view the page without authentication. # Subscriber Notifications Source: https://www.checklyhq.com/docs/communicate/status-pages/subscriber-notifications Configure subscriber notifications. ## Subscribing to incident updates Users can choose to be notified about any incident impacting your components by subscribing through your Status Page. To subscribe to notifications, users click the "Get updates" button at the top of the Status Page, and then fill out a form to enter their email address. A verification email is sent to the user's email address to confirm the subscription. From that moment on, users with a confirmed subscription will receive emails for incident updates and resolutions. They can choose to unsubscribe from these emails at any time. ## Following updates via RSS, Atom, or Slack Status page updates are also published as feeds, so users can follow incidents without subscribing by email. Click **Get updates** on any status page and pick a tab: * **RSS**: copy the RSS feed URL (`https://your-status-page-domain/feed.rss`) or the Atom feed URL (`https://your-status-page-domain/feed.atom`) into any feed reader. Both feeds cover recent incidents and maintenance windows. * **Slack**: run the command shown in the Slack tab — `/feed subscribe https://your-status-page-domain/slack.rss` — in any Slack channel to get updates whenever an incident is created, updated, or resolved. Feed subscriptions are anonymous and don't count toward your subscriber limits. Feeds are not available on private status pages, as feed readers cannot authenticate. ## How Checkly deals with subscribers limits based on your plan To ensure your users can subscribe to your status page, **extra subscribers will be automatically billed as overages** once you've bought a Communicate Starter or Communicate Team add-on. You can monitor your subscribers and overages from [your Checkly account billing page](https://app.checklyhq.com/settings/account/billing). If you have not purchased any Communicate add-on, we will continue accepting new subscribers to your page, yet will only send notifications to the first 250 subscribers. Once you upgrade to get more subscribers, those existing subscribers will start receiving notifications. [View pricing for more details about limits](https://www.checklyhq.com/pricing). # Status Pages v2 (deprecated) Source: https://www.checklyhq.com/docs/communicate/status-pages/v2-deprecated Documentation for the deprecated cards-and-services status pages. **Deprecated.** This page describes the previous generation of Checkly status pages, built from cards and account-wide services. Existing v2 pages keep working, but new pages use [components](/docs/communicate/status-pages/overview#components). You can migrate a v2 page to the current generation from its page settings in the Checkly app. ## Services A service represents a functional piece of your application, such as a landing page, API, or support portal. Services are account-wide: a single service can be shown on multiple status pages. When an incident is opened for a service, it appears on all pages that use it, and subscribers of each of those pages receive email notifications. When naming a service, use a name that is identifiable for your users, as it is used in incident notifications. ## Cards A v2 status page displays services grouped into cards. A card shows the average uptime of the services listed on it. To display a service, open the status page editor and use the **Services** dropdown on a card. You can create new services directly from the dropdown. ## Incident automation with check triggers On v2 pages, incidents are automated by connecting a check to a service: 1. Open your check and click **Edit**. 2. For API checks, URL monitors and TCP monitors, open the **Incident triggers** tab. For Browser and Multistep checks, open **Settings**, then **Incident automation**. 3. Enable **incident automation** and fill in the incident name, first status update, and severity. 4. Select the service the incident should be opened on and whether subscribers are notified. 5. Save your check. When the check fails and triggers an alert, an incident opens on the connected service. It resolves automatically when the check recovers. On current status pages, automation works through tag-based [automation rules](/docs/communicate/status-pages/incidents#incident-automation) instead of per-check triggers. ## Uptime calculation Uptime on v2 pages is calculated over the last 90 days per service. Incident duration counts as downtime: ``` Uptime = ((Total time - Downtime) / Total time) × 100 ``` A card shows the average uptime of its services. ## Monitoring as code The v2 constructs are deprecated but still documented: [`StatusPage`](/docs/constructs/status-page), [`StatusPageService`](/docs/constructs/status-page-service), and [`IncidentTrigger`](/docs/constructs/incident-trigger). ## Migrating to the current generation Open your v2 page and start the migration from the page settings. The wizard lets you: * Pick which cards and services become groups and components. * Carry over incidents, their reported downtime, and maintenance windows. * Review checks that used incident triggers. Tag-based automation rules cannot be derived automatically, so recreate those automations after migrating. Migration is one-way. The v2 page becomes a components-based page under the same URL. # Playwright vs Cypress - Detailed comparison [2024] Source: https://www.checklyhq.com/docs/comparisons/frameworks/playwright-vs-cypress Discover the differences between Playwright and Cypress. Explore key features, pros and cons, and how to pick the right framework. Playwright and Cypress are two frameworks both closely associated with end-to-end testing of production websites. Both frameworks can do quite a bit more than 'making sure nothing on your site is broken' and their design philosophies, architectures, and use cases are different. Starting in mid-2024, Playwright surpassed Cypress in npm downloads, indicating that more projects are starting with Playwright as their preferred automation framework. Playwright is the framework supported by Checkly in our current runtimes. ## Playwright overview While Cypress is a testing tool, [Playwright](https://www.checklyhq.com/learn/playwright/what-is-playwright/) is an automation solution. This distinction is important when you compare these solutions, with Playwright supporting more features to allow for repetetive scripted actions and automations. Playwright is a tool focused on developer productivity with more robust built-in features, the ability to use async/await, built in parallelization, a much lighter weight in CI. Playwright is also less opinionated because it doesn’t have to be, you can use it however you want. Playwright can [monitor your APIs](https://www.checklyhq.com/learn/playwright/testing-apis/) just as well as it can your frontend web pages. Scraping content for a LLM model? Check! Have a nested app in an iframe you want to test? Go wild! *Three different browser sessions in the same chat instance? Sounds cool! Re-use your tests to monitor production? Absolutely.* ## Playwright Key Features * Supports multiple languages: JavaScript, TypeScript, Python, Java, C# * Create tests without writing any code with their test generator * Cross-platform testing (Windows, macOS, Linux) * Native support for multiple browsers (Chromium, Firefox, WebKit) * API testing, visual regression, and component testing support * Test parallelism and isolated browser contexts * Headless and headed modes for fast execution * Advanced debugging tools like Trace Viewer * Network-level testing: intercepts requests and manipulates responses * Integrates easily with CI/CD pipelines ## Cypress overview With Cypress, E2E went from the painful world of hard-coded waits and heavy-handed POM approaches to built in actionability and visibility checks with a focus on community building and developer experience. What we’ve seen over the course of the last five years or so is a cultural shift in the testing world from a heavy reliance on Manual QA and non-developer owned testing responsibilities to testing as a more fully incorporated practice. We’ve shifted left. We’ve also seen testing become the battleground of where your developer velocity goes to die. Since the inception of playwright more and more teams contain dedicated roles for platform engineering, with a focus on making development, testing, and the [deployment process](https://www.checklyhq.com/guides/empowering-developers-with-checkly/) easier for everyone. Titles have changed, entire departments have been lost to restructures, responsibilities have adjusted and solutions that were groundbreaking less than a decade ago are now no longer cutting edge. The main areas where Cypress loses now used to be where they won; community trust, focus on developer productivity and rapid feature development. It’s not that those things don’t matter to Cypress any longer, but their attention has clearly shifted to solving enterprise problems. We can talk about [blocking npm packages](https://currents.dev/posts/v13-blocking), or [paywalling features](https://docs.cypress.io/guides/cloud/test-replay) that create parity with Playwright, but that would be a distraction. What really matters is velocity and practicality. A solution without parity to its top competitor, that requires the largest machines in CI and is still slower to run; is neither efficient nor practical unless you’re already using it. ## Cypress Key Features * JavaScript and TypeScript support (limited to web apps) * Native test runner with interactive GUI * Provides automatic waits, retry logic, and time travel debugging * Rich network mocking and stubbing tools * Custom dot-notation language for async * Supports browser automation for Chromium-based browsers * Focuses on frontend testing but supports API testing * Strong documentation * Direct access to browser internals, enabling state manipulation ## **Playwright vs Cypress: Architectural Differences** ### **Overview of Architectures** The architectural differences between Playwright and Cypress reflect distinct design philosophies and impact how each tool interacts with browsers and testing workflows. Playwright leverages the **Chrome DevTools Protocol (CDP)** to automate browsers directly, while Cypress runs within the browser’s execution loop via a custom Electron-based app. These design choices affect browser support, performance, parallelization, and test writing practices. ### **Playwright Architecture** * **CDP-based**: Playwright interacts with browsers using the Chrome DevTools Protocol, which is natively supported by major browsers (Chromium, Firefox, WebKit). This allows it to control the browser externally without modifying the browser’s native execution loop. * **Separate Node Process**: Since Playwright runs outside the browser’s execution loop, it requires an external process (Node.js) to orchestrate tests. This design is more similar to Selenium’s WebDriver model, although Selenium 4 now also supports CDP. * **Language Flexibility**: Playwright’s architecture allows multi-language support, including JavaScript, TypeScript, Python, Java, and C#. It can also integrate with other frameworks like RobotFramework. * **Parallel Testing**: Playwright offers built-in parallelism without additional configuration, enabling faster test execution out of the box. * **Browser & Tab Support**: Playwright supports all major browsers and multiple tabs, giving it flexibility for complex test scenarios. It also has experimental support for mobile testing. * **Standardized Integration**: Playwright integrates smoothly with high-level testing frameworks (e.g., CucumberJS, CodeceptJS) without custom runners, as the browser behaviors remain unmodified. ### **Cypress Architecture** * **Electron-based App**: Cypress runs as a native JavaScript app embedded within an Electron browser. This architecture means tests and Cypress’s custom library run **within the browser’s execution loop**, directly injecting code into the test browser. * **Tight Browser Integration**: This direct integration allows Cypress to manipulate browser behavior (e.g., automatic waits and retries) but limits support to JavaScript and transpiled languages. It also complicates browser support—Safari, for instance, is not currently supported. * **Single Process Control**: Cypress uses a combination of Node.js and its custom library for test execution, but the bulk of the test control happens in the browser, limiting flexibility compared to Playwright’s external Node process. * **Component Testing Support**: Because Cypress runs directly within the browser, it enables component and unit testing as well as E2E tests in the same framework. However, this approach changes the browser’s behavior, creating potential differences from real-world user scenarios. * **Limited Parallelism**: Parallelization is not available out of the box and requires a **SaaS subscription** to Cypress Cloud for optimal parallel test execution. * **Limited Tab and iFrame Support**: Cypress does not support multiple tabs and has limited and sometimes inconsistent iFrame handling, making it less effective for complex web applications. ### **Impact of Architectural Differences** 1. **Browser and Platform Support** * Playwright supports all modern browsers (Chromium, Firefox, WebKit) and can run on multiple operating systems with little configuration (sidenote: Checkly currently supports using Chromium or Chrome with Playwright Test and Playwright library, with Chromium being the default browser for all checks. [Read more about using Chrome](/docs/detect/synthetic-monitoring/browser-checks/overview#using-other-browsers)). * Cypress, with its Electron-based architecture, requires adaptation for each browser and does not support Safari or tabs. 2. **Testing Flexibility** * Playwright’s language-agnostic design supports a wide range of frameworks and languages beyond JavaScript. Cypress is restricted to JavaScript and TypeScript. * Playwright focuses on E2E and system testing, while Cypress can handle both component and E2E testing within the same framework, though it changes browser behavior in the process. 3. **Parallelization and CI Integration** * Playwright offers **free built-in parallel testing** and easily integrates with CI pipelines using only `npm install`. Cypress requires either SaaS subscriptions or workarounds for parallelism, increasing costs and complexity. * For remote testing, Playwright integrates seamlessly with Selenium Grid and SaaS solutions (e.g., BrowserStack), while Cypress relies on its own cloud service. 4. **Performance and Practicality** * Playwright’s external control through CDP offers **more realistic testing**, reflecting real user behavior without modifying browser internals. * Cypress’s tight browser integration provides fast feedback loops for developers but can lead to discrepancies between test environments and real-world scenarios. 5. **Asynchronous Code Handling** * Playwright uses standard **async/await** syntax, providing a clear, modern JavaScript interface. Cypress uses a custom dot notation that simplifies code but is not fully asynchronous, limiting flexibility. ### **Which Architecture Fits Your Needs?** * **Choose Playwright** if you need cross-browser support, parallelism, and multi-language flexibility. Its architecture is more scalable for complex, multi-layered applications that demand realistic, real-world testing. * **Choose Cypress** if your focus is on quick feedback during frontend development, and you prefer a highly interactive testing experience embedded within the browser. Cypress is ideal for teams already working in a JavaScript/TypeScript environment with limited browser requirements. ## Playwright vs Cypress: Key Differences Comparison | Feature | Playwright | Cypress | | -------------------- | ----------------------------------------- | ------------------------------- | | Language | JavaScript, TypeScript, Python, Java, C# | JavaScript, TypeScript | | Test Runner | Works with Jest, Mocha, and others | Built-in test runner | | Operating Systems | Windows, macOS, Linux | Windows, macOS, Linux | | Open Source | Yes | Yes | | Parallel Testing | Full parallelism, even within specs | Parallel at spec level only | | Architecture | Uses browser contexts for isolation | Runs within the browser itself | | Browsers Supported | Chromium, Firefox, WebKit | Chrome, Edge (Chromium-based) | | Documentation | Strong Microsoft support, Discord channel | Strong community, Slack support | | Real Devices Support | Limited | No | | Plugins | Relies on custom setup | Ecosystem of plugins | ## Playwright vs Cypress Examples At the highest level, Playwright and Cypress tests look very similar when writing a basic tests. Differences only really become visible when you make two asynchronous requests with assertions. ### Playwright Example ```ts theme={null} import { test, expect } from '@playwright/test' test('Multiple API Requests Test', async ({ request }) => { // First request and assertion const todoResponse = await request.get('https://jsonplaceholder.typicode.com/todos/1') expect(todoResponse.status()).toBe(200) // Second request and assertion const userResponse = await request.get('https://jsonplaceholder.typicode.com/users/1') expect(userResponse.status()).toBe(200) }) ``` Playwright uses the standard `await` syntax used in the rest of Node.js. ### Cypress Example ```js theme={null} describe('Multiple API Requests Test', () => { it('should return valid status codes for two API requests', () => { // First request and assertion cy.request('https://jsonplaceholder.typicode.com/todos/1') .its('status') .should('eq', 200) // Second request and assertion cy.request('https://jsonplaceholder.typicode.com/users/1') .its('status') .should('eq', 200) }); }) ``` With Cypress, we're using their custom syntax, which is a bit more compact but still has its own specialized field of knowledge. If you're pursuing a [monitoring as code](https://www.checklyhq.com/guides/monitoring-as-code/) strategy and getting everyone involved in testing and monitoring, this domain-specific syntax may be a barrier to entry. Further, Cypress asynchrony may not act as expected if we're used to asynchrony from Node.js. In Cypress, each `cy.request()` runs asynchronously, but Cypress queues them sequentially. This ensures that the second request only executes after the first one completes, making this pattern simple and effective for making multiple assertions across async requests. ## Playwright vs Cypress: Pros & Cons ### Playwright Pros * Supports more browsers, including Firefox and Safari/WebKit * Suitable for complex web apps with [API](https://www.checklyhq.com/learn/playwright/testing-apis/), UI, and [visual testing](/docs/detect/synthetic-monitoring/browser-checks/visual-regressions) combined * Superior parallelism and scalability for larger test suites * Works on multiple platforms ### Playwright Cons * More complex setup for beginners * Larger learning curve compared to Cypress * Requires deeper configuration to utilize full power ### Cypress Pros * User-friendly interface, easy for beginners * GUI with real-time updates during tests * Great for frontend testing ### Cypress Cons * Limited to Chromium-based browsers * Struggles with large-scale parallelism * No native support for multi-language tests ## Playwright vs Cypress: Which Solution is Better for You? * Choose Playwright if you need to test across multiple browsers, require advanced parallelism, or need to include API and component testing in your workflow. It’s better suited for complex, large-scale projects with multiple stakeholders. If you've been told 'that's hard to test with Cypress' there's no doubt you can do it in Playwright. * Choose Cypress if your focus is frontend testing, or you are working on web apps that run primarily in Chrome/Edge. Cypress is more user-friendly for teams without extensive testing experience and offers quick startup time with fewer configurations. ## Conclusion Both Playwright and Cypress are powerful tools, but each shines in different areas. Playwright’s versatility makes it the better choice for complex, multi-layered applications requiring scalability, while Cypress excels in simplicity and frontend testing. Now that you've chosen a framework, what's next? # Playwright vs other automation frameworks Source: https://www.checklyhq.com/docs/comparisons/frameworks/playwright-vs-others Learn how Playwright, a browser automation tool, simplifies testing across Chrome, Firefox, and WebKit. Start building more reliable web applications today. There are a number of options when for [frameworks for end-to-end testing](https://www.checklyhq.com/blog/cypress-vs-selenium-vs-playwright-vs-puppeteer-speed-comparison/). If you're thinking about using Checkly, you're likely aware of a few. ## Puppeteer vs Playwright The resemblance to Google's [Puppeteer](https://developer.chrome.com/docs/puppeteer) is striking, and for good reason. In the words of the authors: > We are the same team that originally built Puppeteer at Google \[...]. With Playwright, we'd like to take it one step further and offer the same functionality for *all* the popular rendering engines. We'd like to see Playwright vendor-neutral and shared governed. In short, Playwright builds on the experience of Puppeteer to provide a way to: 1. run against all major browsers (Chromium/Chrome, Firefox, WebKit/Safari) 2. write more concise scripts (e.g. minimising the need for explicit waits) 3. easily migrate existing codebases (keeping a very similar API) This is achieved in the form of a compact node library that exposes a high-level API to interact with web pages in a fast, secure, stable and simple way. As it is an open-source project, you can [contribute](https://github.com/microsoft/playwright/blob/master/CONTRIBUTING.md) to it yourself. ## Playwright vs Cypress Long the dominant framework for (at the time) modern end-to-end testing, Cypress is still very widely used as a testing framework by front-end focused teams. Due to architectural differences, Playwright can support multiple languages for writing tests, and run more browsers for testing. Due to Playwright's status as a free and open source project, users don't have to deal with new features being paywalled, a significant issue for Cypress users since 2023. [Read more about Playwright vs. Cypress.](/docs/comparisons/frameworks/playwright-vs-cypress) # Playwright vs Selenium - Detailed Comparison for 2024 Source: https://www.checklyhq.com/docs/comparisons/frameworks/playwright-vs-selenium Explore the key differences between Playwright and Selenium in web testing. Discover the examples, pros and cons, and learn how to run the tests. When considering automated testing tools for web applications, the choice between Playwright and Selenium is common. Both tools offer robust capabilities, but they cater to different needs and expertise levels. This article provides a detailed comparison to help you decide which solution is best for your project or organization. ## Playwright Overview Playwright is a relatively new browser automation framework that has gained popularity due to its modern approach to web testing. It supports multiple programming languages, but it is particularly well-suited for JavaScript and TypeScript users. ### Playwright Key Features * **Out-of-the-box Test Framework**: Playwright comes bundled with Playwright Test, providing a comprehensive test automation framework that handles test execution, reporting, assertions, and more. * **Auto-Wait Mechanism**: Playwright intelligently waits for elements to be ready before interacting with them, reducing the need for manual wait statements. * **Cross-Browser Testing**: It supports Chromium, Firefox, and WebKit, making it useful for testing across different browsers. * **Parallel Execution**: Built-in support for running tests in parallel to speed up execution time. * **Trace Viewer**: A powerful debugging tool that records test execution, allowing you to inspect the behavior and identify issues. * **Headless Mode**: Ability to run tests in headless mode for faster execution and CI/CD pipelines. ### How to Run Playwright Tests 1. Install Playwright using npm: ```bash theme={null} npm install --save-dev playwright ``` 2. Set up a test script using `@playwright/test`: ```ts theme={null} import { test, expect } from '@playwright/test' test('example test', async ({ page }) => { await page.goto('') const title = await page.title() expect(title).toBe('Example Domain') }) ``` 3. Run the test with the Playwright CLI: ```bash theme={null} npx playwright test ``` ## Selenium Overview Selenium has been a mainstay in browser automation for over a decade. It is widely used across the industry and supports multiple languages, including Java, Python, C#, and JavaScript. Selenium is a browser automation tool rather than a full-fledged testing framework, which means you’ll need to add additional libraries for assertions, reporting, and parallel test execution. ### Selenium Key Features * **Multi-Language Support**: Selenium supports many programming languages, making it flexible for teams with diverse tech stacks. * **Cross-Browser Testing**: It works with all major browsers, including Chrome, Firefox, Safari, and Edge. * **WebDriver Protocol**: Selenium uses the WebDriver protocol, which is a standard for browser automation. * **Support for Real Devices**: It integrates well with cloud services for testing on real devices. * **Large Ecosystem**: There are many plugins, libraries, and resources available for Selenium. ### Setting up and running Selenium tests Here’s how to run a Selenium test in NodeJS 1. **Install Selenium WebDriver** You can add Selenium WebDriver to your project using NPM: ```bash theme={null} npm install selenium-webdriver ``` Selenium WebDriver is the library that allows your tests to interact with browsers. ### Writing a Basic Selenium Test 1. **Import the Selenium WebDriver Module** In your test file (e.g., `test.js`), import the `selenium-webdriver` package: ```js theme={null} const { Builder, By, until } = require('selenium-webdriver'); ``` 2. **Set Up the Browser Driver** Use the `Builder` to configure your test environment. Here is a simple example: ```ts theme={null} async function exampleTest() { // Initialize a new browser instance const driver = await new Builder().forBrowser('chrome').build(); try { // Navigate to a website await driver.get('https://www.example.com'); // Perform actions or assertions const title = await driver.getTitle(); console.log('Page Title:', title); // Find an element and interact with it const element = await driver.findElement(By.name('exampleInput')); await element.sendKeys('Test Input'); // Wait for some condition, if necessary await driver.wait(until.titleIs('Expected Title'), 5000); } finally { // Clean up and close the browser await driver.quit(); } } // Run the test exampleTest(); ``` ### Running the Test To run your test, execute `node test.js` in your terminal This command launches a browser, performs the specified actions, and then closes the browser. You should see any console output you added, such as the page title. ## Playwright vs Selenium: Key Differences While Playwright and Selenium are both used for similar roles as test automation. And both are focused on operating a browser automatically, the difference in their backgrounds, core userbase, and ages show up in a number of implementation details. | **Feature** | **Playwright** | **Selenium** | | -------------------------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------- | | **Language** | Primarily used with JavaScript/TypeScript; also supports Python, Java, and .NET. | Supports a wider range of languages, suitable for diverse tech stacks. | | **Test Runner Frameworks** | Comes with Playwright Test, a built-in test runner. | Does not include a test runner; requires integration with frameworks like JUnit, TestNG, or PyTest. | | **Element Locators** | Uses modern CSS selectors and locators like `getByRole`, `getByText`, `getByTestId`. | Uses traditional locators such as `id`, `class`, `xpath`, `cssSelector`. | | **Waits** | Automatic waiting for elements, reducing the need for manual `sleep` statements. | Requires explicit or implicit waits, leading to more complex synchronization issues. | | **Ease of Installation** | Easy to install with a single npm command. | Requires installing browser drivers and additional setup components. | | **Trace Viewer** | Includes a built-in trace viewer for debugging. | No built-in trace viewer; debugging requires additional tools. | | **Prerequisites** | Basic knowledge of JavaScript or TypeScript. | More flexibility with languages but requires additional setup. | | **Operating Systems** | Supports Windows, macOS, and Linux. | Supports Windows, macOS, and Linux. | | **Open Source** | Actively gaining traction and evolving rapidly. | Established community, but some resources may be outdated. | | **Parallel Testing** | Built-in support for parallel test execution. | Requires a third-party framework for parallel runs. | | **Architecture** | Modern architecture optimized for speed and reliability. | Based on the WebDriver protocol, which is older. | | **Browsers Supported** | Chromium, Firefox, WebKit. | Chrome, Firefox, Safari, Edge, and more. | | **Documentation & Community** | Well-documented; community support is growing. | Established community with extensive resources. | | **Real Devices Support** | Limited real device testing options. | Better integration with cloud-based real device testing services. | | **Plugins** | Fewer plugins but growing support. | Rich ecosystem of plugins for various purposes. | | **Visual Testing** | Native support for visual regression testing. | Requires third-party libraries for visual testing. | | **Test Recording & Screenshots** | Built-in support for test recording and screenshots. | Screenshots supported; test recording needs external tools. | | **Assertions** | Comes with built-in assertions. | Needs an external assertion library. | | **Test Reporting** | Built-in test reporting features. | Needs external reporting libraries. | | **API Automation** | Supports API testing natively. | Focused on browser automation only. | | **Performance** | Generally faster, especially in headless mode. | Slower due to the WebDriver protocol overhead. | ## ## Selenium Example Here’s a test that simulates a user logging in and loading recent transactions. The automation then takes a screenshot. ```js theme={null} const { Builder, By, until } = require('selenium-webdriver'); const fs = require('fs'); async function loginAndCaptureScreenshot() { // Initialize the browser driver const driver = await new Builder().forBrowser('chrome').build(); try { // Step 1: Navigate to the login page await driver.get('https://www.example-service.com/login'); // Step 2: Enter login credentials await driver.findElement(By.id('username')).sendKeys('your-username'); await driver.findElement(By.id('password')).sendKeys('your-password'); // Step 3: Click the login button await driver.findElement(By.id('login-button')).click(); // Step 4: Wait until the recent transactions button is loaded await driver.wait(until.elementLocated(By.id('recent-transactions-button')), 10000); // Step 5: Click recent transactions await driver.findElement(By.id('recent-transactions-button')).click(); // Step 6: Wait until the recent transactions are loaded await driver.wait(until.elementLocated(By.id('recent-transactions')), 10000); // Step 7: Take a screenshot const screenshot = await driver.takeScreenshot(); fs.writeFileSync('screenshot.png', screenshot, 'base64'); } catch (error) { console.error('An error occurred:', error); } finally { // Step 8: Close the browser await driver.quit(); } } // Run the test loginAndCaptureScreenshot() ``` ## Playwright Example Here’s the same test in Playwright: ```js theme={null} import { test, expect } from '@playwright/test' test('login and capture screenshot', async ({ page }) => { // Step 1: Navigate to the login page await page.goto('https://www.example-service.com/login'); // Step 2: Enter login credentials await page.getByLabel('Username or email address').fill('username'); await page.getByLabel('Password').fill('password'); // Step 3: Click the login button await page.getByRole('button', { name: 'Sign in' }).click(); // Step 4: Click recent transactions await page.getByLabel('Transactions').click() // Step 5: Take a screenshot await page.screenshot({ path: 'screenshot.png', fullPage: true }); }) ``` Some key differences in the two examples: * Playwright uses modern css locators rather than finding by ID or class. ID and class can shift on an element when all that’s happening is a visual refresh of the site. We don’t want our tests to break in this situation! * Playwright includes auto-waiting, so there’s no need to add manual timeouts to our code. ## Playwright vs Selenium: Pros & Cons ### Playwright **Pros**: Easy to get started, built-in test framework, faster execution, modern architecture, better support for JavaScript/TypeScript. **Cons**: Fewer legacy languages supported (e.g. C), limited real device testing. ### Selenium **Pros**: Established tool with a large community, supports many languages, better integration with real device testing. **Cons**: More setup required, slower execution, higher learning curve for productivity. ## Playwright vs Selenium: Which Solution to Choose? ### When to Use Playwright * If you’re starting a new project and want fast productivity. * If your team is experienced with JavaScript or TypeScript. * If you need built-in features like auto-waiting, test recording, and API testing. ### When to Use Selenium * If you’re joining an established project that already uses Selenium. * If you require deep device simulation ## Conclusion **If you’re starting a new project, you want to use Playwright.** You’ll get exposure to JS or Typescript, plug in to a great existing community, write tests and other automations faster, and your tests will be more consistent and reliable. You can adopt Playwright without needing to become a “Playwright specialist” and the skills you learn will encourage solid front-end engineering and language skills in other areas. If you’re already using Selenium, it’s a framework with a lot of strengths! All other factors being equal, you don’t need to rip out your Selenium workflow just to adopt Playwright. Engineers building testing and automation have more options than ever, and they can simulate a broader range of user actions with great tool suites. For now, our pick for new projects is Playwright, and we’re excited to see what new features are added to the project in the coming years. # Cancellation Source: https://www.checklyhq.com/docs/concepts/cancellation Stop in-flight Playwright Check Suite runs from the UI, API, or CLI. Other check types cannot be cancelled. Cancellation lets you stop an in-progress [Playwright Check Suite](/docs/detect/synthetic-monitoring/playwright-checks/overview) run. Cancelled results are flagged with `isCancelled: true`, do not trigger alerts, and are excluded from availability and performance metrics. A session that contains at least one cancelled run ends in a terminal `CANCELLED` status. ## What you can cancel You can cancel two kinds of sessions, and the behaviour differs: **Check sessions** — created by the UI "Schedule now" button and `checkly deploy`. A check session is one execution of a single Playwright Check Suite, fanned out across the locations you configured. Cancelling the session stops every in-progress run; cancelling a single run leaves the rest of the session going. **Test sessions** — created by `checkly test`, `checkly trigger`, and `checkly pw-test`, which all record by default. A test session can contain multiple checks of different types. Cancelling the test session stops only the Playwright Check Suite runs inside it; any URL, API, Browser, Multistep, Heartbeat, TCP, DNS, or ICMP runs in the same session continue until they finish normally. You can also cancel a single Playwright run within the session. **Only Playwright Check Suite runs are cancellable.** Other check types cannot be cancelled, even when they appear inside a test session alongside Playwright runs. Scheduled runs are also excluded; cancellation is for user-initiated runs only. ## How to cancel On a check session or test session page, click **Cancel session** in the header to stop the whole session. To stop just a single run, use the cancel button on its row. Send a `POST` request to the cancel endpoint for the session type: [`/v1/check-sessions/{checkSessionId}/cancel`](/docs/api-reference/check-sessions/cancel-a-check-session) or [`/v1/test-sessions/{testSessionId}/cancel`](/docs/api-reference/test-sessions/cancel-a-test-session). The session ID goes in the path. Pass an optional `sequenceId` array in the body to cancel only specific runs within the session; send `{}` to cancel everything still running. ```bash Cancel a whole check session theme={null} curl -X POST https://api.checklyhq.com/v1/check-sessions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/cancel \ -H "Authorization: Bearer $CHECKLY_API_KEY" \ -H "X-Checkly-Account: $CHECKLY_ACCOUNT_ID" \ -H "Content-Type: application/json" \ -d '{}' ``` ```bash Cancel specific runs in a test session theme={null} curl -X POST https://api.checklyhq.com/v1/test-sessions/a1b2c3d4-e5f6-7890-abcd-ef1234567890/cancel \ -H "Authorization: Bearer $CHECKLY_API_KEY" \ -H "X-Checkly-Account: $CHECKLY_ACCOUNT_ID" \ -H "Content-Type: application/json" \ -d '{"sequenceId": ["b2c3d4e5-f6a7-8901-bcde-f12345678901"]}' ``` CLI cancellation is available in CLI v8.0.0+. Press Ctrl+C during a recorded test session run — `checkly test`, `checkly trigger`, and `checkly pw-test` all record by default — to cancel the session. The CLI keeps running to report the cancelled results; press Ctrl+C again to exit immediately. See the [CLI reference](/docs/cli/overview) for command-specific behavior. ## What happens after a run is cancelled The runner receives the cancellation signal, aborts the in-flight Playwright run, and reports the result back to Checkly. Each cancelled run's result has `isCancelled: true`. Once the session has stopped (any remaining non-Playwright checks finish normally), the session's status becomes `CANCELLED` because at least one of its runs was cancelled. Cancelled runs never produce failure or recovery alerts, regardless of your alert settings. See [Alert configuration](/docs/communicate/alerts/configuration). Availability, response time percentiles, and success ratios exclude cancelled runs. Your check status does not change. Public and private dashboards omit cancelled runs from their summary counts. Because no alert is sent and the check status does not change, [automated incidents](/docs/communicate/status-pages/incidents) are not opened from a cancelled run. ## API versioning Cancellation introduces two API additions: a new `CANCELLED` value on the check-session status enum, and a new `isCancelled` boolean on individual check results. The `isCancelled` flag is additive and ships on every check-result and check-session response without a version bump. The status enum change is breaking for clients that switch on status values exhaustively, so the new `CANCELLED` value is only returned by the v2 check-session endpoints; v1 maps cancelled sessions to `TIMED_OUT` in `status` so existing clients continue to work unchanged. [`POST /v1/check-sessions/trigger`](/docs/api-reference/check-sessions/trigger-a-new-check-session), [`GET /v1/check-sessions/{checkSessionId}`](/docs/api-reference/check-sessions/retrieve-a-check-session), and [`GET /v1/check-sessions/{checkSessionId}/completion`](/docs/api-reference/check-sessions/await-the-completion-of-a-check-session) report cancelled sessions as `TIMED_OUT` in `status` rather than `CANCELLED`. Per-result objects still include `isCancelled`, so individual cancelled runs remain identifiable. [`POST /v2/check-sessions/trigger`](/docs/api-reference/check-sessions/trigger-a-new-check-session-v2), [`GET /v2/check-sessions/{checkSessionId}`](/docs/api-reference/check-sessions/retrieve-a-check-session-v2), and [`GET /v2/check-sessions/{checkSessionId}/completion`](/docs/api-reference/check-sessions/await-the-completion-of-a-check-session-v2) return `CANCELLED` in `status` for cancelled sessions. Response shape is otherwise the same as v1. [`GET /v1/check-results/{checkId}/{checkResultId}`](/docs/api-reference/check-results/retrieve-a-check-result) and the list endpoints include `isCancelled` on every result. [`POST /v1/check-sessions/{checkSessionId}/cancel`](/docs/api-reference/check-sessions/cancel-a-check-session) and [`POST /v1/test-sessions/{testSessionId}/cancel`](/docs/api-reference/test-sessions/cancel-a-test-session) are the action endpoints. Each takes the session ID in the path and an optional `sequenceId` array in the body. If you build automation against check sessions and need to distinguish cancelled sessions from genuine timeouts at the session level, switch to the v2 endpoints. Otherwise, the `isCancelled` flag on per-result objects is available in both versions. # What are Checks? Source: https://www.checklyhq.com/docs/concepts/checks Checks are automated tests that monitor your application on a schedule. Checks are automated monitors that run against your application to verify availability, performance, and reliability. Each Check represents a specific test that runs on a schedule you define, whether that's a simple health check on an API endpoint or a complex, multi-step workflow through your entire application. Checks experience your application the same way real users would—clicking buttons, making API calls, filling forms, or connecting to services. You can run them as frequently as needed—every minute, hourly, or daily. When something breaks, you get notified immediately, often before users are affected. This lets you catch issues early, maintain confidence in your deployments, and ensure your critical systems are working as expected. ## Types of Checks Checkly's flexible offering includes several types of Checks, each designed for different levels of complexity and testing scenarios: Monitor HTTP/HTTPS endpoints for availability and performance. URL Monitors check if your websites and APIs are responding correctly by making HTTP requests and validating the response. **Perfect for:** * Website uptime monitoring * API endpoint availability * Basic performance tracking * SSL certificate monitoring Verify connectivity to any TCP service by establishing connections to specific hosts and ports. TCP Monitors test the availability of non-HTTP services and infrastructure components. **Perfect for:** * Database connectivity * Custom application services * Network service availability * Port accessibility testing Monitor scheduled processes, cron jobs, and batch operations that should "check in" at regular intervals. Instead of actively testing your service, Heartbeat Monitors wait to receive a signal from your system. **Perfect for:** * Backup job verification * Scheduled task monitoring * Batch process oversight * Data pipeline health Verify DNS resolution by querying domain records and validating responses. DNS Monitors help ensure your domains resolve correctly and detect issues such as misconfigurations, propagation delays, or resolver failures. **Perfect for:** * Domain resolution monitoring * DNS record validation * Detecting propagation issues * Troubleshooting resolver performance Ping hosts to measure network reachability and latency. ICMP monitors help you verify that a server or device is online and understand network-level performance. **Perfect for:** * Host reachability checks * Network latency monitoring * Packet loss detection Advanced API testing that goes beyond uptime monitoring. Use setup and teardown scripts, complex assertions, and custom request handling. Validate that your backend services respond correctly, perform within acceptable timeframes, and return the right data structures. **Perfect for:** * Complex API endpoint validation * Authentication and authorization testing * Data structure and schema validation * Performance benchmarking * Custom request/response handling * Integration testing between services Write Node.js scripts that run multiple API requests in sequence with arbitrary code between requests. Perfect for testing complex workflows involving authentication, data manipulation, and multi-step processes that span multiple endpoints. **Perfect for:** * Multi-step authentication flows * Data transformation workflows * Complex business logic testing * End-to-end API integrations * Workflow orchestration testing * Cross-service data validation Simulate real user interactions in a headless browser using TypeScript/JavaScript with @playwright/test. Navigate, screenshot, and assert your key webapp flows. Browser Checks can handle complex scenarios that simple uptime monitoring cannot. **Perfect for:** * Complete user journey testing * Login flows and authentication * Checkout processes and e-commerce flows * Form submissions and data entry * Visual regression testing * Mobile device emulation Run entire Playwright test suites and projects as production monitors without code rewrites. Playwright Check Suites support the full Playwright API and ecosystem, enabling you to use existing tests and configuration files as-is. **Perfect for:** * Converting existing E2E tests into monitoring * Testing complex user workflows across multiple browsers * Monitoring critical business processes * Validating application functionality after deployments ## How Checks Execute monitoring and alerting pipeline 1. A cron process picks up a check based on its schedule, say every 5 minutes. It validates that the check is not in progress at the moment to avoid race conditions. The check is put into a queue to be run from the next configured data center location 2. If the check is an API check and has a [setup script](/docs/detect/synthetic-monitoring/api-checks/setup-and-teardown), the setup script is executed 3. The check is executed 4. If the check is an API check and has a [teardown script](/docs/detect/synthetic-monitoring/api-checks/setup-and-teardown), the teardown script is executed Teardown scripts are run *before* any assertions are validated 5. The result is stored in our central database 6. If the check fails, its retry strategy is executed. Based on the retry strategy, a check is retried one or multiple times. Any setup & teardown scripts are run again as part of the process 7. Alerts are sent out in requested channels when the sequence is complete. It's considered complete when the check run was successful or the final attempt was executed. We will send alerts only if the final attempt has failed (no alerts sent for the initial attempts) ## Code-First Philosophy All check types at Checkly have a Construct or API endpoint - meaning you can use Checkly to bring your monitoring process right into your repository. We call this [Monitoring as Code](/docs/concepts/monitoring-as-code). This approach transforms monitoring from a manual, UI-driven process into a programmable, scalable system that grows with your application. You can version control your monitoring logic, collaborate on it through code reviews, and deploy monitoring changes through the same CI/CD pipelines you use for application code. # Monitor multiple environments Source: https://www.checklyhq.com/docs/concepts/environments Choose how to test and continuously monitor development, staging, and production environments with Checkly. Checkly does not create a separate Environment resource. Instead, you combine CLI projects, environment variables, and your CI/CD pipeline to target each application environment. Use a separate Checkly CLI project for every long-lived environment that you want to monitor continuously. Use `checkly test` without deploying a project when you only need to validate an ephemeral environment, such as a pull request preview. ## Choose an approach | What you want to do | Recommended approach | | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | Test an ephemeral preview deployment | Run `checkly test` with temporary environment variables. Do not deploy it as a scheduled monitor. | | Continuously monitor the same checks in development, staging, and production | Deploy the same check code as a separate CLI project for each environment. Give every project a unique, stable `logicalId`. | | Continuously monitor different checks in each environment | Use a separate project for each environment and select shared and environment-specific check files in the project configuration. | A Checkly CLI project is a deployment boundary, not the same thing as a Git branch or application environment. Your pipeline decides which branch deploys which project. ## Test an ephemeral environment Pass runtime values to `checkly test` with `--env` (`-e`) or `--env-file`. The values apply only to that test session and do not update your scheduled monitors. ```bash Terminal theme={null} npx checkly test \ --env ENVIRONMENT_URL="https://preview-123.example.com" \ --env API_TOKEN="$PREVIEW_API_TOKEN" ``` This approach works well for pull request previews and other short-lived deployments. See [CI/CD](/docs/integrations/ci-cd/overview) for the recommended test-before-deploy workflow. ## Continuously monitor multiple environments The following example deploys one shared API check to development, staging, and production. Each deployment has: * A unique project identity and separate deployment history * The same project-scoped check and group logical IDs * Its own URL and secret API token * Its own schedule, locations, and tags - A Checkly account and a Checkly CLI project - `CHECKLY_API_KEY` and `CHECKLY_ACCOUNT_ID` configured in your CI provider - A persistent deployment URL and credentials for each environment - A CI branch or deployment event that identifies the target environment Read the target environment from your CI pipeline and map it to a unique project `logicalId`. ```typescript checkly.config.ts theme={null} import { defineConfig, type Region } from "checkly" import { Frequency } from "checkly/constructs" type Environment = "development" | "staging" | "production" const environments: Record = { development: { projectName: "My app - Development", logicalId: "my-app-development", frequency: Frequency.EVERY_30M, locations: ["us-east-1"], }, staging: { projectName: "My app - Staging", logicalId: "my-app-staging", frequency: Frequency.EVERY_10M, locations: ["us-east-1"], }, production: { projectName: "My app - Production", logicalId: "my-app-production", frequency: Frequency.EVERY_5M, locations: ["us-east-1", "eu-west-1"], }, } const environment = process.env.CHECKLY_ENVIRONMENT as Environment | undefined if (!environment || !environments[environment]) { throw new Error( "Set CHECKLY_ENVIRONMENT to development, staging, or production" ) } const target = environments[environment] export default defineConfig({ projectName: target.projectName, logicalId: target.logicalId, checks: { activated: true, checkMatch: "**/__checks__/**/*.check.ts", frequency: target.frequency, locations: target.locations, tags: [environment], }, }) ``` Keep each project `logicalId` stable. Changing it creates a different project instead of updating the existing environment's monitors. Define values on a check or group when scheduled runs need them. In this example, the CLI reads the values from CI while deploying and stores them on the environment's check group. ```typescript __checks__/api.check.ts theme={null} import { ApiCheck, AssertionBuilder, CheckGroupV2, } from "checkly/constructs" const environment = process.env.CHECKLY_ENVIRONMENT const environmentUrl = process.env.ENVIRONMENT_URL const apiToken = process.env.API_TOKEN if (!environment || !environmentUrl || !apiToken) { throw new Error( "Set CHECKLY_ENVIRONMENT, ENVIRONMENT_URL, and API_TOKEN" ) } const environmentGroup = new CheckGroupV2("application", { name: `My app - ${environment}`, tags: [environment], environmentVariables: [ { key: "ENVIRONMENT_URL", value: environmentUrl }, { key: "API_TOKEN", value: apiToken, secret: true }, ], }) new ApiCheck("api-health", { name: `API health - ${environment}`, group: environmentGroup, request: { method: "GET", url: "{{{ENVIRONMENT_URL}}}/health", headers: [ { key: "Authorization", value: "Bearer {{{API_TOKEN}}}" }, ], assertions: [AssertionBuilder.statusCode().equals(200)], }, }) ``` The `application` and `api-health` logical IDs can stay the same because resource logical IDs are scoped to their CLI project. Setting `secret: true` prevents Checkly from exposing the token after it is saved. Map each persistent application environment to one Checkly project in your pipeline. Run the matching command after that environment's application deployment succeeds. | Application branch | `CHECKLY_ENVIRONMENT` | Checkly project `logicalId` | | ------------------ | --------------------- | --------------------------- | | `develop` | `development` | `my-app-development` | | `staging` | `staging` | `my-app-staging` | | `main` | `production` | `my-app-production` | For example, the staging deployment job would run: ```bash Terminal theme={null} CHECKLY_ENVIRONMENT=staging \ ENVIRONMENT_URL="https://staging-api.example.com" \ API_TOKEN="$STAGING_API_TOKEN" \ npx checkly deploy ``` The production job uses the same source files but supplies production values: ```bash Terminal theme={null} CHECKLY_ENVIRONMENT=production \ ENVIRONMENT_URL="https://api.example.com" \ API_TOKEN="$PRODUCTION_API_TOKEN" \ npx checkly deploy ``` Review the deployment changes before confirming them. After you have verified the mapping, a non-interactive CI job can use `--force` to skip the confirmation prompt. A deploy reconciles only the project selected by its `logicalId`, but resources removed from that project are deleted by default. Run [`checkly deploy --preview`](/docs/cli/checkly-deploy#command-options) when changing branch mappings or environment-specific check selection. ## Run different checks in each environment When an environment needs additional or different checks, keep shared checks in one directory and select the environment-specific directory from your configuration: ```typescript checkly.config.ts theme={null} const sharedChecks = "**/__checks__/shared/**/*.check.ts" const environmentChecks = `**/__checks__/${environment}/**/*.check.ts` export default defineConfig({ projectName: target.projectName, logicalId: target.logicalId, checks: { checkMatch: [sharedChecks, environmentChecks], frequency: target.frequency, locations: target.locations, tags: [environment], }, }) ``` For example, `__checks__/shared/` can contain health and login checks, while `__checks__/production/` contains production-only purchase checks. Each environment remains authoritative for its own deployed project. ## Understand environment variable behavior | Variable source | Available when | Persists for scheduled monitoring | | ------------------------------------ | ----------------------------------------- | ---------------------------------------------------------------------------------------------- | | Shell or CI environment | The CLI parses your config and constructs | Only when the value is written into a deployed construct, such as a group environment variable | | `checkly test --env` or `--env-file` | That test session runs in Checkly | No | | Check- or group-level variable | A deployed check runs | Yes, for that check or group | | Global variable | Any check in the account runs | Yes, account-wide | Prefer check- or group-level variables when the same key needs a different value in each environment. A global `ENVIRONMENT_URL`, for example, can hold only one account-wide value and is therefore not a good fit for separate development, staging, and production targets. Use [secrets](/docs/platform/secrets) for credentials, tokens, and other sensitive values. For more detail about build-time and runtime values, see [CLI environment variables](/docs/cli/environment-variables) and [environment variables and secrets](/docs/platform/variables). ## Playwright Check Suites For Playwright Check Suites, keep URLs and credentials in runtime environment variables and read them from `process.env` in your Playwright configuration or fixtures. The project-per-environment model remains the same. See [environment-aware Playwright tests](/docs/guides/playwright-environments) for configuring `baseURL`, fixtures, and local-versus-Checkly execution. # Locations Source: https://www.checklyhq.com/docs/concepts/locations Learn about Public and Private locations using Checkly **Locations** represent the global vantage points from which Checkly tests and monitors your applications. You can configure your tests and checks to run from an ever growing amount of global locations. Leveraging global infrastructure allows us to measure what the user experience is in different parts of the world. ## What are Locations? Think of **Locations** as your monitoring outposts distributed around the globe. Each Location represents a geographic point where Checkly can execute your Checks, simulating the experience of users in that region. This geographic distribution is crucial because it reveals how your application performs for users regardless of where they're accessing it from. You can select one or more data center locations to run your checks from. We advise to always select at least 2 locations. There are two reasons for this: * Redundancy: we might have an issue in one location, but not the other. * Retrying: if your check fails, we will execute its retry strategy where you have the option check from a different location. ## Public Locations You can configure your run checks to run from an ever growing amount of global locations. Leveraging global infrastructure allows us to measure what the user experience is in different parts of the world. Current Locations in Checkly are: | Americas | Europe / Middle East / Africa | Asia Pacific | | ------------------------------ | ----------------------------- | -------------------------- | | North Virginia (us-east-1)\* | Ireland (eu-west-1) | Singapore (ap-southeast-1) | | Ohio (us-east-2) | Frankfurt (eu-central-1)\* | Tokyo (ap-northeast-1) | | North California (us-west-1)\* | London (eu-west-2)\* | Osaka (ap-northeast-3) | | Oregon (us-west-2) | Paris (eu-west-3) | Hong Kong (ap-east-1) | | Montreal (ca-central-1) | Stockholm (eu-north-1) | Sydney (ap-southeast-2) | | São Paulo (sa-east-1) | Milan (eu-south-1) | Seoul (ap-northeast-2) | | | Bahrain (me-south-1) | Mumbai (ap-south-1) | | | Cape Town (af-south-1) | Jakarta (ap-southeast-3) | \*Checkly hosted location. All other locations run on AWS. Please note that the hosting provider for a location may change over time as we scale and optimize our infrastructure. ## Private Locations **Private Locations** extend this concept to your own infrastructure. A **Private Location** is a monitoring location that you manage by simply deploying a lightweight Checkly Agent. Running a check from a **Private Location** allows you to monitor internal systems and test the performance and reliability of applications and APIs that are only accessible from within your network. > Learn more about [private locations](/docs/platform/private-locations/overview) to monitor your private and segregated applications and APIs. ## Locations as User Experience Proxies Ultimately, Locations are about empathy for your users. They ensure that your monitoring perspective matches your users' reality. A user in Tokyo may have a vastly different experience than someone in New York, and **Locations** help you understand and optimize for these differences. They transform monitoring from a single-perspective activity into a truly global understanding of application performance and reliability. # Metrics Source: https://www.checklyhq.com/docs/concepts/metrics Understanding the performance and reliability metrics tracked across all Checkly check types Checkly tracks a comprehensive set of metrics across all check types to provide insights into the performance, reliability, and user experience of your applications and services. This page explains each metric, what it measures, and which check types support it. ## Response Time Metrics Response time metrics measure how quickly your services respond to requests, providing crucial insights into performance and user experience. ### Average Response Time **What it measures:** The arithmetic mean response time across all check executions within the selected time period. **Unit:** Milliseconds\ **Precision:** 2 decimal places\ **Available for:** API, Browser, TCP, DNS, Multistep, URL checks * Establishing performance baselines * Detecting performance degradation trends * Comparing performance across different time periods * Setting SLA thresholds ### 95th Percentile Response Time (P95) **What it measures:** The response time value below which 95% of all requests fall. This metric filters out the slowest 5% of requests to give you a more realistic view of typical user experience. **Unit:** Milliseconds\ **Precision:** 2 decimal places\ **Available for:** API, Browser, TCP, DNS, Multistep, URL checks * SLA monitoring and compliance * Performance budgeting * Capacity planning * Identifying performance outliers ### 99th Percentile Response Time (P99) **What it measures:** The response time value below which 99% of all requests fall. This metric helps identify the worst-case performance experienced by users. **Unit:** Milliseconds\ **Precision:** 2 decimal places\ **Available for:** API, Browser, TCP, DNS, Multistep, URL checks * Understanding worst-case user experience * Setting performance alerts for edge cases * Optimizing for the most demanding scenarios ### Median Response Time (P50) **What it measures:** The middle value of all response times when sorted from fastest to slowest. Half of all requests complete faster than this time, and half complete slower. **Unit:** Milliseconds\ **Precision:** 2 decimal places\ **Available for:** API, Browser, TCP, DNS, Multistep, URL checks * Understanding typical user experience * Baseline performance monitoring * Comparing with average response time to identify skewed distributions * Performance trend analysis ### Minimum Response Time **What it measures:** The fastest response time recorded during the selected time period. **Unit:** Milliseconds\ **Precision:** 2 decimal places\ **Available for:** API, Browser, TCP, DNS, Multistep, URL checks * Understanding best-case performance * Capacity planning for optimal conditions * Performance optimization validation * Network latency analysis ### Maximum Response Time **What it measures:** The slowest response time recorded during the selected time period. **Unit:** Milliseconds\ **Precision:** 2 decimal places\ **Available for:** API, Browser, TCP, DNS, Multistep, URL checks * Identifying performance spikes * Troubleshooting worst-case scenarios * Setting timeout thresholds * Performance regression detection ## Success Rate Metrics Success rate metrics measure the reliability and availability of your services. ### Success Rate **What it measures:** The percentage of check executions that completed successfully according to the defined success criteria (e.g., HTTP 2xx status codes, successful script execution). **Unit:** Percentage (0-100%)\ **Precision:** 2 decimal places\ **Available for:** API, Browser, Heartbeat, ICMP, TCP, Multistep, URL checks * SLA compliance monitoring * Service reliability tracking * Availability reporting * Alerting on service degradation ### Error Rate **What it measures:** The percentage of check executions that failed to meet the defined success criteria. **Unit:** Percentage (0-100%)\ **Precision:** 2 decimal places\ **Available for:** API, Browser, Heartbeat, ICMP, TCP, Multistep, URL checks * Error monitoring and alerting * Quality assurance * Incident detection * Performance troubleshooting ### Total Requests **What it measures:** The total number of check executions performed during the selected time period. **Unit:** Count\ **Available for:** API, Browser, Heartbeat, ICMP, TCP, Multistep, URL checks * Volume analysis and capacity planning * Understanding check execution frequency * Billing and usage tracking * Performance correlation analysis ### Successful Requests **What it measures:** The total number of check executions that completed successfully according to the defined success criteria. **Unit:** Count **Available for:** API, Browser, Heartbeat, ICMP, TCP, Multistep, URL checks * Availability reporting * SLA compliance tracking * Performance analysis * Success trend monitoring ### Failed Requests **What it measures:** The total number of check executions that failed to meet the defined success criteria. **Unit:** Count\ **Available for:** API, Browser, Heartbeat, ICMP, TCP, Multistep, URL checks * Error analysis and troubleshooting * Incident detection and response * Quality assurance metrics * Failure pattern identification ## Core Web Vitals (Browser-Specific) Core Web Vitals are a set of metrics defined by Google that measure real-world user experience for loading performance, interactivity, and visual stability. ### First Contentful Paint (FCP) **What it measures:** The time from when the page starts loading to when any part of the page's content is rendered on the screen. **Unit:** Seconds\ **Precision:** 3 decimal places\ **Available for:** Browser, Multistep checks only **Google's thresholds:** * Good: ≤ 1.8 seconds * Needs improvement: 1.8 - 3.0 seconds * Poor: > 3.0 seconds ### Largest Contentful Paint (LCP) **What it measures:** The time from when the page starts loading to when the largest text block or image element is rendered. **Unit:** Seconds\ **Precision:** 3 decimal places\ **Available for:** Browser, Multistep checks only **Google's thresholds:** * Good: ≤ 2.5 seconds * Needs improvement: 2.5 - 4.0 seconds * Poor: > 4.0 seconds ### Cumulative Layout Shift (CLS) **What it measures:** A measure of how much visible content shifts during the loading process. Lower scores indicate better visual stability. **Unit:** Score (0-1+)\ **Precision:** 4 decimal places\ **Available for:** Browser, Multistep checks only **Google's thresholds:** * Good: ≤ 0.1 * Needs improvement: 0.1 - 0.25 * Poor: > 0.25 ### First Input Delay (FID) **What it measures:** The time from when a user first interacts with your page (clicks a link, taps a button, etc.) to the time when the browser actually responds to that interaction. **Unit:** Milliseconds\ **Precision:** 1 decimal place\ **Available for:** Browser, Multistep checks only **Google's thresholds:** * Good: ≤ 100 milliseconds * Needs improvement: 100 - 300 milliseconds * Poor: > 300 milliseconds - Measuring interactivity responsiveness - Optimizing JavaScript execution timing - Improving user experience for interactive elements - Performance budgeting for user interactions ### Time to Interactive (TTI) **What it measures:** The time from when the page starts loading to when it's visually rendered, its initial scripts have loaded, and it's capable of reliably responding to user input quickly. **Unit:** Seconds\ **Precision:** 3 decimal places\ **Available for:** Browser, Multistep checks only * Measuring page interactivity readiness * Optimizing JavaScript loading and execution * Improving user experience for dynamic content * Performance budgeting for interactive features ## Browser-Specific Performance Metrics Additional performance metrics specific to browser and multistep checks that provide insights into page loading and user experience. ### Average Page Load Time **What it measures:** The total time required for a web page to fully load, including all resources like images, scripts, and stylesheets. **Unit:** Seconds\ **Precision:** 2 decimal places\ **Available for:** Browser, Multistep checks only * Overall page performance monitoring * User experience optimization * Performance benchmarking * Load testing correlation ### Average Script Duration **What it measures:** The total time taken to execute all JavaScript code during a browser check, including user-defined scripts and page interactions. **Unit:** Seconds\ **Precision:** 2 decimal places\ **Available for:** Browser, Multistep checks only * Script performance optimization * Execution time monitoring * Automation efficiency tracking * Performance regression detection ### Performance Score **What it measures:** An overall performance rating (0-100) calculated based on various performance metrics including Core Web Vitals and page load characteristics. **Unit:** Score (0-100)\ **Precision:** 1 decimal place\ **Available for:** Browser, Multistep checks only * Overall performance assessment * Performance comparison across time periods * Performance goal setting and tracking * Quality gate decisions ## Heartbeat-Specific Metrics These metrics are specific to heartbeat checks, which monitor the availability and consistency of scheduled processes or services. ### Uptime Percentage **What it measures:** The percentage of time that expected heartbeat signals were received within the configured time windows. **Unit:** Percentage (0-100%)\ **Precision:** 3 decimal places\ **Available for:** Heartbeat checks only * Service availability monitoring * SLA compliance for batch processes * Monitoring scheduled jobs and cron tasks ### Missed Heartbeats **What it measures:** The total count of expected heartbeat signals that were not received within the configured grace period. **Unit:** Count\ **Available for:** Heartbeat checks only * Failure detection * Alerting on missed scheduled processes * Tracking reliability of automated systems ### Average Heartbeat Interval **What it measures:** The average time between received heartbeat signals during the selected time period. **Unit:** Seconds\ **Precision:** 2 decimal places\ **Available for:** Heartbeat checks only * Monitoring heartbeat consistency * Analyzing scheduled job patterns * Detecting irregular execution intervals * Performance optimization of scheduled processes ### Longest Gap **What it measures:** The longest continuous period without receiving an expected heartbeat signal. **Unit:** Seconds\ **Precision:** 2 decimal places\ **Available for:** Heartbeat checks only * Identifying longest service outages * Understanding worst-case availability gaps * Setting appropriate alerting thresholds * Incident analysis and postmortem data ### Heartbeat Consistency Score **What it measures:** A score (0-100) representing how consistently heartbeat signals are received at their expected intervals. **Unit:** Score (0-100)\ **Precision:** 1 decimal place\ **Available for:** Heartbeat checks only * Measuring scheduled process reliability * Comparing consistency across different services * Quality assessment of automated systems * Setting performance benchmarks ## ICMP-Specific Metrics These metrics are specific to ICMP monitors, which verify host reachability and measure network performance using ICMP Echo Requests (pings). ### Average Ping Latency **What it measures:** The average round-trip time (RTT) across all received ICMP Echo Reply packets within a check run. **Unit:** Milliseconds * Establishing network latency baselines * Detecting latency degradation over time * Comparing latency across regions ### Minimum Ping Latency **What it measures:** The fastest round-trip time recorded across all received packets within a check run. **Unit:** Milliseconds * Understanding best-case network performance ### Maximum Ping Latency **What it measures:** The slowest round-trip time recorded across all received packets within a check run. **Unit:** Milliseconds * Identifying latency spikes * Setting timeout and alerting thresholds ### Ping Latency Standard Deviation **What it measures:** The variability of round-trip times across all received packets within a check run. Higher values indicate less consistent network performance (jitter). **Unit:** Milliseconds * Measuring network stability and jitter ### Packet Loss **What it measures:** The percentage of ICMP Echo Request packets that did not receive a reply. **Unit:** Percentage (0-100%) * Detecting network degradation * Triggering degraded or failed states via [packet loss thresholds](/docs/detect/uptime-monitoring/icmp-monitors/configuration#packet-loss-limits) ### P95 Ping Latency **What it measures:** The 95th percentile of average ping latency across check runs within the selected time period. **Unit:** Milliseconds * SLA monitoring for network latency * Filtering out outlier spikes for a realistic performance view ### P95 Packet Loss **What it measures:** The 95th percentile of packet loss across check runs within the selected time period. **Unit:** Percentage (0-100%) * SLA monitoring for packet delivery * Identifying persistent vs. intermittent packet loss ## Additional Metrics by Check Type ### TCP Connection Time **What it measures:** The time required to establish a TCP connection to the target host and port. **Unit:** Milliseconds\ **Precision:** 2 decimal places\ **Available for:** TCP checks only * Network connectivity monitoring * Port availability testing * Network latency analysis * Infrastructure health monitoring ### DNS Resolution Time **What it measures:** The time required to resolve the hostname to an IP address via DNS lookup. **Unit:** Milliseconds\ **Precision:** 2 decimal places **Available for:** API, Browser, URL, TCP, DNS, ICMP checks (when hostname is used) * DNS performance monitoring * Network troubleshooting * Infrastructure optimization * Geographic performance analysis ### SSL Handshake Time **What it measures:** The time required to complete the SSL/TLS handshake process for secure connections. **Unit:** Milliseconds\ **Precision:** 2 decimal places\ **Available for:** API, Browser, URL checks (HTTPS only) * SSL/TLS performance monitoring * Certificate validation timing * Security overhead analysis * HTTPS optimization *** For all available metrics see the [Analytics API Reference](/docs/api-reference/analytics/list-all-available-reporting-metrics). # Monitoring as Code Source: https://www.checklyhq.com/docs/concepts/monitoring-as-code Define, version, and maintain your monitoring infrastructure alongside your application code **Monitoring as Code (MaC)** treats monitoring configurations like any other code artifactversion controlled, reviewed, tested, and deployed through automated pipelines. With MaC, you can define, version, and maintain your monitoring infrastructure alongside your application code, reusing existing tests, code, data, and other assets to create a consistent, automated, and scalable monitoring setup. To get started with Monitoring as Code, see our [Constructs](/docs/constructs/overview) section or [CLI](/docs/cli/overview) section. ## Core Principles of Monitoring as Code **Declarative Configuration**: Define your monitors, alerts, and status pages, and more in code files using structured formats (JSON, YAML, TypeScript). **Version Control**: Store monitoring configs in Git alongside application code to maintain consistency and enable collaboration. **Infrastructure Automation**: Deploy monitoring changes through CI/CD pipelines with the same rigor as application deployments. ## Benefits of Monitoring as Code * **Consistency**: Standardized monitoring across environments and teams * **Collaboration**: Code reviews ensure monitoring best practices * **Reliability**: Automated deployments reduce manual errors * **Auditability**: Full change history and rollback capabilities * **Scalability**: Template-based monitor creation for similar services * **AI Native**: Use any LLM tooling to generate monitoring code, review code, and more. ## Implementation with Checkly Checkly supports monitoring as code through multiple approaches: * **[CLI](/docs/cli/overview)**: Write checks in TypeScript/JavaScript and deploy via `checkly deploy` * **[Terraform Provider](/docs/integrations/iac/terraform/overview)**: Manage Checkly resources in your infrastructure code * **[Pulumi Integration](/docs/integrations/iac/pulumi/overview)**: Define monitoring using modern IaC patterns * **[API](/docs/api-reference/overview)**: Programmatically manage checks in custom automation This approach ensures your monitoring evolves with your applications, maintaining accuracy and reducing maintenance overhead. # Results Source: https://www.checklyhq.com/docs/concepts/results Learn about the results of Checkly Check **Results** are the outcomes of every monitoring test that Checkly runs. You can select any check on the main Checkly dashboard to get an overview of the results they have produced so far. Select a check and you will see a breakdown of its recent runs, together with key availability and performance metrics. Each time a Check executes—whether it's testing an API endpoint, clicking through a user flow, or verifying a service connection—it generates a **Result** that captures everything that happened during that test run. **Results** are more than just pass or fail indicators. They're comprehensive records that include performance metrics, error details, screenshots, network traces, and any other telemetry that helps you understand not just whether something worked, but how well it worked and why it might have failed. Playwright Check Suite runs can also be [cancelled](/docs/concepts/cancellation) while they are in progress. Cancelled results are excluded from availability and performance metrics. ## Understanding Result Data You can select any check on the main Checkly dashboard to get an overview of the results they have produced so far. ## Check results overview Select a check and you will see a breakdown of its recent runs, together with key availability and performance metrics. check results overview ### Summary section The summary at the top of the page allows for filtering based on the page's data points and the selected timeframe and locations. Retried check runs do not influence this section; only the final results are considered. check results overview summary Based on the user's selection, the metrics in the summary will also be updated to show the most important numbers at a glance. ### Monitoring results chart The monitoring results chart shows a summary of the run results in the selected time period where each bar represents a part of that time period. You can change the time period in the summary section. Hovering a bar in the chart will show the results of all check runs executed during that time. You can quickly filter the check run results in the right sidepanel by clicking a bar in the chart. check results overview time ribbon When retries are enabled, an additional icon highlights that the check result contains multiple check runs. ### Monitoring results sidebar On the right side you can view the check result broken down per check run and location for the selected time frame. If you select a bar in the monitoring results chart it will filter out the corresponding results in the sidebar. Click any result to navigate to the check results screen for detailed information about the check run. ### Performance Depending on the type of check, different performance metrics will be shown in the Performance section. For Browser checks, several performance metrics are shown in separate charts: 1. The total duration of the check run check overview browser session duration graph 2. Load timings for the first page navigation check overview load timings graph 3. A breakdown of different error types check overview errors graph 4. An interactivity summary check overview interactivity graph 5. A visual stability breakdown check overview visual stability graph For API checks, a detailed response time breakdown is shown: check overview api performance graph For Multistep checks, a response time breakdown is shown per step: check overview multistep performance graph A performance comparison by location will also be included for both types of check: check overview location performance graph ## Navigating individual check results The check result page will contain results from multiple locations when using [parallel scheduling](/docs/concepts/scheduling#scheduling-strategies). Navigate between each location using the sidebar. Viewing multiple attempts from the dropdown To learn more about the results shown for each check type, refer to the documentation for the specific monitor: * [API checks](/docs/detect/synthetic-monitoring/api-checks/overview#api-check-results) * [Browser checks](/docs/detect/synthetic-monitoring/browser-checks/overview#browser-check-results) * [Multistep checks](/docs/detect/synthetic-monitoring/multistep-checks/overview#multistep-check-results) * [Heartbeat monitors](/docs/detect/uptime-monitoring/heartbeat-monitors/overview#heartbeat-monitor-results) * [TCP monitors](/docs/detect/uptime-monitoring/tcp-monitors/overview#tcp-monitor-results) * [DNS monitors](/docs/detect/uptime-monitoring/dns-monitors/overview#dns-monitor-results) * [ICMP monitors](/docs/detect/uptime-monitoring/icmp-monitors/overview#icmp-monitor-results) * [URL monitors](/docs/detect/uptime-monitoring/url-monitors/overview#url-monitor-results) ## Check results with retries When checks are retried, a dropdown will indicate that the check result contains multiple check runs: 1. The initial failed attempt 2. The final result (which may have failed or succeeded) When selecting a check run, all data and assets are available for inspection for each attempt. Viewing multiple attempts from the dropdown # Scheduling Source: https://www.checklyhq.com/docs/concepts/scheduling Learn about scheduling strategies in Checkly ## Scheduling Strategies Checkly provides two scheduling strategies for running checks: **Round-robin** or **Parallel scheduling**. To select a scheduling strategy go to ‘Scheduling and locations’ when creating or editing a check. ### Round-robin Using **Round-robin Scheduling**, your check will run on one of the selected locations each time it is scheduled. The next check run will be scheduled on a different location from the list until all locations have been run once, and the check rotates back to the first location in the list. When using the **Round-robin Scheduling** strategy you can choose to have retries to run from a random location of the ones selected, or run it from the same location as the first attempt. Use **Round-robin Scheduling** when the service you are monitoring can be considered available as long as at least one location is available and detecting a regional outage is not critical. ### Parallel With **Parallel Scheduling**, each time the check is scheduled it will run once from each selected location. When running a check in parallel, retries will always be run from the same location as the first attempt. Use **Parallel Scheduling** to reduce detection times for regional outages and reduce time to detect service degradations that impact the customer experience. ## Best Practices ### Frequency Guidelines by Service Criticality **Critical Production Services:** * **Frequency**: Every 10 Seconds - 2 Minutes * **Examples**: Payment processing, user authentication, core APIs * **Rationale**: Immediate detection of issues affecting users **Important Services:** * **Frequency**: Every 5-10 minutes * **Examples**: Secondary APIs, admin interfaces, reporting tools * **Rationale**: Quick detection with reasonable resource usage **Non-Critical Services:** * **Frequency**: Every 15-30 minutes * **Examples**: Documentation sites, internal tools, dev environments * **Rationale**: Monitor availability without excessive overhead ### Frequency Guidelines by Service Type **E-commerce Sites:** * **Homepage**: Every 1 minute (critical for revenue) * **Product Pages**: Every 5 minutes * **Search API**: Every 2 minutes * **Checkout Flow**: Every 30 seconds **SaaS Applications:** * **Login Endpoint**: Every 1 minute * **Core Features**: Every 5 minutes * **Admin Interfaces**: Every 15 minutes * **Status Pages**: Every 10 minutes **Database Servers:** * **Primary Database**: Every 2 minutes * **Read Replicas**: Every 5 minutes * **Backup Systems**: Every 15 minutes ### Resource Impact Considerations **Server Load Management:** * Higher frequency = more requests to your servers * Use round-robin scheduling to distribute load * Consider rate limiting and caching implications * Monitor your server metrics during frequency changes **Monitoring Budget:** * More frequent checks = higher monitoring costs * Balance detection speed with budget constraints * Review and adjust frequencies based on actual value ### Initial Configuration 1. **Start conservative** with 5-10 minute intervals 2. **Monitor high-impact services more frequently** 3. **Adjust based on actual failure patterns** 4. **Consider business hours and user activity** ### Ongoing Optimization * **Review frequency effectiveness** quarterly * **Adjust during high-risk periods** (deployments, traffic spikes) * **Balance detection speed with cost constraints** * **Use data-driven decisions** based on incident history ### Documentation and Communication * **Document scheduling rationale** for different services * **Communicate frequency changes** to relevant teams * **Track scheduling effectiveness** over time * **Regular review with stakeholders** # Alert Channel Overview Source: https://www.checklyhq.com/docs/constructs/alert-channel Learn how to configure alert channels with the Checkly CLI. Alert channels let you get alert notifications when a check or monitor fails. [Learn more about alerting in our docs](/docs/communicate/alerts/overview/). ## Common properties All alert channels share a set of common properties to define when / how they should alert derived from the abstract class `AlertChannel`. Configure common alert channel properties: | Property | Type | Required | Default | Description | | -------------------- | --------- | -------- | ------- | --------------------------------------------- | | `sendRecovery` | `boolean` | ❌ | `true` | Send notifications when checks recover | | `sendFailure` | `boolean` | ❌ | `true` | Send notifications when checks fail | | `sendDegraded` | `boolean` | ❌ | `false` | Send notifications when checks degrade | | `sslExpiry` | `boolean` | ❌ | `false` | Send notifications for SSL certificate expiry | | `sslExpiryThreshold` | `number` | ❌ | `30` | Days before SSL expiry to send notification | Alert channels are assigned to checks, monitors, and groups by instantiating a class and adding the resulting object to the `alertChannels` array: ```ts api-health.check.ts theme={null} import { ApiCheck, EmailAlertChannel } from 'checkly/constructs' // Create a new alert channel const emailChannel = new EmailAlertChannel('email-channel-1', { address: 'alerts@example.com', }) // Create a new API check new ApiCheck('api-health-check', { name: 'API Health', request: { method: 'GET', url: 'https://api.example.com', }, alertChannels: [emailChannel], // Assign our email alert channel to this API check }) ``` To assign alert channels to `CheckGroupV2` constructs, you'll also need to set the [`alertEscalationPolicy`](/docs/constructs/check-group-v2#param-alert-escalation-policy) to enable the group alerting override. ## Using `fromId()` to reference an existing channel If you have an existing alert channel that was created outside of your CLI project, you can reference it using the `fromId()` method on any `AlertChannel` class: ```ts theme={null} export const emailChannel = EmailAlertChannel.fromId(20) ``` Find the alert channel ID in the the [Checkly web UI](https://app.checklyhq.com/accounts/alerts/settings) or via our our [REST API](/docs/api-reference/alert-channels/list-all-alert-channels/). email channel id If your `fromId()` references an invalid alert channel, the CLI will throw an error when you try to deploy your project. This is useful if you have multiple CLI projects, since you can reference the same alert channel in each project without needing to redefine it each time. If you have a single CLI project, instead of using `fromId()`, we recommend defining your alert channel within that CLI project and referencing its JS/TS object. This allows your alert channel to be managed as code alongside your other CLI resources, which makes it easier to manage and scale your alerting setup. # Alert Escalation Policy Construct Source: https://www.checklyhq.com/docs/constructs/alert-escalation-policy Learn how to configure alert escalation policies with the Checkly CLI. Learn more about alert escalation policies in [the alerts configuration](/docs/communicate/alerts/configuration#escalation-strategies). Use alert escalation policies to control when and how often you receive alerts when checks start failing, degrade, or recover. This helps you fine-tune your alerting to reduce noise and ensure timely alerts. ```ts Run-Based Escalation theme={null} import { AlertEscalationBuilder, ApiCheck } from "checkly/constructs" new ApiCheck("run-based-alert-check", { name: "Check With Run-Based Escalation", alertEscalationPolicy: AlertEscalationBuilder.runBasedEscalation( 2, // Alert after 2 consecutive failures { interval: 5, amount: 2 }, // Send 2 reminders, 5 minutes apart { enabled: true, percentage: 50 } // Alert if 50% of parallel runs fail ), request: { method: "GET", url: "https://api.example.com/health", }, }) ``` ```ts Time-Based Escalation theme={null} import { ApiCheck, AlertEscalationBuilder } from "checkly/constructs" new ApiCheck("time-based-alert-check", { name: "Check With Time-Based Escalation", alertEscalationPolicy: AlertEscalationBuilder.timeBasedEscalation( 10, // Alert after 10 minutes of failures { interval: 15, amount: 3 }, // Send 3 reminders, 15 minutes apart { enabled: false, percentage: 30 } // Parallel run threshold disabled ), request: { method: "GET", url: "https://api.example.com/critical-endpoint", }, }) ``` ## Configuration Configure your alert escalation policies using the `AlertEscalationBuilder`, which provides helper methods for the different escalation strategies: | Method | Description | Parameters | | ----------------------- | -------------------------------------------- | ---------------------------------------------------------- | | `runBasedEscalation()` | Alert after N consecutive failed runs | `(failedRuns, reminders, parallelRunFailureThreshold)` | | `timeBasedEscalation()` | Alert after N minutes of continuous failures | `(minutesFailing, reminders, parallelRunFailureThreshold)` | ## Alert Escalation Builder Methods Creates an alert escalation policy that triggers after a specified number of consecutive failed runs. **Usage:** ```ts theme={null} AlertEscalationBuilder.runBasedEscalation( failedRuns, reminders, parallelRunFailureThreshold ) ``` **Parameters:** | Parameter | Type | Required | Default | Description | | ----------------------------- | -------- | -------- | ------- | ------------------------------------------------- | | `failedRuns` | `number` | ✅ | 1 | Number of consecutive failed runs before alerting | | `reminders` | `object` | ❌ | - | Reminder notification configuration | | `parallelRunFailureThreshold` | `object` | ❌ | - | Parallel run failure percentage threshold | **Examples:** ```ts Immediate Alert theme={null} // Alert immediately on first failure const immediateAlert = AlertEscalationBuilder.runBasedEscalation( 1, // Alert after 1 failed run { interval: 5, amount: 0 }, // No reminders ) new ApiCheck("critical-service-check", { name: "Critical Service Check", alertEscalationPolicy: immediateAlert, request: { method: "GET", url: "https://api.example.com/critical", }, }) ``` ```ts Conservative Alert theme={null} // Wait for multiple failures before alerting const conservativeAlert = AlertEscalationBuilder.runBasedEscalation( 5, // Alert after 5 consecutive failures { interval: 30, amount: 2 }, // 2 reminders, 30 minutes apart { enabled: true, percentage: 80 } // Only if 80% of parallel runs fail ) new ApiCheck("flaky-service-check", { name: "Flaky Service Check", alertEscalationPolicy: conservativeAlert, locations: ["us-east-1", "eu-west-1", "ap-southeast-1"], runParallel: true, request: { method: "GET", url: "https://api.example.com/sometimes-flaky", }, }) ``` **Use cases**: Immediate alerting and noise reduction for flaky services. Creates an alert escalation policy that triggers after a specified duration of continuous failures. **Usage:** ```ts theme={null} AlertEscalationBuilder.timeBasedEscalation( minutesFailing, reminders, parallelRunFailureThreshold ) ``` **Parameters:** | Parameter | Type | Required | Description | | ----------------------------- | -------- | -------- | ---------------------------------------------- | | `minutesFailing` | `number` | ✅ | Minutes of continuous failures before alerting | | `reminders` | `object` | ❌ | Reminder notification configuration | | `parallelRunFailureThreshold` | `object` | ❌ | Parallel run failure percentage threshold | **Examples:** ```ts Alert after 15 minutes theme={null} // Wait for batch jobs or slow services const timeBasedAlert = AlertEscalationBuilder.timeBasedEscalation( 15, // Alert after 15 minutes of failures { interval: 10, amount: 3 } // 3 reminders, 10 minutes apart ) new ApiCheck("batch-job-check", { name: "Batch Job Monitoring", frequency: Frequency.EVERY_5M, alertEscalationPolicy: timeBasedAlert, request: { method: "GET", url: "https://api.example.com/batch-status", }, }) ``` **Use cases**: Batch job monitoring, slow services, time-sensitive operations. Configure reminder notifications while an alert is active. **Usage:** ```ts theme={null} reminders: { interval: 10, // Send reminder every 10 minutes amount: 5 // Send up to 5 reminders } ``` **Parameters:** | Parameter | Type | Required | Default | Description | | ---------- | -------- | -------- | ------- | -------------------------------------------------------------------------------- | | `interval` | `number` | ❌ | `5` | Minutes between reminder notifications: `5`, `10`, `15`, `30` | | `amount` | `number` | ❌ | `0` | Number of reminder notifications to send: `0`, `1`, `2`, `3`, `4`, `5`, `100000` | **Examples:** ```ts No Reminders theme={null} // Alert once, no reminders reminders: { interval: 5, amount: 0 } ``` ```ts Frequent Reminders theme={null} // Aggressive reminder schedule reminders: { interval: 15, // Every 15 minutes amount: 5 // Up to 5 reminders } ``` ```ts Conservative Reminders theme={null} // Occasional reminders to avoid spam reminders: { interval: 30, // Every 30 minutes amount: 2 // Only 2 reminders } ``` **Use cases**: Alert fatigue prevention, escalation management, notification frequency control. Configure threshold for checks running in parallel across multiple locations. **Usage:** ```ts theme={null} parallelRunFailureThreshold: { enabled: true, percentage: 60 // Alert if 60% of parallel runs fail } ``` **Parameters:** | Parameter | Type | Required | Default | Description | | ------------ | --------- | -------- | ------- | ------------------------------------------------------------------------ | | `enabled` | `boolean` | ✅ | `false` | Whether to use parallel run failure threshold | | `percentage` | `number` | ❌ | `10` | Percentage of parallel runs that must fail (10-100, in increments of 10) | **Examples:** ```ts Regional Redundancy theme={null} // Only alert if majority of regions fail const regionalAlert = AlertEscalationBuilder.runBasedEscalation( 2, // After 2 consecutive failures { interval: 10, amount: 3 }, { enabled: true, percentage: 70 } // 70% of regions must fail ) new ApiCheck("global-service-check", { name: "Global Service Check", locations: ["us-east-1", "us-west-2", "eu-west-1", "ap-southeast-1"], runParallel: true, alertEscalationPolicy: regionalAlert, request: { method: "GET", url: "https://global-api.example.com/health", }, }) ``` ```ts CDN Monitoring theme={null} // Alert if 10% of CDN edges are failing const cdnAlert = AlertEscalationBuilder.runBasedEscalation( 1, // Immediate on failure { interval: 5, amount: 2 }, { enabled: true, percentage: 10 } // 10% of edges must fail ) new UrlMonitor("cdn-availability", { name: "CDN Edge Availability", locations: ["us-east-1", "us-west-2", "eu-west-1", "ap-southeast-1"], runParallel: true, alertEscalationPolicy: cdnAlert, request: { url: "https://cdn.example.com/health", }, }) ``` **Use cases**: Multi-region monitoring, CDN availability, redundant service checking. ## Examples ```ts Group-Level Policy theme={null} import { AlertEscalationBuilder, ApiCheck, CheckGroupV2, } from "checkly/constructs" const groupAlertPolicy = AlertEscalationBuilder.runBasedEscalation( 3, // Alert after 3 consecutive failures { interval: 15, amount: 3 }, // 3 reminders, 15 minutes apart { enabled: true, percentage: 60 } ) const monitoringGroup = new CheckGroupV2("monitoring-group", { name: "Production Monitoring", alertEscalationPolicy: groupAlertPolicy, // Applies to all checks in group locations: ["us-east-1", "eu-west-1"], runParallel: true, }) new ApiCheck("group-api-check", { name: "API Check with Group Alert Policy", group: monitoringGroup, // Inherits alert policy from group request: { method: "GET", url: "https://api.example.com/endpoint", }, }) ``` **Reminder Limits**: Be cautious with reminder settings. Too many reminders can lead to alert fatigue, while too few might cause important issues to be overlooked. **Parallel Run Thresholds**: Only use parallel run failure thresholds for checks that run in multiple locations simultaneously (`runParallel: true`). # API Check Construct Source: https://www.checklyhq.com/docs/constructs/api-check Learn how to configure API Checks with the Checkly CLI. Learn more about API Checks in [the API Checks overview](/docs/detect/synthetic-monitoring/api-checks/overview). Use API Checks to monitor HTTP endpoints, REST APIs, GraphQL APIs, and other HTTP-based services. The examples below show how to configure monitoring for different types of API endpoints. Before creating API Checks, ensure you have: * An initialized Checkly CLI project * URLs or HTTP endpoints you want to monitor * Understanding of HTTP status codes and response behavior * Network access to the URLs you want to monitor For additional setup information, see [CLI overview](/docs/cli/overview). ```ts Basic Example theme={null} import { ApiCheck } from "checkly/constructs" new ApiCheck("hello-api-1", { name: "Hello API Check", description: "Verifies the `/hello` endpoint returns a **successful** response.", request: { method: "GET", url: "https://api.checklyhq.com/hello", }, }) ``` ```ts Advanced Example theme={null} import { ApiCheck, AssertionBuilder, Frequency } from "checkly/constructs" new ApiCheck("advanced-api-check", { name: "Advanced API Check", description: "User creation succeeds (201) with valid ID.", activated: true, frequency: Frequency.EVERY_5M, locations: ["us-east-1", "eu-west-1"], tags: ["api", "critical"], maxResponseTime: 10000, degradedResponseTime: 5000, request: { method: "POST", url: "https://api.example.com/users", headers: [ { key: "Content-Type", value: "application/json" }, { key: "Authorization", value: "Bearer {{API_TOKEN}}" }, ], body: JSON.stringify({ name: "Test User" }), assertions: [ AssertionBuilder.statusCode().equals(201), AssertionBuilder.jsonBody("$.id").notEmpty(), AssertionBuilder.headers( "strict-transport-security", "max-age=(\\d+)" ).greaterThan(10000), ], }, }) ``` ## Configuration The API Check configuration consists of specific API Check options and inherited general check options. | Parameter | Type | Required | Default | Description | | ---------------------- | --------- | -------- | ------- | ------------------------------------------------------------------------- | | `request` | `object` | ✅ | - | HTTP request configuration object | | `degradedResponseTime` | `number` | ❌ | `10000` | Response time threshold in milliseconds for degraded status | | `maxResponseTime` | `number` | ❌ | `20000` | Maximum response time in milliseconds before marking as failed | | `shouldFail` | `boolean` | ❌ | `false` | Whether a failure should count as a pass (status 400+ reported as passed) | | `setupScript` | `object` | ❌ | - | Script to run before the API Check execution | | `tearDownScript` | `object` | ❌ | - | Script to run after the API Check execution | | Property | Type | Required | Default | Description | | ----------------------- | ----------------------- | -------- | ------- | ----------------------------------------------------------------------- | | `name` | `string` | ✅ | - | Friendly name for your check | | `description` | `string` | ❌ | `null` | A description of the check. Supports markdown. Max 500 characters | | `activated` | `boolean` | ❌ | `true` | Whether the check is enabled | | `alertChannels` | `AlertChannel[]` | ❌ | `[]` | Array of AlertChannel objects for notifications | | `alertEscalationPolicy` | `AlertEscalationPolicy` | ❌ | - | Advanced alert settings | | `environmentVariables` | `object[]` | ❌ | `[]` | Check-level environment variables | | `frequency` | `Frequency` | ❌ | - | How often to run your check | | `group` | `CheckGroup` | ❌ | - | The CheckGroup this check belongs to | | `locations` | `string[]` | ❌ | `[]` | Array of public location codes | | `muted` | `boolean` | ❌ | `false` | Whether alert notifications are muted | | `privateLocations` | `string[]` | ❌ | `[]` | Array of Private Location slugs | | `retryStrategy` | `RetryStrategy` | ❌ | - | Strategy for configuring retries | | `runtimeId` | `string` | ❌ | - | The ID of the runtime to use | | `runParallel` | `boolean` | ❌ | `false` | Run checks in parallel or round-robin | | `tags` | `string[]` | ❌ | `[]` | Array of tags to organize checks | | `testOnly` | `boolean` | ❌ | `false` | Only run with test, not during deploy | | `triggerIncident` | `IncidentTrigger` | ❌ | - | Create and resolve an incident based on the check's alert configuration | ### `ApiCheck` Options The HTTP request configuration that defines the API endpoint to monitor. This is the core component of any API Check. **Usage:** ```ts theme={null} request: { method: 'GET', url: 'https://api.example.com/users' } ``` **Parameters:** | Parameter | Type | Required | Default | Description | | ----------------- | --------- | -------- | ------- | ----------------------------------------------------------------------------------- | | `method` | `string` | ✅ | - | HTTP method: `GET` \| `POST` \| `PUT` \| `PATCH` \| `HEAD` \| `DELETE` \| `OPTIONS` | | `url` | `string` | ✅ | - | The target URL for the HTTP request | | `assertions` | `array` | ❌ | `[]` | Response assertions using `AssertionBuilder` | | `basicAuth` | `object` | ❌ | - | Basic auth credentials: `{ username, password }` | | `body` | `string` | ❌ | - | HTTP request body content | | `bodyType` | `string` | ❌ | `NONE` | Body type: `JSON` \| `FORM` \| `RAW` \| `GRAPHQL` \| `NONE` | | `followRedirects` | `boolean` | ❌ | `true` | Whether to automatically follow 30x redirects | | `headers` | `array` | ❌ | `[]` | Array of `{ key, value }` objects for HTTP headers | | `skipSSL` | `boolean` | ❌ | `false` | Whether to skip SSL certificate validation | | `queryParameters` | `array` | ❌ | `[]` | Array of `{ key, value }` objects for query parameters | **Examples:** ```ts REST API theme={null} request: { method: "GET", url: "https://api.example.com/users", headers: [ { key: "Authorization", value: "Bearer {{API_TOKEN}}" }, { key: "Content-Type", value: "application/json" }, ], assertions: [ AssertionBuilder.statusCode().equals(200), AssertionBuilder.jsonBody("$.length").greaterThan(0), AssertionBuilder.responseTime().lessThan(1000), ], }, ``` ```ts GraphQL API theme={null} request: { method: "POST", url: "https://api.example.com/graphql", headers: [{ key: "Content-Type", value: "application/json" }], body: JSON.stringify({ query: ` query GetUser($id: ID!) { user(id: $id) { id name email } } `, variables: { id: "1" }, }), assertions: [ AssertionBuilder.statusCode().equals(200), AssertionBuilder.jsonBody("$.data.user.id").equals("1"), AssertionBuilder.jsonBody("$.errors").isEmpty(), ], }, ``` ```ts Form POST theme={null} request: { method: "POST", url: "https://httpbin.org/post", headers: [ { key: "Content-Type", value: "application/x-www-form-urlencoded" }, ], body: "name=John+Doe&email=john%40example.com", assertions: [ AssertionBuilder.statusCode().equals(200), AssertionBuilder.jsonBody("$.form.name").equals("John Doe"), ], }, ``` ```ts API with Authentication theme={null} request: { method: "GET", url: "https://api.example.com/protected-resource", basicAuth: { username: "admin", password: "{{SECRET_PASSWORD}}", }, assertions: [ AssertionBuilder.statusCode().equals(200), AssertionBuilder.headers("x-rate-limit-remaining").greaterThan(0), ], }, ``` **Use cases**: HTTP endpoint monitoring, REST API testing, GraphQL API validation, authentication testing. Response time threshold in milliseconds for marking the check as degraded. This provides an early warning before the check fails completely. **Usage:** ```ts highlight={3} theme={null} new ApiCheck("performance-check", { name: "Performance Monitoring", degradedResponseTime: 2000, // Warning at 2 seconds maxResponseTime: 5000, // Failure at 5 seconds request: { method: "GET", url: "https://api.example.com/users", }, }) ``` **Use cases**: Performance alerting, SLA monitoring, gradual degradation detection. Maximum response time in milliseconds before marking the check as failed. This sets the absolute threshold for check failure based on response time. **Usage:** ```ts highlight={3} theme={null} new ApiCheck("timeout-check", { name: "API Timeout Check", maxResponseTime: 5000, // Fail if response takes longer than 5 seconds request: { method: "GET", url: "https://api.example.com/slow-endpoint", }, }) ``` **Use cases**: Performance monitoring, SLA compliance, timeout management. Whether a failure should count as a pass. When set to `true`, HTTP status codes 400 and above are reported as passed instead of failed. **Usage:** ```ts highlight={3} theme={null} new ApiCheck("negative-test", { name: "Test Error Handling", shouldFail: true, // Expect this to fail request: { method: "GET", url: "https://httpbin.org/status/403", }, }) ``` **Examples:** ```ts Error Testing theme={null} new ApiCheck("error-handling-test", { name: "Error Handling Test", shouldFail: true, // We expect 4xx/5xx responses request: { method: "POST", url: "https://api.example.com/protected", // No auth headers - should return 401 assertions: [AssertionBuilder.statusCode().equals(401)], }, }) ``` ```ts Rate Limit Testing theme={null} new ApiCheck("rate-limit-test", { name: "Rate Limit Behavior", shouldFail: true, // Expecting 429 Too Many Requests request: { method: "GET", url: "https://api.example.com/rate-limited-endpoint", assertions: [ AssertionBuilder.statusCode().equals(429), AssertionBuilder.headers("retry-after").isNotNull(), ], }, }) ``` **Use cases**: Negative testing, error handling validation, security testing. Script to run before the API Check execution. Useful for setting up test data or authentication tokens. **Usage:** ```ts File Reference highlight={3-5} theme={null} new ApiCheck("api-with-setup", { name: "API with Setup Script", setupScript: { entrypoint: path.join(__dirname, "scripts/api-setup.ts"), }, request: { method: "GET", url: "https://api.example.com/users", }, }) ``` ```ts Inline Script highlight={3-8} theme={null} new ApiCheck('inline-setup', { name: 'API with Inline Setup', setupScript: { content: ` const token = await getToken() request.headers['Authorization'] = \`Bearer \${token}\` ` }, request: { url: 'https://api.example.com/users' } }) ``` **Parameters:** | Parameter | Type | Required | Description | | ------------ | -------- | -------- | --------------------------------------------------------- | | `entrypoint` | `string` | ❌ | Path to a `.js` or `.ts` file containing the setup script | | `content` | `string` | ❌ | Inline JavaScript/TypeScript code as a string | You must provide either `entrypoint` or `content`, but not both. Learn more about writing setup and teardown scripts in [the setup and teardown scripts documentation](/docs/detect/synthetic-monitoring/api-checks/setup-and-teardown). **Use cases**: Test data setup, authentication preparation, environment configuration. Script to run after the API Check execution. Useful for cleaning up test data or resources. **Usage:** ```ts File Reference highlight={3-5} theme={null} new ApiCheck("api-with-teardown", { name: "API with Teardown Script", tearDownScript: { entrypoint: path.join(__dirname, "scripts/api-teardown.ts"), }, request: { method: "GET", url: "https://api.example.com/users", }, }) ``` ```ts Inline Script highlight={3-9} theme={null} new ApiCheck("inline-teardown", { name: "API with Inline Teardown", tearDownScript: { content: ` // Clean up test data console.log('Cleaning up test resources'); // Cleanup logic here `, }, request: { method: "GET", url: "https://api.example.com/users", }, }) ``` **Parameters:** | Parameter | Type | Required | Description | | ------------ | -------- | -------- | ------------------------------------------------------------ | | `entrypoint` | `string` | ❌ | Path to a `.js` or `.ts` file containing the teardown script | | `content` | `string` | ❌ | Inline JavaScript/TypeScript code as a string | You must provide either `entrypoint` or `content`, but not both. Learn more about writing setup and teardown scripts in [the setup and teardown scripts documentation](/docs/detect/synthetic-monitoring/api-checks/setup-and-teardown). **Use cases**: Test data cleanup, resource cleanup, logging and reporting. ### `ApiCheck` Assertions To define `assertions` for the `request` of an `ApiCheck` you should use the `AssertionBuilder`. The following sources are available for API check assertions: * `statusCode()`: Assert the HTTP status code for the HTTP request, e.g. 200 or 404 * `jsonBody(property?)`: Assert the JSON response body. The property argument accepts a [JSON path expression](/docs/detect/assertions/#json-responses-with-json-path) * `textBody()`: Assert the body as raw text * `headers(propery?, regex?)`: Assert a set of response headers, takes the header name as the property argument and a regex to tease out a string from the header value * `responseTime()`: Assert the total response time of the HTTP request Learn more in our docs on [Assertions](/docs/detect/assertions). **Assertion Examples** * Asserting an HTTP status code ```ts theme={null} AssertionBuilder.statusCode().equals(200) // Equivalent to: { source: 'STATUS_CODE', comparison: 'EQUALS', target: '200' } ``` * Asserting a part of a JSON response body using a JSON path expression ```ts theme={null} AssertionBuilder.jsonBody('$.data').greaterThan(2000), // Equivalent to: { source: 'JSON_BODY', property: '$.data', comparison: 'GREATER_THAN', target: '2000' } ``` * Asserting the value of a part of an HTTP response header. Note that you can pass in a regex as the second argument ```ts theme={null} AssertionBuilder.headers('strict-transport-security', 'max-age=(\\d+)').greaterThan(10000), // Equivalent to: { source: 'HEADERS', regex: 'max-age=(\d+)', property: 'strict-transport-security', comparison: 'GREATER_THAN', target: '10000' } ``` ## Examples ```ts REST API Check theme={null} new ApiCheck("users-api-check", { name: "Users API Check", maxResponseTime: 5000, degradedResponseTime: 2000, request: { method: "GET", url: "https://api.example.com/users", headers: [ { key: "Authorization", value: "Bearer {{API_TOKEN}}" }, { key: "Content-Type", value: "application/json" }, ], assertions: [ AssertionBuilder.statusCode().equals(200), AssertionBuilder.jsonBody("$.users.length").greaterThan(0), AssertionBuilder.responseTime().lessThan(1000), ], }, }) ``` ```ts GraphQL API Check theme={null} new ApiCheck("graphql-api-check", { name: "GraphQL API Check", request: { method: "POST", url: "https://api.example.com/graphql", headers: [{ key: "Content-Type", value: "application/json" }], body: JSON.stringify({ query: ` query GetUser($id: ID!) { user(id: $id) { id name email } } `, variables: { id: "1" }, }), assertions: [ AssertionBuilder.statusCode().equals(200), AssertionBuilder.jsonBody("$.data.user.id").equals("1"), AssertionBuilder.jsonBody("$.errors").isEmpty(), ], }, }) ``` ```ts Form Submission Check theme={null} new ApiCheck("form-api-check", { name: "Form Submission Check", request: { method: "POST", url: "https://httpbin.org/post", headers: [ { key: "Content-Type", value: "application/x-www-form-urlencoded" }, ], body: "name=John+Doe&email=john%40example.com", assertions: [ AssertionBuilder.statusCode().equals(200), AssertionBuilder.jsonBody("$.form.name").equals("John Doe"), ], }, }) ``` ```ts Authenticated API Check theme={null} new ApiCheck("protected-api-check", { name: "Protected API Check", request: { method: "GET", url: "https://api.example.com/protected-resource", basicAuth: { username: "admin", password: "{{SECRET_PASSWORD}}", }, assertions: [ AssertionBuilder.statusCode().equals(200), AssertionBuilder.headers("x-rate-limit-remaining").greaterThan(0), ], }, }) ``` When using environment variables in your requests (like `{{API_TOKEN}}`), make sure [they are properly configured in your project or check group settings](/docs/platform/variables). # Browser Check Construct Source: https://www.checklyhq.com/docs/constructs/browser-check Learn how to configure browser checks with the Checkly CLI. Learn more about Browser Checks in [the Browser Checks overview](/docs/detect/synthetic-monitoring/browser-checks/overview). Use Browser Checks to run end-to-end tests with Playwright. The examples below show how to configure browser checks for different testing scenarios. Before creating Browser Checks, ensure you have: * An initialized Checkly CLI project * A public website you want to monitor * Understanding of [Playwright test syntax and structure](/docs/learn/playwright/overview) For additional setup information, see [CLI overview](/docs/cli/overview). ```ts Basic Example theme={null} import { BrowserCheck, Frequency } from "checkly/constructs" import * as path from "path" new BrowserCheck("browser-check-1", { name: "Browser check #1", description: "Loads the **home page** and asserts key elements are visible.", frequency: Frequency.EVERY_10M, locations: ["us-east-1", "eu-west-1"], code: { entrypoint: path.join(__dirname, "home.spec.ts"), }, }) ``` ```ts Advanced Example theme={null} import { BrowserCheck, Frequency } from "checkly/constructs" import { secret } from "checkly/util" import * as path from "path" new BrowserCheck("advanced-browser-check", { name: "Advanced Browser Check", description: "Loads the **home page** and asserts key elements are visible.", activated: true, frequency: Frequency.EVERY_5M, locations: ["us-east-1", "eu-west-1"], tags: ["e2e", "critical-path"], runtimeId: "2025.04", environmentVariables: [ { key: "TEST_USERNAME", value: "testuser" }, { key: "TEST_PASSWORD", value: secret("TEST_PASSWORD"), secret: true }, ], code: { entrypoint: path.join(__dirname, "advanced-flow.spec.ts"), }, }) ``` ## Configuration The Browser Check configuration consists of specific Browser Check options and inherited general check options. | Parameter | Type | Required | Default | Description | | --------- | -------- | -------- | ------- | ------------------------ | | `code` | `object` | ✅ | - | The Playwright test code | | Property | Type | Required | Default | Description | | ----------------------- | ----------------------- | -------- | ------- | ----------------------------------------------------------------------- | | `name` | `string` | ✅ | - | Friendly name for your check | | `description` | `string` | ❌ | `null` | A description of the check. Supports markdown. Max 500 characters | | `activated` | `boolean` | ❌ | `true` | Whether the check is enabled | | `alertChannels` | `AlertChannel[]` | ❌ | `[]` | Array of AlertChannel objects for notifications | | `alertEscalationPolicy` | `AlertEscalationPolicy` | ❌ | - | Advanced alert settings | | `environmentVariables` | `object[]` | ❌ | `[]` | Check-level environment variables | | `frequency` | `Frequency` | ❌ | - | How often to run your check | | `group` | `CheckGroup` | ❌ | - | The CheckGroup this check belongs to | | `locations` | `string[]` | ❌ | `[]` | Public locations for this monitor/check | | `muted` | `boolean` | ❌ | `false` | Whether alert notifications are muted | | `privateLocations` | `string[]` | ❌ | `[]` | Private Location slugs | | `retryStrategy` | `RetryStrategy` | ❌ | - | Strategy for configured retries | | `runtimeId` | `string` | ❌ | - | The ID of the runtime to use | | `runParallel` | `boolean` | ❌ | `false` | Whether to run checks in parallel across locations | | `tags` | `string[]` | ❌ | `[]` | Tags to organize checks/monitors | | `testOnly` | `boolean` | ❌ | `false` | Only run with test, not during deploy | | `triggerIncident` | `IncidentTrigger` | ❌ | - | Create and resolve an incident based on the check's alert configuration | ### Browser Check Options The Playwright test code that defines how to execute your end-to-end browser monitor. This is the core component of any browser check. **Usage:** ```ts theme={null} // Using file reference code: { entrypoint: path.join(__dirname, "login-flow.spec.ts") } // Using inline content code: { content: ` import { test, expect } from '@playwright/test' test("homepage loads", async ({ page }) => { await page.goto("https://example.com"); await expect(page).toHaveTitle(/Example/); }); ` } ``` **Parameters:** | Parameter | Type | Required | Description | | ------------ | -------- | -------- | ---------------------------------------------------------------------- | | `entrypoint` | `string` | ❌ | Path to a `.spec.js` or `.spec.ts` file containing the Playwright test | | `content` | `string` | ❌ | Inline JavaScript/TypeScript code as a string | You must provide either `entrypoint` or `content`, but not both. **Examples:** ```ts File Reference theme={null} new BrowserCheck("login-flow-check", { name: "User Login Flow", code: { entrypoint: path.join(__dirname, "tests/login.spec.ts"), }, }) ``` ```ts Inline Content theme={null} new BrowserCheck("quick-test", { name: "Quick Homepage Test", code: { content: ` import { test, expect } from '@playwright/test' test('homepage loads correctly', async ({ page }) => { await page.goto('https://example.com') await expect(page).toHaveTitle(/Example/) await expect(page.locator('h1')).toContainText('Welcome') }) `, }, }) ``` ```ts Complex Test File theme={null} import { secret } from "checkly/util" new BrowserCheck("e2e-purchase", { name: "E-commerce Purchase Flow", code: { entrypoint: path.join(__dirname, "tests/purchase-flow.spec.ts"), }, environmentVariables: [ { key: "TEST_USER_EMAIL", value: "test@example.com" }, { key: "TEST_PASSWORD", value: secret("TEST_PASSWORD"), secret: true }, ], }) ``` **Use cases**: E2E testing, user journey validation, performance testing, visual regression testing. ### General Check Options Friendly name for your Browser Check that will be displayed in the Checkly dashboard and used in notifications. **Usage:** ```ts highlight={2} theme={null} new BrowserCheck("my-check", { name: "User Login Flow Test", /* More options... */ }) ``` How often the Browser Check should run. Use the `Frequency` enum to set the check interval. **Usage:** ```ts highlight={5} theme={null} import { Frequency } from 'checkly/constructs' new BrowserCheck("my-check", { name: "My Browser Check", frequency: Frequency.EVERY_5M, /* More options... */ }) ``` **Examples:** ```ts High Frequency theme={null} // For critical user journeys new BrowserCheck("critical-login", { name: "Critical Login Flow", frequency: Frequency.EVERY_1M, // Every minute tags: ["critical", "high-priority"], /* More options... */ }) ``` ```ts Standard Frequency theme={null} // For regular monitoring new BrowserCheck("standard-check", { name: "Standard User Flow", frequency: Frequency.EVERY_10M, // Every 10 minutes tags: ["monitoring"], /* More options... */ }) ``` **Available frequencies**: `EVERY_1M`, `EVERY_2M`, `EVERY_5M`, `EVERY_10M`, `EVERY_15M`, `EVERY_30M`, `EVERY_1H`, `EVERY_2H`, `EVERY_6H`, `EVERY_12H`, `EVERY_24H` The Checkly runtime version used to execute the Browser Check. Runtimes are managed execution environments for Browser and Multistep Checks. They include fixed Checkly-provided dependencies, such as Playwright, browser binaries, and runtime libraries. Use `runtimeId` for Browser Checks and Multistep Checks. For Playwright Check Suites, use [`engine`](/docs/constructs/playwright-check#engine) instead to select the JavaScript engine version that runs your own Playwright project. **Usage:** ```ts highlight={3} theme={null} new BrowserCheck("my-check", { name: "My Browser Check", runtimeId: "2025.04", /* More options... */ }) ``` Learn more about [Checkly runtimes in the general documentation](/docs/platform/runtimes/overview). Array of public location codes where the Browser Check should run. Multiple locations provide geographic coverage and redundancy. **Usage:** ```ts highlight={3} theme={null} new BrowserCheck("my-check", { name: "My Browser Check", locations: ["us-east-1", "eu-west-1", "ap-southeast-1"], /* More options... */ }) ``` **Examples:** ```ts Global Coverage theme={null} // Comprehensive global monitoring new BrowserCheck("global-check", { name: "Global User Experience", locations: [ "us-east-1", // N. Virginia "us-west-1", // N. California "eu-west-1", // Ireland "ap-southeast-1", // Singapore "ap-northeast-1", // Tokyo ], /* More options... */ }) ``` ```ts Regional Focus theme={null} // Focus on specific regions new BrowserCheck("europe-check", { name: "European User Flow", locations: ["eu-west-1", "eu-central-1"], /* More options... */ }) ``` **Use cases**: Global user experience monitoring, regional performance testing, compliance requirements. Whether the browser check is enabled and will run according to its schedule. **Usage:** ```ts highlight={3} theme={null} new BrowserCheck("my-check", { name: "My Browser Check", activated: false, // Disabled check /* More options... */ }) ``` Array of tags to organize and categorize your Browser Checks in the Checkly infrastructure. **Usage:** ```ts highlight={3} theme={null} new BrowserCheck("my-check", { name: "My Browser Check", tags: ["e2e", "critical-path", "user-journey"], /* More options... */ }) ``` **Examples:** ```ts Functional Tags theme={null} new BrowserCheck("login-test", { name: "User Authentication", tags: ["authentication", "login", "security"], code: { entrypoint: path.join(__dirname, "auth.spec.ts") }, /* More options... */ }) ``` ```ts Priority Tags theme={null} new BrowserCheck("checkout-flow", { name: "Checkout Process", tags: ["critical", "revenue", "high-priority"], code: { entrypoint: path.join(__dirname, "checkout.spec.ts") }, /* More options... */ }) ``` ```ts Environment Tags theme={null} new BrowserCheck("staging-test", { name: "Staging Environment Test", tags: ["staging", "pre-production", "validation"], /* More options... */ }) ``` **Use cases**: Organization, filtering, alerting rules, reporting. Check-level environment variables that will be available during test execution. Useful for test configuration and sensitive data. **Usage:** ```ts highlight={5-8} theme={null} import { secret } from "checkly/util" new BrowserCheck("my-check", { name: "My Browser Check", environmentVariables: [ { key: "TEST_USERNAME", value: "testuser@example.com" }, { key: "TEST_PASSWORD", value: secret("TEST_PASSWORD"), secret: true }, ], /* More options... */ }) ``` **Parameters:** | Parameter | Type | Required | Description | | --------- | --------- | -------- | ------------------------------------------------ | | `key` | `string` | ✅ | Environment variable name | | `value` | `string` | ✅ | Environment variable value | | `secret` | `boolean` | ❌ | Whether the value should be encrypted and hidden | **Examples:** ```ts Test Credentials theme={null} import { secret } from "checkly/util" new BrowserCheck("user-flow", { name: "User Account Flow", environmentVariables: [ { key: "TEST_EMAIL", value: "test@example.com" }, { key: "TEST_PASSWORD", value: secret("TEST_PASSWORD"), secret: true }, { key: "BASE_URL", value: "https://staging.example.com" }, ], code: { entrypoint: path.join(__dirname, "user-flow.spec.ts") }, }) ``` ```ts Feature Flags theme={null} new BrowserCheck("feature-test", { name: "Feature Flag Test", environmentVariables: [ { key: "FEATURE_ENABLED", value: "true" }, { key: "TEST_VARIANT", value: "A" }, ], code: { entrypoint: path.join(__dirname, "feature-flags.spec.ts") }, }) ``` **Use cases**: Test configuration, authentication, API keys, feature flags, environment-specific settings. ## Examples ```ts Login Flow theme={null} new BrowserCheck("login-flow-check", { name: "User Login Flow", frequency: Frequency.EVERY_15M, locations: ["us-east-1", "eu-west-1"], code: { entrypoint: path.join(__dirname, "login.spec.ts"), }, }) // login.spec.ts import { expect, test } from "@playwright/test" test("user can login successfully", async ({ page }) => { await page.goto("https://app.example.com/login") await page.getByLabel('email', { name: /email/i }).fill(process.env.TEST_USERNAME) await page.getByLabel('password', { name: /password/i }).fill(process.env.TEST_PASSWORD) await page.getByRole('button', { name: /login/i }).click() await expect(page).toHaveURL(/dashboard/) await expect(page.getByTestId('user-menu')).toBeVisible() }) ``` ```ts E-commerce Purchase theme={null} new BrowserCheck("purchase-flow-check", { name: "Purchase Flow", frequency: Frequency.EVERY_30M, locations: ["us-east-1", "eu-west-1"], tags: ["e2e", "critical", "revenue"], code: { entrypoint: path.join(__dirname, "purchase.spec.ts"), }, }) // purchase.spec.ts import { test, expect } from "@playwright/test" test("user can complete purchase", async ({ page }) => { await page.goto("https://shop.example.com") // Add item to cart await page.getByTestId("product-1").click() await page.getByTestId("add-to-cart").click() // Go to checkout await page.getByTestId("cart-button").click() await page.getByTestId("checkout-button").click() // Fill checkout form await page.getByLabel("email").fill("test@example.com") await page.getByLabel("card-number").fill("4242424242424242") // Complete purchase await page.getByTestId("complete-purchase").click() await expect(page.getByTestId("success-message")).toBeVisible() }) ``` ```ts Form Submission theme={null} new BrowserCheck("contact-form-check", { name: "Contact Form Submission", frequency: Frequency.EVERY_10M, code: { entrypoint: path.join(__dirname, "contact-form.spec.ts"), }, }) // contact-form.spec.ts import { test, expect } from "@playwright/test" test("contact form works correctly", async ({ page }) => { await page.goto("https://example.com/contact") await page.getByLabel('name').fill("John Doe") await page.getByLabel('email').fill("john@example.com") await page.getByLabel('message').fill("This is a test message") await page.getByLabel('submit').click() await expect(page.getByText("Thank you")).toBeVisible() }) ``` Browser checks require Playwright test files. Make sure your test files use the `@playwright/test` framework and follow Playwright's testing conventions. # CheckGroup Construct Source: https://www.checklyhq.com/docs/constructs/check-group Learn how to configure check groups with the Checkly CLI. Learn more about Check Groups in [the Groups overview](/docs/platform/groups). `CheckGroup` is deprecated. Please use `CheckGroupV2` instead. See [CheckGroupV2 documentation](/docs/constructs/check-group-v2) for details. Use `CheckGroup` to organize your checks into logical groups. This provides better organization, shared configuration, and group-level controls for your monitoring setup. ```ts Basic Example theme={null} import { ApiCheck, CheckGroup, Frequency } from "checkly/constructs" const group = new CheckGroup("api-group-1", { name: "API Endpoints Group", activated: true, muted: false, frequency: Frequency.EVERY_15M, locations: ["us-east-1", "eu-west-1"], tags: ["api-group"], }) new ApiCheck("api-check-1", { name: "API check #1", group, request: { method: "GET", url: "https://api.example.com/health", }, }) ``` ```ts Advanced Example theme={null} import { ApiCheck, CheckGroup, EmailAlertChannel, Frequency, } from "checkly/constructs" import { secret } from "checkly/util" const emailChannel = new EmailAlertChannel("team-email", { address: "team@example.com", }) const group = new CheckGroup("comprehensive-group", { name: "Comprehensive Monitoring Group", activated: true, muted: false, frequency: Frequency.EVERY_10M, locations: ["us-east-1", "eu-west-1"], tags: ["production", "critical"], concurrency: 5, environmentVariables: [ { key: "API_BASE_URL", value: "https://api.example.com" }, { key: "API_KEY", value: secret("API_KEY"), secret: true }, ], alertChannels: [emailChannel], browserChecks: { frequency: Frequency.EVERY_30M, testMatch: "*.spec.js", }, }) new ApiCheck("api-check-1", { name: "API check #1", group, request: { method: "GET", url: "https://api.example.com/health", }, }) ``` ## Configuration | Parameter | Type | Required | Default | Description | | ---------------------------------- | ----------------------- | -------- | ------- | ------------------------------------------------------------ | | `name` | `string` | ✅ | - | Friendly name for your check group | | `activated` | `boolean` | ❌ | `true` | Whether checks in the group are running | | `apiCheckDefaults` | `object` | ❌ | - | Default settings for API checks in the group | | `alertEscalationPolicy` | `AlertEscalationPolicy` | ❌ | - | Advanced alert escalation settings | | `alertChannels` | `AlertChannel[]` | ❌ | `[]` | Alert channels for all checks in the group | | `environmentVariables` | `object[]` | ❌ | `[]` | Group-level environment variables | | `concurrency` | `number` | ❌ | `10` | Number of concurrent Checks to run when a group is triggered | | `frequency` | `Frequency` | ❌ | - | How often to run checks within the group | | `localSetupScript` (deprecated) | `string` | ❌ | - | Code to run before each check/monitor in this group | | `localTearDownScript` (deprecated) | `string` | ❌ | - | Code to run after each check/monitor in this group | | `locations` | `string[]` | ❌ | - | Public locations for all checks in the group | | `muted` | `boolean` | ❌ | `false` | Whether alert notifications are muted | | `privateLocations` | `string[]` | ❌ | - | Private Location slugs | | `retryStrategy` | `RetryStrategy` | ❌ | - | Strategy for configured retries | | `runtimeId` | `string` | ❌ | - | Runtime ID for all checks in the group | | `runParallel` | `boolean` | ❌ | - | Whether to run checks in parallel across locations | | `tags` | `string[]` | ❌ | `[]` | Tags to organize all checks in the group | | `browserChecks` | `object` | ❌ | - | Settings for Browser Checks in the group | | `multistepChecks` | `object` | ❌ | - | Settings for Multistep Checks in the group | ### Group Options Friendly name for your check group that will be displayed in the Checkly dashboard and used for organization. **Usage:** ```ts highlight={2} theme={null} const group = new CheckGroup("api-monitoring-group", { name: "API Monitoring Group", }) ``` **Use cases**: Group organization, dashboard display, team coordination. Whether checks in the group are running. When false, all checks in the group are paused. **Usage:** ```ts highlight={3} theme={null} const group = new CheckGroup("api-monitoring-group", { name: "API Monitoring Group", activated: false, }) ``` **Use cases**: Environment-specific checks, maintenance windows, temporary disabling. Whether to mute alerts for all checks in the group. Checks will still run but won't send notifications. **Usage:** ```ts highlight={3} theme={null} const group = new CheckGroup("api-monitoring-group", { name: "API Monitoring Group", muted: true, // Silence all alerts }) ``` **Use cases**: Non-production environments, testing phases, scheduled maintenance. How often to run checks within the group. This frequency applies to all checks in the group unless overridden at the check level. **Usage:** ```ts highlight={5} theme={null} import { Frequency } from 'checkly/constructs' const group = new CheckGroup("api-monitoring-group", { name: "API Monitoring Group", frequency: Frequency.EVERY_10M, }) ``` **Available frequencies**: `EVERY_10S`, `EVERY_20S`, `EVERY_30S`, `EVERY_1M`, `EVERY_2M`, `EVERY_5M`, `EVERY_10M`, `EVERY_15M`, `EVERY_30M`, `EVERY_1H`, `EVERY_2H`, `EVERY_6H`, `EVERY_12H`, `EVERY_24H` Generally, Check Groups support all available frequencies, but if a group includes a check type that doesn't support high frequencies, `npx checkly deploy` will fail. We recommend separating high-frequency ones into their own groups. Public locations for all checks in the group. Checks inherit these locations unless they specify their own. **Usage:** ```ts highlight={3} theme={null} const group = new CheckGroup("api-monitoring-group", { name: "API Monitoring Group", locations: ["us-east-1", "eu-west-1", "ap-southeast-1"], }) ``` **Use cases**: Global monitoring, regional service coverage, user experience testing. Setting to automatically create and apply Browser Checks to a group. **Usage:** ```ts highlight={3-5} theme={null} const group = new CheckGroup("api-monitoring-group", { name: "API Monitoring Group", browserChecks: { testMatch: "./*.spec.ts", }, }) ``` **Use cases**: Automated test discovery, E2E test organization, user flow monitoring. Setting to automatically create and apply MultiStep Checks to a group. **Usage:** ```ts highlight={3-5} theme={null} const group = new CheckGroup("api-multistep-group", { name: "API Multistep Monitoring Group", multiStepChecks: { testMatch: "./*.multi-step.spec.ts", }, }) ``` **Use cases**: Automated test discovery, E2E test organization, user flow monitoring. ## Examples ```ts theme={null} const apiGroup = new CheckGroup("api-monitoring-group", { name: "API Monitoring", activated: true, frequency: Frequency.EVERY_5M, locations: ["us-east-1", "eu-west-1"], tags: ["api", "production"], environmentVariables: [ { key: "API_BASE_URL", value: "https://api.example.com" }, { key: "API_VERSION", value: "v2" }, ], alertChannels: [slackChannel], }) new ApiCheck("users-api", { name: "Users API", group: apiGroup, request: { method: "GET", url: "{{API_BASE_URL}}/{{API_VERSION}}/users", }, }) new ApiCheck("orders-api", { name: "Orders API", group: apiGroup, request: { method: "GET", url: "{{API_BASE_URL}}/{{API_VERSION}}/orders", }, }) ``` ```ts theme={null} const servicesGroup = new CheckGroup("services-monitoring", { name: "Core Services Monitoring", activated: true, frequency: Frequency.EVERY_10M, locations: ["us-east-1", "eu-west-1"], tags: ["services", "infrastructure"], alertChannels: [emailChannel], retryStrategy: RetryStrategyBuilder.linearStrategy({ baseBackoffSeconds: 30, maxRetries: 3, sameRegion: false, }), }) // API checks new ApiCheck("database-health", { name: "Database Health", group: servicesGroup, request: { method: "GET", url: "https://api.example.com/health/database", }, }) // TCP monitors new TcpMonitor("redis-connectivity", { name: "Redis Connectivity", group: servicesGroup, request: { hostname: "redis.example.com", port: 6379, }, }) // URL monitors new UrlMonitor("cdn-availability", { name: "CDN Availability", group: servicesGroup, request: { url: "https://cdn.example.com/health", }, }) ``` ```ts theme={null} const regionalGroup = new CheckGroup("us-east-monitoring", { name: "US East Region Monitoring", activated: true, frequency: Frequency.EVERY_2M, locations: ["us-east-1"], // Single region focus tags: ["us-east", "regional"], runParallel: false, // Sequential execution alertEscalationPolicy: AlertEscalationBuilder.runBasedEscalation(2, { interval: 5, amount: 2, }), }) new ApiCheck("us-east-api", { name: "US East API Endpoint", group: regionalGroup, request: { method: "GET", url: "https://us-east-api.example.com/health", }, }) ``` # CheckGroupV2 Construct Source: https://www.checklyhq.com/docs/constructs/check-group-v2 Learn how to configure check groups with the Checkly CLI. Learn more about Check Groups in [the Groups overview](/docs/platform/groups). Use `CheckGroupV2` to organize your checks into logical groups. This provides better organization, shared configuration, and group-level controls for your monitoring setup. ## `CheckGroupV2` Structure ```ts Basic Example theme={null} import { ApiCheck, CheckGroupV2, Frequency } from "checkly/constructs" const group = new CheckGroupV2("api-group-1", { name: "API Endpoints Group", activated: true, muted: false, frequency: Frequency.EVERY_15M, locations: ["us-east-1", "eu-west-1"], tags: ["api-group"], }) new ApiCheck("api-check-1", { name: "API check #1", group, request: { method: "GET", url: "https://api.example.com/health", }, }) ``` ```ts Advanced Example theme={null} import { ApiCheck, CheckGroupV2, EmailAlertChannel, Frequency } from "checkly/constructs" import { secret } from "checkly/util" const emailChannel = new EmailAlertChannel("team-email", { address: "team@example.com", }) const group = new CheckGroupV2("comprehensive-group", { name: "Comprehensive Monitoring Group", activated: true, muted: false, frequency: Frequency.EVERY_10M, locations: ["us-east-1", "eu-west-1"], tags: ["production", "critical"], concurrency: 5, environmentVariables: [ { key: "API_BASE_URL", value: "https://api.example.com" }, { key: "API_KEY", value: secret("API_KEY"), secret: true }, ], alertChannels: [emailChannel], browserChecks: { frequency: Frequency.EVERY_30M, testMatch: "*.spec.js", }, }) new ApiCheck("api-check-1", { name: "API check #1", group, request: { method: "GET", url: "https://api.example.com/health", }, }) ``` ## Configuration | Parameter | Type | Required | Default | Description | | ---------------------------------- | ----------------------- | -------- | ------- | ------------------------------------------------------------ | | `name` | `string` | ✅ | - | Friendly name for your check group | | `activated` | `boolean` | ❌ | `true` | Whether checks in the group are running | | `apiCheckDefaults` | `object` | ❌ | - | Default settings for API checks in the group | | `alertEscalationPolicy` | `AlertEscalationPolicy` | ❌ | - | Advanced alert escalation settings | | `alertChannels` | `AlertChannel[]` | ❌ | `[]` | Alert channels for all checks in the group | | `environmentVariables` | `object[]` | ❌ | `[]` | Group-level environment variables | | `concurrency` | `number` | ❌ | `10` | Number of concurrent Checks to run when a group is triggered | | `frequency` | `Frequency` | ❌ | - | How often to run checks within the group | | `localSetupScript` (deprecated) | `string` | ❌ | - | Code to run before each check/monitor in this group | | `localTearDownScript` (deprecated) | `string` | ❌ | - | Code to run after each check/monitor in this group | | `locations` | `string[]` | ❌ | - | Public locations for all checks in the group | | `muted` | `boolean` | ❌ | `false` | Whether alert notifications are muted | | `privateLocations` | `string[]` | ❌ | - | Private Location slugs | | `retryStrategy` | `RetryStrategy` | ❌ | - | Strategy for configured retries | | `runtimeId` | `string` | ❌ | - | Runtime ID for all checks in the group | | `runParallel` | `boolean` | ❌ | - | Whether to run checks in parallel across locations | | `tags` | `string[]` | ❌ | `[]` | Tags to organize all checks in the group | | `browserChecks` | `object` | ❌ | - | Settings for Browser Checks in the group | | `multistepChecks` | `object` | ❌ | - | Settings for Multistep Checks in the group | If you want the group's alert settings to override check-level alert settings, you must set the [`alertEscalationPolicy`](/docs/constructs/check-group-v2#param-alert-escalation-policy). Otherwise, the alert settings of individual checks will be used, even if `alertChannels` is defined in your group. ### Group Options Friendly name for your check group that will be displayed in the Checkly dashboard and used for organization. **Usage:** ```ts highlight={2} theme={null} const group = new CheckGroupV2("api-monitoring-group", { name: "API Monitoring Group", }) ``` **Use cases**: Group organization, dashboard display, team coordination. Whether checks in the group are running. When false, all checks in the group are paused. **Usage:** ```ts highlight={3} theme={null} const group = new CheckGroupV2("api-monitoring-group", { name: "API Monitoring Group", activated: false, }) ``` **Use cases**: Environment-specific checks, maintenance windows, temporary disabling. Whether to mute alerts for all checks in the group. Checks will still run but won't send notifications. **Usage:** ```ts highlight={3} theme={null} const group = new CheckGroupV2("api-monitoring-group", { name: "API Monitoring Group", muted: true, // Silence all alerts }) ``` **Use cases**: Non-production environments, testing phases, scheduled maintenance. How often to run checks within the group. This frequency applies to all checks in the group unless overridden at the check level. **Usage:** ```ts highlight={5} theme={null} import { Frequency } from 'checkly/constructs' const group = new CheckGroupV2('api-monitoring-group', { name: "API Monitoring Group", frequency: Frequency.EVERY_10M }) ``` **Available frequencies**: `EVERY_10S`, `EVERY_20S`, `EVERY_30S`, `EVERY_1M`, `EVERY_2M`, `EVERY_5M`, `EVERY_10M`, `EVERY_15M`, `EVERY_30M`, `EVERY_1H`, `EVERY_2H`, `EVERY_6H`, `EVERY_12H`, `EVERY_24H` Generally, Check Groups support all available frequencies, but if a group includes a check type that doesn't support high frequencies, `npx checkly deploy` will fail. We recommend separating high-frequency ones into their own groups. Public locations for all checks in the group. Checks inherit these locations unless they specify their own. **Usage:** ```ts highlight={3} theme={null} const group = new CheckGroupV2("api-monitoring-group", { name: "API Monitoring Group", locations: ["us-east-1", "eu-west-1", "ap-southeast-1"], }) ``` **Use cases**: Global monitoring, regional service coverage, user experience testing. Setting to automatically create and apply Browser Checks to a group. **Usage:** ```ts highlight={3-5} theme={null} const group = new CheckGroupV2("api-monitoring-group", { name: "API Monitoring Group", browserChecks: { testMatch: "./*.spec.ts", }, }) ``` **Use cases**: Automated test discovery, E2E test organization, user flow monitoring. Setting to automatically create and apply MultiStep Checks to a group. **Usage:** ```ts highlight={3-5} theme={null} const group = new CheckGroupV2("api-multistep-group", { name: "API Multistep Monitoring Group", multiStepChecks: { testMatch: "./*.multi-step.spec.ts", }, }) ``` **Use cases**: Automated test discovery, E2E test organization, user flow monitoring. An [AlertEscalationPolicy](/docs/constructs/alert-escalation-policy) object defines [alert-settings](/docs/communicate/alerts/overview) for Check runs. If **set to** `'global'`, it overrides the alert settings of all checks in the group to use the [global account notification settings](https://app.checklyhq.com/alerts/settings). If **set** to specific values, it overrides the alert settings of all checks in the group. If **not set**, each Check uses its own alert configuration. ## Reference an existing group by ID To add checks to an existing group in your account, find the group ID in the Checkly web UI or via the API and reference it using `CheckGroupV2.fromId()`. Navigate to the group in the Checkly UI and copy the group ID from the URL or the group details. ```bash theme={null} curl -H "Authorization: Bearer YOUR_API_KEY" \ -H "X-Checkly-Account: YOUR_ACCOUNT_ID" \ https://api.checklyhq.com/v1/check-groups ``` ```ts Using Existing Group highlight={2,6} theme={null} // Reference an existing group by ID const existingGroup = CheckGroupV2.fromId(123) new ApiCheck("existing-group-check", { name: "Check with Existing Group", group: existingGroup, request: { method: "GET", url: "https://api.example.com/endpoint", }, }) ``` When referencing existing groups with `fromId()`, note: * You cannot filter tests by group tags since group properties aren't available locally * Checks won't inherit the group's frequency. This only works for groups defined in the CLI project If you need these features, you can either import the group using the [Checkly import feature](/docs/cli/checkly-import) (e.g. `npx checkly import check-group:123`) or define a new group directly in your project. ## Shared Settings in Groups with Different Monitor Types With `CheckGroupV2` you can group uptime monitors (e.g. URL, TCP, DNS) and synthetic checks (e.g. API, Multistep, Playwright Check Suites). Depending on your plan type, some [group settings](/docs/constructs/check-group-v2#configuration) (such as parallel runs or advanced retry strategies) may not be supported across both monitor types. To avoid conflicts, Checkly validates group settings against the lowest common denominator of supported features in the group. See [Mixing Checks and Monitors in a Group](/docs/platform/groups/#mixing-checks-and-monitors-in-a-group) for details. ## Examples ```ts theme={null} const apiGroup = new CheckGroupV2("api-monitoring-group", { name: "API Monitoring", activated: true, frequency: Frequency.EVERY_5M, locations: ["us-east-1", "eu-west-1"], tags: ["api", "production"], environmentVariables: [ { key: "API_BASE_URL", value: "https://api.example.com" }, { key: "API_VERSION", value: "v2" }, ], alertEscalationPolicy: 'global', alertChannels: [slackChannel], }) new ApiCheck("users-api", { name: "Users API", group: apiGroup, request: { method: "GET", url: "{{API_BASE_URL}}/{{API_VERSION}}/users", }, }) new ApiCheck("orders-api", { name: "Orders API", group: apiGroup, request: { method: "GET", url: "{{API_BASE_URL}}/{{API_VERSION}}/orders", }, }) ``` ```ts theme={null} const servicesGroup = new CheckGroupV2("services-monitoring", { name: "Core Services Monitoring", activated: true, frequency: Frequency.EVERY_10M, locations: ["us-east-1", "eu-west-1"], tags: ["services", "infrastructure"], alertEscalationPolicy: 'global', alertChannels: [emailChannel, pagerdutyChannel], retryStrategy: RetryStrategyBuilder.linearStrategy({ baseBackoffSeconds: 30, maxRetries: 3, sameRegion: false, }), }) // API checks new ApiCheck("database-health", { name: "Database Health", group: servicesGroup, request: { method: "GET", url: "https://api.example.com/health/database", }, }) // TCP monitors new TcpMonitor("redis-connectivity", { name: "Redis Connectivity", group: servicesGroup, request: { hostname: "redis.example.com", port: 6379, }, }) // URL monitors new UrlMonitor("cdn-availability", { name: "CDN Availability", group: servicesGroup, request: { url: "https://cdn.example.com/health", }, }) ``` ```ts theme={null} const regionalGroup = new CheckGroupV2("us-east-monitoring", { name: "US East Region Monitoring", activated: true, frequency: Frequency.EVERY_2M, locations: ["us-east-1"], // Single region focus tags: ["us-east", "regional"], runParallel: false, // Sequential execution alertEscalationPolicy: AlertEscalationBuilder.runBasedEscalation(2, { interval: 5, amount: 2, }), alertChannels: [slackChannel], }) new ApiCheck("us-east-api", { name: "US East API Endpoint", group: regionalGroup, request: { method: "GET", url: "https://us-east-api.example.com/health", }, }) ``` # Dashboard Construct Source: https://www.checklyhq.com/docs/constructs/dashboard Learn how to configure dashboards with the Checkly CLI. Learn more about Dashboards in [the Dashboards overview](/docs/communicate/dashboards/overview). Use Dashboard to create public or private dashboards that display checks and their related metrics on a single page. Dashboards provide a centralized view of your monitoring data. ```ts Basic Example theme={null} import { Dashboard } from "checkly/constructs" new Dashboard("basic-dashboard", { header: "Service Status", description: "Real-time monitoring dashboard", tags: ["production", "api"], customUrl: "service-status", }) ``` ```ts Advanced Example theme={null} import { Dashboard } from "checkly/constructs" import * as path from "path" new Dashboard("advanced-dashboard", { header: "ACME Production Status", description: "Comprehensive monitoring for all ACME services", tags: ["prod", "api", "web"], logo: "https://assets.acme.com/images/acme-logo.png", customUrl: "acme-production-status", customDomain: "status.acme.com", favicon: "https://assets.acme.com/favicon.ico", link: "https://acme.com", width: "FULL", refreshRate: 60, paginate: true, paginationRate: 30, checksPerPage: 20, useTagsAndOperator: true, hideTags: false, enableIncidents: true, expandChecks: false, showHeader: true, showP95: true, showP99: true, isPrivate: false, customCSS: { entrypoint: path.join(__dirname, "dashboard.css"), }, }) ``` ## Configuration | Parameter | Type | Required | Default | Description | | -------------------- | ---------- | -------- | -------- | ------------------------------------------------------------------------ | | `checksPerPage` | `number` | ❌ | `15` | Number of checks per page (1-20) | | `customCSS` | `object` | ❌ | - | Custom CSS styling (Team/Enterprise plans only) | | `customDomain` | `string` | ❌ | - | Custom domain (e.g., "status.example.com") | | `customUrl` | `string` | ❌ | - | Subdomain under "checklyhq.com" (required if customDomain not specified) | | `description` | `string` | ❌ | - | Text displayed below the header | | `enableIncidents` | `boolean` | ❌ | `false` | Enable incidents | | `expandChecks` | `boolean` | ❌ | `false` | Expand checks by default | | `favicon` | `string` | ❌ | - | URL to favicon image | | `header` | `string` | ❌ | - | Text displayed at the top of your dashboard | | `hideTags` | `boolean` | ❌ | `false` | Hide tags on the dashboard | | `isPrivate` | `boolean` | ❌ | `false` | Make dashboard private (Team/Enterprise plans only) | | `link` | `string` | ❌ | - | URL to redirect when dashboard logo is clicked | | `logo` | `string` | ❌ | - | URL to logo image for the dashboard header | | `paginate` | `boolean` | ❌ | `true` | Enable pagination for checks | | `paginationRate` | `number` | ❌ | `60` | Pagination interval: `30` \| `60` \| `300` seconds | | `refreshRate` | `number` | ❌ | `60` | Auto-refresh interval: `60` \| `300` \| `600` seconds | | `showHeader` | `boolean` | ❌ | `true` | Show header and description | | `showP95` | `boolean` | ❌ | `true` | Show P95 statistics | | `showP99` | `boolean` | ❌ | `true` | Show P99 statistics | | `tags` | `string[]` | ❌ | `[]` | Tags that filter which checks appear on the dashboard | | `useTagsAndOperator` | `boolean` | ❌ | `false` | Use AND instead of OR for tag filtering | | `width` | `string` | ❌ | `'FULL'` | Dashboard width: `'FULL'` \| `'960PX'` | ### Essential `Dashboard` Options Text displayed at the top of your dashboard as the main title. **Usage:** ```ts highlight={2} theme={null} new Dashboard('my-dashboard', { header: 'Production Services Status' }) ``` **Use cases**: Brand identity, service identification, user clarity. Text displayed below the header providing additional context about the dashboard. **Usage:** ```ts highlight={3} theme={null} new Dashboard('my-dashboard', { header: 'Production Services', description: 'Real-time monitoring of all production services' }) ``` **Use cases**: Context provision, scope clarification, user guidance. Tags that filter which checks appear on the dashboard. Empty array shows all checks. **Usage:** ```ts highlight={2} theme={null} new Dashboard('my-dashboard', { tags: ['production', 'api'] }) ``` **Examples:** ```ts theme={null} // Service-specific tags new Dashboard('api-dashboard', { header: 'API Services', tags: ['api-dashboard'], }) // Environment and service tags new Dashboard('prod-web-dashboard', { header: 'Production Web Services', tags: ['production', 'web'], useTagsAndOperator: true // Must have BOTH tags }) // All checks (empty array) new Dashboard('all-services', { header: 'All Services', tags: [] // Shows all checks }) ``` **Use cases**: Service filtering, environment separation, team organization. Subdomain under "checklyhq.com" for your dashboard (e.g., "my-status" becomes "my-status.checklyhq.com"). **Usage:** ```ts highlight={2} theme={null} new Dashboard('my-dashboard', { customUrl: 'service-status' }) // Creates: service-status.checklyhq.com ``` Required if `customDomain` is not specified. Use lowercase letters, numbers, and hyphens only. **Use cases**: Public access, branded URLs, easy sharing. Custom domain for your dashboard (e.g., "status.example.com"). Must be verified through the Checkly UI. **Usage:** ```ts highlight={2} theme={null} new Dashboard('my-dashboard', { customDomain: 'status.example.com' }) ``` **Use cases**: Brand consistency, professional appearance, domain control. Custom CSS styling for your dashboard. Only available on Team and Enterprise plans. **Usage:** ```ts highlight={3-5,10-20} theme={null} // Using file reference new Dashboard("styled-dashboard", { customCSS: { entrypoint: path.join(__dirname, "dashboard.css"), }, }) // Using inline content new Dashboard("styled-dashboard", { customCSS: { content: ` .header { background: #080808; border-bottom-color: #313035; } .header .logo a { color: #f7f8f8; } `, }, }) ``` **Properties:** | Parameter | Type | Required | Description | | ------------ | -------- | -------- | ------------------------------------------- | | `entrypoint` | `string` | ❌ | Path to a CSS file containing custom styles | | `content` | `string` | ❌ | Inline CSS content as a string | You must provide either `entrypoint` or `content`, but not both. **Use cases**: Brand consistency, custom themes, visual identity, enhanced UX. ## Examples ```ts theme={null} new Dashboard("production-monitoring", { header: "Production Services", description: "Real-time monitoring of all production services", tags: ["production", "critical"], customUrl: "production-monitoring", logo: "https://company.com/logo.png", refreshRate: 60, width: "FULL", showP95: true, showP99: true, enableIncidents: true, }) ``` ```ts theme={null} new Dashboard("api-dashboard", { header: "API Endpoints Status", description: "Monitor all API endpoints and their performance", tags: ["api"], customUrl: "api-status", customDomain: "api-status.company.com", width: "960PX", refreshRate: 60, checksPerPage: 25, expandChecks: true, }) ``` ```ts theme={null} new Dashboard("us-east-dashboard", { header: "US East Region Status", description: "Monitoring for US East infrastructure", tags: ["us-east", "production"], customUrl: "us-east-status", logo: "https://assets.company.com/regional-logo.png", refreshRate: 300, paginate: false, showHeader: true, hideTags: true, }) ``` ```ts theme={null} new Dashboard("platform-team-dashboard", { header: "Platform Team Services", description: "Services owned and maintained by the Platform team", tags: ["platform-team"], customUrl: "platform-team-status", width: "960PX", refreshRate: 300, checksPerPage: 10, useTagsAndOperator: true, expandChecks: true, isPrivate: true, // Only accessible with authentication }) ``` ```ts theme={null} new Dashboard("branded-dashboard", { header: "ACME Corporation Status", description: "Service availability dashboard", tags: ["production"], customUrl: "acme-status", logo: "https://acme.com/logo.svg", customCSS: { entrypoint: path.join(__dirname, "acme-dashboard.css"), }, width: "FULL", refreshRate: 60, }) ``` # DnsMonitor Construct Source: https://www.checklyhq.com/docs/constructs/dns-monitor Learn how to configure DNS monitors with the Checkly CLI. Learn more about DNS Monitors in [the DNS monitor overview](/docs/detect/uptime-monitoring/dns-monitors/overview). Use DNS Monitors to verify that DNS records resolve correctly and to track lookup performance over time. Before creating DNS Monitors, ensure you have: * An initialized Checkly CLI project * A domain or hostname you want to monitor * Basic understanding of DNS record types (A, AAAA, CNAME, MX, NS, TXT, SOA, HTTPS) For additional setup information, see [CLI overview](/docs/cli/overview). ```ts Basic Example theme={null} import { Frequency, DnsAssertionBuilder, DnsMonitor } from "checkly/constructs" new DnsMonitor("dns-monitor", { name: "DNS A Record Monitor", description: "Asserts `example.com` A record resolves to the **expected IP**.", activated: true, maxResponseTime: 1000, degradedResponseTime: 500, frequency: Frequency.EVERY_5M, locations: ["us-east-1", "eu-central-1"], request: { query: "example.com", recordType: "A", assertions: [ DnsAssertionBuilder.jsonAnswer("$.Answer[0].data").equals("93.184.216.34") ], }, }) ``` ```ts Advanced Example theme={null} import { Frequency, DnsAssertionBuilder, DnsMonitor } from "checkly/constructs" new DnsMonitor("advanced-dns-monitor", { name: "Advanced DNS Monitor", description: "Asserts `api.example.com` A record resolves to the **expected IP**.", activated: true, frequency: Frequency.EVERY_5M, locations: ["us-east-1", "eu-central-1"], maxResponseTime: 800, degradedResponseTime: 400, tags: ["dns", "production", "critical"], request: { query: "api.example.com", recordType: "A", nameServer: "9.9.9.9", port: 53, protocol: "UDP", assertions: [ DnsAssertionBuilder.jsonAnswer("$.Answer[0].TTL").greaterThan(300), DnsAssertionBuilder.responseTime().lessThan(500), DnsAssertionBuilder.jsonAnswer("$.Answer[0].data").equals("93.184.216.34") ], }, }) ``` ## Configuration A DNS Monitor has its own DNS-specific settings, plus the standard monitor options shared across all check types. | Parameter | Type | Required | Default | Description | | ---------------------- | -------- | -------- | ------- | -------------------------------------------------------------- | | `request` | `object` | ✅ | - | DNS request configuration object | | `degradedResponseTime` | `number` | ❌ | `500` | Response time threshold in milliseconds for degraded status | | `maxResponseTime` | `number` | ❌ | `1000` | Maximum response time in milliseconds before marking as failed | | Property | Type | Required | Default | Description | | ----------------------- | ---------------------------------------- | -------- | ----------- | ----------------------------------------------------------------------- | | `name` | `string` | ✅ | - | Friendly name for your monitor | | `description` | `string` | ❌ | `null` | A description of the monitor. Supports markdown. Max 500 characters | | `activated` | `boolean` | ❌ | `true` | Whether the monitor is enabled | | `alertChannels` | `Array` | ❌ | `[]` | Array of AlertChannel objects for notifications | | `alertEscalationPolicy` | `AlertEscalationPolicy` | ❌ | - | Advanced alert escalation settings | | `frequency` | `Frequency` | ❌ | `EVERY_10M` | How often to run your monitor | | `group` | `CheckGroupV1` `CheckGroupV2` | ❌ | - | The CheckGroup this monitor belongs to | | `locations` | `string[]` | ❌ | `[]` | Array of public location codes | | `privateLocations` | `string[]` | ❌ | `[]` | Array of Private Location slugs | | `muted` | `boolean` | ❌ | `false` | Whether alert notifications are muted | | `tags` | `string[]` | ❌ | `[]` | Array of tags to organize monitors | | `testOnly` | `boolean` | ❌ | `false` | Only run with test, not during deploy | | `retryStrategy` | `RetryStrategy` | ❌ | - | Strategy for configuring retries | | `runParallel` | `boolean` | ❌ | `false` | Run monitors in parallel or round-robin | | `triggerIncident` | `IncidentTrigger` | ❌ | - | Create and resolve an incident based on the check's alert configuration | ### `DnsMonitor` Options DNS request configuration that defines the DNS query to perform and how to validate the response. **Usage:** ```ts theme={null} new DnsMonitor("dns-monitor", { name: "DNS A Record Monitor", request: { query: "example.com", recordType: "A", assertions: [ DnsAssertionBuilder.jsonAnswer("$.Answer[0].data").equals("93.184.216.34") ] } }) ``` **Parameters:** | Parameter | Type | Required | Default | Description | | ------------ | ---------------- | -------- | ------- | -------------------------------------------------------- | | `query` | `string` | ✅ | - | The DNS query (domain name or IP address) | | `recordType` | `DnsRecordType` | ✅ | - | DNS record type: A, AAAA, CNAME, MX, NS, TXT, SOA, HTTPS | | `nameServer` | `string` | ❌ | - | Custom DNS server to query (e.g. "9.9.9.9") | | `port` | `number` | ❌ | `53` | Port of the DNS server | | `protocol` | `DnsProtocol` | ❌ | `UDP` | Protocol to use: UDP or TCP | | `assertions` | `DnsAssertion[]` | ❌ | `[]` | Response assertions using `DnsAssertionBuilder` | Response time threshold in milliseconds for marking the DNS Monitor as degraded (warning state). **Usage:** ```ts highlight={3} theme={null} new DnsMonitor("dns-performance-tiers", { name: "DNS Performance Tiers", degradedResponseTime: 300, // Warn at 300ms request: { query: "example.com", recordType: "A", assertions: [ DnsAssertionBuilder.jsonAnswer("$.Answer[0].data").equals("93.184.216.34") ], }, }) ``` Maximum response time in milliseconds before the DNS Monitor is marked as failed. **Usage:** ```ts highlight={3} theme={null} new DnsMonitor("fast-dns", { name: "Fast DNS Resolution", maxResponseTime: 500, // Fail at 500ms request: { query: "fast.example.com", recordType: "A", }, }) ``` ### `DnsMonitor` Assertions To define `assertions` for the `request` of an `DnsMonitor` you should use the `DnsAssertionBuilder`. The following sources are available for DNS monitor assertions: * `responseTime()`: Assert the total response time of the DNS request in milliseconds. Use this to set thresholds for failed lookups * `responseCode()`: By default, DNS monitors pass when the return code is NOERROR and fail on error codes (FORMERR, SERVFAIL, NXDOMAIN, etc.). You can override this behavior by defining a custom return code assertion * `textAnswer()`: The raw DNS response as plain text. Use this to check for specific strings in the response * `jsonAnswer(property?)`: The [DNS response in JSON format](/docs/detect/uptime-monitoring/dns-monitors/configuration#json-response-schemas). This allows you to target specific fields using JSON path assertions. The response structure varies by record type. [Learn more about using JSON path](/docs/detect/assertions/#json-responses-with-json-path). Here are some examples: * Assert the total response time of the DNS request ```ts theme={null} DnsAssertionBuilder.responseTime().lessThan(1000) // Equivalent to: { source: 'RESPONSE_TIME', comparison: 'LESS_THAN', target: '1000' } ``` * Assert the DNS response code ```ts theme={null} DnsAssertionBuilder.responseCode().equals('NOERROR') // Equivalent to: { source: 'RESPONSE_CODE', comparison: 'EQUALS', target: 'NOERROR' } ``` * Assert against specific JSON fields in the response. ```ts theme={null} DnsAssertionBuilder.jsonAnswer('$.Answer.length').equals(4) // Equivalent to: { source: 'JSON_ANSWER', property: '$.Answer.length', comparison: 'EQUALS', target: '4' } ``` Learn more in our docs on [Assertions](/docs/detect/assertions). ### General Monitor Options Friendly name for your DNS Monitor that will be displayed in the Checkly dashboard and used in notifications. **Usage:** ```ts highlight={2} theme={null} new DnsMonitor("my-monitor", { name: "DNS Resolution Monitor", /* More options ... */ }) ``` How often the DNS Monitor should run. Use the `Frequency` enum to set the check interval. **Usage:** ```ts highlight={2} theme={null} new DnsMonitor("my-monitor", { frequency: Frequency.EVERY_1M, /* More options ... */ }) ``` **Available frequencies**: `EVERY_10S`, `EVERY_20S`, `EVERY_30S`, `EVERY_1M`, `EVERY_2M`, `EVERY_5M`, `EVERY_10M`, `EVERY_15M`, `EVERY_30M`, `EVERY_1H`, `EVERY_2H`, `EVERY_3H`, `EVERY_6H`, `EVERY_12H`, `EVERY_24H` Array of [public location codes](/docs/concepts/locations/#public-locations) where the DNS Monitor should run from. Multiple locations provide geographic coverage and help detect regional DNS issues. **Usage:** ```ts highlight={2} theme={null} new DnsMonitor("global-dns-monitor", { locations: ["us-east-1", "eu-central-1", "ap-southeast-1"] }) ``` Whether the DNS Monitor is enabled and will run according to its schedule. **Usage:** ```ts highlight={2} theme={null} new DnsMonitor("my-monitor", { activated: false // Disabled monitor }) ``` # Dynamic monitor creation Source: https://www.checklyhq.com/docs/constructs/dynamic-monitor-creation Create monitors dynamically with the Checkly CLI by looping over lists of targets in TypeScript or JavaScript, managing checks at scale without duplication. The [Checkly CLI](/docs/cli/overview/) enables you to code your entire monitoring setup taking full advantage of the flexibility of TypeScript/JavaScript. Reusing language constructs that you are already familiar with, you will be able to create a MaC setup that neatly fits your unique use cases and workflows. This page shows a few examples. ## Similar checks from a list of targets Iterating through lists of target URLs is an easy way to manage checks at scale while avoiding code duplication. ```ts __checks__/api.check.ts theme={null} import { ApiCheck, AssertionBuilder } from 'checkly/constructs' const publicResources = ['/public-stats', '/v1/runtimes'] for (const publicResource of publicResources) { new ApiCheck(`public-resource_${publicResource}`, { name: `Public Resource ${publicResource}`, request: { url: `https://api.checkly.com${publicResource}`, method: 'GET', followRedirects: true, skipSSL: false, assertions: [ AssertionBuilder.statusCode().equals(200) ] } }) } ``` Asynchronous operations are supported by exporting an async function from your check files, too. ```ts __checks__/api.check.ts theme={null} import { ApiCheck, AssertionBuilder } from 'checkly/constructs' import { getPublicResources } from './helpers' // an exported async function to signal that // this check file performs asynchronous operations export default async function createApiChecks() { const publicResources = await getPublicResources(); for (const publicResource of publicResources) { new ApiCheck(`public-resource_${publicResource}`, { name: `Public Resource ${publicResource}`, request: { url: `https://api.checkly.com${publicResource}`, method: 'GET', followRedirects: true, skipSSL: false, assertions: [ AssertionBuilder.statusCode().equals(200) ] } }) } } ``` ## Separate groups for prod and pre-prod Iterating through target environments (like `preview` and `production`) linked to [`Group`](/docs/constructs/check-group-v2) resources allows you to reuse existing `Check` definitions. ```ts __checks__/browser.check.ts theme={null} import fs from 'fs' import { BrowserCheck } from 'checkly/constructs' import { groupProd, groupPreview } from './groups.check' // This reads a directory and extracts all file paths containing '.spec.ts' const files = fs.readdirSync('__checks__/') const specFiles = files.filter((filename) => { return filename.includes('.spec.ts') }) // This is the list of environments and their matching group; it can be extended easily const environments = [ { name: 'preview', group: groupPreview }, { name: 'production', group: groupProd }, ] // Here we create a new browser check for each environment x testspec combination // Checks are added to the right groups - the group will set the right env variable for the target URL environments.forEach((environment) => { for (const specFile of specFiles) { new BrowserCheck(`${specFile}${environment.name}`, { name: `${specFile} [${environment.name}]`, tags: [`${environment.name}`], group: environment.group, code: { entrypoint: specFile, }, }) } }) ``` You can handle potential differences between target environments via group-level [environment variables](/docs/platform/variables/), which are made available to all checks within a group. ```ts __checks__/group.check.ts theme={null} import { CheckGroupV2 } from 'checkly/constructs' import { smsChannel, emailChannel } from '../alert-channels' const alertChannels = [smsChannel, emailChannel] export const groupPreview = new CheckGroupV2('group-browser-preview', { name: 'WebShop - Preview', activated: true, muted: false, runtimeId: '2025.04', locations: ['us-east-1', 'eu-west-1'], tags: ['mac', 'preview'], // You can use group-level environment vars to point each group's checks to the right target URL environmentVariables: [ { key: 'TARGET_URL', value: 'https://preview.mywebsite.com' }], apiCheckDefaults: {}, concurrency: 100, alertEscalationPolicy: 'global', alertChannels }) export const groupProd = new CheckGroupV2('group-browser-prod', { name: 'WebShop - Production', activated: true, muted: false, runtimeId: '2025.04', locations: ['us-east-1', 'eu-west-1'], tags: ['mac', 'production'], // You can use group-level environment vars to point each group's checks to the right target URL environmentVariables: [ { key: 'TARGET_URL', value: 'https://www.mywebsite.com' }], apiCheckDefaults: {}, concurrency: 100, alertEscalationPolicy: 'global', alertChannels }) ``` # EmailAlertChannel Construct Source: https://www.checklyhq.com/docs/constructs/email-alert-channel Learn how to configure email alert channels with the Checkly CLI. For general information about alerting, see our docs on [email alerts](/docs/integrations/alerts/email) and [alerting with Checkly](/docs/communicate/alerts/overview/). Use Email Alert Channels to send email notifications when checks fail or recover. ```ts Basic Example theme={null} import { EmailAlertChannel } from "checkly/constructs" const emailChannel = new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", }) ``` ```ts Advanced Example theme={null} import { EmailAlertChannel } from "checkly/constructs" const emailChannel = new EmailAlertChannel("ops-email-channel", { address: "ops-team@acme.com", sendRecovery: true, sendFailure: true, sendDegraded: true, sslExpiry: true, sslExpiryThreshold: 30, }) ``` If you need to reference existing alert channels that were created outside of your CLI project, use [`fromId()`](/docs/constructs/alert-channel#using-fromid-to-reference-an-existing-channel). ## Configuration ### Email Alert Channel Options Email address to send notifications to. To notify multiple recipients from one `EmailAlertChannel`, pass a comma-separated list of email addresses. ### General Alert Channel Options These options are valid for all alert channels types. Whether to send notifications when checks recover from a [failed or degraded state](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [fail](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [become degraded](/docs/communicate/alerts/overview/#alert-channels). Default value is `false`. Whether to send notifications when a SSL/TLS certificate is about to expire. Default value is `false`. ```ts highlight={3} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) Number of days before the SSL/TLS certificate expiry date to send notifications. Only relevant when `sslExpiry` is enabled. Default value is `30`. ```ts highlight={4} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) # GrpcMonitor Construct Source: https://www.checklyhq.com/docs/constructs/grpc-monitor Learn how to configure gRPC monitors with the Checkly CLI. Learn more about gRPC Monitors in [the gRPC monitor overview](/docs/detect/uptime-monitoring/grpc-monitors/overview). Use gRPC Monitors to verify that your gRPC services are reachable, responding correctly, and meeting performance expectations. Monitors run in two modes: * **BEHAVIOR** — Invokes a unary gRPC method and asserts on the response * **HEALTH** — Queries the standard `grpc.health.v1.Health/Check` endpoint Before creating gRPC Monitors, ensure you have: * An initialized Checkly CLI project * The hostname and port of the gRPC service you want to monitor * In BEHAVIOR mode: the fully-qualified method name, and either server reflection enabled on the target or an inline `.proto` file For additional setup information, see [CLI overview](/docs/cli/overview). ```ts HEALTH Mode theme={null} import { Frequency, GrpcAssertionBuilder, GrpcMonitor } from "checkly/constructs" new GrpcMonitor('grpc-health-1', { name: 'My Service Health Check', description: "Checks that **my-service** reports `SERVING` via the gRPC health protocol.", frequency: Frequency.EVERY_1M, request: { url: 'grpc.example.com', port: 50051, grpcConfig: { mode: 'HEALTH', tls: true, service: 'my.package.MyService', }, assertions: [ GrpcAssertionBuilder.healthCheckStatus().equals(1), // 1 = SERVING GrpcAssertionBuilder.responseTime().lessThan(500), ], }, }) ``` ```ts BEHAVIOR Mode theme={null} import { Frequency, GrpcAssertionBuilder, GrpcMonitor } from "checkly/constructs" new GrpcMonitor('grpc-behavior-1', { name: 'User Service GetUser', description: "Invokes `GetUser` on **user-service** and asserts the response.", activated: true, frequency: Frequency.EVERY_5M, locations: ['us-east-1', 'eu-west-1'], maxResponseTime: 3000, degradedResponseTime: 1500, request: { url: 'grpc.example.com', port: 50051, grpcConfig: { mode: 'BEHAVIOR', tls: true, serviceDefinition: 'REFLECTION', method: 'users.UserService/GetUser', message: '{"userId": "health-probe"}', metadata: [{ key: 'authorization', value: 'Bearer {{GRPC_TOKEN}}' }], }, assertions: [ GrpcAssertionBuilder.statusCode().equals(0), GrpcAssertionBuilder.responseTime().lessThan(1000), GrpcAssertionBuilder.responseMessage('$.name').notEmpty(), ], }, }) ``` ## Configuration gRPC monitors have their own gRPC-specific settings, plus the standard monitor options shared across all check types. | Parameter | Type | Required | Default | Description | | ---------------------- | -------- | -------- | ------- | ------------------------------------------------------------------------------------ | | `request` | `object` | ✅ | - | gRPC request configuration object | | `degradedResponseTime` | `number` | ❌ | `10000` | Response time in milliseconds at which the monitor is marked as degraded | | `maxResponseTime` | `number` | ❌ | `20000` | Response time in milliseconds at which the monitor is marked as failed (max 180,000) | | Property | Type | Required | Default | Description | | ----------------------- | ---------------------------------------- | -------- | ----------- | ----------------------------------------------------------------------- | | `name` | `string` | ✅ | - | Friendly name for your monitor | | `description` | `string` | ❌ | `null` | A description of the monitor. Supports markdown. Max 500 characters | | `activated` | `boolean` | ❌ | `true` | Whether the monitor is enabled | | `alertChannels` | `Array` | ❌ | `[]` | Array of AlertChannel objects for notifications | | `alertEscalationPolicy` | `AlertEscalationPolicy` | ❌ | - | Advanced alert escalation settings | | `frequency` | `Frequency` | ❌ | `EVERY_10M` | How often to run your monitor | | `group` | `CheckGroupV1` `CheckGroupV2` | ❌ | - | The CheckGroup this monitor belongs to | | `locations` | `string[]` | ❌ | `[]` | Array of public location codes | | `privateLocations` | `string[]` | ❌ | `[]` | Array of Private Location slugs | | `muted` | `boolean` | ❌ | `false` | Whether alert notifications are muted | | `tags` | `string[]` | ❌ | `[]` | Array of tags to organize monitors | | `testOnly` | `boolean` | ❌ | `false` | Only run with test, not during deploy | | `retryStrategy` | `RetryStrategy` | ❌ | - | Strategy for configuring retries | | `runParallel` | `boolean` | ❌ | `false` | Run monitors in parallel or round-robin | | `triggerIncident` | `IncidentTrigger` | ❌ | - | Create and resolve an incident based on the check's alert configuration | ### `GrpcMonitor` Options gRPC connection and call configuration. **Usage:** ```ts theme={null} new GrpcMonitor('grpc-monitor', { name: 'My gRPC Service', request: { url: 'grpc.example.com', port: 50051, grpcConfig: { mode: 'HEALTH', tls: true, }, assertions: [ GrpcAssertionBuilder.healthCheckStatus().equals(1), // 1 = SERVING ], }, }) ``` **Parameters:** | Parameter | Type | Required | Default | Description | | ------------ | ----------------- | -------- | -------- | ----------------------------------------------------- | | `url` | `string` | ✅ | - | Hostname or IP of the gRPC server. No scheme or port. | | `port` | `number` | ✅ | - | Port the gRPC server listens on (1–65535) | | `grpcConfig` | `object` | ✅ | - | gRPC-specific call configuration (see below) | | `ipFamily` | `string` | ❌ | `'IPv4'` | IP family: `'IPv4'` \| `'IPv6'` | | `skipSSL` | `boolean` | ❌ | `false` | Skip TLS certificate validation when `tls` is enabled | | `timeout` | `number` | ❌ | `60` | Seconds to wait for the gRPC call to complete (1–180) | | `assertions` | `GrpcAssertion[]` | ❌ | `[]` | Response assertions using `GrpcAssertionBuilder` | gRPC-specific call configuration nested inside `request`. **Parameters:** | Parameter | Type | Required | Default | Description | | ------------------- | ------------------------------------- | -------- | -------------- | ------------------------------------------------------------------------------------------- | | `mode` | `string` | ❌ | `'BEHAVIOR'` | Monitoring mode: `'BEHAVIOR'` \| `'HEALTH'` | | `tls` | `boolean` | ❌ | `true` | Use TLS for the connection. Set to `false` for plaintext. | | `metadata` | `Array<{key: string, value: string}>` | ❌ | `[]` | gRPC metadata (request headers) sent with the call | | `method` | `string` | BEHAVIOR | - | Fully-qualified method: `package.Service/Method`. Required in BEHAVIOR mode. | | `serviceDefinition` | `string` | ❌ | `'REFLECTION'` | How to resolve the method schema: `'REFLECTION'` \| `'PROTO_FILE'`. BEHAVIOR mode only. | | `protoContent` | `string` | ❌ | - | Inline `.proto` file content. Required when `serviceDefinition` is `'PROTO_FILE'`. | | `message` | `string` | ❌ | - | JSON-encoded request payload. BEHAVIOR mode only. | | `service` | `string` | ❌ | - | Service name to health-check. HEALTH mode only. Leave empty to query overall server health. | Response time in milliseconds at which the monitor is marked as degraded (warning state). Maximum: 180,000. **Usage:** ```ts highlight={3} theme={null} new GrpcMonitor('grpc-thresholds', { name: 'gRPC Latency Thresholds', degradedResponseTime: 1500, maxResponseTime: 3000, request: { url: 'grpc.example.com', port: 50051, grpcConfig: { mode: 'HEALTH' }, }, }) ``` Response time in milliseconds at which the monitor is marked as failed. Maximum: 180,000. **Usage:** ```ts highlight={3} theme={null} new GrpcMonitor('grpc-thresholds', { name: 'gRPC Latency Thresholds', maxResponseTime: 3000, request: { url: 'grpc.example.com', port: 50051, grpcConfig: { mode: 'HEALTH' }, }, }) ``` ### `GrpcMonitor` Assertions Use `GrpcAssertionBuilder` to define assertions for the `request` of a `GrpcMonitor`. The following sources are available: * `responseTime()`: Assert the total response time (DNS + connect + call) in milliseconds * `statusCode()`: Assert the numeric gRPC status code (`0` = OK, `14` = UNAVAILABLE, etc.) * `healthCheckStatus()`: Assert the health status by its **numeric** value (HEALTH mode). The runner evaluates this as a number — not a string. Enum mapping: `UNKNOWN=0`, `SERVING=1`, `NOT_SERVING=2`, `SERVICE_UNKNOWN=3` * `responseMessage(property?)`: Assert against the JSON response body (BEHAVIOR mode), with an optional JSON path (e.g. `'$.name'`) * `textBody(property?)`: Assert against the raw response body as text * `responseMetadata(property?)`: Assert against response metadata (header) values returned by the server, identified by key Here are some examples: * Assert the call returns gRPC OK (code 0): ```ts theme={null} GrpcAssertionBuilder.statusCode().equals(0) // Equivalent to: { source: 'GRPC_STATUS_CODE', comparison: 'EQUALS', target: '0' } ``` * Assert the health check reports SERVING (numeric target required — the runner does not accept string labels): ```ts theme={null} GrpcAssertionBuilder.healthCheckStatus().equals(1) // UNKNOWN=0, SERVING=1, NOT_SERVING=2, SERVICE_UNKNOWN=3 // Equivalent to: { source: 'GRPC_HEALTHCHECK_STATUS', comparison: 'EQUALS', target: '1' } ``` * Assert a specific field in the JSON response body: ```ts theme={null} GrpcAssertionBuilder.responseMessage('$.userId').notEmpty() // Equivalent to: { source: 'GRPC_RESPONSE', property: '$.userId', comparison: 'NOT_EMPTY', target: '' } ``` * Assert the total response time: ```ts theme={null} GrpcAssertionBuilder.responseTime().lessThan(500) // Equivalent to: { source: 'RESPONSE_TIME', comparison: 'LESS_THAN', target: '500' } ``` * Assert a response metadata header value: ```ts theme={null} GrpcAssertionBuilder.responseMetadata('content-type').contains('grpc') // Equivalent to: { source: 'GRPC_METADATA', property: 'content-type', comparison: 'CONTAINS', target: 'grpc' } ``` Learn more in our docs on [Assertions](/docs/detect/assertions). ### General Monitor Options Friendly name for your gRPC Monitor displayed in the Checkly dashboard and used in notifications. **Usage:** ```ts highlight={2} theme={null} new GrpcMonitor('my-grpc-monitor', { name: 'User Service Health', /* More options ... */ }) ``` How often the gRPC Monitor should run. Use the `Frequency` enum to set the check interval. **Usage:** ```ts highlight={3} theme={null} new GrpcMonitor('my-grpc-monitor', { name: 'User Service Health', frequency: Frequency.EVERY_1M, /* More options ... */ }) ``` **Available frequencies**: `EVERY_10S`, `EVERY_20S`, `EVERY_30S`, `EVERY_1M`, `EVERY_2M`, `EVERY_5M`, `EVERY_10M`, `EVERY_15M`, `EVERY_30M`, `EVERY_1H`, `EVERY_2H`, `EVERY_3H`, `EVERY_6H`, `EVERY_12H`, `EVERY_24H` Array of [public location codes](/docs/concepts/locations/#public-locations) where the gRPC Monitor runs from. Multiple locations provide geographic coverage. **Usage:** ```ts highlight={3} theme={null} new GrpcMonitor('global-grpc-monitor', { name: 'Global gRPC Health', locations: ['us-east-1', 'eu-west-1', 'ap-southeast-1'], /* More options ... */ }) ``` Whether the gRPC Monitor is enabled and will run according to its schedule. **Usage:** ```ts highlight={3} theme={null} new GrpcMonitor('my-grpc-monitor', { name: 'User Service Health', activated: false, /* More options ... */ }) ``` ## Examples ```ts theme={null} import { Frequency, GrpcAssertionBuilder, GrpcMonitor } from "checkly/constructs" new GrpcMonitor('auth-health', { name: 'Auth Service Health', frequency: Frequency.EVERY_1M, locations: ['us-east-1', 'eu-west-1'], request: { url: 'auth.internal.example.com', port: 50051, grpcConfig: { mode: 'HEALTH', tls: true, service: 'auth.AuthService', }, assertions: [ GrpcAssertionBuilder.healthCheckStatus().equals(1), // 1 = SERVING GrpcAssertionBuilder.responseTime().lessThan(500), ], }, }) ``` ```ts theme={null} import { Frequency, GrpcAssertionBuilder, GrpcMonitor } from "checkly/constructs" new GrpcMonitor('order-get-order', { name: 'Order Service GetOrder', frequency: Frequency.EVERY_5M, maxResponseTime: 5000, degradedResponseTime: 2000, request: { url: 'orders.example.com', port: 443, grpcConfig: { mode: 'BEHAVIOR', tls: true, serviceDefinition: 'PROTO_FILE', protoContent: `syntax = "proto3"; package orders; service OrderService { rpc GetOrder (GetOrderRequest) returns (Order); } message GetOrderRequest { string order_id = 1; } message Order { string order_id = 1; string status = 2; }`, method: 'orders.OrderService/GetOrder', message: '{"orderId": "probe-001"}', }, assertions: [ GrpcAssertionBuilder.statusCode().equals(0), GrpcAssertionBuilder.responseMessage('$.status').notEmpty(), ], }, }) ``` ```ts theme={null} import { Frequency, GrpcAssertionBuilder, GrpcMonitor } from "checkly/constructs" new GrpcMonitor('secure-grpc', { name: 'Secure gRPC Service', frequency: Frequency.EVERY_2M, request: { url: 'secure-grpc.example.com', port: 443, grpcConfig: { mode: 'HEALTH', tls: true, metadata: [ { key: 'authorization', value: 'Bearer {{GRPC_API_TOKEN}}' }, { key: 'x-tenant-id', value: '{{TENANT_ID}}' }, ], }, assertions: [ GrpcAssertionBuilder.healthCheckStatus().equals(1), // 1 = SERVING ], }, }) ``` # Heartbeat Monitor Construct Source: https://www.checklyhq.com/docs/constructs/heartbeat-monitor Learn how to configure heartbeat monitors with the Checkly CLI. Learn more about Heartbeat monitors in [the Heartbeat monitor overview](/docs/detect/uptime-monitoring/heartbeat-monitors/overview). Use Heartbeat Monitors to track passive monitoring scenarios where external services ping Checkly at regular intervals. The examples below show how to configure monitoring for different types of scheduled jobs and services. Before creating heartbeat monitors, ensure you have: * An initialized Checkly CLI project * External services, cron jobs, or scripts that can send HTTP POST requests * Understanding of your scheduled job intervals and expected timing * Network access from your services to Checkly's ping endpoints For additional setup information, see [CLI overview](/docs/cli/overview). ```ts Basic Example theme={null} import { HeartbeatMonitor } from "checkly/constructs" new HeartbeatMonitor("daily-backup-heartbeat", { name: "Daily Backup Job", description: "Expects a ping every **24h** from the nightly DB backup cron.", period: 1, periodUnit: "days", grace: 2, graceUnit: "hours", }) ``` ```ts Advanced Example theme={null} import { HeartbeatMonitor, EmailAlertChannel, SlackAppAlertChannel } from "checkly/constructs" const emailChannel = new EmailAlertChannel("team-email", { address: "team@example.com", }) const slackChannel = new SlackAppAlertChannel("team-slack", { slackChannels: ["#ops"] }) new HeartbeatMonitor("newsletter-heartbeat", { name: "Weekly Newsletter Job", description: "Weekly newsletter job completes every 7 days.", activated: true, muted: false, period: 7, periodUnit: "days", grace: 4, graceUnit: "hours", tags: ["newsletter", "marketing", "weekly"], alertChannels: [emailChannel, slackChannel], }) ``` ## Configuration The Heartbeat Monitoring configuration consists of specific heartbeat monitoring options and inherited general monitoring options. | Parameter | Type | Required | Default | Description | | ------------ | -------- | -------- | ------- | -------------------------------------------------------------------- | | `period` | `number` | ✅ | - | The expected period between pings (30 seconds to 365 days) | | `periodUnit` | `string` | ✅ | - | Time unit: `'seconds'` \| `'minutes'` \| `'hours'` \| `'days'` | | `grace` | `number` | ✅ | - | Grace period before alerting (0 seconds to 365 days) | | `graceUnit` | `string` | ✅ | - | Grace time unit: `'seconds'` \| `'minutes'` \| `'hours'` \| `'days'` | | Property | Type | Required | Default | Description | | --------------- | ---------------- | -------- | ------- | ------------------------------------------------------------------- | | `name` | `string` | ✅ | - | Friendly name for your monitor | | `description` | `string` | ❌ | `null` | A description of the monitor. Supports markdown. Max 500 characters | | `activated` | `boolean` | ❌ | `true` | Whether the monitor is enabled | | `muted` | `boolean` | ❌ | `false` | Whether alert notifications are muted | | `alertChannels` | `AlertChannel[]` | ❌ | `[]` | Array of AlertChannel objects for notifications | | `tags` | `string[]` | ❌ | `[]` | Array of tags to organize monitors | ### `HeartbeatMonitor` Options The expected period between pings from your external service. This defines how often your job or service should check in. **Usage:** ```ts highlight={3} theme={null} new HeartbeatMonitor('my-heartbeat', { name: "My heartbeat", period: 1, periodUnit: 'days' // Daily check-in expected /* More options ... */ }) ``` **Examples:** ```ts theme={null} // Daily backup job new HeartbeatMonitor("backup-job", { name: "Daily Database Backup", period: 1, periodUnit: "days", grace: 2, graceUnit: "hours", }) ``` ```ts theme={null} // Hourly data sync new HeartbeatMonitor("data-sync", { name: "Hourly Data Sync", period: 1, periodUnit: "hours", grace: 15, graceUnit: "minutes", }) ``` ```ts theme={null} // Every 5 minutes new HeartbeatMonitor("frequent-task", { name: "Frequent Health Check", period: 5, periodUnit: "minutes", grace: 2, graceUnit: "minutes", }) ``` **Range**: 30 seconds to 365 days The time unit for the period. Defines whether the period is in seconds, minutes, hours, or days. **Usage:** ```ts highlight={4} theme={null} new HeartbeatMonitor("my-heartbeat", { name: "My heartbeat", period: 2, periodUnit: "hours" // Every 2 hours /* More options ... */ }) ``` **Available units**: `'seconds'`, `'minutes'`, `'hours'`, `'days'` The grace period to wait before alerting after the expected ping time has passed. This allows for slight delays in job execution. **Usage:** ```ts highlight={4} theme={null} new HeartbeatMonitor('my-heartbeat', { period: 1, periodUnit: 'hours', grace: 10, graceUnit: 'minutes' // 10 minute grace period }) ``` **Examples:** ```ts theme={null} // Strict timing requirements new HeartbeatMonitor("critical-task", { name: "Critical System Task", period: 5, periodUnit: "minutes", grace: 1, // Only 1 minute grace graceUnit: "minutes", }) ``` ```ts theme={null} // Standard tolerance new HeartbeatMonitor("standard-job", { name: "Standard Processing Job", period: 1, periodUnit: "hours", grace: 15, // 15 minute grace period graceUnit: "minutes", }) ``` ```ts theme={null} // Flexible timing for complex jobs new HeartbeatMonitor("complex-job", { name: "Complex Data Processing", period: 1, periodUnit: "days", grace: 4, // 4 hour grace period graceUnit: "hours", }) ``` **Range**: 0 seconds to 365 days The time unit for the grace period. Defines whether the grace period is in seconds, minutes, hours, or days. **Usage:** ```ts highlight={5} theme={null} new HeartbeatMonitor('my-heartbeat', { period: 6, periodUnit: 'hours', grace: 30, graceUnit: 'minutes' // 30 minute grace period }) ``` **Available units**: `'seconds'`, `'minutes'`, `'hours'`, `'days'` ### General Monitor Options Friendly name for your heartbeat monitor that will be displayed in the Checkly dashboard and used in notifications. **Usage:** ```ts highlight={2} theme={null} new HeartbeatMonitor('my-heartbeat', { name: 'Daily Backup Job Monitor', /* More options ... */ }) ``` ## Examples ```ts theme={null} new HeartbeatMonitor("backup-job-heartbeat", { name: "Daily Database Backup", period: 1, periodUnit: "days", grace: 2, graceUnit: "hours", tags: ["backup", "database", "critical"], }) // Example cron job that would ping this heartbeat: // 0 2 * * * /scripts/backup-database.sh && curl -X POST https://ping.checklyhq.com/[heartbeat-id] ``` ```ts theme={null} new HeartbeatMonitor("sync-job-heartbeat", { name: "Hourly Data Synchronization", period: 1, periodUnit: "hours", grace: 15, graceUnit: "minutes", tags: ["sync", "data", "hourly"], }) // Example Node.js job: // setInterval(async () => { // try { // await syncData() // await fetch('https://ping.checklyhq.com/[heartbeat-id]', { method: 'POST' }) // } catch (error) { // console.error('Sync failed:', error) // } // }, 60 * 60 * 1000) // Every hour ``` ```ts theme={null} new HeartbeatMonitor('deployment-heartbeat', { name: 'Production Deployment Pipeline', period: 2, periodUnit: 'hours', grace: 30, graceUnit: 'minutes', tags: ['deployment', 'ci-cd', 'production'] }) // Example GitHub Actions workflow step: // - name: Ping Checkly on successful deployment // if: success() // run: | // curl -X POST https://ping.checklyhq.com/${{ secrets.HEARTBEAT_ID }} ``` ```ts theme={null} new HeartbeatMonitor('log-processing-heartbeat', { name: 'Log Processing Job', period: 30, periodUnit: 'minutes', grace: 10, graceUnit: 'minutes', tags: ['logs', 'processing', 'monitoring'] }) // Example log processing service: // const processLogs = async () => { // try { // await processLogFiles() // // // Ping heartbeat on successful processing // await fetch(process.env.CHECKLY_HEARTBEAT_URL, { // method: 'POST', // headers: { 'User-Agent': 'LogProcessor/1.0' } // }) // } catch (error) { // console.error('Log processing failed:', error) // } // } // // // Run every 30 minutes // setInterval(processLogs, 30 * 60 * 1000) ``` ```ts theme={null} new HeartbeatMonitor('frequent-task-heartbeat', { name: 'Every Minute Task', period: 60, periodUnit: 'seconds', grace: 30, graceUnit: 'seconds', tags: ['frequent', 'monitoring'] }) // Example for very frequent tasks: // setInterval(async () => { // try { // await performQuickCheck() // await fetch('https://ping.checklyhq.com/[heartbeat-id]', { method: 'POST' }) // } catch (error) { // console.error('Quick check failed:', error) // } // }, 60000) // Every minute ``` ## Getting the heartbeat Ping URL After deploying your heartbeat monitor, you can obtain the ping URL in several ways: ```bash theme={null} npx checkly deploy # Output will include: # Ping URL of heartbeat check "[YOUR_HEARTBEAT_MONITOR_NAME]" is https://ping.checklyhq.com/... ``` Navigate to your heartbeat monitor in the [Checkly web UI](https://app.checklyhq.com/heartbeats) to copy the ping URL. The ping URL is unique for each heartbeat monitor and should be kept secure. Anyone with access to this URL can send pings to your monitor. Heartbeat monitors are passive - they wait for your external services to ping them. Make sure your jobs and services are configured to send HTTP POST requests to the ping URL on successful completion. # IcmpMonitor Construct Source: https://www.checklyhq.com/docs/constructs/icmp-monitor Learn how to configure ICMP monitors with the Checkly CLI. Learn more about ICMP Monitors in [the ICMP monitor overview](/docs/detect/uptime-monitoring/icmp-monitors/overview). ICMP monitors check if a host is reachable by sending ICMP Echo Requests (pings). Use them to monitor network connectivity and latency. Before creating ICMP Monitors, ensure you have: * An initialized Checkly CLI project * A hostname or IP address you want to ping * Basic understanding of network connectivity (ICMP / ping) For additional setup information, see [CLI overview](/docs/cli/overview). ```ts Basic Example theme={null} import { Frequency, IcmpMonitor } from "checkly/constructs" new IcmpMonitor('icmp-welcome', { name: 'Welcome Site Reachability', description: "Pings `welcome.checklyhq.com` to verify **host reachability**.", frequency: Frequency.EVERY_1M, request: { hostname: 'welcome.checklyhq.com', }, degradedPacketLossThreshold: 20, // percentage maxPacketLossThreshold: 30, // percentage }) ``` ```ts Advanced Example theme={null} import { Frequency, IcmpAssertionBuilder, IcmpMonitor } from "checkly/constructs" new IcmpMonitor('cloudflare-dns-icmp', { name: 'Cloudflare DNS ICMP Monitor', description: "Cloudflare DNS reachability and latency check.", activated: true, frequency: Frequency.EVERY_1M, maxPacketLossThreshold: 20, // percentage degradedPacketLossThreshold: 10, request: { hostname: '1.1.1.1', pingCount: 20, assertions: [ IcmpAssertionBuilder.latency('avg').lessThan(100), IcmpAssertionBuilder.latency('max').lessThan(200), ] } }) ``` ## Configuration ICMP monitors have their own ICMP-specific settings, plus the standard monitor options shared across all check types. | Parameter | Type | Required | Default | Description | | ----------------------------- | -------- | -------- | ------- | ----------------------------------------------------------------- | | `request` | `object` | ✅ | - | ICMP request configuration object | | `degradedPacketLossThreshold` | `number` | ❌ | `10` | Packet loss percentage at which the monitor is marked as degraded | | `maxPacketLossThreshold` | `number` | ❌ | `20` | Packet loss percentage at which the monitor is marked as failed | | Property | Type | Required | Default | Description | | ----------------------- | ---------------------------------------- | -------- | ----------- | ----------------------------------------------------------------------- | | `name` | `string` | ✅ | - | Friendly name for your monitor | | `description` | `string` | ❌ | `null` | A description of the monitor. Supports markdown. Max 500 characters | | `activated` | `boolean` | ❌ | `true` | Whether the monitor is enabled | | `alertChannels` | `Array` | ❌ | `[]` | Array of AlertChannel objects for notifications | | `alertEscalationPolicy` | `AlertEscalationPolicy` | ❌ | - | Advanced alert escalation settings | | `frequency` | `Frequency` | ❌ | `EVERY_10M` | How often to run your monitor | | `group` | `CheckGroupV1` `CheckGroupV2` | ❌ | - | The CheckGroup this monitor belongs to | | `locations` | `string[]` | ❌ | `[]` | Array of public location codes | | `privateLocations` | `string[]` | ❌ | `[]` | Array of Private Location slugs | | `muted` | `boolean` | ❌ | `false` | Whether alert notifications are muted | | `tags` | `string[]` | ❌ | `[]` | Array of tags to organize monitors | | `testOnly` | `boolean` | ❌ | `false` | Only run with test, not during deploy | | `retryStrategy` | `RetryStrategy` | ❌ | - | Strategy for configuring retries | | `runParallel` | `boolean` | ❌ | `false` | Run monitors in parallel or round-robin | | `triggerIncident` | `IncidentTrigger` | ❌ | - | Create and resolve an incident based on the check's alert configuration | ### `IcmpMonitor` Options ICMP request configuration, including ping settings and response validation. **Usage:** ```ts theme={null} new IcmpMonitor('icmp-monitor', { name: 'ICMP Latency Monitor', request: { hostname: 'api.checklyhq.com', pingCount: 15, assertions: [ IcmpAssertionBuilder.latency('avg').lessThan(100), ] } }) ``` **Parameters:** | Parameter | Type | Required | Default | Description | | ------------ | ----------------- | -------- | ------- | ----------------------------------------------------------------------------- | | `hostname` | `string` | ✅ | - | The target host (domain name or IP address) | | `pingCount` | `number` | ❌ | `10` | Number of ICMP Echo Request packets to send per check run (1-50, default: 10) | | `assertions` | `IcmpAssertion[]` | ❌ | `[]` | Response assertions using the `IcmpAssertionBuilder` | | `ipFamily` | `string` | ❌ | `IPv4` | IP family selection (IPv4, IPv6) | Packet loss percentage at which the monitor is marked as degraded (warning state). **Usage:** ```ts highlight={3} theme={null} new IcmpMonitor("icmp-performance-tiers", { name: "ICMP Performance Tiers", degradedPacketLossThreshold: 15, // Warn at 15% request: { hostname: '1.1.1.1', pingCount: 20, } }) ``` Packet loss percentage at which the monitor is marked as failed **Usage:** ```ts highlight={3} theme={null} new IcmpMonitor("icmp-performance-tiers", { name: "ICMP Performance Tiers", maxPacketLossThreshold: 25, // Fail at 25% request: { hostname: '1.1.1.1', pingCount: 20, } }) ``` ### `IcmpMonitor` Assertions Assertions for ICMP monitors can be defined using the `IcmpAssertionBuilder`. The following sources are available: * `latency(property)`: Validate round-trip time (RTT) for ICMP pings. The property parameter is required and must be one of: `avg`, `min`, `max`, or `stdDev` * `jsonResponse(property?)`: Assert against the [JSON response structure](/docs/detect/uptime-monitoring/icmp-monitors/configuration#json-response-schemas). This allows you to target specific fields using JSON path assertions Here are some examples: * Assert the average latency is below a threshold ```ts theme={null} IcmpAssertionBuilder.latency('avg').lessThan(100) // Equivalent to: { source: 'LATENCY', property: 'avg', comparison: 'LESS_THAN', target: '100' } ``` * Assert against specific JSON fields in the response ```ts theme={null} IcmpAssertionBuilder.jsonResponse('$.packetsReceived').equals(10) // Equivalent to: { source: 'JSON_RESPONSE', property: '$.packetsReceived', comparison: 'EQUALS', target: '10' } ``` Learn more in our docs on [Assertions](/docs/detect/assertions). ### General Monitor Options Friendly name for your ICMP Monitor that will be displayed in the Checkly dashboard and used in notifications. **Usage:** ```ts highlight={2} theme={null} new IcmpMonitor("my-monitor", { name: "ICMP Ping Monitor", /* More options ... */ }) ``` How often the ICMP Monitor should run. Use the `Frequency` enum to set the check interval. **Usage:** ```ts highlight={3} theme={null} new IcmpMonitor("my-monitor", { name: "ICMP Ping Monitor", frequency: Frequency.EVERY_1M, /* More options ... */ }) ``` **Available frequencies**: `EVERY_10S`, `EVERY_20S`, `EVERY_30S`, `EVERY_1M`, `EVERY_2M`, `EVERY_5M`, `EVERY_10M`, `EVERY_15M`, `EVERY_30M`, `EVERY_1H`, `EVERY_2H`, `EVERY_3H`, `EVERY_6H`, `EVERY_12H`, `EVERY_24H` Array of [public location codes](/docs/concepts/locations/#public-locations) where the ICMP Monitor should run from. Multiple locations provide geographic coverage and help detect regional network issues. **Usage:** ```ts highlight={3} theme={null} new IcmpMonitor("global-icmp-monitor", { name: "ICMP Ping Monitor", locations: ["us-east-1", "eu-central-1", "ap-southeast-1"] }) ``` Whether the ICMP Monitor is enabled and will run according to its schedule. **Usage:** ```ts highlight={3} theme={null} new IcmpMonitor("my-monitor", { name: "ICMP Ping Monitor", activated: false // Disabled monitor }) ``` # IncidentTrigger Configuration Source: https://www.checklyhq.com/docs/constructs/incident-trigger Learn how to configure status page incident automation with the Checkly CLI. **Deprecated.** Incident triggers automate incidents on v2 (services-based) status pages. On v3 pages, use [`StatusPageV3AutomationRule`](/docs/constructs/status-page-v3-automation-rule) instead. Learn more about Status Pages in [the Status Pages overview](/docs/communicate/status-pages/overview). Use incident triggers to automatically create and resolve an incident and notify subscribers based on the alert configuration of a monitor or check. This allows you to link synthetic monitoring failures directly to incidents on your status pages. ```ts Basic Example highlight={12-19,28} theme={null} import { Frequency, IncidentTrigger, PlaywrightCheck, StatusPageService, } from "checkly/constructs"; const searchService = new StatusPageService("search-service", { name: "Search Service", }); const searchIncidentTrigger: IncidentTrigger = { service: searchService, severity: "MINOR", name: "Search is down", description: "Some users experience issues with the product search. We're investigating.", notifySubscribers: true, }; new PlaywrightCheck("playwright-check-suite", { name: "Search Monitoring", playwrightConfigPath: "../playwright.config.ts", activated: true, pwProjects: ["Search Monitoring"], locations: ["us-east-1", "eu-west-1", "ap-southeast-2"], frequency: Frequency.EVERY_10M, triggerIncident: searchIncidentTrigger, }); ``` ## Configuration | Parameter | Type | Required | Default | Description | | ------------------- | ------------------- | -------- | ------- | ---------------------------------------------------------------------------- | | `service` | `StatusPageService` | ✅ | - | The status page service that this incident will be associated with | | `severity` | `IncidentSeverity` | ✅ | - | The severity level of the incident. (`MINOR`, `MEDIUM`, `MAJOR`, `CRITICAL`) | | `name` | `string` | ✅ | - | The name of the incident. | | `description` | `string` | ✅ | - | A detailed description of the incident. | | `notifySubscribers` | `boolean` | ✅ | - | Whether to notify subscribers when the incident is triggered | ## `IncidentTrigger` Options The status page service that this incident will be associated with. When a check or monitor fails, an incident is created for this service and connected status pages. **Usage:** ```ts highlight={6} theme={null} const searchService = new StatusPageService("search-service", { name: "Search Service", }) const incidentTrigger: IncidentTrigger = { service: searchService, /* More options... */ } ``` **Use cases**: Linking monitors to specific services, automatic incident creation, service-based status tracking. The severity level of the incident. Determines how the incident is displayed and prioritized. **Options:** * `MINOR` - Minor impact, most users unaffected * `MEDIUM` - Moderate impact, some users affected * `MAJOR` - Major impact, many users affected * `CRITICAL` - Critical impact, all users affected **Usage:** ```ts highlight={3} theme={null} const incidentTrigger: IncidentTrigger = { service: searchService, severity: "MAJOR", /* More options... */ } ``` **Use cases**: Incident prioritization, user communication, escalation workflows. The name of the incident displayed on the status page. Should clearly communicate the issue to users. **Usage:** ```ts highlight={3} theme={null} const incidentTrigger: IncidentTrigger = { service: searchService, name: "Search is down", /* More options... */ } ``` **Use cases**: User communication, incident identification, status page clarity. A detailed description of the incident. Provides context to users about what's happening and potential impact. **Usage:** ```ts highlight={3-4} theme={null} const incidentTrigger: IncidentTrigger = { service: searchService, description: "Some users experience issues with the product search. We're investigating.", /* More options... */ } ``` **Use cases**: User communication, incident context, expectation setting. Whether to notify status page subscribers when the incident is triggered. When `true`, subscribers receive notifications via their configured channels. **Usage:** ```ts highlight={3} theme={null} const incidentTrigger: IncidentTrigger = { service: searchService, notifySubscribers: true, /* More options... */ } ``` **Use cases**: Proactive user communication, incident awareness, stakeholder updates. # IncidentioAlertChannel Construct Source: https://www.checklyhq.com/docs/constructs/incidentio-alert-channel Learn how to configure Incident.io alert channels with the Checkly CLI. For general information about alerting, see our docs on [the Incident.io integration](/docs/integrations/incident-management/incidentio) and [alerting with Checkly](/docs/communicate/alerts/overview/). Triggers and resolves alerts in Incident.io. ```ts Basic Example theme={null} import { IncidentioAlertChannel } from 'checkly/constructs' const incidentioChannel = new IncidentioAlertChannel('incidentio-channel-1', { name: 'ACME alerts', url: 'https://api.incident.io/v2/alert_events/checkly/xxxxx', apiKey: 'xxxxx45afe73' }) ``` ```ts Advanced Example theme={null} import { IncidentioAlertChannel } from 'checkly/constructs' const incidentioChannel = new IncidentioAlertChannel('incidentio-channel-1', { name: 'ACME alerts', url: 'https://api.incident.io/v2/alert_events/checkly/xxxxx', apiKey: 'xxxxx45afe73', sendRecovery: true, sendFailure: true, sendDegraded: true, sslExpiry: true, sslExpiryThreshold: 30, }) ``` If you need to reference existing alert channels that were created outside of your CLI project, use [`fromId()`](/docs/constructs/alert-channel#using-fromid-to-reference-an-existing-channel). ## Configuration ### Incident.io Alert Channel Options Friendly name to recognise the integration. The target URL created by installing the Checkly integration in Incident.io. The API key created by installing the Checkly integration in Incident.io. The payload sent to the target URL when an alert is triggered. If this is not specified, we'll send a default payload with a basic title, description, etc. We have [handlebar helpers and variables](/docs/integrations/alerts/webhooks/#using-variables) available for building custom payloads. Here's an example payload, using the default one that we provide: ```ts highlight={5-26} theme={null} new IncidentioAlertChannel('incidentio-channel-1', { name: 'ACME alerts', url: 'https://api.incident.io/v2/alert_events/checkly/xxxxx', apiKey: 'xxxxx45afe73', payload: ` { "title": "{{ALERT_TITLE}}", "description": "{{ALERT_TITLE}} at {{STARTED_AT}} in {{RUN_LOCATION}} {{RESPONSE_TIME}}ms\\n\\n{{#if AI_ANALYSIS_CLASSIFICATION}}# AI Analysis\\n\\n{{AI_ANALYSIS_CLASSIFICATION}}\\n\\n{{{AI_ANALYSIS_ROOT_CAUSE}}}\\nRead full analysis: {{AI_ANALYSIS_LINK}}{{/if}}", "deduplication_key": "{{CHECK_ID}}", "metadata": { {{#if AI_ANALYSIS_CLASSIFICATION}} "ai_analysis_classification": "{{AI_ANALYSIS_CLASSIFICATION}}", "ai_analysis_root_cause": "{{{AI_ANALYSIS_ROOT_CAUSE}}}", "ai_analysis_link": "{{AI_ANALYSIS_LINK}}", {{/if}} "alertType": "{{ALERT_TYPE}}", "check_result_id": "{{CHECK_RESULT_ID}}", "resultLink": "{{RESULT_LINK}}" }, {{#contains ALERT_TYPE "RECOVERY"}} "status": "resolved" {{else}} "status": "firing" {{/contains}} } ` }) ``` ### General Alert Channel Options These options are valid for all alert channels types. Whether to send notifications when checks recover from a [failed or degraded state](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [fail](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [become degraded](/docs/communicate/alerts/overview/#alert-channels). Default value is `false`. Whether to send notifications when a SSL/TLS certificate is about to expire. Default value is `false`. ```ts highlight={3} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) Number of days before the SSL/TLS certificate expiry date to send notifications. Only relevant when `sslExpiry` is enabled. Default value is `30`. ```ts highlight={4} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) # Create Checks Automatically from Files Source: https://www.checklyhq.com/docs/constructs/including-checks Learn how to automatically include checks in your project The [Project](/docs/constructs/project) and [CheckGroup](/docs/constructs/check-group-v2) constructs allow you to use file-based routing to discover files and create checks and monitors. This approach enables you to add and remove files from your project, and have the corresponding Checks created or removed automatically when you run `npx checkly deploy`. ## `checks.checkMatch` The `checkMatch` property takes a [glob pattern](https://www.npmjs.com/package/glob) to match files inside your project structure that contain instances of a Check, i.e. `**/__checks__/*.check.ts`. The goal of this property is so you can add files to an existing repo that are automatically detected. This pattern should be very familiar to unit testing: the test runner takes care of finding, building and running all the files. Removing files containing your check and monitoring configuration will lead to deleted monitoring resources once you run `npx checkly deploy`. Here are some best practices: 1. Establish a file name convention for your Check files, e.g. `*.check.ts`. 2. Store any Checkly related Checks inside a `__checks__` folder. This neatly indicates where your Checks are organized. 3. Use multiple `__checks__` folders throughout your code base, near the functionality it should be checking. ```ts checkly.config.ts highlight={4} theme={null} const config = defineConfig({ checks: { // A glob pattern that matches the Checks inside your repo. checkMatch: "**/__checks__/**/*.check.ts", }, }) ``` ## `browserChecks.testMatch` The `testMatch` property is very similar to `checkMatch`. This property allows you to write standard `*.spec.ts` Playwright files with no proprietary Checkly config or code added — this is why it's nested under `browserChecks` as it only applies to Browser Checks. In turn, this allows you to just use `npx playwright test` on the command line to write and debug these Checks. Some caveats: 1. As a `.spec.ts` file does not contain any Checkly specific properties like `frequency` or `tags`, the CLI will add these properties based on the defaults set inside the `browserChecks` config object. 2. A `logicalId` and `name` will be generated based on the file name. 3. If you want to explicitly set the properties for a Browser Check and not use the defaults, you need to add [a `BrowserCheck` construct](/docs/constructs/browser-check) in a separate `.check.ts` file and set file path to the `.spec.ts` file in the `code.entrypoint` property. 4. When you rename a file that was previously deployed, the `logicalId` will change. The effect is that once you deploy again the new `logicalId` will trigger a deletion of the "old" Check and a creation of this "new" Check and you will lose any historical metrics. ```ts checkly.config.ts highlight={7} theme={null} const config = defineConfig({ checks: { checkMatch: "**/__checks__/**/*.check.ts", browserChecks: { // A glob pattern matches any Playwright .spec.ts files // and automagically creates a Browser Check. testMatch: "**/__checks__/**/*.spec.ts", }, }, }) ``` ```ts group.check.ts highlight={6} theme={null} const group = new CheckGroupV2("api-monitoring-group", { name: "Browser Check Monitoring Group", browserChecks: { // A glob pattern matches any Playwright .spec.ts files // and automagically creates a Browser Check for this group. testMatch: "./*.spec.ts", }, }) ``` ## `multiStepChecks.testMatch` The `testMatch` property for Multistep checks work the same as for [Browser checks described above](#browserchecks-testmatch). Some caveats: 1. `browserChecks.testMatch` will have priority to resolve directories. We recommend having a clear definition for each Browser and Multistep check to prevent loading the wrong check type. For example using `browserChecks.testMatch: ['__checks__/**/*.ts']` and `browserChecks.testMatch: ['__checks__/multistep/**/*.ts']` will result in all checks created as Browser checks. ```ts checkly.config.ts highlight={7} theme={null} const config = defineConfig({ checks: { checkMatch: "**/__checks__/**/*.check.ts", // A glob pattern matches any Playwright .spec.ts files // and automagically creates MultiStep Checks. multiStepChecks: { testMatch: "**/__checks__/**/*.spec.ts", }, }, }) ``` ```ts group.check.ts highlight={6} theme={null} const group = new CheckGroupV2("api-multistep-group", { name: "API Multistep Monitoring Group", multiStepChecks: { // A glob pattern matches any Playwright .spec.ts files // and automagically creates MultiStep Checks for this group. testMatch: "./*.multi-step.spec.ts", }, }) ``` Note that the recommended patterns are just conventions. You can set any glob pattern or turn off any globbing by setting `checkMatch: false` and / or `testMatch: false`. # MaintenanceWindow Construct Source: https://www.checklyhq.com/docs/constructs/maintenance-window Learn how to configure maintenance windows with the Checkly CLI. Learn more about Maintenance Windows in [the Maintenance Windows documentation](/docs/communicate/maintenance-windows/overview). Use Maintenance Windows to schedule planned maintenance periods that prevent your checks from running and triggering alerts during expected downtime. ```ts One-Time Maintenance theme={null} import { MaintenanceWindow } from "checkly/constructs" new MaintenanceWindow("server-upgrade", { name: "Server Upgrade Maintenance", tags: ["production", "api"], startsAt: new Date("2025-02-15T02:00:00.000Z"), endsAt: new Date("2025-02-15T06:00:00.000Z"), }) ``` ```ts Recurring Maintenance theme={null} import { MaintenanceWindow } from "checkly/constructs" new MaintenanceWindow("weekly-backup", { name: "Weekly Database Backup", tags: ["database", "backup"], startsAt: new Date("2025-02-01T03:00:00.000Z"), endsAt: new Date("2025-02-01T04:00:00.000Z"), repeatInterval: 1, repeatUnit: "WEEK", repeatEndsAt: new Date("2025-12-31T23:59:59.000Z"), }) ``` ## Configuration | Parameter | Type | Required | Default | Description | | ---------------- | ---------- | -------- | ------- | -------------------------------------------------- | | `name` | `string` | ✅ | - | Name of the maintenance window | | `startsAt` | `Date` | ✅ | - | Start date and time (ISO 8601 timestamp) | | `endsAt` | `Date` | ✅ | - | End date and time (ISO 8601 timestamp) | | `tags` | `string[]` | ✅ | - | Tags that filter which checks are affected | | `repeatInterval` | `number` | ❌ | - | Repeat interval from the first occurrence | | `repeatUnit` | `string` | ❌ | - | Repeat strategy: `'WEEK'` \| `'MONTH'` \| `'YEAR'` | | `repeatEndsAt` | `Date` | ❌ | - | When to stop repeating (ISO 8601 timestamp) | ### `MaintenanceWindow` Options A name for the maintenance window that will be displayed in the Checkly dashboard and used for identification. Usage: ```ts highlight={2} theme={null} new MaintenanceWindow("my-maintenance", { name: "Weekly Database Backup", /* More options... */ }) ``` **Use cases**: Window identification, dashboard display, maintenance tracking. Tags that filter which checks are affected by this maintenance window. Checks with ANY of these tags will be paused during the maintenance period to avoid unnecessary alerts. **Usage:** ```ts highlight={3} theme={null} new MaintenanceWindow("my-maintenance", { name: "API Maintenance", tags: ["api", "backend"], /* More options... */ }) ``` Maintenance windows affect ALL checks that have ANY of the specified tags. Be specific with your tags to avoid affecting unintended checks. **Use cases**: Service targeting, environment isolation, maintenance scope control. Start date and time for the maintenance window in UTC (ISO 8601 timestamp). **Usage:** ```ts highlight={3} theme={null} new MaintenanceWindow("my-maintenance", { name: "Database Maintenance", startsAt: new Date("2025-02-15T02:00:00.000Z"), // 2 AM UTC /* More options... */ }) ``` **Use cases**: Scheduled downtime, emergency maintenance, recurring maintenance timing. End date and time for the maintenance window in UTC (ISO 8601 timestamp). **Usage:** ```ts highlight={4} theme={null} new MaintenanceWindow("my-maintenance", { name: "Database Maintenance", startsAt: new Date("2025-02-15T02:00:00.000Z"), endsAt: new Date("2025-02-15T06:00:00.000Z"), // 4-hour window /* More options... */ }) ``` **Use cases**: Maintenance duration control, downtime limitation, schedule coordination. Repeat interval from the first occurrence. Used with `repeatUnit` to create recurring maintenance windows. **Usage:** ```ts highlight={3} theme={null} new MaintenanceWindow("recurring-maintenance", { name: "Weekly Maintenance", repeatInterval: 1, // Every 1 week repeatUnit: "WEEK", /* More options... */ }) ``` **Use cases**: Regular maintenance scheduling, automated recurring downtime, consistent maintenance intervals. Repeat strategy that defines the time unit for recurring maintenance windows (`DAY` | `WEEK` | `MONTH`). **Usage:** ```ts highlight={4} theme={null} new MaintenanceWindow('recurring-maintenance', { name: "Bi-weekly Maintenance", repeatInterval: 2, repeatUnit: 'WEEK' // Every 2 weeks /* More options... */ }) ``` **Examples:** ```ts Daily Maintenance theme={null} new MaintenanceWindow("daily-updates", { name: "Daily Database Sync", repeatInterval: 1, repeatUnit: "DAY", startsAt: new Date("2025-02-02T01:00:00.000Z"), // Every Sunday endsAt: new Date("2025-02-02T01:30:00.000Z"), tags: ["db-sync"], }) ``` ```ts Weekly Maintenance theme={null} new MaintenanceWindow("weekly-updates", { name: "Weekly System Updates", repeatInterval: 1, repeatUnit: "WEEK", startsAt: new Date("2025-02-02T01:00:00.000Z"), // Every Sunday endsAt: new Date("2025-02-02T02:30:00.000Z"), tags: ["updates"], }) ``` ```ts Monthly Maintenance theme={null} new MaintenanceWindow("monthly-db", { name: "Monthly Database Maintenance", repeatInterval: 1, repeatUnit: "MONTH", startsAt: new Date("2025-02-01T02:00:00.000Z"), // First of each month endsAt: new Date("2025-02-01T05:00:00.000Z"), tags: ["database"], }) ``` **Use cases**: Time-based recurrence patterns, maintenance scheduling consistency, automated repetition. When to stop repeating the maintenance window (ISO 8601 timestamp in UTC). If not specified, the maintenance window will repeat indefinitely. **Usage:** ```ts highlight={5} theme={null} new MaintenanceWindow("limited-recurring", { name: "Limited Time Maintenance", repeatInterval: 1, repeatUnit: "WEEK", repeatEndsAt: new Date("2025-12-31T23:59:59.000Z"), // Stop at end of year /* More options... */ }) ``` **Use cases**: Limited-time maintenance periods, project-based scheduling, planned end dates. ## Examples ```ts theme={null} new MaintenanceWindow("database-maintenance", { name: "Monthly Database Maintenance", tags: ["database", "production"], startsAt: new Date("2025-02-01T02:00:00.000Z"), // First Saturday of month at 2 AM UTC endsAt: new Date("2025-02-01T05:00:00.000Z"), // Ends at 5 AM UTC repeatInterval: 1, repeatUnit: "MONTH", repeatEndsAt: new Date("2025-12-31T23:59:59.000Z"), // Repeat for a year }) ``` ```ts theme={null} new MaintenanceWindow("system-updates", { name: "Weekly System Updates", tags: ["infrastructure", "updates"], startsAt: new Date("2025-02-02T01:00:00.000Z"), // Every Sunday at 1 AM UTC endsAt: new Date("2025-02-02T02:30:00.000Z"), // 1.5 hour window repeatInterval: 1, repeatUnit: "WEEK", repeatEndsAt: new Date("2025-06-01T00:00:00.000Z"), // Repeat until June }) ``` ```ts theme={null} // For immediate one-time maintenance const now = new Date() const inOneHour = new Date(now.getTime() + 60 * 60 * 1000) const inFourHours = new Date(now.getTime() + 4 * 60 * 60 * 1000) new MaintenanceWindow("emergency-fix", { name: "Emergency Security Patch", tags: ["security", "critical"], startsAt: inOneHour, // Start in 1 hour endsAt: inFourHours, // End in 4 hours (no repeat) }) ``` ```ts theme={null} // API service maintenance new MaintenanceWindow("api-maintenance", { name: "API Service Upgrade", tags: ["api", "backend"], startsAt: new Date("2025-02-20T03:00:00.000Z"), endsAt: new Date("2025-02-20T04:00:00.000Z"), }) // Frontend deployment new MaintenanceWindow("frontend-deployment", { name: "Frontend Deployment", tags: ["frontend", "web"], startsAt: new Date("2025-02-20T04:30:00.000Z"), endsAt: new Date("2025-02-20T05:00:00.000Z"), }) // Database migration (longer window) new MaintenanceWindow("database-migration", { name: "Database Schema Migration", tags: ["database", "migration"], startsAt: new Date("2025-02-22T01:00:00.000Z"), endsAt: new Date("2025-02-22T07:00:00.000Z"), // 6-hour window }) ``` ## Best Practices **Tag Matching**: Maintenance windows affect ALL checks that have ANY of the specified tags. Be specific with your tags to avoid affecting unintended checks. **Time Zones**: Always use UTC timestamps for consistency across different time zones. Convert your local maintenance times to UTC. # MSTeamsAlertChannel Construct Source: https://www.checklyhq.com/docs/constructs/msteams-alert-channel Learn how to configure Microsoft Teams alert channels with the Checkly CLI. For general information about alerting, see our docs on [Microsoft Teams alerts](/docs/integrations/alerts/msteams) and [alerting with Checkly](/docs/communicate/alerts/overview/). Sends alert notifications to a Microsoft Teams channel via a Workflow webhook. ```ts Basic Example theme={null} import { MSTeamsAlertChannel } from 'checkly/constructs' const msTeamsAlertChannel = new MSTeamsAlertChannel('msteams-channel-01', { name: 'ACME alerts', url: 'https://prod-24.westus.logic.azure.com:443/workflows/xxxxx', }) ``` ```ts Advanced Example expandable theme={null} import { MSTeamsAlertChannel } from 'checkly/constructs' const msTeamsAlertChannel = new MSTeamsAlertChannel('msteams-channel-01', { name: 'ACME alerts', url: 'https://prod-24.westus.logic.azure.com:443/workflows/xxxxx', sendRecovery: true, sendFailure: true, sendDegraded: true, sslExpiry: true, sslExpiryThreshold: 14, payload: `{ "type":"message", "attachments":[ { "contentType":"application/vnd.microsoft.card.adaptive", "contentUrl":null, "content":{ "$schema":"http://adaptivecards.io/schemas/adaptive-card.json", "type":"AdaptiveCard", "version":"1.2", "body":[ { "type": "Container", "items": [ { "type": "TextBlock", "text": "{{ALERT_TITLE}}", "weight": "Bolder", "size": "Large", "style": "heading" }, {{#if AI_ANALYSIS_CLASSIFICATION}} { "type": "TextBlock", "text": "AI analysis", "weight": "Bolder", "size": "Default", "style": "heading" }, { "type": "ColumnSet", "columns": [ { "type": "Column", "width": "stretch", "items": [ { "type": "TextBlock", "text": "{{AI_ANALYSIS_CLASSIFICATION}}", "weight": "Bolder", "wrap": true }, { "type": "TextBlock", "text": "{{AI_ANALYSIS_ROOT_CAUSE}}", "wrap": true } ] } ] }, { "type": "ActionSet", "actions": [ { "type": "Action.OpenUrl", "title": "Read full analysis", "url": "{{AI_ANALYSIS_LINK}}", "style": "positive", "iconUrl": "icon:Sparkle" } ] }, {{/if}} { "type": "ColumnSet", "columns": [ { "type": "Column", "width": "stretch", "items": [ { "type": "TextBlock", "text": "Response time: {{RESPONSE_TIME}}ms", "wrap": true }, { "type": "TextBlock", "text": "Location: {{RUN_LOCATION}}", "wrap": true }, { "type": "TextBlock", "text": "Timestamp: {{STARTED_AT}}", "wrap": true }, {{#if GROUP_NAME}} { "type": "TextBlock", "text": "Group: {{GROUP_NAME}}", "wrap": true }, {{/if}} { "type": "TextBlock", "text": "Tags: {{#each TAGS}} {{this}} {{#unless @last}},{{/unless}} {{/each}}", "wrap": true } ] } ] } ] } ], "actions":[ { "type":"Action.OpenUrl", "title":"View in Checkly", "url":"{{RESULT_LINK}}", "style": "positive" } ] } } ] }` }) ``` If you need to reference existing alert channels that were created outside of your CLI project, use [`fromId()`](/docs/constructs/alert-channel#using-fromid-to-reference-an-existing-channel). ## Configuration ### Microsoft Teams Alert Channel Options The target URL created by [creating a Workflow in Microsoft Teams](/docs/integrations/alerts/msteams). Friendly name to recognize the integration. Custom payload for the alert message. If this is not specified, we'll send a default payload with basic information about the alert. We have [handlebar helpers and variables](/docs/integrations/alerts/webhooks/#using-variables) available for building custom payloads. Here's an example payload, using the default one that we provide: ```ts highlight={4-120} expandable theme={null} new MSTeamsAlertChannel('msteams-channel-01', { name: 'ACME alerts', url: 'https://prod-24.westus.logic.azure.com:443/workflows/xxxxx', payload: `{ "type":"message", "attachments":[ { "contentType":"application/vnd.microsoft.card.adaptive", "contentUrl":null, "content":{ "$schema":"http://adaptivecards.io/schemas/adaptive-card.json", "type":"AdaptiveCard", "version":"1.2", "body":[ { "type": "Container", "items": [ { "type": "TextBlock", "text": "{{ALERT_TITLE}}", "weight": "Bolder", "size": "Large", "style": "heading" }, {{#if AI_ANALYSIS_CLASSIFICATION}} { "type": "TextBlock", "text": "AI analysis", "weight": "Bolder", "size": "Default", "style": "heading" }, { "type": "ColumnSet", "columns": [ { "type": "Column", "width": "stretch", "items": [ { "type": "TextBlock", "text": "{{AI_ANALYSIS_CLASSIFICATION}}", "weight": "Bolder", "wrap": true }, { "type": "TextBlock", "text": "{{AI_ANALYSIS_ROOT_CAUSE}}", "wrap": true } ] } ] }, { "type": "ActionSet", "actions": [ { "type": "Action.OpenUrl", "title": "Read full analysis", "url": "{{AI_ANALYSIS_LINK}}", "style": "positive", "iconUrl": "icon:Sparkle" } ] }, {{/if}} { "type": "ColumnSet", "columns": [ { "type": "Column", "width": "stretch", "items": [ { "type": "TextBlock", "text": "Response time: {{RESPONSE_TIME}}ms", "wrap": true }, { "type": "TextBlock", "text": "Location: {{RUN_LOCATION}}", "wrap": true }, { "type": "TextBlock", "text": "Timestamp: {{STARTED_AT}}", "wrap": true }, {{#if GROUP_NAME}} { "type": "TextBlock", "text": "Group: {{GROUP_NAME}}", "wrap": true }, {{/if}} { "type": "TextBlock", "text": "Tags: {{#each TAGS}} {{this}} {{#unless @last}},{{/unless}} {{/each}}", "wrap": true } ] } ] } ] } ], "actions":[ { "type":"Action.OpenUrl", "title":"View in Checkly", "url":"{{RESULT_LINK}}", "style": "positive" } ] } } ] }` }) ``` ### General Alert Channel Options These options are valid for all alert channels types. Whether to send notifications when checks recover from a [failed or degraded state](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [fail](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [become degraded](/docs/communicate/alerts/overview/#alert-channels). Default value is `false`. Whether to send notifications when a SSL/TLS certificate is about to expire. Default value is `false`. ```ts highlight={3} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) Number of days before the SSL/TLS certificate expiry date to send notifications. Only relevant when `sslExpiry` is enabled. Default value is `30`. ```ts highlight={4} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) # Multistep Check Construct Source: https://www.checklyhq.com/docs/constructs/multistep-check Learn how to configure multistep checks with the Checkly CLI. Learn more about Multistep Checks in [the Multistep Checks overview](/docs/detect/synthetic-monitoring/multistep-checks/overview). Use Multistep Checks to run complex end-to-end workflows with Playwright that span multiple endpoints. The examples below show how to configure Multistep Checks for different testing scenarios. Before creating Multistep Checks, ensure you have: * An initialized Checkly CLI project * Public endpoints you want to monitor * Runtime `2023.09` or later (Multistep Checks require [newer runtimes](/docs/platform/runtimes/runtime-specification)) For additional setup information, see [CLI overview](/docs/cli/overview). ```ts Basic Example theme={null} import { MultiStepCheck } from "checkly/constructs" import * as path from "path" new MultiStepCheck("multistep-check-1", { name: "Multistep Check #1", description: "Validates user signup and login flow.", locations: ["us-east-1", "eu-west-1"], code: { entrypoint: path.join(__dirname, "multi-step.spec.ts"), }, }) ``` ```ts Advanced Example theme={null} import { MultiStepCheck, Frequency } from "checkly/constructs" import { secret } from "checkly/util" import * as path from "path" new MultiStepCheck("complex-multistep-check", { name: "Complex User Journey", description: "Validates user signup and login flow.", activated: true, runtimeId: "2025.04", frequency: Frequency.EVERY_15M, locations: ["us-east-1", "eu-west-1"], tags: ["e2e", "user-journey", "critical"], environmentVariables: [ { key: "BASE_URL", value: "https://app.example.com" }, { key: "TEST_USER_EMAIL", value: "test@example.com" }, { key: "TEST_USER_PASSWORD", value: secret("TEST_USER_PASSWORD"), secret: true }, ], code: { entrypoint: path.join(__dirname, "user-journey.spec.ts"), }, }) ``` ## Configuration | Parameter | Type | Required | Default | Description | | --------- | -------- | -------- | ------- | ------------------------ | | `code` | `object` | ✅ | - | The Playwright test code | | Property | Type | Required | Default | Description | | ----------------------- | ----------------------- | -------- | ------- | ----------------------------------------------------------------------- | | `name` | `string` | ✅ | - | Friendly name for your check | | `description` | `string` | ❌ | `null` | A description of the check. Supports markdown. Max 500 characters | | `activated` | `boolean` | ❌ | `true` | Whether the check is enabled | | `alertChannels` | `AlertChannel[]` | ❌ | `[]` | Array of AlertChannel objects for notifications | | `alertEscalationPolicy` | `AlertEscalationPolicy` | ❌ | - | Advanced alert settings | | `environmentVariables` | `object[]` | ❌ | `[]` | Check-level environment variables | | `frequency` | `Frequency` | ❌ | - | How often to run your check | | `group` | `CheckGroup` | ❌ | - | The CheckGroup this check belongs to | | `locations` | `string[]` | ❌ | `[]` | Array of public location codes | | `muted` | `boolean` | ❌ | `false` | Whether alert notifications are muted | | `runtimeId` | `string` | ❌ | - | The ID of the runtime to use (2023.09 or later required) | | `privateLocations` | `string[]` | ❌ | `[]` | Array of Private Location slugs | | `retryStrategy` | `RetryStrategy` | ❌ | - | Strategy for configuring retries | | `runParallel` | `boolean` | ❌ | `false` | Run checks in parallel or round-robin | | `tags` | `string[]` | ❌ | `[]` | Array of tags to organize checks | | `testOnly` | `boolean` | ❌ | `false` | Only run with test, not during deploy | | `triggerIncident` | `IncidentTrigger` | ❌ | - | Create and resolve an incident based on the check's alert configuration | ### Multistep Check Options The Playwright test code that defines your Multistep Check monitor. **Usage:** ```ts theme={null} // Using file reference code: { entrypoint: path.join(__dirname, "user-journey.spec.ts") } // Using inline content code: { content: ` import { test, expect } from "@playwright/test" test("complete workflow", async ({ request }) => { // Multistep logic here }) ` } ``` **Parameters:** | Parameter | Type | Required | Description | | ------------ | -------- | -------- | ---------------------------------------------------------------------- | | `entrypoint` | `string` | ❌ | Path to a `.spec.js` or `.spec.ts` file containing the Playwright test | | `content` | `string` | ❌ | Inline JavaScript/TypeScript code as a string | You must provide either `entrypoint` or `content`, but not both. **Examples:** ```ts theme={null} new MultiStepCheck("onboarding-flow", { name: "Complete User Onboarding", runtimeId: "2025.04", code: { entrypoint: path.join(__dirname, "group.spec.ts") } }) // group.spec.ts import { test, expect } from "@playwright/test" const baseUrl = "https://api.checklyhq.com/v1" const headers = { Authorization: `Bearer ${process.env.API_KEY}`, "x-checkly-account": process.env.ACCOUNT_ID, } test("Verify Group API", async ({ request }) => { /** * Create a group */ const group = await test.step("POST /check-groups", async () => { const response = await request.post(`${baseUrl}/check-groups/`, { data: { locations: ["eu-west-1"], name: "createdViaApiCheck", }, headers, }) expect(response).toBeOK() return response.json() }) /** * Get the newly created group */ await test.step("GET /check-groups/{id}", async () => { const response = await request.get(`${baseUrl}/check-groups/${group.id}`, { headers, }) expect(response).toBeOK() const receivedGroup = await response.json() expect(receivedGroup.id).toEqual(group.id) }) /** * Update the new group */ await test.step("PUT /check-groups/{id}", async () => { const response = await request.put(`${baseUrl}/check-groups/${group.id}`, { data: { tags: ["public-api", "added-by-check"], }, headers, }) expect(response).toBeOK() }) /** * Delete the new group */ await test.step("DELETE /check-group/{id}", async () => { const response = await request.delete( `${baseUrl}/check-groups/${group.id}`, { headers }, ) expect(response).toBeOK() }) }) ``` ```ts theme={null} new MultiStepCheck("degraded-example", { name: "Degraded Example", runtimeId: "2025.04", code: { entrypoint: path.join(__dirname, "degraded.spec.ts") }, }) // degraded.spec.ts import { test, expect } from "@playwright/test" import { getAPIResponseTime, markCheckAsDegraded } from "@checkly/playwright-helpers" const baseUrl = "https://api.spacexdata.com/v3" test("SpaceX-API Dragon Capsules & Next Launch", async ({ request }) => { await test.step("get all capsules", async () => { const response = await request.get(`${baseUrl}/dragons`) // Check 200 status code expect(response).toBeOK() // Check degraded status expect.soft(getAPIResponseTime(response), 'GET /dragons too slow').toBeLessThanOrEqual(200) return response.json() }) // Trigger degraded state if check failed due to soft assertion if (test.info().errors.length) { markCheckAsDegraded('Check degraded due to soft assertion failure.') } }) ``` **Use cases**: Complex API journeys, end-to-end API workflows, business process validation. ### General Check Options Friendly name for your multistep check that will be displayed in the Checkly dashboard and used in notifications. **Usage:** ```ts highlight={2} theme={null} new MultiStepCheck("my-multistep", { name: "Complete User Journey Test" }) ``` The Checkly runtime version used to execute the Multistep Check. Runtimes are managed execution environments for Browser and Multistep Checks. They include fixed Checkly-provided dependencies, such as Playwright, browser binaries, and runtime libraries. Multistep checks require runtime `2023.09` or later. Usage: ```ts highlight={3} theme={null} new MultiStepCheck("my-multistep", { name: 'My Multistep Check', runtimeId: "2025.04" // Use latest runtime for best performance /* More options... */ }) ``` Multistep checks require runtime `2023.09` or later. Earlier runtimes do not support multistep functionality. How often the multistep check should run. Use the `Frequency` enum to set the check interval. Usage: ```ts highlight={5} theme={null} import { Frequency } from 'checkly/constructs' new MultiStepCheck("my-multistep", { name: "My Multistep Check", frequency: Frequency.EVERY_15M, /* More options... */ }) ``` **Available frequencies**: `EVERY_1M`, `EVERY_2M`, `EVERY_5M`, `EVERY_10M`, `EVERY_15M`, `EVERY_30M`, `EVERY_1H`, `EVERY_2H`, `EVERY_3H`, `EVERY_6H`, `EVERY_12H`, `EVERY_24H` Array of public location codes where the multistep check should run. Multiple locations provide geographic coverage and user experience insights. Usage: ```ts highlight={3} theme={null} new MultiStepCheck("global-check", { name: "Global Multistep Check", locations: ["us-east-1", "eu-west-1", "ap-southeast-1"] /* More options... */ }) ``` Examples: ```ts theme={null} // Worldwide API testing new MultiStepCheck("global-journey", { name: "Global API Journey", locations: [ "us-east-1", // N. Virginia "us-west-1", // N. California "eu-west-1", // Ireland "ap-southeast-1", // Singapore "ap-northeast-1" // Tokyo ], /* More options... */ }) ``` ```ts theme={null} // European user focus new MultiStepCheck("eu-workflow", { name: "European API Journey", locations: ["eu-west-1", "eu-central-1"], /* More options... */ }) ``` **Use cases**: Global API monitoring, regional API testing, geographic compliance validation. Multistep checks are only supported on runtime `2023.09` or later. Make sure to specify a compatible `runtimeId` in your check configuration. # OpsgenieAlertChannel Construct Source: https://www.checklyhq.com/docs/constructs/opsgenie-alert-channel Learn how to configure Opsgenie alert channels with the Checkly CLI. For general information about alerting, see our docs on [the Opsgenie integration](/docs/integrations/incident-management/opsgenie) and [alerting with Checkly](/docs/communicate/alerts/overview/). Sends an alert notification to your Opsgenie account. ```ts Basic Example theme={null} import { OpsgenieAlertChannel } from 'checkly/constructs' const opsGenieChannel = new OpsgenieAlertChannel('opsgenie-channel-1', { name: 'My Ops Team', region: 'EU', priority: 'P1', apiKey: 'xxxx123abc' }) ``` ```ts Advanced Example theme={null} import { OpsgenieAlertChannel } from 'checkly/constructs' const opsGenieChannel = new OpsgenieAlertChannel('opsgenie-channel-1', { name: 'My Ops Team', region: 'EU', priority: 'P1', apiKey: 'xxxx123abc', sendRecovery: true, sendFailure: true, sendDegraded: true, sslExpiry: true, sslExpiryThreshold: 30, }) ``` If you need to reference existing alert channels that were created outside of your CLI project, use [`fromId()`](/docs/constructs/alert-channel#using-fromid-to-reference-an-existing-channel). ## Configuration ### Opsgenie Alert Channel Options Friendly name to recognise the integration. A string representing the Opsgenie location, either `EU` or `US`. A string representing the severity level, `P1` to `P5`. An API key for your Opsgenie account. ### General Alert Channel Options These options are valid for all alert channels types. Whether to send notifications when checks recover from a [failed or degraded state](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [fail](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [become degraded](/docs/communicate/alerts/overview/#alert-channels). Default value is `false`. Whether to send notifications when a SSL/TLS certificate is about to expire. Default value is `false`. ```ts highlight={3} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) Number of days before the SSL/TLS certificate expiry date to send notifications. Only relevant when `sslExpiry` is enabled. Default value is `30`. ```ts highlight={4} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) # Using Checkly CLI Constructs Source: https://www.checklyhq.com/docs/constructs/overview Build monitoring infrastructure using JavaScript/TypeScript and the Checkly CLI Every resource you create using the [Checkly CLI](/docs/cli/overview/) is represented by a "construct": it's a class you import from `checkly/constructs`, for instance an `ApiCheck` or `EmailAlertChannel`. A construct is the "as-code" representation of the eventual resource created / deleted / updated on the Checkly cloud once you run `npx checkly deploy`. You must install the [Checkly CLI](/docs/cli/overview) before you can use constructs. Constructs are JavaScript/TypeScript classes that represent your all monitoring resources. Import them from `checkly/constructs` to create checks, alert channels, and other resources in code. ```ts api.check.ts theme={null} import { ApiCheck, AssertionBuilder } from 'checkly/constructs' new ApiCheck('api-health-check', { name: 'API Health Check', request: { url: 'https://danube-web.shop/api/books', method: 'GET', assertions: [ AssertionBuilder.statusCode().equals(200), ], }, }) ``` ```js api.check.js theme={null} const { ApiCheck, AssertionBuilder } = require('checkly/constructs') new ApiCheck('api-health-check', { name: 'API Health Check', request: { url: 'https://danube-web.shop/api/books', method: 'GET', assertions: [ AssertionBuilder.statusCode().equals(200), ], }, }) ``` The Checkly CLI supports JavaScript and TypeScript. The documentation focuses on TypeScript, because we recommend using TypeScript for a better developer experience. Test this API check with `npx checkly test` and transform it to production monitoring with `npx checkly deploy`. ## Project Structure * `checkly.config.ts` - Mandatory global project and CLI configuration. We recommend using TypeScript. * `src/__checks__/*` - TS/JS files defining your checks and other resources. * `package.json` - Standard NPM project manifest. Here is an example directory tree of what that would look like: ``` . |-- checkly.config.ts |-- package.json `-- src `-- __checks__ |-- alert-channels.ts |-- api-check.check.ts `-- homepage.spec.ts ``` The `checkly.config.ts` at the root of your project defines a range of defaults for all your checks. ## Project Configuration As your project grows, you will want to override these defaults for specific checks or check groups. The recommended way to tackle this is using a mix of **global** and **local** configuration. ### Global Configuration As mentioned, your global `checkly.config.ts` holds a set of defaults for your project, checks, and some CLI commands. Use `defineConfig` to configure your Checkly project. ```ts checkly.config.ts theme={null} import { defineConfig } from "checkly" import { Frequency } from "checkly/constructs" export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", repoUrl: "https://github.com/you/your-project", checks: { activated: true, muted: false, runtimeId: "2025.04", frequency: Frequency.EVERY_5M, locations: ["us-east-1", "eu-west-1"], tags: ["website", "api"], checkMatch: "**/*.check.ts", browserChecks: { frequency: Frequency.EVERY_10M, testMatch: "browsers/**/*.spec.ts", }, multiStepChecks: { testMatch: "multistep/**/*.spec.ts", }, }, cli: { runLocation: "eu-west-1", }, }) ``` ```js checkly.config.js theme={null} const { defineConfig } = require("checkly") const { Frequency } = require("checkly/constructs") module.exports = defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", repoUrl: "https://github.com/you/your-project", checks: { activated: true, muted: false, runtimeId: "2025.04", frequency: Frequency.EVERY_5M, locations: ["us-east-1", "eu-west-1"], tags: ["website", "api"], checkMatch: "**/*.check.js", browserChecks: { frequency: Frequency.EVERY_10M, testMatch: "browsers/**/*.spec.js", }, multiStepChecks: { testMatch: "multistep/**/*.spec.js", }, }, cli: { runLocation: "eu-west-1", }, }) ``` Find a full reference of all project properties in [the `Project` construct section](/docs/constructs/project). ### Local Configuration Override any of the `checks` global configuration settings at the individual check level. ```ts __checks__/api.check.ts theme={null} import { ApiCheck, AssertionBuilder, Frequency } from 'checkly/constructs' new ApiCheck('books-api', { name: 'Books API', locations: ['ap-south-1'], // overrides the locations property frequency: Frequency.EVERY_30M, // overrides the frequency property request: { method: 'GET', url: 'https://danube-web.shop/api/books', assertions: [AssertionBuilder.statusCode().equals(200)], }, }) ``` ```js __checks__/api.check.js theme={null} const { ApiCheck, AssertionBuilder, Frequency } = require('checkly/constructs') new ApiCheck('books-api', { name: 'Books API', locations: ['ap-south-1'], // overrides the locations property frequency: Frequency.EVERY_30M, // overrides the frequency property request: { method: 'GET', url: 'https://danube-web.shop/api/books', assertions: [AssertionBuilder.statusCode().equals(200)], }, }) ``` Find a full reference of all check properties in [the `ApiCheck` construct](/docs/constructs/api-check) or [`BrowserCheck` construct section](/docs/constructs/browser-check). ## Logical IDs Assigning a `logicalId` is crucial when creating a construct. Remember the following rules when creating and updating constructs: 1. Every construct needs to have a `logicalId`. This is the first argument when instantiating a class, i.e. ```ts theme={null} const check = new ApiCheck('my-logical-id', { name: 'My API check' }) ``` 2. Every `logicalId` needs to be unique within the scope of a `Project`. 3. A `Project` also has a `logicalId`. This needs to be unique within the scope of the Checkly account. 4. A `logicalId` can be any string up to 255 characters in length. 5. There is no hard limit on the amount of `Project`s you can have in your Checkly account. Behind the scenes, we use the `logicalId` to create a graph of your resources so we know what to persist, update and remove from our database. Changing the `logicalId` on an existing resource in your code base will tell the Checkly backend that a resource was removed and a new resource was created. When using the Checkly CLI to manage multiple projects and repositories, each project's `logicalId` should be unique within the Checkly account. The project's `logicalId` is used during the Checkly CLI commands to detect exactly which project is being used. If multiple projects are using the same project `logicalId`, deploying one project will delete the checks that were deployed by another project. The project `logicalId` can be configured in the project's [global configuration](/docs/constructs/project). When changing the logical ID of a project you will keep all resources on your Checkly account, unless you run [`npx checkly destroy`](/docs/cli/checkly-destroy/) to remove the old project. ## Programming with Constructs All resources you can create and manage using the Checkly CLI are derived from "constructs". These constructs are just [TypeScript classes](https://github.com/checkly/checkly-cli/tree/main/packages/cli/src/constructs). You can use standard JS/TS programming to use these constructs to create the monitoring setup of your choice. Loops, variables, if-statements, file imports, extensions etc. [Here are some examples.](/docs/constructs/dynamic-monitor-creation) # PagerdutyAlertChannel Construct Source: https://www.checklyhq.com/docs/constructs/pagerduty-alert-channel Learn how to configure Pagerduty alert channels with the Checkly CLI. For general information about alerting, see our docs on [the Pagerduty integration](/docs/integrations/incident-management/pagerduty) and [alerting with Checkly](/docs/communicate/alerts/overview/). Sends an alert notification to a specific service in your Pagerduty account. ```ts Basic Example theme={null} import { PagerdutyAlertChannel } from 'checkly/constructs' const pagerdutyChannel = new PagerdutyAlertChannel('pagerduty-channel-1', { account: 'ACME', serviceName: 'ACME products', serviceKey: '872b9b58ff4a9n06d0dl9f20487bbqwew' }) ``` ```ts Advanced Example theme={null} import { PagerdutyAlertChannel } from 'checkly/constructs' const pagerdutyChannel = new PagerdutyAlertChannel('pagerduty-channel-1', { account: 'ACME', serviceName: 'ACME products', serviceKey: '872b9b58ff4a9n06d0dl9f20487bbqwew', sendRecovery: true, sendFailure: true, sendDegraded: true, sslExpiry: true, sslExpiryThreshold: 30, }) ``` If you need to reference existing alert channels that were created outside of your CLI project, use [`fromId()`](/docs/constructs/alert-channel#using-fromid-to-reference-an-existing-channel). ## Configuration ### Pagerduty Alert Channel Options The name of your Pagerduty account. The name of your service defined in Pagerduty under which the alerts should be nested. The API key created by installing the Checkly integration in Pagerduty. We advise you to [install the Pagerduty alert channel first from the UI](https://app.checklyhq.com/alerts/settings/channels/new/pagerduty/) to grab the `serviceKey`. ### General Alert Channel Options These options are valid for all alert channels types. Whether to send notifications when checks recover from a [failed or degraded state](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [fail](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [become degraded](/docs/communicate/alerts/overview/#alert-channels). Default value is `false`. Whether to send notifications when a SSL/TLS certificate is about to expire. Default value is `false`. ```ts highlight={3} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) Number of days before the SSL/TLS certificate expiry date to send notifications. Only relevant when `sslExpiry` is enabled. Default value is `30`. ```ts highlight={4} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) # PhoneCallAlertChannel Construct Source: https://www.checklyhq.com/docs/constructs/phone-call-alert-channel Learn how to configure phone call alert channels with the Checkly CLI. For general information about alerting, see our docs on [phone call alerts](/docs/integrations/alerts/phone-calls) and [alerting with Checkly](/docs/communicate/alerts/overview/). Sends phone calls to the specified phone number. ```ts Basic Example theme={null} import { PhoneCallAlertChannel } from 'checkly/constructs' const callChannel = new PhoneCallAlertChannel('call-channel-1', { phoneNumber: '+31061234567890', }) ``` ```ts Advanced Example theme={null} import { PhoneCallAlertChannel } from 'checkly/constructs' const callChannel = new PhoneCallAlertChannel('call-channel-1', { phoneNumber: '+31061234567890', name: 'Ops on-call', sendRecovery: false, sendFailure: true, sendDegraded: false, sslExpiry: true, sslExpiryThreshold: 3, }) ``` If you need to reference existing alert channels that were created outside of your CLI project, use [`fromId()`](/docs/constructs/alert-channel#using-fromid-to-reference-an-existing-channel). ## Configuration ### Phone Call Alert Channel Options Phone number to call. Each `PhoneCallAlertChannel` supports only one phone number. Phone numbers need to be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). We only support phone numbers from certain [countries and regions](/docs/integrations/alerts/phone-calls/#supported-countries-and-regions). ```ts highlight={2} theme={null} new PhoneCallAlertChannel('call-channel-1', { phoneNumber: '+31061234567890', }) ``` Friendly name for the phone call alert channel. ### General Alert Channel Options These options are valid for all alert channels types. Whether to send notifications when checks recover from a [failed or degraded state](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [fail](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [become degraded](/docs/communicate/alerts/overview/#alert-channels). Default value is `false`. Whether to send notifications when a SSL/TLS certificate is about to expire. Default value is `false`. ```ts highlight={3} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) Number of days before the SSL/TLS certificate expiry date to send notifications. Only relevant when `sslExpiry` is enabled. Default value is `30`. ```ts highlight={4} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) # Playwright Check Suite Source: https://www.checklyhq.com/docs/constructs/playwright-check Learn how to configure Playwright check suites with the Checkly CLI. Learn more about Playwright Check Suites in [the Playwright Check Suites overview](/docs/detect/synthetic-monitoring/playwright-checks/overview). Use Playwright Check Suites to reuse your existing Playwright test suite to run it as end-to-end tests and synthetic monitoring. The examples below show how to configure Playwright Check Suites for different testing and monitoring scenarios. Before creating Playwright Check Suites, ensure you have: * An initialized Checkly CLI project * A running Playwright test suite * A public website you want to monitor * Understanding of [Playwright test syntax and structure](/docs/learn/playwright/overview) For additional setup information, see [CLI overview](/docs/cli/overview). ```ts Basic Example theme={null} import { PlaywrightCheck } from "checkly/constructs" new PlaywrightCheck("critical-e2e-monitor", { name: "Critical E2E Monitor", description: "Runs the **critical path** e2e suite against production.", playwrightConfigPath: "./playwright.config.ts", }) ``` ```ts Advanced Example theme={null} import { Engine, PlaywrightCheck } from "checkly/constructs" new PlaywrightCheck("critical-e2e-monitor", { name: "Critical E2E Monitor", description: "Runs the **critical path** e2e suite against production.", include: [".npmrc", "test-files/**"], playwrightConfigPath: "./playwright.config.ts", engine: Engine.node("24"), // Optional: override the auto-detected engine. installCommand: "npm ci", testCommand: "npx playwright test --max-failures=5", pwProjects: ["chromium"], pwTags: ["e2e"], }) ``` ## Configuration The Playwright Check Suite configuration consists of specific Playwright Check Suite options and inherited general monitoring options. | Parameter | Type | Required | Default | Description | | ---------------------- | ------------------- | -------- | ------------------------------ | ----------------------------------------------------------------------- | | `playwrightConfigPath` | `string` | ✅ | - | Path to the Playwright configuration file (playwright.config.js/ts) | | `installCommand` | `string` | ❌ | - | Command to install dependencies before running tests | | `testCommand` | `string` | ❌ | `npx playwright test` | Command to execute Playwright tests | | `pwProjects` | `string` `string[]` | ❌ | - | Specific Playwright projects to run from your configuration | | `pwTags` | `string` `string[]` | ❌ | - | Tags to filter which tests to run using Playwright's grep functionality | | `include` | `string` `string[]` | ❌ | - | File patterns to include when bundling the test project | | `engine` | `Engine` | ❌ | Auto-detected, then Node.js 22 | JavaScript engine and version used to run the Playwright Check Suite | | Property | Type | Required | Default | Description | | ----------------------- | ----------------------- | -------- | ------- | ----------------------------------------------------------------------- | | `name` | `string` | ✅ | - | Friendly name for your check | | `description` | `string` | ❌ | `null` | A description of the check. Supports markdown. Max 500 characters | | `activated` | `boolean` | ❌ | `true` | Whether the check is enabled | | `alertChannels` | `AlertChannel[]` | ❌ | `[]` | Array of AlertChannel objects for notifications | | `alertEscalationPolicy` | `AlertEscalationPolicy` | ❌ | - | Advanced alert settings | | `environmentVariables` | `object[]` | ❌ | `[]` | Check-level environment variables | | `frequency` | `Frequency` | ❌ | - | How often to run your check | | `group` | `CheckGroup` | ❌ | - | The CheckGroup this check belongs to | | `locations` | `string[]` | ❌ | `[]` | Array of public location codes | | `muted` | `boolean` | ❌ | `false` | Whether alert notifications are muted | | `privateLocations` | `string[]` | ❌ | `[]` | Array of Private Location slugs | | `runParallel` | `boolean` | ❌ | `false` | Run checks in parallel or round-robin | | `tags` | `string[]` | ❌ | `[]` | Array of tags to organize checks | | `testOnly` | `boolean` | ❌ | `false` | Only run with test, not during deploy | | `triggerIncident` | `IncidentTrigger` | ❌ | - | Create and resolve an incident based on the check's alert configuration | ### Playwright Check Suite Options The path to the Playwright configuration file (`playwright.config.js/ts`) which defines test settings, browser configurations, and project structure. **Usage:** ```ts highlight={3} theme={null} new PlaywrightCheck("critical-e2e-monitor", { name: "Critical E2E Monitor", playwrightConfigPath: "../playwright.config.ts", }) ``` The command to install dependencies before running tests. This configuration is useful for ensuring test dependencies are available in the runtime environment. Checkly defaults to using npm, but automatically detects other package managers if lock files are present. **Usage:** ```ts highlight={4} theme={null} new PlaywrightCheck("critical-e2e-monitor", { name: "Critical E2E Monitor", playwrightConfigPath: "../playwright.config.ts", installCommand: "npm ci", }) ``` The command to execute Playwright tests when running `npx checkly test` or running your Playwright Check Suite as monitor. **Usage:** ```ts highlight={4} theme={null} new PlaywrightCheck("critical-e2e-monitor", { name: "Critical E2E Monitor", playwrightConfigPath: "../playwright.config.ts", testCommand: "npx playwright test --grep@checkly --config=playwright.foo.config.ts", }) ``` If you configure the `testCommand` property and `pwTags` or `pwProjects` the options will be merged and all configurations applied to `npx playwright test`. Checkly applies these Playwright defaults when you do not set them yourself: `workers: 4`, `retries: 2`, `use.video: "on-first-retry"`, and `use.screenshot: "on-first-retry"`. Checkly also records traces on every run, uses the Checkly reporter, and appends a Checkly user-agent suffix. Checkly supports Playwright's `globalTimeout`; the timer starts when `npx playwright test` begins. The defined projects to run from your Playwright configuration. **Usage:** ```ts Single project highlight={4} theme={null} new PlaywrightCheck("critical-e2e-monitor", { name: "Critical E2E Monitor", playwrightConfigPath: "../playwright.config.ts", pwProjects: "chromium", }) ``` ```ts Multiple projects highlight={4} theme={null} new PlaywrightCheck("critical-e2e-monitor", { name: "Critical E2E Monitor", playwrightConfigPath: "../playwright.config.ts", pwProjects: ["chromium", "firefox"], }) ``` [Playwright Test Projects](https://playwright.dev/docs/test-projects) let you run different test files in different browsers and with different settings. They're the recommended way to group and bundle test functionality. The tags to filter which tests to run using Playwright's grep functionality. Tests matching any of these tags will be executed. **Usage:** ```ts Single project highlight={4} theme={null} new PlaywrightCheck("critical-e2e-monitor", { name: "Critical E2E Monitor", playwrightConfigPath: "../playwright.config.ts", pwTags: "@smoke", }) ``` ```ts Multiple projects highlight={4} theme={null} new PlaywrightCheck("critical-e2e-monitor", { name: "Critical E2E Monitor", playwrightConfigPath: "../playwright.config.ts", pwTags: ["@smoke", "@critical"], }) ``` Learn more about test tags and annotations in [the Playwright annotation docs](https://playwright.dev/docs/test-annotations#annotate-tests). Defines the glob patterns for files and directories that should be included when bundling the Playwright Check Suite. Use this option to manually include additional test files, helper utilities, or other resources that might be outside of the tests directory that your playwright config file points to. **Usage:** ```ts highlight={4} theme={null} new PlaywrightCheck("critical-e2e-monitor", { name: "Critical E2E Monitor", playwrightConfigPath: "../playwright.config.ts", include: [".npmrc", "test-files/**"], }) ``` The Playwright Check Suite bundling process uses a breadth-first search algorithm starting from the entrypoint to recursively find all local file dependencies. It parses `import`/`require` statements and follows the dependency graph to include all necessary files. Use `include` to bundle files that are not directly imported/required. The JavaScript engine and version used to run the Playwright Check Suite. Use the `Engine` helpers to select Node.js or Bun explicitly. **Usage:** ```ts Node.js highlight={1,5} theme={null} import { Engine, PlaywrightCheck } from "checkly/constructs" new PlaywrightCheck("critical-e2e-monitor", { name: "Critical E2E Monitor", playwrightConfigPath: "../playwright.config.ts", engine: Engine.node("24"), }) ``` ```ts Bun highlight={1,5} theme={null} import { Engine, PlaywrightCheck } from "checkly/constructs" new PlaywrightCheck("critical-e2e-monitor", { name: "Critical E2E Monitor", playwrightConfigPath: "../playwright.config.ts", engine: Engine.bun("1.3"), }) ``` If you omit `engine`, the Checkly CLI tries to detect it from project version files. It checks `.node-version`, `.nvmrc`, `.tool-versions` (`nodejs` or `bun`), `.bun-version`, the [Volta](https://volta.sh) pin in `package.json` (`volta.node`), and `package.json` `engines.node` or `engines.bun`, in that order. The files are read from the project root: the workspace root when your Checkly config is part of a pnpm, npm, or Yarn workspace, otherwise the directory of the nearest `package.json`. When both Node.js and Bun candidates are found, Node.js takes precedence. `.nvmrc` aliases such as `lts`, `lts/*`, `node`, `stable`, and `latest` are skipped. The Volta pin is the one source that is also looked up below the project root. Like Volta itself, the CLI starts from the package that contains your Checkly config, walks up to the project root, and uses the nearest `package.json` that has a `volta` key, following `volta.extends` when that manifest delegates to another file. Volta does not manage Bun, so only `volta.node` is considered. For `package.json` engine ranges (and Volta pins that use a range), the CLI uses the minimum version from the semver range. For example, `>=22` resolves to Node.js `22`, and `>=1.3` resolves to Bun `1.3`. Detected and explicit versions are checked against Checkly's engine rules: | Engine | Supported versions | Resolution behavior | | ------- | ------------------ | -------------------------------------------------------------------------------------------------------------- | | Node.js | `22`, `24`, `26` | Older, EOL, non-LTS, or future major versions are remapped to the nearest supported LTS version with a warning | | Bun | `1.3` | Older or future `1.x` versions are remapped to `1.3` with a warning; `2.x` and newer are rejected | If no engine is set and the CLI cannot auto-detect one, Checkly uses the default Node.js 22 engine. ### General Check Options Friendly name for your Playwright Check Suite that will be displayed in the Checkly dashboard and used in notifications. **Usage:** ```ts highlight={2} theme={null} new PlaywrightCheck("critical-e2e-monitor", { name: "Critical E2E Monitor", playwrightConfigPath: "../playwright.config.ts", }) ``` How often the Playwright Check Suite should run. Use the `Frequency` enum to set the check interval. **Usage:** ```ts highlight={4} theme={null} new PlaywrightCheck("my-pwt-check-suite", { name: "My Playwright Check Suite", playwrightConfigPath: "../playwright.config.ts", frequency: Frequency.EVERY_5M, }) ``` **Examples:** ```ts High Frequency theme={null} // For critical user journeys new PlaywrightCheck("my-pwt-check-suite", { name: "My Playwright Check Suite", playwrightConfigPath: "../playwright.config.ts", frequency: Frequency.EVERY_2M, pwTags: ["@critical"], }) ``` ```ts Standard Frequency theme={null} // For regular monitoring new PlaywrightCheck("my-pwt-check-suite", { name: "My Playwright Check Suite", playwrightConfigPath: "../playwright.config.ts", frequency: Frequency.EVERY_2M, pwTags: ["@monitoring"], }) ``` **Available frequencies**: `EVERY_1M`, `EVERY_2M`, `EVERY_5M`, `EVERY_10M`, `EVERY_15M`, `EVERY_30M`, `EVERY_1H`, `EVERY_2H`, `EVERY_6H`, `EVERY_12H`, `EVERY_24H` Array of public location codes where the Playwright Check Suite should run. Multiple locations provide geographic coverage and redundancy. **Usage:** ```ts highlight={4} theme={null} new PlaywrightCheck("my-pwt-check-suite", { name: "My Playwright Check Suite", playwrightConfigPath: "../playwright.config.ts", locations: ["us-east-1", "eu-west-1", "ap-southeast-1"], }) ``` **Examples:** ```ts Global Coverage theme={null} // Comprehensive global monitoring new PlaywrightCheck("global-pwt-check-suite", { name: "Global Playwright Check Suite", playwrightConfigPath: "../playwright.config.ts", locations: [ "us-east-1", // N. Virginia "us-west-1", // N. California "eu-west-1", // Ireland "ap-southeast-1", // Singapore "ap-northeast-1", // Tokyo ], }) ``` ```ts Regional Focus theme={null} // Focus on specific regions new PlaywrightCheck("europe-pwt-check-suite", { name: "Europe Playwright Check Suite", playwrightConfigPath: "../playwright.config.ts", locations: ["eu-west-1", "eu-central-1"], }) ``` **Use cases**: Global user experience monitoring, regional performance testing, compliance requirements. Whether the Playwright Check Suite is enabled and will run according to its schedule. **Usage:** ```ts highlight={4} theme={null} new PlaywrightCheck("disabled-pwt-check-suite", { name: "Disabled Playwright Check Suite", playwrightConfigPath: "../playwright.config.ts", activated: false, }) ``` Array of Checkly tags to organize and categorize your Playwright Check Suite in the Checkly infrastructure. **Usage:** ```ts highlight={4} theme={null} new PlaywrightCheck("my-check-suite", { name: "My Playwright Check Suite", playwrightConfigPath: "../playwright.config.ts", tags: ["pwt", "critical"], }) ``` **Examples:** ```ts Priority Tags theme={null} new PlaywrightCheck("my-check-suite", { name: "My Playwright Check Suite", playwrightConfigPath: "../playwright.config.ts", tags: ["critical", "revenue", "high-priority"], }) ``` ```ts Environment Tags theme={null} new PlaywrightCheck("staging-check-suite", { name: "Staging Playwright Check Suite", playwrightConfigPath: "../playwright.config.ts", tags: ["staging"], /* More options... */ }) new PlaywrightCheck("prod-check-suite", { name: "Production Playwright Check Suite", playwrightConfigPath: "../playwright.config.ts", tags: ["production"], /* More options... */ }) ``` **Use cases**: Organization, filtering, alerting rules, reporting. Check-level environment variables that will be available during test execution. Useful for test configuration and sensitive data. **Usage:** ```ts highlight={6-9} theme={null} import { secret } from "checkly/util" new PlaywrightCheck("user-flow-pwt-check-suite", { name: "User Flow Playwright Check Suite", playwrightConfigPath: "../playwright.config.ts", environmentVariables: [ { key: "TEST_USERNAME", value: "testuser@example.com" }, { key: "TEST_PASSWORD", value: secret("TEST_PASSWORD"), secret: true }, ], }) ``` **Parameters:** | Parameter | Type | Required | Description | | --------- | --------- | -------- | ------------------------------------------------ | | `key` | `string` | ✅ | Environment variable name | | `value` | `string` | ✅ | Environment variable value | | `secret` | `boolean` | ❌ | Whether the value should be encrypted and hidden | **Examples:** ```ts Test Credentials theme={null} import { secret } from "checkly/util" new PlaywrightCheck("user-flow-pwt-check-suite", { name: "User Flow Playwright Check Suite", playwrightConfigPath: "../playwright.config.ts", environmentVariables: [ { key: "TEST_USERNAME", value: "testuser@example.com" }, { key: "TEST_PASSWORD", value: secret("TEST_PASSWORD"), secret: true }, ], }) ``` ```ts Environment settings theme={null} new PlaywrightCheck("feature-test", { name: "Feature Flag Test", playwrightConfigPath: "../playwright.config.ts", environmentVariables: [ { key: "BASE_URL", value: "https://example.com", }, ], }) ``` **Use cases**: Test configuration, authentication, API keys, feature flags, environment-specific settings. ## Examples ```ts Multi-browser Support theme={null} const playwrightChecks = new PlaywrightCheck("multi-browser-check", { name: "Multi-browser check suite", playwrightConfigPath: "./playwright.config.ts", // Playwright Check Suites support all browsers // defined in your `playwight.config` pwProjects: ["chromium", "firefox", "webkit"], }) ``` ```ts Project-dependency Support theme={null} // Often, it makes sense to define different Playwright projects // in your `playwright.config` and make them depend on each other // to perform setup tasks: // // projects: [ // { // name: "setup", // use: { ...devices["Desktop Chrome"] }, // testMatch: /.*\.setup\.ts/, // }, // { // name: "e2e", // use: { ...devices["Desktop Chrome"] }, // dependencies: ["setup"], // testMatch: /.*\.spec\.ts/, // }, // ] // Playwright Check Suites support, detect and run your // Playwright project dependencies. // // Learn more in the Playwright docs: const playwrightChecks = new PlaywrightCheck("multi-browser-check", { name: "Multi-browser check suite", playwrightConfigPath: "./playwright.config.ts", // https://playwright.dev/docs/test-projects#dependencies pwProjects: ["e2e"], // this will run `setup` and then `e2e` }) ``` # PrivateLocation Construct Source: https://www.checklyhq.com/docs/constructs/private-location Learn how to configure private locations with the Checkly CLI. Learn more about Private Locations in [the Private Locations overview](/docs/platform/private-locations/overview). Use Private Locations to run checks from your own infrastructure, VPCs, or isolated networks. With a Private Location, you can monitor internal services and applications not accessible from the public internet. Before creating private locations, ensure you have: * An initialized Checkly CLI project * Access to the infrastructure where you'll deploy the private location agent * Network connectivity from your infrastructure to Checkly's API endpoints * Understanding of your internal network topology and security requirements * Administrative privileges to deploy and run the private location agent For additional setup information, see [CLI overview](/docs/cli/overview). ```ts Basic Example theme={null} import { PrivateLocation } from "checkly/constructs" const myPrivateLocation = new PrivateLocation("private-location-1", { name: "My Private Location", icon: "server", slugName: "my-private-location" }) ``` ```ts Check using a private location theme={null} import { ApiCheck, PrivateLocation } from "checkly/constructs" const datacenterLocation = new PrivateLocation("datacenter-east-1", { name: "East Coast Datacenter", icon: "building", slugName: "datacenter-east-1", proxyUrl: "http://proxy.datacenter.local:8080", }) // Use the private location in a check new ApiCheck("internal-api-check", { name: "Internal API Check", privateLocations: [datacenterLocation], request: { method: "GET", url: "https://internal-api.company.local/health", }, }) ``` ## Configuration | Parameter | Type | Required | Default | Description | | ---------- | -------- | -------- | ------- | ------------------------------------------------------------------------------------ | | `name` | `string` | ✅ | - | Friendly name for your private location | | `slugName` | `string` | ✅ | - | Unique slug identifier (must be unique across your account) | | `icon` | `string` | ❌ | - | [Octicon name](https://primer.style/octicons/) to distinguish the location in the UI | | `proxyUrl` | `string` | ❌ | - | Proxy URL for outgoing HTTP calls from this location | ## Private Location Options Friendly name for your private location that will be displayed in the Checkly dashboard and used for identification. **Usage:** ```ts theme={null} new PrivateLocation("my-location", { name: "Corporate Data Center", slugName: "corporate-data-center" }) ``` Unique slug identifier for your private location. This must be unique across your entire Checkly account and is used for referencing the location. **Usage:** ```ts theme={null} new PrivateLocation("my-location", { name: "My Location", slugName: "my-unique-location-slug", }) ``` **Examples:** ```ts theme={null} // Descriptive and stable slugs new PrivateLocation("corp-vpc-east", { name: "Corporate VPC East", slugName: "corporate-vpc-east-1", }) new PrivateLocation("k8s-prod", { name: "Production Kubernetes", slugName: "k8s-production-cluster" }) new PrivateLocation("datacenter-west", { name: "West Coast Datacenter", slugName: "datacenter-west-coast" }) ``` ```ts theme={null} // Too generic or likely to change new PrivateLocation("location-1", { name: "Location 1", slugName: "location-1" // Too generic }) new PrivateLocation("temp-loc", { name: "Temporary Location", slugName: "temp-location-2024" // Date-based, will become outdated }) ``` The `slugName` must be unique across your entire Checkly account and cannot be changed after creation. Choose descriptive, stable names. Octicon name to visually distinguish the location in the Checkly UI. Choose icons that represent your infrastructure type or purpose. Usage: ```ts theme={null} new PrivateLocation("my-location", { name: "Database Zone", icon: "database", slugName: "database-zone" }) ``` **Available icons**: Any [Octicon](https://primer.style/design/foundations/icons) name (e.g., `server`, `database`, `cloud`, `shield`, `container`, `tools`, `building`) Proxy URL for outgoing HTTP calls from this private location. Use when your infrastructure requires all external traffic to go through a corporate proxy. Usage: ```ts theme={null} new PrivateLocation('corporate-location', { name: 'Corporate Network', slugName: 'corporate-network', proxyUrl: 'http://proxy.company.local:8080' }) ``` ## Referencing Existing Locations Reference private locations by using their construct reference or by slug names if they were created outside your CLI project: ```ts theme={null} const privateLocationVpcEast = new PrivateLocation("corp-vpc-east", { name: "Corporate VPC East", slugName: "corporate-vpc-east-1", }) new ApiCheck("existing-location-reference", { name: "Check Using Existing Reference", privateLocations: [privateLocationVpcEast], // Construct reference request: { method: "GET", url: "https://internal.company.local/health" } }) ``` ```ts theme={null} new ApiCheck("existing-location-check", { name: "Check Using Existing Location", privateLocations: ["existing-datacenter-slug"], // String reference request: { method: "GET", url: "https://internal.company.local/health" } }) ``` ```ts theme={null} // Combine new and existing private locations const newLocation = new PrivateLocation("new-location", { name: "New Private Location", slugName: "new-location" }) new ApiCheck("mixed-locations-check", { name: "Check with Mixed Locations", privateLocations: [ newLocation, // Construct reference "existing-location-slug" // Existing location by slug ], request: { method: "GET", url: "https://internal.company.local/health" } }) ``` All checks and monitors that support the `privateLocations` option can run in your private location **Examples:** ```ts theme={null} new PrivateLocation("corp-proxy-location", { name: "Corporate Network with Proxy", slugName: "corporate-with-proxy", proxyUrl: "http://proxy.company.local:8080" }) ``` ```ts theme={null} new PrivateLocation("secure-proxy-location", { name: "Secure Corporate Proxy", slugName: "secure-corporate-proxy", proxyUrl: "https://secure-proxy.company.local:8443" }) ``` ```ts theme={null} new PrivateLocation("auth-proxy-location", { name: "Authenticated Proxy Location", slugName: "authenticated-proxy", proxyUrl: "http://user:password@proxy.company.local:8080" }) ``` When `proxyUrl` is configured, all HTTP calls from API checks running in this private location will route through the specified proxy server. **Use cases**: Corporate network compliance, security requirements, traffic routing control. ## Examples ```ts theme={null} import { PrivateLocation, ApiCheck } from "checkly/constructs" const corporateVpc = new PrivateLocation("corporate-vpc", { name: "Corporate VPC", icon: "shield", slugName: "corporate-vpc" }) // Monitor internal services new ApiCheck("intranet-check", { name: "Corporate Intranet", privateLocations: [corporateVpc], request: { method: "GET", url: "https://intranet.company.local" } }) new ApiCheck("ldap-health-check", { name: "LDAP Service Health", privateLocations: [corporateVpc], request: { method: "GET", url: "https://ldap-health.company.local/status" } }) ``` ```ts theme={null} const eastDatacenter = new PrivateLocation("dc-east", { name: "East Coast Datacenter", icon: "server", slugName: "datacenter-east" }) const westDatacenter = new PrivateLocation("dc-west", { name: "West Coast Datacenter", icon: "server", slugName: "datacenter-west" }) const centralDatabase = new PrivateLocation("central-db", { name: "Central Database Location", icon: "database", slugName: "central-database" }) // Monitor cross-datacenter connectivity new ApiCheck("east-west-connectivity", { name: "East-West Datacenter Connectivity", privateLocations: [eastDatacenter, westDatacenter], request: { method: "GET", url: "https://connectivity-test.internal/ping" } }) // Database health check from central location new ApiCheck("database-health", { name: "Database Health Check", privateLocations: [centralDatabase], request: { method: "GET", url: "https://db-health.internal:5432/health" } }) ``` ```ts theme={null} const devEnvironment = new PrivateLocation("dev-env", { name: "Development Environment", icon: "tools", slugName: "development-environment" }) const stagingEnvironment = new PrivateLocation("staging-env", { name: "Staging Environment", icon: "staging", slugName: "staging-environment" }) // Development API monitoring new ApiCheck("dev-api-check", { name: "Development API", privateLocations: [devEnvironment], request: { method: "GET", url: "https://dev-api.company.local/health" } }) // Staging environment checks new ApiCheck("staging-integration-check", { name: "Staging Integration Test", privateLocations: [stagingEnvironment], request: { method: "POST", url: "https://staging-api.company.local/integration-test", body: JSON.stringify({ test: true }) } }) ``` ```ts theme={null} const corporateLocation = new PrivateLocation("corporate-with-proxy", { name: "Corporate Network with Proxy", icon: "shield-lock", slugName: "corporate-with-proxy", proxyUrl: "http://proxy.company.local:8080" }) // All API Check HTTP calls from this location will go through the proxy new ApiCheck("proxied-external-check", { name: "External API via Corporate Proxy", privateLocations: [corporateLocation], request: { method: "GET", url: "https://api.external-service.com/health" } }) ``` # Project Construct Source: https://www.checklyhq.com/docs/constructs/project Learn how to configure projects with the Checkly CLI. Use the `defineConfig` to define core settings for your entire Checkly CLI project. This is typically configured in your `checkly.config.ts` file and provides global defaults for all CLI-powered checks and monitors. ```ts Basic Example theme={null} import { defineConfig } from 'checkly' import { Frequency } from 'checkly/constructs' export default defineConfig({ projectName: 'Website Monitoring', logicalId: 'website-monitoring-1', repoUrl: 'https://github.com/acme/website', checks: { activated: true, muted: false, runtimeId: '2025.04', frequency: Frequency.EVERY_5M, locations: ['us-east-1', 'eu-west-1'], tags: ['website', 'api'] } }) ``` ```ts Advanced Example theme={null} import { defineConfig } from "checkly" import { Frequency } from "checkly/constructs" export default defineConfig({ projectName: "Production Monitoring Suite", logicalId: "prod-monitoring-2025", repoUrl: "https://github.com/acme/monitoring", checks: { activated: true, muted: false, runtimeId: "2025.04", frequency: Frequency.EVERY_10M, locations: ["us-east-1", "eu-west-1", "ap-southeast-1"], tags: ["production", "critical"], checkMatch: "**/__checks__/*.check.ts", ignoreDirectoriesMatch: ["node_modules/**", "dist/**"], playwrightConfig: { use: { baseURL: "https://app.example.com", }, }, browserChecks: { frequency: Frequency.EVERY_30M, testMatch: "**/__tests__/*.spec.ts", }, }, cli: { runLocation: "eu-west-1", privateRunLocation: "private-dc1", retries: 2, }, }) ``` ## Configuration | Parameter | Type | Required | Default | Description | | ------------- | -------- | -------- | ------- | ----------------------------------------------------- | | `projectName` | `string` | ✅ | - | Friendly name for your project | | `logicalId` | `string` | ✅ | - | Unique identifier for this project (should be stable) | | `repoUrl` | `string` | ❌ | - | Optional URL to a Git repository | | `checks` | `object` | ❌ | - | Top-level defaults for all checks in this project | | `cli` | `object` | ❌ | - | Defaults for CLI commands | ### Core Project Options Friendly name for your project that will be displayed in the Checkly dashboard and used for identification. **Usage:** ```ts highlight={2} theme={null} export default defineConfig({ projectName: 'Website Monitoring', /* More options... */ }) ``` **Use cases**: Dashboard identification, project organization, team coordination. Unique identifier for this project that should remain stable across deployments. Changing this will cause Checkly to treat it as a new project. **Usage:** ```ts highlight={2} theme={null} export default defineConfig({ logicalId: 'website-monitoring-prod', /* More options... */ }) ``` The `logicalId` should remain stable across deployments. Changing it will cause Checkly to treat it as a new project, losing historical data and configurations. **Use cases**: Project identification, deployment tracking, configuration persistence. Optional URL to a Git repository for documentation and team collaboration purposes in Checkly UI. **Usage:** ```ts highlight={2} theme={null} export default defineConfig({ repoUrl: 'https://github.com/acme/website', /* More options... */ }) ``` **Use cases**: Documentation linking, team collaboration, source code reference. Defaults for CLI commands like `checkly test` and `checkly trigger`. **Usage:** ```ts highlight={4-7} theme={null} export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", cli: { runLocation: "us-east-1", retries: 2, }, }) ``` **Properties:** | Parameter | Type | Required | Default | Description | | -------------------- | -------- | -------- | ------- | --------------------------------------------------------- | | `runLocation` | `string` | ❌ | - | Default location for `checkly test` and `checkly trigger` | | `privateRunLocation` | `string` | ❌ | - | Default private location for CLI commands | | `retries` | `number` | ❌ | `0` | Default retry count for failing checks (max 3) | **Use cases**: Local testing defaults, CI/CD configuration, development workflow. ### Check and Monitor Configuration The `checks` property allows you to set global defaults for all checks and monitors in your project. Individual checks and groups can override these settings. Top-level defaults for all checks in this project. Individual checks and groups can override these settings. **Usage:** ```ts highlight={5-13} theme={null} export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", repoUrl: "https://github.com/acme/website", checks: { activated: true, muted: false, runtimeId: "2025.04", frequency: Frequency.EVERY_5M, locations: ["us-east-1", "eu-west-1"], tags: ["website", "api"], /* More options... */ }, }) ``` **Properties:** | Parameter | Type | Required | Default | Description | | ------------------------ | ---------------------------------------- | -------- | ------- | ----------------------------------------------------------------------------- | | `activated` | `boolean` | ❌ | `true` | Whether checks are enabled by default | | `alertChannels` | `Array` | ❌ | `[]` | Default alert channels for all checks | | `checkMatch` | `string` | ❌ | - | Glob pattern to find check construct files | | `environmentVariables` | `EnvironmentVariable[]` | ❌ | `[]` | Default environment variables for all checks | | `frequency` | `Frequency` | ❌ | - | Default frequency for all checks | | `ignoreDirectoriesMatch` | `string[]` | - | - | Glob patterns for directories to ignore | | `locations` | `string[]` | ❌ | `[]` | Default public locations for all checks | | `muted` | `boolean` | ❌ | `false` | Whether alert notifications are muted by default | | `playwrightConfig` | `object` | ❌ | - | Subset of Playwright configuration options | | `playwrightConfigPath` | `string` | ❌ | - | Path to the Playwright configuration file | | `privateLocations` | `string[]` | ❌ | `[]` | Default private locations for all checks | | `retryStrategy` | `object` | ❌ | - | Control the retry behavior for failed checks | | `runtimeId` | `string` | ❌ | - | Default runtime ID for all checks | | `shouldFail` | `boolean` | ❌ | `false` | Whether the behavior of when a check/alert is considered to fail is inverted. | | `tags` | `string[]` | ❌ | `[]` | Default tags applied to all checks | | `browserChecks` | `object` | ❌ | - | Default settings for browser checks | | `multiStepChecks` | `object` | ❌ | - | Default settings for multi-step checks | | `playwrightChecks` | `object` | ❌ | - | Default settings for Playwright Check Suites | ### General Settings for All Check and Monitor Types Define global defaults for all checks and monitors in this project. Individual checks and groups can override these settings. Whether the checks and monitors are enabled and will run according to its schedule. **Usage:** ```ts highlight={5} theme={null} export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", checks: { activated: true, }, }) ``` Default alert channels for all checks and monitors. **Usage:** ```ts highlight={9} theme={null} const smsAlertChannel = new SmsAlertChannel("sms-alert-channel", { phoneNumber: "+1234567890", }) export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", checks: { alertChannels: [smsAlertChannel], }, }) ``` Glob pattern where the CLI looks for files containing Check constructs, i.e. all `.check.ts` files. **Usage:** ```ts highlight={5} theme={null} export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", checks: { checkMatch: ["**/*.check.ts"], }, }) ``` We recommend to establish a clear file convention like `*.check.ts` to easily identify files containing Checkly constructs. Environment variables available to the check script and monitors. **Usage:** ```ts highlight={5-10} theme={null} export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", checks: { environmentVariables: [ { key: "BASE_URL", value: "https://example.com", }, ], }, }) ``` Default frequency at which the checks and monitors are executed. **Usage:** ```ts highlight={5} theme={null} export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", checks: { frequency: Frequency.EVERY_5M, }, }) ``` **Available frequencies**: `EVERY_1M`, `EVERY_2M`, `EVERY_5M`, `EVERY_10M`, `EVERY_15M`, `EVERY_30M`, `EVERY_1H`, `EVERY_2H`, `EVERY_3H`, `EVERY_6H`, `EVERY_12H`, `EVERY_24H` Use [`UrlMonitor`](/docs/constructs/url-monitor) or [`TcpMonitor`](/docs/constructs/tcp-monitor) construct for high-frequency checks running up to every ten seconds. Directories to ignore when looking for check files. **Usage:** ```ts highlight={6} theme={null} export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", checks: { checkMatch: ["**/**/*.check.ts"], ignoreDirectoriesMatch: ["api/**"], }, }) ``` Array of public location codes where the URL monitor should run from. Multiple locations provide geographic coverage. ```ts highlight={5} theme={null} export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", checks: { locations: ["us-east-1", "eu-west-1"], }, }) ``` Find a list of [all public locations in the general documentation](/docs/concepts/locations). Determine if any notifications will be sent out when a check fails and/or recovers. Muting checks is useful for temporarily silencing alerts during maintenance. **Usage:** ```ts highlight={5} theme={null} export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", checks: { muted: true, }, }) ``` Global configuration options for the Playwright Test Runner use in [Browser Checks](/docs/detect/synthetic-monitoring/browser-checks/overview) and [MultiStep Checks](/docs/detect/synthetic-monitoring/multistep-checks/overview). This allows you to configure your Playwright-powered checks in a single place, instead of having to repeat the same configuration for each test file. **Usage:** ```ts highlight={5-16} theme={null} export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", checks: { playwrightConfig: { timeout: 1234, use: { baseURL: 'https://www.checklyhq.com', isMobile: true, }, expect: { toHaveScreenshot: { maxDiffPixels: 10, } } }, }, }) ``` Learn more about the supported Playwright configuration options in [the Browser Check Playwright documentation](/docs/detect/synthetic-monitoring/browser-checks/playwright-support). Browser Checks don't support the `projects`, `globalSetup`, `globalTeardown` and `storageState` options. Check [Playwright Check Suites](/docs/detect/synthetic-monitoring/playwright-checks/overview) for full Playwright support. Playwright config path to be used during [Playwright Check Suite](/docs/detect/synthetic-monitoring/playwright-checks/overview) bundling and config parsing. **Usage:** ```ts highlight={5} theme={null} export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", checks: { playwrightConfigPath: "./playwright.config.ts", }, }) ``` Private Locations to run your monitors and checks from. **Usage:** ```ts highlight={12} theme={null} const datacenterLocation = new PrivateLocation("datacenter-east-1", { name: "East Coast Datacenter", icon: "building", slugName: "datacenter-east-1", proxyUrl: "http://proxy.datacenter.local:8080", }) export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", checks: { privateLocations: [datacenterLocation], }, }) ``` Learn more about [Private Locations in the general documentation](/docs/platform/private-locations/overview). Set a retry policy for your checks and monitors. [Use `RetryStrategyBuilder`](/docs/constructs/retry-strategy) to create a retry policy. **Usage:** ```ts highlight={5} theme={null} export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", checks: { retryStrategy: RetryStrategyBuilder.linearStrategy({ baseBackoffSeconds: 30, maxRetries: 4, sameRegion: false, }), }, }) ``` Learn more about [alerting and retries in the general documentation](/docs/communicate/alerts/retries). The runtime version used to execute checks and monitors. **Usage:** ```ts highlight={5} theme={null} export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", checks: { runtimeId: '2025.04', }, }) ``` Learn more about [Checkly runtimes in the general documentation](/docs/platform/runtimes/overview). The tags assigned to the checks and monitors. **Usage:** ```ts highlight={5} theme={null} export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", checks: { tags: ["website", "frontend"], }, }) ``` ### Default Settings for Complex Check Types If your project doesn't require specific configuration and you want to quickly transform your Playwright end-to-end tests into Browser Checks, use the `browserChecks.testMatch` property. **Properties:** | Parameter | Type | Required | Default | Description | | | ----------- | -------- | ---------- | ------- | ----------- | -------------------------------------------------------- | | `testMatch` | `string` | `string[]` | ❌ | - | Glob pattern for Playwright tests uses as Browser Checks | **Example:** ```ts highlight={6} theme={null} export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", checks: { browserChecks: { testMatch: ["**/*.spec.ts"], }, }, }) ``` The `checks.browserChecks` property gives your monitoring setup a head start by turning your existing end-to-end tests into monitors. For more advanced use cases and individual configuration use [the `BrowserCheck` construct](/docs/constructs/browser-check). If your project doesn't require specific configuration and you want to quickly transform your Playwright API tests into Multistep Checks, use the `multiStepChecks.testMatch` property. **Properties:** | Parameter | Type | Required | Default | Description | | | ----------- | -------- | ---------- | ------- | ----------- | -------------------------------------------------------- | | `testMatch` | `string` | `string[]` | ❌ | - | Glob pattern for Playwright tests uses as Browser Checks | **Example:** ```ts highlight={6} theme={null} export default defineConfig({ projectName: "API Monitoring", logicalId: "api-monitoring-1", checks: { multiStepChecks: { testMatch: ["**/*.spec.ts"], }, }, }) ``` The `checks.multiStepChecks` property gives your monitoring setup a head start by turning your existing API tests into monitors. For more advanced use cases and individual configuration use [the `MultistepCheck` construct](/docs/constructs/multistep-check). **Usage:** ```ts highlight={5-14} theme={null} export default defineConfig({ projectName: "Website Monitoring", logicalId: "website-monitoring-1", checks: { playwrightChecks: [ { name: "critical-tagged", logicalId: "critical-tagged", pwTags: "critical", pwProjects: "chromium", frequency: Frequency.EVERY_1M, locations: ["us-east-1", "eu-west-1"], }, ], }, }) ``` **Parameters:** | Parameter | Type | Required | Default | Description | | ---------------------- | ---------------------- | -------- | ------- | ---------------------------------------------------------- | | `playwrightConfigPath` | `string` | ✅ | - | Path to the Playwright configuration file | | `installCommand` | `string` | ❌ | - | Command to install dependencies before running tests | | `testCommand` | `string` | ❌ | - | Command to execute Playwright tests | | `pwProjects` | `string` \| `string[]` | ❌ | - | Projects to run from your configuration | | `pwTags` | `string` \| `string[]` | ❌ | - | Tags to filter tests using Playwright's grep functionality | | `include` | `string` \| `string[]` | ❌ | - | File patterns to include when bundling the test project | | `groupName` | `string` | ❌ | - | Name of the check group to assign this check to | | Property | Type | Required | Default | Description | | ----------------------- | ----------------------- | -------- | ------- | ----------------------------------------------- | | `name` | `string` | ✅ | - | Friendly name for your check | | `logicalId` | `string` | ✅ | - | Unique identifier for your check suite | | `activated` | `boolean` | ❌ | `true` | Whether the check suite is enabled | | `alertChannels` | `AlertChannel[]` | ❌ | `[]` | Array of AlertChannel objects for notifications | | `alertEscalationPolicy` | `AlertEscalationPolicy` | ❌ | - | Advanced alert settings | | `environmentVariables` | `object[]` | ❌ | `[]` | Check-level environment variables | | `frequency` | `Frequency` | ❌ | - | How often to run your check suite | | `locations` | `string[]` | ❌ | `[]` | Array of public location codes | | `muted` | `boolean` | ❌ | `false` | Whether alert notifications are muted | | `privateLocations` | `string[]` | ❌ | `[]` | Array of Private Location slugs | | `retryStrategy` | `RetryStrategy` | ❌ | - | Strategy for configuring retries | | `runParallel` | `boolean` | ❌ | `false` | Run check suites in parallel or round-robin | | `tags` | `string[]` | ❌ | `[]` | Array of tags to organize check suites | The `checks.playwrightChecks` property gives your monitoring setup a head start by turning your existing Playwright test suite into synthetic monitoring. For more advanced use cases and individual configuration use [the `PlaywrightCheck` construct](/docs/constructs/playwright-check). ## Examples ```ts theme={null} export default defineConfig({ projectName: "Acme Website", logicalId: "acme-website-prod", repoUrl: "https://github.com/acme/website", checks: { activated: true, frequency: Frequency.EVERY_5M, locations: ["us-east-1", "eu-west-1"], tags: ["website"], checkMatch: "monitoring/**/*.check.ts", }, }) ``` ```ts theme={null} import { defineConfig } from 'checkly' import { Frequency } from 'checkly/constructs' export default defineConfig({ projectName: "E-commerce Platform Monitoring", logicalId: "ecommerce-platform-2025", repoUrl: "https://github.com/acme/ecommerce", checks: { activated: true, muted: false, runtimeId: "2025.04", frequency: Frequency.EVERY_10M, locations: ["us-east-1", "eu-west-1"], tags: ["ecommerce", "critical"], checkMatch: "**/*.check.ts", ignoreDirectoriesMatch: ["dist/**", "coverage/**"], playwrightConfig: { use: { baseURL: "https://shop.acme.com", }, }, browserChecks: { frequency: Frequency.EVERY_30M, testMatch: "e2e/**/*.spec.ts", }, }, cli: { runLocation: "us-east-1", retries: 2, }, }) ``` ```ts theme={null} import { defineConfig } from 'checkly' import { Frequency } from 'checkly/constructs' export default defineConfig({ projectName: "API Monitoring Suite", logicalId: "api-monitoring-v2", repoUrl: "https://github.com/acme/api-monitoring", checks: { activated: true, muted: false, runtimeId: "2025.04", frequency: Frequency.EVERY_2M, locations: ["us-east-1", "eu-west-1", "ap-southeast-1"], tags: ["api", "microservices"], checkMatch: "checks/**/*.api.check.ts", ignoreDirectoriesMatch: ["tests/**", "docs/**"], }, cli: { runLocation: "us-east-1", retries: 3, }, }) ``` # RetryStrategyBuilder Construct Source: https://www.checklyhq.com/docs/constructs/retry-strategy Learn how to configure retry strategies with the Checkly CLI. Learn more about retry strategies in [the Alert Retries overview](/docs/communicate/alerts/retries). Use retry strategies to configure automatic retries for failed check runs. This helps reduce false positives and ensures that temporary network issues don't trigger unnecessary alerts. Before configuring retry strategies, ensure you have: * An initialized Checkly CLI project * Understanding of your service's reliability characteristics and expected failure patterns * Knowledge of appropriate retry intervals for your specific use case * Awareness of how retries affect alert timing and incident response workflows For additional setup information, see [CLI overview](/docs/cli/overview). ```ts Linear Strategy highlight={5-9} theme={null} import { ApiCheck, RetryStrategyBuilder } from "checkly/constructs" new ApiCheck("retrying-check", { name: "Check With Linear Retries", retryStrategy: RetryStrategyBuilder.linearStrategy({ baseBackoffSeconds: 30, maxRetries: 4, sameRegion: false, }), request: { method: "GET", url: "https://api.example.com/health", }, }) ``` ```ts Exponential Strategy highlight={5-9} theme={null} import { ApiCheck, RetryStrategyBuilder } from "checkly/constructs" new ApiCheck("exponential-retry-check", { name: "Check With Exponential Backoff", retryStrategy: RetryStrategyBuilder.exponentialStrategy({ baseBackoffSeconds: 5, maxRetries: 3, maxDurationSeconds: 300, sameRegion: true, }), request: { method: "GET", url: "https://api.example.com/unstable-endpoint", }, }) ``` ## Configuration ### Retry Strategy Methods Use the `RetryStrategyBuilder` methods to apply different retry strategies to your checks and monitors. | Method | Description | Use Case | | ------------------------------ | -------------------------------------------------------- | ------------------------------------------ | | `noRetries()` | No retries are performed | Checks that should fail fast | | `singleRetry(options)` | Single retry attempt with configurable delay | Simple retry for transient failures | | `fixedStrategy(options)` | Fixed time between retries (e.g., 5s, 5s, 5s) | Predictable retry intervals | | `linearStrategy(options)` | Linearly increasing intervals (e.g., 5s, 10s, 15s) | Gradual backoff | | `exponentialStrategy(options)` | Exponentially increasing intervals (e.g., 5s, 25s, 125s) | Aggressive backoff for overloaded services | Disables all retries for a check. When a check fails, it immediately triggers an alert without attempting any retries. **Usage:** ```ts highlight={4} theme={null} // Critical endpoint that should alert immediately new ApiCheck("critical-endpoint", { name: "Critical Payment API", retryStrategy: RetryStrategyBuilder.noRetries(), request: { method: "GET", url: "https://api.example.com/payments/health", }, }) ``` **Use cases**: Critical services requiring immediate alerting, security endpoints, fail-fast scenarios. Performs exactly one retry after a failure. **Usage:** ```ts highlight={4-6} theme={null} new ApiCheck("single-retry-check", { name: "Single Retry Check", retryStrategy: RetryStrategyBuilder.singleRetry({ baseBackoffSeconds: 60, }), /* More options... */ }) ``` **Use cases**: Simple retry for transient failures. Retries with fixed intervals between attempts. Each retry waits the same amount of time as specified by `baseBackoffSeconds`. Time between retries with five seconds `baseBackoffSeconds` and three retries: `5s`, `5s`, `5s`. **Usage:** ```ts highlight={4-8} theme={null} // Stable API with predictable retry pattern new ApiCheck("stable-api", { name: "Stable API Endpoint", retryStrategy: RetryStrategyBuilder.fixedStrategy({ baseBackoffSeconds: 30, // Wait 30s between retries maxRetries: 2, sameRegion: true, }), /* More options... */ }) // Retry pattern: 30s, 30s (total: ~60s) ``` ```ts highlight={4-8} theme={null} // Database connectivity with consistent intervals new ApiCheck("database-health", { name: "Database Health Check", retryStrategy: RetryStrategyBuilder.fixedStrategy({ baseBackoffSeconds: 45, maxRetries: 3, sameRegion: true, }), /* More options... */ }) // Retry pattern: 45s, 45s, 45s (total: ~135s) ``` **Use cases**: Stable services, predictable retry timing, simple backoff requirements. Retries with linearly increasing intervals. Each subsequent retry waits longer: `baseBackoffSeconds × retry_number`. Time between retries with five seconds `baseBackoffSeconds` and three retries: `5s`, `10s`, `15s`. **Usage:** ```ts highlight={4-8} theme={null} // API with gradual backoff strategy new ApiCheck("gradual-backoff", { name: "API with Gradual Backoff", retryStrategy: RetryStrategyBuilder.linearStrategy({ baseBackoffSeconds: 15, // First retry after 15s maxRetries: 3, sameRegion: false, // Try different regions }), /* More options... */ }) // Retry pattern: 15s, 30s, 45s (total: ~90s) ``` ```ts highlight={4-8} theme={null} // Service that might need time to recover new ApiCheck("recovering-service", { name: "Recovering Service Check", retryStrategy: RetryStrategyBuilder.linearStrategy({ baseBackoffSeconds: 30, maxRetries: 4, maxDurationSeconds: 300, // Cap at 5 minutes }), /* More options... */ }) // Retry pattern: 30s, 60s, 90s, 120s (total: ~300s) ``` **Use cases**: Services that need time to recover, moderate backoff requirements, regional issue detection. Retries with exponentially increasing intervals. Each retry waits exponentially longer: `baseBackoffSeconds^retry_number`. Time between retries with five seconds `baseBackoffSeconds` and three retries: `5s`, `25s`, `125s`. **Usage:** ```ts highlight={4-9} theme={null} // Service that might be overloaded new ApiCheck("overloaded-api", { name: "Potentially Overloaded API", retryStrategy: RetryStrategyBuilder.exponentialStrategy({ baseBackoffSeconds: 5, // First retry after 5s maxRetries: 3, maxDurationSeconds: 300, // Stop after 5 minutes total sameRegion: true, }), /* More options... */ }) // Retry pattern: 5s, 25s, 125s ``` ```ts highlight={4-9} theme={null} // API with rate limiting new ApiCheck("rate-limited-api", { name: "Rate Limited Service", retryStrategy: RetryStrategyBuilder.exponentialStrategy({ baseBackoffSeconds: 4, maxRetries: 4, maxDurationSeconds: 600, sameRegion: false, }), /* More options... */ }) // Retry pattern: 4s, 16s, 64s, 256s (total: ~340s) ``` **Use cases**: Overloaded services, rate-limited APIs, aggressive backoff scenarios, circuit breaker patterns. ### Retry Strategy Options Time to wait before the first retry attempt. Also used as the base value for calculating subsequent retry intervals in linear and exponential strategies. **Usage:** ```ts highlight={3,8,13} theme={null} // Quick retries for fast services RetryStrategyBuilder.fixedStrategy({ baseBackoffSeconds: 30, // Fixed: 30s, 30s, 30s }) // Slower retries for heavy operations RetryStrategyBuilder.linearStrategy({ baseBackoffSeconds: 10, // Linear: 10s, 20s, 30s }) // Very quick retries for lightweight checks RetryStrategyBuilder.exponentialStrategy({ baseBackoffSeconds: 5, // Exponential: 5s, 25s, 125s }) ``` Maximum number of retry attempts after the initial failure. The total number of check attempts will be maxRetries + 1. **Usage:** ```ts highlight={2} theme={null} RetryStrategyBuilder.linearStrategy({ maxRetries: 3, // 3 retry attempts after initial failure }) ``` **Range**: 1-10 retries Maximum total time to spend on all retry attempts. If the calculated retry schedule would exceed this duration, retries stop early. The maximum value is 600 seconds (10 minutes). **Usage:** ```ts highlight={2} theme={null} RetryStrategyBuilder.exponentialStrategy({ maxDurationSeconds: 300, // Stop retrying after 5 minutes total }) ``` Whether retry attempts should run from the same region as the original failed check, or from different regions to help identify regional issues. **Usage:** ```ts highlight={2} theme={null} RetryStrategyBuilder.linearStrategy({ sameRegion: false, // Try different regions for retries }) ``` When `sameRegion: false`, retries are attempted from different regions to help distinguish between regional networking issues and actual service problems. **Use cases**: Regional issue detection, network diversity, consistency testing. Apply the retry strategy only when the failure cause matches the specified condition. **Usage:** ```ts highlight={3} theme={null} RetryStrategyBuilder.fixedStrategy({ maxRetries: 3, onlyOn: 'NETWORK_ERROR', // Only retry network failures }) ``` Currently supports `'NETWORK_ERROR'` for `ApiCheck` and `UrlMonitor` constructs only. Learn more in [network retries](https://www.checklyhq.com/docs/communicate/alerts/retries/#network-retries). ## Examples ```ts theme={null} import { ApiCheck, RetryStrategyBuilder } from "checkly/constructs" new ApiCheck("fail-fast-check", { name: "Fail Fast Check", retryStrategy: RetryStrategyBuilder.noRetries(), request: { method: "GET", url: "https://api.example.com/critical-endpoint", }, }) ``` ```ts theme={null} import { ApiCheck, RetryStrategyBuilder } from "checkly/constructs" const fixedRetryStrategy = RetryStrategyBuilder.fixedStrategy({ baseBackoffSeconds: 30, // Wait 30s between each retry maxRetries: 3, sameRegion: true }) new ApiCheck('fixed-retry-check', { name: 'Fixed Interval Retries', retryStrategy: fixedRetryStrategy, request: { method: 'GET', url: 'https://api.example.com/sometimes-slow' } }) // Retry pattern: 30s, 30s, 30s (total: ~90s) ``` ```ts theme={null} import { ApiCheck, RetryStrategyBuilder } from "checkly/constructs" const linearRetryStrategy = RetryStrategyBuilder.linearStrategy({ baseBackoffSeconds: 20, // First retry after 20s maxRetries: 4, sameRegion: false, // Try different regions }) new ApiCheck("linear-retry-check", { name: "Linear Backoff Retries", retryStrategy: linearRetryStrategy, request: { method: "GET", url: "https://api.example.com/unstable", }, }) // Retry pattern: 20s, 40s, 60s, 80s (total: ~200s) ``` ```ts theme={null} import { ApiCheck, RetryStrategyBuilder } from "checkly/constructs" const exponentialRetryStrategy = RetryStrategyBuilder.exponentialStrategy({ baseBackoffSeconds: 5, // First retry after 5s maxRetries: 3, maxDurationSeconds: 300, // Stop after 5 minutes total sameRegion: true, }) new ApiCheck("exponential-retry-check", { name: "Exponential Backoff Retries", retryStrategy: exponentialRetryStrategy, request: { method: "GET", url: "https://api.example.com/overloaded", }, }) // Retry pattern: 5s, 25s, 125s ``` ```ts theme={null} import { ApiCheck, CheckGroupV2, Frequency, RetryStrategyBuilder, } from "checkly/constructs" const groupRetryStrategy = RetryStrategyBuilder.linearStrategy({ baseBackoffSeconds: 30, maxRetries: 3, sameRegion: false, }) const apiGroup = new CheckGroupV2("api-group", { name: "API Monitoring Group", retryStrategy: groupRetryStrategy, // Applies to all checks in group frequency: Frequency.EVERY_5M, locations: ["us-east-1", "eu-west-1"], }) new ApiCheck("group-api-check", { name: "API Check with Group Retry Strategy", group: apiGroup, // Inherits retry strategy from group request: { method: "GET", url: "https://api.example.com/endpoint", }, }) // Retry pattern: 30s, 60s, 90s ``` ```ts checkly.config.ts theme={null} import { defineConfig } from "checkly" import { Frequency, RetryStrategyBuilder } from "checkly/constructs" export default defineConfig({ projectName: "Resilient Monitoring", logicalId: "resilient-monitoring", checks: { activated: true, frequency: Frequency.EVERY_10M, locations: ["us-east-1", "eu-west-1"], retryStrategy: RetryStrategyBuilder.linearStrategy({ baseBackoffSeconds: 60, maxRetries: 2, sameRegion: false, }), }, }) ``` ## Best Practices ```ts theme={null} // For stable APIs - minimal retries const stableApiRetry = RetryStrategyBuilder.fixedStrategy({ baseBackoffSeconds: 30, maxRetries: 2, sameRegion: true, }) // For unstable APIs - more aggressive retries const unstableApiRetry = RetryStrategyBuilder.exponentialStrategy({ baseBackoffSeconds: 10, maxRetries: 4, sameRegion: false, }) ``` ```ts theme={null} // Critical endpoints - fail fast to alert quickly const criticalRetry = RetryStrategyBuilder.fixedStrategy({ baseBackoffSeconds: 15, maxRetries: 1, // Minimal retries sameRegion: true, }) // Non-critical endpoints - more tolerant const nonCriticalRetry = RetryStrategyBuilder.linearStrategy({ baseBackoffSeconds: 60, maxRetries: 3, sameRegion: false, }) ``` ```ts theme={null} // Browser checks - longer backoff due to complexity const browserRetry = RetryStrategyBuilder.linearStrategy({ baseBackoffSeconds: 90, maxRetries: 2, sameRegion: false, }) // API checks - faster retries const apiRetry = RetryStrategyBuilder.fixedStrategy({ baseBackoffSeconds: 30, maxRetries: 3, sameRegion: false, }) ``` # SlackAlertChannel Construct Source: https://www.checklyhq.com/docs/constructs/slack-alert-channel Learn how to configure Slack alert channels with the Checkly CLI. The Slack webhook based alert channel is deprecated in favour of the more modern [Slack App alert channel](/docs/constructs/slack-app-alert-channel) Sends alert notifications to a Slack channel via an incoming webhook. ```ts Basic Example theme={null} import { SlackAlertChannel } from 'checkly/constructs' const slackChannel = new SlackAlertChannel('slack-channel-1', { url: new URL('https://hooks.slack.com/services/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'), channel: '#ops' }) ``` ```ts Advanced Example theme={null} import { SlackAlertChannel } from 'checkly/constructs' const slackChannel = new SlackAlertChannel('slack-channel-1', { url: new URL('https://hooks.slack.com/services/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'), channel: '#ops', sendRecovery: true, sendFailure: true, sendDegraded: true, sslExpiry: true, sslExpiryThreshold: 30, }) ``` If you need to reference existing alert channels that were created outside of your CLI project, use [`fromId()`](/docs/constructs/alert-channel#using-fromid-to-reference-an-existing-channel). ## Configuration ### Slack Alert Channel Options The Slack incoming webhook URL where Checkly will send alert notifications. ```ts highlight={2} theme={null} new SlackAlertChannel('slack-channel-1', { url: new URL('https://hooks.slack.com/services/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'), channel: '#ops' }) ``` Target Slack channel or user for notifications. You can specify the target channel to override the default channel configured in the webhook. ### General Alert Channel Options These options are valid for all alert channels types. Whether to send notifications when checks recover from a [failed or degraded state](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [fail](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [become degraded](/docs/communicate/alerts/overview/#alert-channels). Default value is `false`. Whether to send notifications when a SSL/TLS certificate is about to expire. Default value is `false`. ```ts highlight={3} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) Number of days before the SSL/TLS certificate expiry date to send notifications. Only relevant when `sslExpiry` is enabled. Default value is `30`. ```ts highlight={4} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) # SlackAppAlertChannel Construct Source: https://www.checklyhq.com/docs/constructs/slack-app-alert-channel Learn how to configure Slack alert channels with the Checkly CLI. Slack App alert channels require the [Checkly Slack App](/docs/integrations/alerts/slack) to be installed in your Slack workspace. Sends alert notifications to Slack channels and as DMs. ```ts Basic Example theme={null} import { SlackAppAlertChannel } from 'checkly/constructs' const slackAppChannel = new SlackAppAlertChannel('slack-channel-1', { slackChannels: ['#ops', '@John Doe'] }) ``` ```ts Advanced Example theme={null} import { SlackAppAlertChannel } from 'checkly/constructs' const slackAppChannel = new SlackAppAlertChannel('slack-channel-1', { slackChannels: ['#ops', '@John Doe'], sendRecovery: true, sendFailure: true, sendDegraded: true, sslExpiry: true, sslExpiryThreshold: 30, }) ``` If you need to reference existing alert channels that were created outside of your CLI project, use [`fromId()`](/docs/constructs/alert-channel#using-fromid-to-reference-an-existing-channel). ## Configuration ### Slack Alert Channel Options The Slack channels to alert. Can also include DM handles, e.g. "@John Doe" ```ts highlight={2} theme={null} new SlackAppAlertChannel('slack-channel-1', { slackChannels: ['#ops','@John Doe'] }) ``` ### General Alert Channel Options These options are valid for all alert channels types. Whether to send notifications when checks recover from a [failed or degraded state](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [fail](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [become degraded](/docs/communicate/alerts/overview/#alert-channels). Default value is `false`. Whether to send notifications when a SSL/TLS certificate is about to expire. Default value is `false`. ```ts highlight={3} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) Number of days before the SSL/TLS certificate expiry date to send notifications. Only relevant when `sslExpiry` is enabled. Default value is `30`. ```ts highlight={4} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) # SmsAlertChannel Construct Source: https://www.checklyhq.com/docs/constructs/sms-alert-channel Learn how to configure SMS alert channels with the Checkly CLI. For general information about alerting, see our docs on [SMS alerts](/docs/integrations/alerts/sms) and [alerting with Checkly](/docs/communicate/alerts/overview/). Use SMS Alert Channels to send SMS notifications to phone numbers when checks fail or recover. ```ts Basic Example theme={null} import { SmsAlertChannel } from 'checkly/constructs' const smsChannel = new SmsAlertChannel('sms-channel-1', { name: 'Ops on-call', phoneNumber: '+31061234567890', }) ``` ```ts Advanced Example theme={null} import { SmsAlertChannel } from 'checkly/constructs' const smsChannel = new SmsAlertChannel('sms-channel-1', { name: 'Ops on-call', phoneNumber: '+31061234567890', sendRecovery: true, sendFailure: true, sendDegraded: false, sslExpiry: true, sslExpiryThreshold: 7, }) ``` If you need to reference existing alert channels that were created outside of your CLI project, use [`fromId()`](/docs/constructs/alert-channel#using-fromid-to-reference-an-existing-channel). ## Configuration ### SMS Alert Channel Options Phone number to send SMS notifications to. Each `SmsAlertChannel` supports only one phone number. Phone numbers need to be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). We only support phone numbers from certain [countries and regions](/docs/integrations/alerts/sms#supported-countries-and-regions). ```ts highlight={3} theme={null} new SmsAlertChannel('sms-channel-1', { name: 'Ops on-call', phoneNumber: '+31061234567890', }) ``` Friendly name for the SMS alert channel. ### General Alert Channel Options These options are valid for all alert channels types. Whether to send notifications when checks recover from a [failed or degraded state](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [fail](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [become degraded](/docs/communicate/alerts/overview/#alert-channels). Default value is `false`. Whether to send notifications when a SSL/TLS certificate is about to expire. Default value is `false`. ```ts highlight={3} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) Number of days before the SSL/TLS certificate expiry date to send notifications. Only relevant when `sslExpiry` is enabled. Default value is `30`. ```ts highlight={4} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) # SslMonitor Construct Source: https://www.checklyhq.com/docs/constructs/ssl-monitor Learn how to configure SSL monitors with the Checkly CLI. Learn more about SSL Monitors in [the SSL monitor overview](/docs/detect/uptime-monitoring/ssl-monitors/overview). Use SSL Monitors to verify the health and security posture of your TLS certificates. The examples below show how to configure monitoring for common scenarios. Before creating SSL Monitors, ensure you have: * An initialized Checkly CLI project * Network access to the HTTPS endpoint you want to monitor * The hostname (and optionally port) of the target server For additional setup information, see [CLI overview](/docs/cli/overview). ```ts Basic Example theme={null} import { Frequency, SslMonitor } from "checkly/constructs" new SslMonitor("homepage-ssl", { name: "Homepage Certificate", description: "Monitors the TLS certificate for `example.com`.", frequency: Frequency.EVERY_1H, request: { hostname: "example.com", sslConfig: { alertDaysBeforeExpiry: 30, }, }, }) ``` ```ts Advanced Example theme={null} import { Frequency, SslAssertionBuilder, SslMonitor, TlsVersion, } from "checkly/constructs" new SslMonitor("api-ssl-advanced", { name: "API Certificate — strict baseline", description: "Enforces TLS 1.3, checks chain trust, and alerts 45 days before expiry.", activated: true, frequency: Frequency.EVERY_10M, locations: ["us-east-1", "eu-west-1"], degradedResponseTime: 1000, maxResponseTime: 5000, request: { hostname: "api.example.com", port: 443, sslConfig: { alertDaysBeforeExpiry: 45, handshakeTimeout: 5000, securityBaseline: { enabled: true, minTLSVersion: { value: "TLS1.2", severity: "fail" }, recommendedTLSVersion: { value: "TLS1.3", severity: "degrade" }, weakCipherSuite: { severity: "fail" }, ocspMustStapleRespected: { severity: "degrade" }, }, }, assertions: [ SslAssertionBuilder.connection("chainTrusted").equals(true), SslAssertionBuilder.connection("hostnameVerified").equals(true), SslAssertionBuilder.connection("tlsVersion").equals(TlsVersion.TLS1_3), SslAssertionBuilder.certificate("daysUntilExpiry").greaterThan(45), ], }, }) ``` ## Configuration SSL monitors have SSL-specific settings and inherit the standard monitor options shared across all check types. | Parameter | Type | Required | Default | Description | | ---------------------- | -------- | -------- | ------- | ---------------------------------------------------------------------- | | `request` | `object` | ✅ | - | SSL connection and certificate configuration | | `degradedResponseTime` | `number` | ❌ | `3000` | Handshake time in milliseconds at which the monitor is marked degraded | | `maxResponseTime` | `number` | ❌ | `10000` | Handshake time in milliseconds at which the monitor is marked failed | | Property | Type | Required | Default | Description | | ----------------------- | ---------------------------------------- | -------- | ----------- | ----------------------------------------------------------------------- | | `name` | `string` | ✅ | - | Friendly name for your monitor | | `description` | `string` | ❌ | `null` | A description of the monitor. Supports markdown. Max 500 characters | | `activated` | `boolean` | ❌ | `true` | Whether the monitor is enabled | | `alertChannels` | `Array` | ❌ | `[]` | Array of AlertChannel objects for notifications | | `alertEscalationPolicy` | `AlertEscalationPolicy` | ❌ | - | Advanced alert escalation settings | | `frequency` | `Frequency` | ❌ | `EVERY_10M` | How often to run your monitor | | `group` | `CheckGroupV1` `CheckGroupV2` | ❌ | - | The CheckGroup this monitor belongs to | | `locations` | `string[]` | ❌ | `[]` | Array of public location codes | | `privateLocations` | `string[]` | ❌ | `[]` | Array of Private Location slugs | | `muted` | `boolean` | ❌ | `false` | Whether alert notifications are muted | | `tags` | `string[]` | ❌ | `[]` | Array of tags to organize monitors | | `testOnly` | `boolean` | ❌ | `false` | Only run with test, not during deploy | | `retryStrategy` | `RetryStrategy` | ❌ | - | Strategy for configuring retries | | `runParallel` | `boolean` | ❌ | `false` | Run monitors in parallel or round-robin | | `triggerIncident` | `IncidentTrigger` | ❌ | - | Create and resolve an incident based on the check's alert configuration | ### `SslMonitor` Options SSL connection configuration that defines the target host and all TLS-specific options. **Usage:** ```ts theme={null} new SslMonitor("my-ssl-monitor", { name: "Example SSL Monitor", request: { hostname: "example.com", sslConfig: { alertDaysBeforeExpiry: 30, }, }, }) ``` **Parameters:** | Parameter | Type | Required | Default | Description | | ------------ | ---------------- | -------- | -------- | ------------------------------------------------------------ | | `hostname` | `string` | ✅ | - | The hostname to connect to and validate (no scheme or port) | | `port` | `number` | ❌ | `443` | TCP port to connect to (1–65535) | | `ipFamily` | `string` | ❌ | `'IPv4'` | IP family: `'IPv4'` \| `'IPv6'` | | `sslConfig` | `SslConfig` | ✅ | - | TLS handshake and certificate options (see below) | | `assertions` | `SslAssertion[]` | ❌ | `[]` | Certificate/handshake assertions using `SslAssertionBuilder` | TLS handshake time in milliseconds at or above which the monitor is marked as degraded (warning state). Range: 0–30,000 ms. Must be ≤ `maxResponseTime`. **Usage:** ```ts highlight={3} theme={null} new SslMonitor("my-ssl", { name: "Example SSL", degradedResponseTime: 1000, maxResponseTime: 5000, request: { hostname: "example.com", sslConfig: {}, }, }) ``` TLS handshake time in milliseconds at or above which the monitor is marked as failed. Range: 0–30,000 ms. **Usage:** ```ts highlight={4} theme={null} new SslMonitor("my-ssl", { name: "Example SSL", degradedResponseTime: 1000, maxResponseTime: 5000, request: { hostname: "example.com", sslConfig: {}, }, }) ``` ### `SslConfig` Options Raise a degraded alert when the certificate is within this many days of expiry. Range: 1–365. ```ts theme={null} sslConfig: { alertDaysBeforeExpiry: 30, // Warn 30 days before expiry } ``` SNI server name to send during the TLS handshake. Useful when a single IP hosts multiple certificates. Defaults to `hostname` when unset. ```ts theme={null} sslConfig: { serverName: "tenant-a.example.com", } ``` Maximum milliseconds to wait for the TLS handshake to complete. Range: 1,000–30,000 ms. ```ts theme={null} sslConfig: { handshakeTimeout: 5000, } ``` When `true`, the certificate chain is not verified against system trusted roots. The certificate is still inspected for expiry and the security baseline. Use for internal or self-signed certificates. ```ts theme={null} sslConfig: { skipChainValidation: true, } ``` Enables mutual TLS by sending a client certificate during the handshake. * `'auto'` — Checkly selects a stored client certificate automatically. * `'explicit'` — uses the certificate referenced by `sslClientCertificateId`. Omit to connect without a client certificate. ```ts theme={null} sslConfig: { clientCertificateMode: "explicit", sslClientCertificateId: "9e83b6d8-a1e5-4c7b-8f0a-3d2e1c4b5a69", } ``` The UUID of the stored client certificate to present during the TLS handshake. Required when `clientCertificateMode` is `'explicit'`. Client certificates are managed under **Settings → Client Certificates** in the Checkly dashboard. ```ts theme={null} sslConfig: { clientCertificateMode: "explicit", sslClientCertificateId: "9e83b6d8-a1e5-4c7b-8f0a-3d2e1c4b5a69", } ``` Override the default security baseline for this monitor. Omit to inherit the built-in default baseline. ```ts theme={null} sslConfig: { securityBaseline: { enabled: true, minTLSVersion: { value: "TLS1.2", severity: "fail" }, recommendedTLSVersion: { value: "TLS1.3", severity: "degrade" }, weakCipherSuite: { severity: "fail" }, weakSignatureAlgorithm: { severity: "fail" }, knownBadCA: { severity: "fail" }, ocspMustStapleRespected: { severity: "degrade" }, }, } ``` **`SecurityBaseline` parameters:** | Parameter | Type | Default severity | Description | | ------------------------- | ------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------ | | `enabled` | `boolean` | `true` | Enable or disable baseline evaluation | | `minTLSVersion` | `{ value?: string, severity? }` | `fail` | Minimum required TLS version (e.g. `'TLS1.2'`) | | `minKeySizeBits` | `{ value?: number, severity? }` | `fail` | Minimum RSA key size in bits | | `weakSignatureAlgorithm` | `{ severity? }` | `fail` | Reject weak signature algorithms (MD2-RSA, MD5-RSA, SHA1-RSA, DSA-SHA1, ECDSA-SHA1) on non-root certificates | | `weakCipherSuite` | `{ severity? }` | `fail` | Reject known-weak cipher suites | | `knownBadCA` | `{ severity? }` | `fail` | Reject distrusted certificate authorities | | `recommendedTLSVersion` | `{ value?: string, severity? }` | `ignore` | Advisory minimum TLS version | | `recommendedKeySizeBits` | `{ value?: number, severity? }` | `ignore` | Advisory minimum RSA key size | | `ocspMustStapleRespected` | `{ severity? }` | `ignore` | Alert when must-staple cert is missing an OCSP staple | | `sctPresent` | `{ severity? }` | `ignore` | Alert when no Signed Certificate Timestamp is observed | Each rule's `severity` can be `'fail'` | `'degrade'` | `'ignore'`. ### `SslMonitor` Assertions Define `assertions` using the `SslAssertionBuilder`. Five entry points map to the assertion sources — `certificate`/`connection` take a `property` (a field selector); `jsonResponse`/`textResponse` take a JSONPath/regex: | Builder | Source | Description | | ------------------------ | --------------- | ----------------------------------------------------------------------- | | `certificate(property)` | `CERTIFICATE` | Assert on a leaf-certificate field | | `connection(property)` | `CONNECTION` | Assert on a TLS handshake / connection field | | `responseTime()` | `RESPONSE_TIME` | TLS handshake duration in milliseconds | | `jsonResponse(jsonPath)` | `JSON_RESPONSE` | Assert on any response field via a JSONPath expression | | `textResponse(regex?)` | `TEXT_RESPONSE` | Extract a value from the serialized response with a regex, then compare | `certificate(property)` properties: `daysUntilExpiry` / `keySizeBits` (number — `EQUALS` / `NOT_EQUALS` / `GREATER_THAN` / `LESS_THAN`), `subjectCN` / `issuerCN` (string — also `CONTAINS` / `NOT_CONTAINS`), `serialNumber` / `fingerprintSha256` / `issuerFingerprintSha256` / `keyAlgorithm` / `signatureAlgorithm` (exact — `EQUALS` / `NOT_EQUALS` only), `sans` (list — `CONTAINS` / `NOT_CONTAINS`), `selfSigned` / `isCA` (boolean — `EQUALS`). `connection(property)` properties: `tlsVersion` (version — `EQUALS` / `NOT_EQUALS` / `GREATER_THAN` / `LESS_THAN`, ordered TLS1.0 \< TLS1.3), `cipherSuite` / `resolvedIp` (string — also `CONTAINS` / `NOT_CONTAINS`), `ocspStatus` (exact — `good` / `revoked` / `unknown`), `hostnameVerified` / `chainTrusted` / `ocspStapled` (boolean — `EQUALS`). Examples: ```ts theme={null} // Alert when fewer than 30 days remain before expiry SslAssertionBuilder.certificate("daysUntilExpiry").greaterThan(30) // Equivalent to: { source: 'CERTIFICATE', property: 'daysUntilExpiry', comparison: 'GREATER_THAN', target: '30' } // The certificate chain must be trusted SslAssertionBuilder.connection("chainTrusted").equals(true) // Equivalent to: { source: 'CONNECTION', property: 'chainTrusted', comparison: 'EQUALS', target: 'true' } // Assert an exact TLS version — tlsVersion is ordered, so greaterThan/lessThan also work // (the security baseline's minTLSVersion is the usual way to enforce a "1.2-or-newer" floor) SslAssertionBuilder.connection("tlsVersion").equals(TlsVersion.TLS1_3) // Equivalent to: { source: 'CONNECTION', property: 'tlsVersion', comparison: 'EQUALS', target: 'TLS1.3' } // Pin the cipher suite SslAssertionBuilder.connection("cipherSuite").equals(CipherSuite.TLS_AES_256_GCM_SHA384) // Equivalent to: { source: 'CONNECTION', property: 'cipherSuite', comparison: 'EQUALS', target: 'TLS_AES_256_GCM_SHA384' } // Verify a specific issuer SslAssertionBuilder.certificate("issuerCN").equals("Let's Encrypt") // Equivalent to: { source: 'CERTIFICATE', property: 'issuerCN', comparison: 'EQUALS', target: "Let's Encrypt" } // Reject weak keys (the security baseline's minKeySizeBits enforces a hard minimum) SslAssertionBuilder.certificate("keySizeBits").greaterThan(1024) // Equivalent to: { source: 'CERTIFICATE', property: 'keySizeBits', comparison: 'GREATER_THAN', target: '1024' } // Assert on a nested chain field with a JSONPath expression SslAssertionBuilder.jsonResponse("$.chain[0].keySizeBits").greaterThan(2048) // Equivalent to: { source: 'JSON_RESPONSE', property: '$.chain[0].keySizeBits', comparison: 'GREATER_THAN', target: '2048' } ``` Use the `TlsVersion` and `CipherSuite` constants for type-safe comparisons: ```ts theme={null} import { CipherSuite, SslAssertionBuilder, TlsVersion, } from "checkly/constructs" SslAssertionBuilder.connection("tlsVersion").equals(TlsVersion.TLS1_3) SslAssertionBuilder.connection("cipherSuite").equals(CipherSuite.TLS_AES_128_GCM_SHA256) ``` Learn more in our docs on [Assertions](/docs/detect/assertions). ### General Monitor Options Friendly name for your SSL Monitor, displayed in the Checkly dashboard and used in notifications. ```ts highlight={2} theme={null} new SslMonitor("my-ssl-monitor", { name: "Homepage Certificate", /* More options ... */ }) ``` How often the SSL Monitor should run. Use the `Frequency` enum to set the check interval. ```ts highlight={3} theme={null} new SslMonitor("my-ssl-monitor", { name: "Homepage Certificate", frequency: Frequency.EVERY_1H, /* More options ... */ }) ``` **Available frequencies**: `EVERY_1M`, `EVERY_2M`, `EVERY_5M`, `EVERY_10M`, `EVERY_15M`, `EVERY_30M`, `EVERY_1H`, `EVERY_2H`, `EVERY_3H`, `EVERY_6H`, `EVERY_12H`, `EVERY_24H`. SSL monitors do not support sub-minute frequencies (`EVERY_10S` / `EVERY_20S` / `EVERY_30S`). Array of [public location codes](/docs/concepts/locations/#public-locations) where the monitor should run from. Multiple locations provide geographic coverage. ```ts highlight={3} theme={null} new SslMonitor("global-ssl", { name: "Global Certificate Monitor", locations: ["us-east-1", "eu-west-1", "ap-southeast-1"], /* More options ... */ }) ``` Whether the SSL Monitor is enabled and will run according to its schedule. ```ts highlight={3} theme={null} new SslMonitor("my-ssl-monitor", { name: "Homepage Certificate", activated: false, // Disabled monitor /* More options ... */ }) ``` ## Examples ```ts theme={null} import { Frequency, SslMonitor } from "checkly/constructs" new SslMonitor("homepage-ssl", { name: "Homepage Certificate", frequency: Frequency.EVERY_1H, locations: ["us-east-1", "eu-west-1"], request: { hostname: "example.com", sslConfig: { alertDaysBeforeExpiry: 30, }, }, }) ``` ```ts theme={null} import { Frequency, SslAssertionBuilder, SslMonitor, TlsVersion } from "checkly/constructs" new SslMonitor("api-strict-tls", { name: "API — Strict TLS Policy", frequency: Frequency.EVERY_10M, locations: ["us-east-1", "eu-central-1"], request: { hostname: "api.example.com", sslConfig: { alertDaysBeforeExpiry: 45, securityBaseline: { enabled: true, minTLSVersion: { value: "TLS1.2", severity: "fail" }, recommendedTLSVersion: { value: "TLS1.3", severity: "degrade" }, }, }, assertions: [ SslAssertionBuilder.connection("chainTrusted").equals(true), SslAssertionBuilder.connection("hostnameVerified").equals(true), SslAssertionBuilder.connection("tlsVersion").equals(TlsVersion.TLS1_3), ], }, }) ``` ```ts theme={null} import { Frequency, SslAssertionBuilder, SslMonitor } from "checkly/constructs" new SslMonitor("internal-ssl", { name: "Internal Service Certificate", frequency: Frequency.EVERY_6H, privateLocations: ["my-private-location"], request: { hostname: "internal.corp.example.com", port: 8443, sslConfig: { skipChainValidation: true, alertDaysBeforeExpiry: 14, }, assertions: [ SslAssertionBuilder.certificate("selfSigned").equals(true), SslAssertionBuilder.certificate("daysUntilExpiry").greaterThan(7), ], }, }) ``` ```ts theme={null} import { Frequency, SslAssertionBuilder, SslMonitor } from "checkly/constructs" new SslMonitor("mtls-endpoint", { name: "mTLS API Gateway", frequency: Frequency.EVERY_5M, request: { hostname: "mtls.api.example.com", sslConfig: { clientCertificateMode: "explicit", sslClientCertificateId: "9e83b6d8-a1e5-4c7b-8f0a-3d2e1c4b5a69", alertDaysBeforeExpiry: 30, }, assertions: [ SslAssertionBuilder.certificate("daysUntilExpiry").greaterThan(0), SslAssertionBuilder.connection("hostnameVerified").equals(true), ], }, }) ``` ```ts theme={null} import { Frequency, SslMonitor } from "checkly/constructs" // Monitor a certificate served for a specific SNI name // on a shared IP (e.g. a CDN or multi-tenant server). new SslMonitor("tenant-ssl", { name: "Tenant Certificate via SNI", frequency: Frequency.EVERY_1H, request: { hostname: "shared-cdn.example.net", sslConfig: { serverName: "tenant-a.example.com", alertDaysBeforeExpiry: 20, }, }, }) ``` # StatusPage Construct Source: https://www.checklyhq.com/docs/constructs/status-page Learn how to configure status pages with the Checkly CLI. **Deprecated.** This construct creates a v2 (cards and services) status page. New status pages should use [`StatusPageV3`](/docs/constructs/status-page-v3). Existing v2 pages keep working and can be migrated to v3 with the migration wizard in the Checkly app. Learn more about Status Pages in [the Status Pages overview](/docs/communicate/status-pages/overview). Use public Status Pages to show the uptime of your services through organized cards. Status pages help communicate service availability to your users and stakeholders. ```ts Basic Example theme={null} import { StatusPage, StatusPageService } from "checkly/constructs" const apiService = new StatusPageService("api-service", { name: "API Service", }) new StatusPage("company-status", { name: "Company Status", url: "company-status", cards: [ { name: "Core Services", services: [apiService], }, ], }) ``` ```ts Complete Example theme={null} import { BrowserCheck, StatusPage, StatusPageService } from "checkly/constructs" const webService = new StatusPageService("web-app", { name: "Web Application", }) new BrowserCheck("homepage-check", { name: "Homepage Check", code: { entrypoint: "home.spec.ts", }, triggerIncident: { // trigger an incident by using a status page service service: webService, severity: "MEDIUM", name: "Homepage Disruption", description: "The homepage check has failed.", notifySubscribers: true, }, }) new StatusPage("acme-status", { name: "A.C.M.E Status", url: "acme-status", customDomain: "status.acme.com", logo: "https://acme.com/logo.png", redirectTo: "https://acme.com", favicon: "https://acme.com/favicon.ico", defaultTheme: "DARK", cards: [ // add a status page service to a status page { name: "User-Facing Services", services: [webService], }, ], }) ``` ## Configuration | Parameter | Type | Required | Default | Description | | -------------- | ----------------------- | -------- | -------- | ---------------------------------------------------------------------- | | `name` | `string` | ✅ | - | Name of the status page | | `cards` | `StatusPageCardProps[]` | ✅ | - | Array of card objects containing services | | `url` | `string` | ✅ | - | Subdomain under `checkly-status-page.com` (unique across all accounts) | | `customDomain` | `string` | ❌ | - | Custom domain (e.g., `status.example.com`) | | `logo` | `string` | ❌ | - | URL to logo image for the header | | `redirectTo` | `string` | ❌ | - | URL to redirect when logo is clicked | | `favicon` | `string` | ❌ | - | URL to favicon image | | `defaultTheme` | `string` | ❌ | `'AUTO'` | Theme: `'DARK'` \| `'LIGHT'` \| `'AUTO'` | ### `StatusPage` Options Name of the status page displayed in the header and browser title. **Usage:** ```ts highlight={2} theme={null} new StatusPage("company-status", { name: "Company Status Page", /* More options... */ }) ``` **Use cases**: Brand visibility, service identification, regional status pages, internal team pages. Array of card objects that organize services into logical groups on the status page. **Usage:** ```ts highlight={3-8} theme={null} new StatusPage("company-status", { name: "Company Status", cards: [ { name: "Core Services", services: [apiService, webService], }, ], /* More options... */ }) ``` **Parameters:** | Parameter | Type | Required | Description | | ---------- | --------------------- | -------- | ----------------------------------------- | | `name` | `string` | ✅ | Display name for the card | | `services` | `StatusPageService[]` | ✅ | Array of services to display on this card | **Examples:** ```ts Functional Organization theme={null} const webAppService = new StatusPageService("web-app", { name: "Web Application" }) const mobileApiService = new StatusPageService("mobile-api", { name: "Mobile API" }) const databaseService = new StatusPageService("database", { name: "Database" }) new StatusPage("functional-status", { name: "Functional Status", url: "functional-status", cards: [ { name: "User-Facing Services", // Customer impact grouped together services: [webApp, mobileApi], }, { name: "Infrastructure", // Backend services grouped services: [database], }, ], }) ``` ```ts Team Organization theme={null} const frontendAppService = new StatusPageService("frontend", { name: "Frontend App" }) const backendApiService = new StatusPageService("backend", { name: "Backend API" }) const paymentService = new StatusPageService("payments", { name: "Payments" }) new StatusPage("team-status", { name: "Team Status", url: "team-status", cards: [ { name: "Frontend Team", // Team-based grouping services: [frontendApp], }, { name: "Backend Team", services: [backendApi], }, { name: "Platform Team", services: [paymentService], }, ], }) ``` ```ts Priority Organization theme={null} const coreApiService = new StatusPageService("core-api", { name: "Core API" }) const authService = new StatusPageService("auth", { name: "Authentication" }) const reportingService = new StatusPageService("reports", { name: "Reporting" }) new StatusPage("priority-status", { name: "Priority Status", url: "priority-status", cards: [ { name: "Critical Services", // High-priority services services: [coreApi, authService], }, { name: "Supporting Services", // Lower-priority services services: [reportingService], }, ], }) ``` **Use cases**: Service organization, user experience optimization, incident communication, operational clarity. Subdomain under `checkly-status-page.com` that must be unique across all Checkly accounts. **Usage:** ```ts highlight={3} theme={null} new StatusPage("company-status", { name: "Company Status", url: "company-status", // Creates company-status.checkly-status-page.com /* More options... */ }) ``` **Use cases**: Public status pages, team-specific status pages, service-specific monitoring, temporary status pages. Custom domain for your status page (e.g., `status.example.com`). Requires DNS configuration and domain verification. **Usage:** ```ts highlight={4} theme={null} new StatusPage("company-status", { name: "Company Status", url: "status.example.com", customDomain: "status.example.com", /* More options... */ }) ``` **Use cases**: Brand consistency, SEO benefits, professional appearance, domain ownership. URL to logo image displayed in the status page header. Must be publicly accessible. **Usage:** ```ts highlight={3} theme={null} new StatusPage("company-status", { name: "Company Status", logo: "https://company.com/logo.png", /* More options... */ }) ``` **Use cases**: Brand recognition, visual consistency, professional presentation, team identification. URL to redirect users when they click the logo. Typically your main website or service. **Usage:** ```ts highlight={4} theme={null} new StatusPage("company-status", { name: "Company Status", logo: "https://company.com/logo.png", redirectTo: "https://company.com", // Redirect to main site on logo click /* More options... */ }) ``` **Use cases**: Navigation flow, user engagement, brand consistency, service discovery. URL to favicon image displayed in browser tabs. Must be publicly accessible. **Usage:** ```ts highlight={3} theme={null} new StatusPage("company-status", { name: "Company Status", favicon: "https://company.com/favicon.ico", /* More options... */ }) ``` **Use cases**: Browser tab identification, brand consistency, visual organization, professional appearance. Default color theme for the status page. Options: 'LIGHT', 'DARK', or 'AUTO' (follows system preference). **Usage:** ```ts highlight={3} theme={null} new StatusPage("company-status", { name: "Company Status", defaultTheme: "DARK", // Dark theme by default /* More options... */ }) ``` **Use cases**: User preference accommodation, brand consistency, accessibility, professional appearance. ## Examples ```ts Application Status theme={null} import { ApiCheck, StatusPage, StatusPageService } from "checkly/constructs" // Define status page services const webAppService = new StatusPageService("web-app", { name: "Web Application", }) // Include service status on status page new StatusPage("saas-company-status", { name: "SaaS Company Service Status", url: "saas-company-status", customDomain: "status.saascompany.com", logo: "https://saascompany.com/assets/logo.png", redirectTo: "https://saascompany.com", favicon: "https://saascompany.com/favicon.ico", defaultTheme: "AUTO", cards: [ { name: "Core Platform", services: [webAppService], }, ], }) new ApiCheck("web-api-check", { name: "Web API Check", request: { url: "app.example.com/api/status", method: "GET", }, // Trigger service incidents from your checks and monitors triggerIncident: { service: webAppService, name: "Web API Outage", description: "Web API is down", severity: "MAJOR", notifySubscribers: true, }, }) ``` ```ts E-commerce Platform theme={null} import { StatusPage, StatusPageService, UrlMonitor } from "checkly/constructs" // Define services for all the core parts of your infrastructure const storefrontService = new StatusPageService("storefront", { name: "Online Store", }) const checkoutApiService = new StatusPageService("checkout-api", { name: "Checkout & Cart", }) const cdnService = new StatusPageService("cdn", { name: "Image & Asset Delivery", }) new StatusPage("ecommerce-status", { name: "E-commerce Platform Status", url: "ecommerce-platform-status", logo: "https://shop.example.com/logo.png", redirectTo: "https://shop.example.com", defaultTheme: "LIGHT", // Group and display your services in your status page cards: [ { name: "Shopping Experience", services: [storefrontService, checkoutApiService], }, { name: "Content Delivery", services: [cdnService], }, ], }) new UrlMonitor("storefront-monitor", { name: "Storefront Monitor", request: { url: "https://shop.example.com", }, triggerIncident: { name: "Storefront Uptime", description: "The storefront is down", severity: "MAJOR", notifySubscribers: true, service: storefrontService, }, }) ``` ```ts Minimal Status Page theme={null} import { StatusPage, StatusPageService } from "checkly/constructs" const mainService = new StatusPageService("main-service", { name: "Main Service", }) new StatusPage("simple-status", { name: "Simple Status Page", url: "simple-status", cards: [ { name: "Service Status", services: [mainService], }, ], }) ``` **Service Reuse**: A single `StatusPageService` can be used across multiple status pages and cards, making it easy to maintain consistent service definitions. # StatusPageService Construct Source: https://www.checklyhq.com/docs/constructs/status-page-service Learn how to configure status page services with the Checkly CLI. **Deprecated.** Services belong to v2 status pages. On v3 pages, use [`StatusPageV3Component`](/docs/constructs/status-page-v3-component) instead. Learn more about Status Pages in [the Status Pages overview](/docs/communicate/status-pages/overview). Use Status Page Services to allow monitors and checks to trigger incidents and to be displayed on status pages. Services represent individual components or systems that you want to show uptime information for. ```ts Basic Example theme={null} import { StatusPage, StatusPageService } from "checkly/constructs" const apiService = new StatusPageService("api-service", { name: "API Service", }) new StatusPage("company-status", { name: "Company Status", url: "company-status", cards: [ { name: "Core Services", services: [apiService], }, ], }) ``` ```ts Complete Example theme={null} import { BrowserCheck, StatusPage, StatusPageService } from "checkly/constructs" const webService = new StatusPageService("web-app", { name: "Web Application", }) new BrowserCheck("homepage-check", { name: "Homepage Check", code: { entrypoint: "home.spec.ts", }, triggerIncident: { // trigger an incident by using a status page service service: webService, severity: "MEDIUM", name: "Homepage Disruption", description: "The homepage check has failed.", notifySubscribers: true, }, }) new StatusPage("acme-status", { name: "A.C.M.E Status", url: "acme-status", customDomain: "status.acme.com", logo: "https://acme.com/logo.png", redirectTo: "https://acme.com", favicon: "https://acme.com/favicon.ico", defaultTheme: "DARK", cards: [ // add a status page service to a status page { name: "User-Facing Services", services: [webService], }, ], }) ``` ## Configuration | Parameter | Type | Required | Default | Description | | --------- | -------- | -------- | ------- | ----------------------------------------------- | | `name` | `string` | ✅ | - | Display name for the service on the status page | ## `StatusPageService` Options Display name for the service on the status page. This name appears in the status page cards and helps users identify which service component is being monitored. **Usage:** ```ts highlight={2} theme={null} new StatusPageService("api-service", { name: "API Service", }) ``` **Use cases**: User-facing service identification, infrastructure monitoring, regional service tracking, team-specific services. ## Examples ```ts Application Status theme={null} import { ApiCheck, StatusPage, StatusPageService } from "checkly/constructs" // Define status page services const webAppService = new StatusPageService("web-app", { name: "Web Application", }) // Include service status on status page new StatusPage("saas-company-status", { name: "SaaS Company Service Status", url: "saas-company-status", customDomain: "status.saascompany.com", logo: "https://saascompany.com/assets/logo.png", redirectTo: "https://saascompany.com", favicon: "https://saascompany.com/favicon.ico", defaultTheme: "AUTO", cards: [ { name: "Core Platform", services: [webAppService], }, ], }) new ApiCheck("web-api-check", { name: "Web API Check", request: { url: "app.example.com/api/status", method: "GET", }, // Trigger service incidents from your checks and monitors triggerIncident: { service: webAppService, name: "Web API Outage", description: "Web API is down", severity: "MAJOR", notifySubscribers: true, }, }) ``` ```ts E-commerce Platform theme={null} import { StatusPage, StatusPageService, UrlMonitor } from "checkly/constructs" // Define services for all the core parts of your infrastructure const storefrontService = new StatusPageService("storefront", { name: "Online Store", }) const checkoutApiService = new StatusPageService("checkout-api", { name: "Checkout & Cart", }) const cdnService = new StatusPageService("cdn", { name: "Image & Asset Delivery", }) new StatusPage("ecommerce-status", { name: "E-commerce Platform Status", url: "ecommerce-platform-status", logo: "https://shop.example.com/logo.png", redirectTo: "https://shop.example.com", defaultTheme: "LIGHT", // Group and display your services in your status page cards: [ { name: "Shopping Experience", services: [storefrontService, checkoutApiService], }, { name: "Content Delivery", services: [cdnService], }, ], }) new UrlMonitor("storefront-monitor", { name: "Storefront Monitor", request: { url: "https://shop.example.com", }, triggerIncident: { name: "Storefront Uptime", description: "The storefront is down", severity: "MAJOR", notifySubscribers: true, service: storefrontService, }, }) ``` ```ts Minimal Status Page theme={null} import { StatusPage, StatusPageService } from "checkly/constructs" const mainService = new StatusPageService("main-service", { name: "Main Service", }) new StatusPage("simple-status", { name: "Simple Status Page", url: "simple-status", cards: [ { name: "Service Status", services: [mainService], }, ], }) ``` ## Service Reusability StatusPageService instances can be reused across multiple status pages: ```ts theme={null} // Define services once const apiService = new StatusPageService("api-service", { name: "API Service", }) const databaseService = new StatusPageService("database-service", { name: "Database Service", }) // Use in multiple status pages new StatusPage("public-status", { name: "Public Status Page", url: "public-status", cards: [ { name: "Core Services", services: [apiService, databaseService], }, ], }) new StatusPage("internal-status", { name: "Internal Status Page", url: "internal-status", cards: [ { name: "Infrastructure", services: [databaseService], // Same service, different page }, { name: "APIs", services: [apiService], // Same service, different page }, ], }) ``` ## Integration with Checks and Monitors Status Page Services represent logical groupings of functionality. You'll typically have multiple checks monitoring different aspects of each service, but the service itself provides a high-level view for your status page visitors. Enable checks and monitors to trigger incidents by using the `triggerIncident` property. ```ts highlight=12,27 theme={null} import { ApiCheck, StatusPageService, UrlMonitor } from "checkly/constructs" const criticalAppService = new StatusPageService("critical-app-service", { name: "Critical Application Infrastructure", }) new UrlMonitor("storefront-monitor", { name: "Storefront Monitor", request: { url: "https://shop.example.com", }, triggerIncident: { name: "Storefront Uptime", description: "The storefront is down", severity: "MAJOR", notifySubscribers: true, service: criticalAppService, }, }) new ApiCheck("web-api-check", { name: "Web API Check", request: { url: "app.example.com/api/status", method: "GET", }, triggerIncident: { service: criticalAppService, name: "Web API Outage", description: "Web API is down", severity: "MAJOR", notifySubscribers: true, }, }) ``` # StatusPageV3 Construct Source: https://www.checklyhq.com/docs/constructs/status-page-v3 Learn how to configure status pages with the Checkly CLI. Use `StatusPageV3` to create a public status page. A v3 page has no cards or services: its structure is declared with [`StatusPageV3Component`](/docs/constructs/status-page-v3-component) constructs that point at the page, and incidents can be automated with [`StatusPageV3AutomationRule`](/docs/constructs/status-page-v3-automation-rule). A page's generation cannot change in place. A logical ID that was deployed as a [`StatusPage`](/docs/constructs/status-page) (deprecated) cannot be redeployed as a `StatusPageV3`, or vice versa. To move a v2 page to v3, use the migration wizard in the Checkly app. ```ts Basic Example theme={null} import { StatusPageV3, StatusPageV3Component } from "checkly/constructs" const statusPage = new StatusPageV3("company-status", { name: "Company Status", url: "company-status", }) new StatusPageV3Component("api-component", { statusPage, name: "API", displayOrder: 0, }) ``` ```ts Complete Example theme={null} import { StatusPageV3, StatusPageV3AutomationRule, StatusPageV3Component, } from "checkly/constructs" const statusPage = new StatusPageV3("acme-status", { name: "A.C.M.E Status", url: "acme-status", customDomain: "status.acme.com", description: "Live status of all A.C.M.E services.", logo: "https://acme.com/logo.png", logoDark: "https://acme.com/logo-dark.png", redirectTo: "https://acme.com", favicon: "https://acme.com/favicon.ico", defaultTheme: "AUTO", footerText: "A.C.M.E Inc.", privacyPolicyLink: "https://acme.com/privacy", termsOfServiceLink: "https://acme.com/terms", }) // A group with one component nested under it. const userFacing = new StatusPageV3Component("user-facing-group", { statusPage, type: "GROUP", name: "User-Facing Services", displayOrder: 0, }) const webApp = new StatusPageV3Component("web-app-component", { statusPage, name: "Web Application", parent: userFacing, displayOrder: 1, }) // Open an incident on the page when a check tagged "web" fails. new StatusPageV3AutomationRule("web-outage-rule", { statusPage, name: "Web outage", tags: ["web"], firstUpdate: "We are investigating an issue with the web application.", lastUpdate: "The issue is resolved.", components: [{ component: webApp, targetImpact: "MAJOR_OUTAGE" }], }) ``` ## Configuration ### `StatusPageV3` Options Name of the status page, shown in the header and browser title. **Usage:** ```ts highlight={2} theme={null} new StatusPageV3("company-status", { name: "Company Status", /* More options... */ }) ``` Subdomain under `checkly-status-page.com`. Must be unique across all Checkly accounts. **Usage:** ```ts highlight={3} theme={null} new StatusPageV3("company-status", { name: "Company Status", url: "company-status", // Creates company-status.checkly-status-page.com }) ``` Custom domain for your status page (e.g., `status.example.com`). Requires DNS configuration and domain verification. See [Custom domains](/docs/communicate/status-pages/customization#custom-domain). **Usage:** ```ts highlight={4} theme={null} new StatusPageV3("company-status", { name: "Company Status", url: "company-status", customDomain: "status.example.com", }) ``` Short text shown at the top of the public page. URL to a logo image shown in the header. Must be publicly accessible. URL to a logo used when the page is in dark mode. Falls back to `logo` when unset. URL to redirect users to when they click the logo. URL to a favicon image shown in browser tabs. Must be publicly accessible. Default color theme for the page: `'LIGHT'`, `'DARK'`, or `'AUTO'` (follows system preference). Link to your privacy policy, shown in the page footer. Link to your terms of service, shown in the page footer. Free-form text shown in the page footer. Google Analytics tag ID (e.g. `G-XXXXXXXXXX`) embedded on the public page. Whether search engines may index the public page. ## Referencing an existing page Use `StatusPageV3.fromId()` to attach components and automation rules declared in code to a page created in the UI, without managing the page itself: ```ts theme={null} import { StatusPageV3, StatusPageV3Component } from "checkly/constructs" const statusPage = StatusPageV3.fromId("2fbb3ec1-0d32-4e1e-964a-9f4823502e2f") new StatusPageV3Component("cdn-component", { statusPage, name: "CDN", displayOrder: 3, }) ``` ## Importing an existing page `checkly import status-page:` imports a v3 page together with its components and automation rules into your project. # StatusPageV3AutomationRule Construct Source: https://www.checklyhq.com/docs/constructs/status-page-v3-automation-rule Learn how to automate status page incidents with the Checkly CLI. An automation rule opens and resolves incidents on a [`StatusPageV3`](/docs/constructs/status-page-v3) page automatically. When a check whose tags overlap with the rule's tags fails, Checkly opens one incident impacting the listed components, and resolves it when the check recovers. ```ts theme={null} import { StatusPageV3, StatusPageV3AutomationRule, StatusPageV3Component, } from "checkly/constructs" const statusPage = new StatusPageV3("company-status", { name: "Company Status", url: "company-status", }) const api = new StatusPageV3Component("api-component", { statusPage, name: "API", displayOrder: 0, }) new StatusPageV3AutomationRule("api-outage-rule", { statusPage, name: "API outage", tags: ["api", "production"], firstUpdate: "We are investigating elevated error rates on the API.", lastUpdate: "The API has recovered.", components: [{ component: api, targetImpact: "PARTIAL_OUTAGE" }], }) ``` ## Configuration ### `StatusPageV3AutomationRule` Options The page this rule belongs to. Name of the rule. A failing check matches this rule when it, or its group, carries any of these tags. At least one tag is required. **Usage:** ```ts highlight={4} theme={null} new StatusPageV3AutomationRule("api-outage-rule", { statusPage, name: "API outage", tags: ["api", "production"], /* More options... */ }) ``` Body of the status update that opens the incident. Body of the status update that resolves the incident. The components an automated incident impacts, with the impact each one gets. **Parameters:** The component the automated incident impacts. The impact set on the component while the incident is open: `'UNDER_MAINTENANCE'`, `'DEGRADED_PERFORMANCE'`, `'PARTIAL_OUTAGE'`, or `'MAJOR_OUTAGE'`. **Usage:** ```ts highlight={5-8} theme={null} new StatusPageV3AutomationRule("api-outage-rule", { statusPage, name: "API outage", tags: ["api"], components: [ { component: api, targetImpact: "PARTIAL_OUTAGE" }, { component: webApp, targetImpact: "DEGRADED_PERFORMANCE" }, ], firstUpdate: "We are investigating elevated error rates.", lastUpdate: "The issue is resolved.", }) ``` A disabled rule never opens incidents. Whether subscribers are notified of the automated updates. Minimum minutes after an automated incident before this rule may open the next one. `0` disables the cool down. Rules match on tags, not on individual checks. To automate incidents from a specific check, give that check a tag only the rule uses. # StatusPageV3Component Construct Source: https://www.checklyhq.com/docs/constructs/status-page-v3-component Learn how to configure status page components with the Checkly CLI. Components are the building blocks of a [`StatusPageV3`](/docs/constructs/status-page-v3) page. A component is either a `SERVICE` (a monitored thing with its own status) or a `GROUP` (a container for other components). ```ts theme={null} import { StatusPageV3, StatusPageV3Component } from "checkly/constructs" const statusPage = new StatusPageV3("company-status", { name: "Company Status", url: "company-status", }) const backend = new StatusPageV3Component("backend-group", { statusPage, type: "GROUP", name: "Backend", displayOrder: 0, }) new StatusPageV3Component("api-component", { statusPage, name: "API", description: "Public REST API", parent: backend, displayOrder: 1, }) ``` ## Configuration ### `StatusPageV3Component` Options The page this component belongs to. A component belongs to exactly one page and cannot move to another one later. **Usage:** ```ts highlight={2} theme={null} new StatusPageV3Component("api-component", { statusPage, name: "API", displayOrder: 0, }) ``` The name shown on the status page. Position among its siblings; lower comes first. `'SERVICE'` (a monitored thing with its own status) or `'GROUP'` (a container for other components). **Usage:** ```ts highlight={3} theme={null} new StatusPageV3Component("backend-group", { statusPage, type: "GROUP", name: "Backend", displayOrder: 0, }) ``` Shown next to the name on the status page. Hide the component from the public page while keeping it available for incidents and automation. The `GROUP` component to nest this component under. Must be on the same status page. **Usage:** ```ts highlight={4} theme={null} new StatusPageV3Component("api-component", { statusPage, name: "API", parent: backendGroup, displayOrder: 1, }) ``` Unlike v2 services, a component belongs to one status page. It cannot be shared between pages. ## Referencing an existing component Use `StatusPageV3Component.fromId()` to point an [automation rule](/docs/constructs/status-page-v3-automation-rule) or a `parent` at a component created in the UI: ```ts theme={null} const cdn = StatusPageV3Component.fromId("790f145a-6ce9-4d94-b7b2-a92e0e2c6a1a") ``` # TcpMonitor Construct Source: https://www.checklyhq.com/docs/constructs/tcp-monitor Learn how to configure TCP monitors with the Checkly CLI. Learn more about TCP Monitors in [the TCP monitor overview](/docs/detect/uptime-monitoring/tcp-monitors/overview). Use TCP Monitors to verify connectivity and response times of your TCP services. The examples below show how to configure monitoring for different types of services. Before creating TCP Monitors, ensure you have: * An initialized Checkly CLI project * Network access to the TCP services you want to monitor * Knowledge of the target hostname and port number * Understanding of the expected response format (if sending data) For additional setup information, see [CLI overview](/docs/cli/overview). ```ts Basic Example theme={null} import { TcpAssertionBuilder, TcpMonitor } from "checkly/constructs" new TcpMonitor("database-tcp-1", { name: "Database Connection Check", description: "Verifies **PostgreSQL** on `db.example.com:5432` accepts connections.", activated: true, maxResponseTime: 5000, degradedResponseTime: 2000, request: { hostname: "db.example.com", port: 5432, ipFamily: "IPv4", assertions: [TcpAssertionBuilder.responseTime().lessThan(1000)], }, }) ``` ```ts Advanced Example theme={null} import { Frequency, TcpAssertionBuilder, TcpMonitor } from "checkly/constructs" new TcpMonitor("redis-tcp-1", { name: "Redis Service Check", description: "Verifies **Redis service** is reachable and responsive.", activated: true, frequency: Frequency.EVERY_5M, locations: ["us-east-1", "eu-west-1"], maxResponseTime: 3000, degradedResponseTime: 1500, tags: ["redis", "cache", "critical"], request: { hostname: "redis.example.com", port: 6379, ipFamily: "IPv4", data: "PING\r\n", assertions: [ TcpAssertionBuilder.responseTime().lessThan(500), TcpAssertionBuilder.responseData().contains("PONG"), ], }, }) ``` ## Configuration The TCP Monitoring configuration consists of specific TCP monitoring options and inherited general monitoring options. | Parameter | Type | Required | Default | Description | | ---------------------- | -------- | -------- | ------- | -------------------------------------------------------------- | | `request` | `object` | ✅ | - | TCP connection configuration object | | `degradedResponseTime` | `number` | ❌ | `4000` | Response time threshold in milliseconds for degraded status | | `maxResponseTime` | `number` | ❌ | `5000` | Maximum response time in milliseconds before marking as failed | | Property | Type | Required | Default | Description | | ----------------------- | ---------------------------------------- | -------- | ----------- | ----------------------------------------------------------------------- | | `name` | `string` | ✅ | - | Friendly name for your monitor | | `description` | `string` | ❌ | `null` | A description of the monitor. Supports markdown. Max 500 characters | | `activated` | `boolean` | ❌ | `true` | Whether the monitor is enabled | | `alertChannels` | `Array` | ❌ | `[]` | Array of AlertChannel objects for notifications | | `alertEscalationPolicy` | `AlertEscalationPolicy` | ❌ | - | Advanced alert escalation settings | | `frequency` | `Frequency` | ❌ | `EVERY_10M` | How often to run your monitor | | `group` | `CheckGroupV1` `CheckGroupV2` | ❌ | - | The CheckGroup this monitor belongs to | | `locations` | `string[]` | ❌ | `[]` | Array of public location codes | | `privateLocations` | `string[]` | ❌ | `[]` | Array of Private Location slugs | | `muted` | `boolean` | ❌ | `false` | Whether alert notifications are muted | | `tags` | `string[]` | ❌ | `[]` | Array of tags to organize monitors | | `testOnly` | `boolean` | ❌ | `false` | Only run with test, not during deploy | | `retryStrategy` | `RetryStrategy` | ❌ | - | Strategy for configuring retries | | `runParallel` | `boolean` | ❌ | `false` | Run monitors in parallel or round-robin | | `triggerIncident` | `IncidentTrigger` | ❌ | - | Create and resolve an incident based on the check's alert configuration | ### `TcpMonitor` Options TCP connection configuration that defines the hostname, port, and optional data to send. **Usage:** ```ts theme={null} new TcpMonitor("tcp-monitor", { name: "Database TCP Check", request: { hostname: "db.example.com", port: 5432, assertions: [TcpAssertionBuilder.responseTime().lessThan(1000)], }, }) ``` **Parameters:** | Parameter | Type | Required | Default | Description | | ------------ | ---------------- | -------- | -------- | --------------------------------------------------- | | `hostname` | `string` | ✅ | - | The hostname to connect to (without scheme or port) | | `port` | `number` | ✅ | - | The port number for the TCP connection | | `ipFamily` | `string` | ❌ | `'IPv4'` | IP family: `'IPv4'` \| `'IPv6'` | | `data` | `string` | ❌ | - | Data to send to the target host | | `assertions` | `TcpAssertion[]` | ❌ | `[]` | Response assertions using `TcpAssertionBuilder` | **Examples:** ```ts theme={null} new TcpMonitor("database-check", { name: "Database Connectivity", request: { hostname: "postgres.example.com", port: 5432, ipFamily: "IPv4", assertions: [TcpAssertionBuilder.responseTime().lessThan(1000)], }, }) ``` ```ts theme={null} new TcpMonitor("redis-ping", { name: "Redis PING Test", request: { hostname: "cache.example.com", port: 6379, data: "PING\r\n", assertions: [ TcpAssertionBuilder.responseTime().lessThan(500), TcpAssertionBuilder.responseData().contains("PONG"), ], }, }) ``` ```ts theme={null} new TcpMonitor("ipv6-service", { name: "IPv6 Service Check", request: { hostname: "2001:db8::1", port: 80, ipFamily: "IPv6", assertions: [TcpAssertionBuilder.responseTime().lessThan(2000)], }, }) ``` **Use cases**: Database connectivity, cache service monitoring, custom TCP service validation. Response time threshold in milliseconds for marking the monitor as degraded (warning state). Usage: ```ts highlight={3} theme={null} new TcpMonitor("tiered-monitoring", { name: "Tiered Monitoring", degradedResponseTime: 1000, // Warning at 1 second maxResponseTime: 3000, // Fail at 3 seconds request: { hostname: "service.example.com", port: 3306, }, }) ``` Examples: ```ts theme={null} // Progressive performance alerts new TcpMonitor("mysql-performance", { name: "MySQL Performance Monitoring", degradedResponseTime: 800, // Warn at 800ms maxResponseTime: 2000, // Fail at 2s request: { hostname: "mysql.example.com", port: 3306, assertions: [TcpAssertionBuilder.responseTime().lessThan(2000)], }, }) ``` **Use cases**: Early performance warnings, gradual degradation detection. Maximum response time in milliseconds before the monitor is marked as failed. Usage: ```ts highlight={3} theme={null} new TcpMonitor("fast-db", { name: "Fast DB Connection", maxResponseTime: 2000, // 2 seconds max request: { hostname: "fast-db.example.com", port: 5432, }, }) ``` Examples: ```ts theme={null} // Low-latency database requirement new TcpMonitor("performance-db", { name: "Performance Database", maxResponseTime: 1000, // Fail at 1 second degradedResponseTime: 500, // Warning at 500ms request: { hostname: "db.example.com", port: 5432, }, }) // Service with higher tolerance new TcpMonitor("batch-service", { name: "Batch Processing Service", maxResponseTime: 10000, // 10 seconds request: { hostname: "batch.example.com", port: 8080, }, }) ``` **Use cases**: Performance monitoring, SLA compliance, connection timeout management. ### `TcpMonitor` Assertions To define `assertions` for the `request` of an `TcpMonitor` you should use the `TcpAssertionBuilder`. The following sources are available for TCP monitor assertions: * `responseTime()`: Assert the total response time of the TCP request * `responseData()`: Assert the value in the response data Here are some examples: * Assert the total response time of the TCP request ```ts theme={null} TcpAssertionBuilder.responseTime().lessThan(1000), // Equivalent to: { source: 'RESPONSE_TIME', comparison: 'LESS_THAN', target: '1000' } ``` * Asserting the value in the response ```ts theme={null} TcpAssertionBuilder.responseData().contains('ping') // Equivalent to: { source: 'RESPONSE_DATA', comparison: 'CONTAINS', target: 'ping' } ``` Learn more in our docs on [Assertions](/docs/detect/assertions). ### General Monitor Options Friendly name for your TCP monitor that will be displayed in the Checkly dashboard and used in notifications. Usage: ```ts highlight={2} theme={null} new TcpMonitor('my-tcp-monitor', { name: 'Database Connection Monitor' /* More options ... */ }) ``` How often the TCP monitor should run. Use the `Frequency` enum to set the check interval. Usage: ```ts highlight={4} theme={null} import { Frequency } from 'checkly/constructs' new TcpMonitor("my-monitor", { frequency: Frequency.EVERY_2M, /* More options ... */ }) ``` Examples: ```ts theme={null} // Database connectivity (high frequency) new TcpMonitor("critical-db", { name: "Critical Database", frequency: Frequency.EVERY_1M, // Every minute /* More options ... */ }) ``` ```ts theme={null} // Application service (standard frequency) new TcpMonitor("app-service", { name: "Application Service", frequency: Frequency.EVERY_5M, // Every 5 minutes /* More options ... */ }) ``` ```ts theme={null} // Background service (low frequency) new TcpMonitor("background-service", { name: "Background Processing", frequency: Frequency.EVERY_15M, // Every 15 minutes /* More options ... */ }) ``` **Available frequencies**: `EVERY_10S`, `EVERY_20S`, `EVERY_30S`, `EVERY_1M`, `EVERY_2M`, `EVERY_5M`, `EVERY_10M`, `EVERY_15M`, `EVERY_30M`, `EVERY_1H`, `EVERY_2H`, `EVERY_3H`, `EVERY_6H`, `EVERY_12H`, `EVERY_24H` Array of public location codes where the TCP monitor should run from. Multiple locations provide geographic coverage. Usage: ```ts highlight={2} theme={null} new TcpMonitor('global-monitor', { locations: ['us-east-1', 'eu-west-1', 'ap-southeast-1'] }) ``` Examples: ```ts theme={null} // Database replication monitoring new TcpMonitor("global-db", { name: "Global Database Connectivity", frequency: Frequency.EVERY_2M, locations: [ "us-east-1", // N. Virginia "eu-west-1", // Ireland "ap-southeast-1", // Singapore ], request: { hostname: "db.example.com", port: 5432, }, }) ``` ```ts theme={null} // Regional service monitoring new TcpMonitor("eu-service", { name: "European Service Monitor", frequency: Frequency.EVERY_5M, locations: ["eu-west-1", "eu-central-1"], request: { hostname: "db.example.com", port: 5432, }, }) ``` **Use cases**: Global connectivity testing, regional service monitoring, network latency analysis. Whether the TCP monitor is enabled and will run according to its schedule. Usage: ```ts highlight={2} theme={null} new TcpMonitor('my-monitor', { activated: false // Disabled monitor }) ``` Examples: ```ts theme={null} // Temporarily disable a monitor new TcpMonitor("maintenance-db", { name: "Database Under Maintenance", activated: false, request: { hostname: "maint-db.example.com", port: 5432, }, }) ``` ## Examples ```ts theme={null} new TcpMonitor("postgres-check", { name: "PostgreSQL Connection", frequency: Frequency.EVERY_5M, maxResponseTime: 5000, degradedResponseTime: 2000, tags: ["database", "postgres"], request: { hostname: "db.example.com", port: 5432, assertions: [TcpAssertionBuilder.responseTime().lessThan(1000)], }, }) ``` ```ts theme={null} new TcpMonitor("redis-check", { name: "Redis Connectivity", frequency: Frequency.EVERY_2M, maxResponseTime: 2000, degradedResponseTime: 1000, tags: ["cache", "redis"], request: { hostname: "cache.example.com", port: 6379, data: "PING\r\n", assertions: [ TcpAssertionBuilder.responseTime().lessThan(500), TcpAssertionBuilder.responseData().contains("PONG"), ], }, }) ``` ```ts theme={null} new TcpMonitor("smtp-check", { name: "SMTP Server Check", frequency: Frequency.EVERY_10M, maxResponseTime: 10000, degradedResponseTime: 5000, tags: ["email", "smtp"], request: { hostname: "mail.example.com", port: 587, assertions: [ TcpAssertionBuilder.responseTime().lessThan(3000), TcpAssertionBuilder.responseData().contains("220"), ], }, }) ``` ```ts theme={null} new TcpMonitor("ssh-check", { name: "SSH Connectivity", frequency: Frequency.EVERY_15M, maxResponseTime: 5000, degradedResponseTime: 2000, tags: ["ssh", "server"], request: { hostname: "server.example.com", port: 22, assertions: [ TcpAssertionBuilder.responseTime().lessThan(1000), TcpAssertionBuilder.responseData().contains("SSH"), ], }, }) ``` ```ts theme={null} new TcpMonitor("app-port-check", { name: "Custom Application Port", frequency: Frequency.EVERY_5M, maxResponseTime: 3000, degradedResponseTime: 1500, tags: ["application", "custom-port"], request: { hostname: "app.example.com", port: 8080, data: "HEALTH\n", assertions: [ TcpAssertionBuilder.responseTime().lessThan(1000), TcpAssertionBuilder.responseData().contains("OK"), ], }, }) ``` ```ts theme={null} new TcpMonitor("blocked-port-check", { name: "Verify Port is Blocked", frequency: Frequency.EVERY_30M, maxResponseTime: 5000, degradedResponseTime: 2000, tags: ["security", "firewall"], request: { hostname: "secure.example.com", port: 23, // Telnet port that should be blocked assertions: [TcpAssertionBuilder.responseTime().lessThan(5000)], }, }) ``` When sending data to services, ensure you use proper protocol formatting. For example, Redis commands should end with `\r\n`. # TelegramAlertChannel Construct Source: https://www.checklyhq.com/docs/constructs/telegram-alert-channel Learn how to configure Telegram alert channels and forum topics with the Checkly CLI. For general information about alerting, see our docs on [the Telegram integration](/docs/integrations/alerts/telegram) and [alerting with Checkly](/docs/communicate/alerts/overview/). Sends alerts to a Telegram channel. ```ts Basic Example theme={null} import { TelegramAlertChannel } from 'checkly/constructs' const telegramChannel = new TelegramAlertChannel('my-telegramchannel-1', { name: 'My Telegram channel', apiKey: 'xxxxxx', chatId: 'xxxxxx' }) ``` ```ts Advanced Example theme={null} import { TelegramAlertChannel } from 'checkly/constructs' const telegramChannel = new TelegramAlertChannel('my-telegramchannel-1', { name: 'My Telegram channel', apiKey: 'xxxxxx', chatId: 'xxxxxx', messageThreadId: '42', sendRecovery: true, sendFailure: true, sendDegraded: true, sslExpiry: true, sslExpiryThreshold: 30, }) ``` `messageThreadId` requires Checkly CLI 8.18.0 or later. If you need to reference existing alert channels that were created outside of your CLI project, use [`fromId()`](/docs/constructs/alert-channel#using-fromid-to-reference-an-existing-channel). ## Configuration ### Telegram Alert Channel Options Friendly name to recognise the integration. The API key associated with your Telegram bot. The chat ID of the Telegram channel you want to send alerts to. The positive integer Message Thread ID of a Telegram forum topic. Use it together with `chatId` to send alerts to a specific topic. The message sent to the chat when an alert is triggered. If this is not specified, we'll send a default payload with some basic information about the alert. We have [handlebar helpers and variables](/docs/integrations/alerts/webhooks/#using-variables) available for building custom payloads. ```ts highlight={5-16} theme={null} new TelegramAlertChannel('my-telegramchannel-1', { name: 'My Telegram channel', apiKey: 'xxxxxx', chatId: 'xxxxxx', payload: ` {{ALERT_TITLE}} at {{RUN_LOCATION}} ({{RESPONSE_TIME}}ms) {{#if AI_ANALYSIS_CLASSIFICATION}} AI Analysis: {{AI_ANALYSIS_CLASSIFICATION}} {{AI_ANALYSIS_ROOT_CAUSE}} Read full analysis {{/if}} Tags: {{#each TAGS}} {{this}} {{#unless @last}},{{/unless}} {{/each}} View check result ` }) ``` ### General Alert Channel Options These options are valid for all alert channels types. Whether to send notifications when checks recover from a [failed or degraded state](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [fail](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [become degraded](/docs/communicate/alerts/overview/#alert-channels). Default value is `false`. Whether to send notifications when a SSL/TLS certificate is about to expire. Default value is `false`. ```ts highlight={3} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) Number of days before the SSL/TLS certificate expiry date to send notifications. Only relevant when `sslExpiry` is enabled. Default value is `30`. ```ts highlight={4} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) # TracerouteMonitor Construct Source: https://www.checklyhq.com/docs/constructs/traceroute-monitor Learn how to configure Traceroute monitors with the Checkly CLI. Learn more about Traceroute Monitors in [the Traceroute monitor overview](/docs/detect/uptime-monitoring/traceroute-monitors/overview). Traceroute monitors map the network path to a host hop-by-hop, measuring per-hop latency and packet loss, and detecting whether the destination is reached. Use them to monitor path stability and catch routing issues before they affect your users. Before creating Traceroute Monitors, ensure you have: * An initialized Checkly CLI project * A hostname or IP address you want to trace * Basic understanding of network tracing (traceroute / tracert) For additional setup information, see [CLI overview](/docs/cli/overview). ```ts Basic Example theme={null} import { Frequency, TracerouteMonitor } from "checkly/constructs" new TracerouteMonitor('traceroute-api', { name: 'API Gateway Network Path', description: "Maps the network path to `api.example.com` to detect routing changes.", frequency: Frequency.EVERY_5M, request: { url: 'api.example.com', }, }) ``` ```ts Advanced Example theme={null} import { Frequency, TracerouteAssertionBuilder, TracerouteMonitor } from "checkly/constructs" new TracerouteMonitor('traceroute-db', { name: 'Database Routing Monitor', description: "Traces path to `db.example.com` with strict latency and hop assertions.", activated: true, frequency: Frequency.EVERY_10M, locations: ['us-east-1', 'eu-central-1'], degradedResponseTime: 10000, maxResponseTime: 20000, request: { url: 'db.example.com', protocol: 'TCP', port: 5432, ipFamily: 'IPv4', maxHops: 20, maxUnknownHops: 10, ptrLookup: true, timeout: 15, assertions: [ TracerouteAssertionBuilder.hopCount().lessThan(15), TracerouteAssertionBuilder.responseTime('avg').lessThan(50), TracerouteAssertionBuilder.packetLoss().lessThan(5), ], }, }) ``` ## Configuration Traceroute monitors have their own probe-specific settings, plus the standard monitor options shared across all check types. | Parameter | Type | Required | Default | Description | | ---------------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------- | | `request` | `object` | ✅ | - | Traceroute request configuration object | | `degradedResponseTime` | `number` | ❌ | `10000` | Final-hop avg RTT in milliseconds at which the monitor is marked as degraded | | `maxResponseTime` | `number` | ❌ | `20000` | Final-hop avg RTT in milliseconds at which the monitor is marked as failed | | Property | Type | Required | Default | Description | | ----------------------- | ---------------------------------------- | -------- | ----------- | ----------------------------------------------------------------------- | | `name` | `string` | ✅ | - | Friendly name for your monitor | | `description` | `string` | ❌ | `null` | A description of the monitor. Supports markdown. Max 500 characters | | `activated` | `boolean` | ❌ | `true` | Whether the monitor is enabled | | `alertChannels` | `Array` | ❌ | `[]` | Array of AlertChannel objects for notifications | | `alertEscalationPolicy` | `AlertEscalationPolicy` | ❌ | - | Advanced alert escalation settings | | `frequency` | `Frequency` | ❌ | `EVERY_10M` | How often to run your monitor | | `group` | `CheckGroupV1` `CheckGroupV2` | ❌ | - | The CheckGroup this monitor belongs to | | `locations` | `string[]` | ❌ | `[]` | Array of public location codes | | `privateLocations` | `string[]` | ❌ | `[]` | Array of Private Location slugs | | `muted` | `boolean` | ❌ | `false` | Whether alert notifications are muted | | `tags` | `string[]` | ❌ | `[]` | Array of tags to organize monitors | | `testOnly` | `boolean` | ❌ | `false` | Only run with test, not during deploy | | `retryStrategy` | `RetryStrategy` | ❌ | - | Strategy for configuring retries | | `runParallel` | `boolean` | ❌ | `false` | Run monitors in parallel or round-robin | | `triggerIncident` | `IncidentTrigger` | ❌ | - | Create and resolve an incident based on the check's alert configuration | ### `TracerouteMonitor` Options Traceroute request configuration, including probe protocol, target host, and response validation. **Usage:** ```ts theme={null} new TracerouteMonitor('traceroute-monitor', { name: 'Network Path Monitor', request: { url: 'api.example.com', protocol: 'TCP', port: 443, assertions: [ TracerouteAssertionBuilder.hopCount().lessThan(20), ], }, }) ``` **Parameters:** | Parameter | Type | Required | Default | Description | | ---------------- | ----------------------- | -------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `url` | `string` | ✅ | - | Target hostname or IP address. Do not include a scheme or port | | `protocol` | `string` | ❌ | `'TCP'` | Probe protocol: `'TCP'` \| `'UDP'` \| `'ICMP'` \| `'SCTP'` | | `port` | `number` | ❌ | `443` (TCP) / `33434` (UDP, SCTP) | Destination port (1–65535). Defaults to `443` for TCP and to `33434` — a high, typically closed port — for UDP/SCTP, so the destination returns ICMP Destination Unreachable to confirm arrival. Ignored (and not sent) when `protocol` is `'ICMP'` | | `ipFamily` | `string` | ❌ | `'IPv4'` | IP family: `'IPv4'` \| `'IPv6'` | | `maxHops` | `number` | ❌ | `30` | Maximum hops to probe (1–64) | | `maxUnknownHops` | `number` | ❌ | `15` | Maximum consecutive unresponsive hops before stopping (1–30) | | `ptrLookup` | `boolean` | ❌ | `true` | Perform reverse-DNS (PTR) lookups on hop IPs | | `timeout` | `number` | ❌ | `10` | Seconds to wait for the trace to complete (1–30) | | `assertions` | `TracerouteAssertion[]` | ❌ | `[]` | Response assertions using `TracerouteAssertionBuilder` | Final-hop average RTT in milliseconds at which the monitor is marked as degraded (warning state). Maximum: 30,000. **Usage:** ```ts highlight={3} theme={null} new TracerouteMonitor("traceroute-latency-tiers", { name: "API Network Path", degradedResponseTime: 5000, // Warn when final-hop avg RTT exceeds 5 seconds request: { url: 'api.example.com', }, }) ``` Final-hop average RTT in milliseconds at which the monitor is marked as failed. Maximum: 30,000. **Usage:** ```ts highlight={3} theme={null} new TracerouteMonitor("traceroute-latency-tiers", { name: "API Network Path", maxResponseTime: 15000, // Fail when final-hop avg RTT exceeds 15 seconds request: { url: 'api.example.com', }, }) ``` ### `TracerouteMonitor` Assertions Assertions for Traceroute monitors are defined using the `TracerouteAssertionBuilder`. The following sources are available: * `responseTime(property?)`: Validate RTT at the final responding hop. Pass `'avg'`, `'min'`, `'max'`, or `'stdDev'` as the argument to target a specific statistic; when omitted, it defaults to `'avg'`. This assertion fails when `destinationReached` is `false` * `hopCount()`: Assert against the total number of hops recorded in the trace * `packetLoss()`: Assert against the packet loss percentage at the last recorded hop (0–100) Here are some examples: * Assert that the average final-hop latency is below a threshold (default property is `avg`): ```ts theme={null} TracerouteAssertionBuilder.responseTime().lessThan(100) // Equivalent to: { source: 'RESPONSE_TIME', property: 'avg', comparison: 'LESS_THAN', target: '100' } ``` * Assert against a specific RTT property: ```ts theme={null} TracerouteAssertionBuilder.responseTime('max').lessThan(200) // Equivalent to: { source: 'RESPONSE_TIME', property: 'max', comparison: 'LESS_THAN', target: '200' } ``` * Assert on the number of hops: ```ts theme={null} TracerouteAssertionBuilder.hopCount().lessThan(15) // Equivalent to: { source: 'HOP_COUNT', comparison: 'LESS_THAN', target: '15' } ``` * Assert on packet loss at the last hop: ```ts theme={null} TracerouteAssertionBuilder.packetLoss().lessThan(10) // Equivalent to: { source: 'PACKET_LOSS', comparison: 'LESS_THAN', target: '10' } ``` Learn more in our docs on [Assertions](/docs/detect/assertions). ### General Monitor Options Friendly name for your Traceroute Monitor that will be displayed in the Checkly dashboard and used in notifications. **Usage:** ```ts highlight={2} theme={null} new TracerouteMonitor("my-traceroute", { name: "API Gateway Network Path", /* More options ... */ }) ``` How often the Traceroute Monitor should run. Use the `Frequency` enum to set the check interval. **Usage:** ```ts highlight={3} theme={null} new TracerouteMonitor("my-traceroute", { name: "API Gateway Network Path", frequency: Frequency.EVERY_5M, /* More options ... */ }) ``` **Available frequencies**: `EVERY_30S`, `EVERY_1M`, `EVERY_2M`, `EVERY_5M`, `EVERY_10M`, `EVERY_15M`, `EVERY_30M`, `EVERY_1H`, `EVERY_2H`, `EVERY_3H`, `EVERY_6H`, `EVERY_12H`, `EVERY_24H`. Traceroute monitors do not support sub-30-second frequencies (`EVERY_10S` / `EVERY_20S`). Array of [public location codes](/docs/concepts/locations/#public-locations) where the Traceroute Monitor should run from. Use `privateLocations` for [private locations](/docs/platform/private-locations/overview). Multiple locations help detect regional routing differences. **Usage:** ```ts highlight={3} theme={null} new TracerouteMonitor("global-path-monitor", { name: "API Path from Multiple Regions", locations: ["us-east-1", "eu-central-1", "ap-southeast-1"], request: { url: 'api.example.com', }, }) ``` Whether the Traceroute Monitor is enabled and will run according to its schedule. **Usage:** ```ts highlight={3} theme={null} new TracerouteMonitor("my-traceroute", { name: "API Gateway Network Path", activated: false, // Disabled monitor request: { url: 'api.example.com', }, }) ``` # UrlMonitor Construct Source: https://www.checklyhq.com/docs/constructs/url-monitor Learn how to configure URL monitors with the Checkly CLI. Learn more about URL Monitors in [the URL monitor overview](/docs/detect/uptime-monitoring/url-monitors/overview). Use URL Monitors to track basic availability and HTTP status codes of your services and websites. The examples below show how to configure monitoring for different types of HTTP endpoints. Before creating URL Monitors, ensure you have: * An initialized Checkly CLI project * URLs or HTTP endpoints you want to monitor * Understanding of HTTP status codes and response behavior * Network access to the URLs you want to monitor For additional setup information, see [CLI overview](/docs/cli/overview). ```ts Basic Example theme={null} import { Frequency, UrlAssertionBuilder, UrlMonitor } from "checkly/constructs" new UrlMonitor("url-monitor", { name: "Url Monitor", description: "[httpbin.org/get](https://httpbin.org/get) should return **200** status code.", activated: true, maxResponseTime: 10000, degradedResponseTime: 5000, frequency: Frequency.EVERY_5M, request: { url: "https://httpbin.org/get", assertions: [UrlAssertionBuilder.statusCode().equals(200)], }, }) ``` ```ts Advanced Example theme={null} import { Frequency, UrlAssertionBuilder, UrlMonitor } from "checkly/constructs" new UrlMonitor("advanced-url-monitor", { name: "Advanced URL Monitor", description: "**API health check** returns 200.", activated: true, frequency: Frequency.EVERY_5M, locations: ["us-east-1", "eu-west-1"], maxResponseTime: 5000, degradedResponseTime: 2000, tags: ["api", "production", "critical"], request: { url: "https://api.example.com/health", skipSSL: false, followRedirects: true, assertions: [UrlAssertionBuilder.statusCode().equals(200)], }, }) ``` ## Configuration The URL Monitoring configuration consists of specific URL monitoring options and inherited general monitoring options. | Parameter | Type | Required | Default | Description | | ---------------------- | --------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | `object` | ✅ | - | HTTP request configuration object | | `degradedResponseTime` | `number` | ❌ | `3000` | Response time threshold in milliseconds for degraded status | | `maxResponseTime` | `number` | ❌ | `5000` | Maximum response time in milliseconds before marking as failed | | `shouldFail` | `boolean` | ❌ | false | Treat HTTP error codes (4xx and 5xx) as passed. Please note that successful responses still pass. Only failed assertions will cause the check to fail. | | Property | Type | Required | Default | Description | | ----------------------- | ---------------------------------------- | -------- | ----------- | ----------------------------------------------------------------------- | | `name` | `string` | ✅ | - | Friendly name for your monitor | | `description` | `string` | ❌ | `null` | A description of the monitor. Supports markdown. Max 500 characters | | `activated` | `boolean` | ❌ | `true` | Whether the monitor is enabled | | `alertChannels` | `Array` | ❌ | `[]` | Array of AlertChannel objects for notifications | | `alertEscalationPolicy` | `AlertEscalationPolicy` | ❌ | - | Advanced alert escalation settings | | `frequency` | `Frequency` | ❌ | `EVERY_10M` | How often to run your monitor | | `group` | `CheckGroupV1` `CheckGroupV2` | ❌ | - | The CheckGroup this monitor belongs to | | `locations` | `string[]` | ❌ | `[]` | Array of public location codes | | `privateLocations` | `string[]` | ❌ | `[]` | Array of Private Location slugs | | `muted` | `boolean` | ❌ | `false` | Whether alert notifications are muted | | `tags` | `string[]` | ❌ | `[]` | Array of tags to organize monitors | | `testOnly` | `boolean` | ❌ | `false` | Only run with test, not during deploy | | `retryStrategy` | `RetryStrategy` | ❌ | - | Strategy for configuring retries | | `runParallel` | `boolean` | ❌ | `false` | Run monitors in parallel or round-robin | | `triggerIncident` | `IncidentTrigger` | ❌ | - | Create and resolve an incident based on the check's alert configuration | ### `UrlMonitor` Options HTTP request configuration that defines the URL to monitor and how to handle the request. **Usage:** ```ts theme={null} new UrlMonitor("url-monitor", { request: { url: "https://example.com", followRedirects: true, assertions: [ UrlAssertionBuilder.statusCode().equals(200) ] } }) ``` **Parameters:** | Parameter | Type | Required | Default | Description | | ----------------- | ---------------- | -------- | ------- | ----------------------------------------------- | | `url` | `string` | ✅ | - | The HTTP(S) URL to monitor | | `followRedirects` | `boolean` | ❌ | `true` | Whether to automatically follow 30x redirects | | `ipFamily` | `IPFamily` | ❌ | `IPv4` | IP family version to use for the connection | | `skipSSL` | `boolean` | ❌ | `false` | Whether to skip validation of SSL certificates | | `assertions` | `UrlAssertion[]` | ❌ | `[]` | Response assertions using `UrlAssertionBuilder` | **Examples:** ```ts theme={null} new UrlMonitor('website-check', { name: 'Website Availability', request: { url: 'https://example.com', followRedirects: true, assertions: [ UrlAssertionBuilder.statusCode().equals(200) ] } }) ``` ```ts theme={null} new UrlMonitor("api-health", { name: "API Health Check", request: { url: "https://api.example.com/health", followRedirects: false, skipSSL: false, assertions: [UrlAssertionBuilder.statusCode().equals(200)], }, }) ``` ```ts theme={null} new UrlMonitor("dev-endpoint", { name: "Development Environment", request: { url: "https://dev.example.com", followRedirects: true, skipSSL: true, // Skip SSL for dev environment assertions: [UrlAssertionBuilder.statusCode().equals(200)], }, }) ``` **Use cases**: Website availability, API health checks, service uptime monitoring. Response time threshold in milliseconds for marking the monitor as degraded (warning state). **Usage:** ```ts highlight={4} theme={null} // Progressive performance monitoring new UrlMonitor("performance-tiers", { name: "Website Performance Tiers", degradedResponseTime: 1500, // Warn at 1.5s maxResponseTime: 3000, // Fail at 3s request: { url: "https://example.com", assertions: [UrlAssertionBuilder.statusCode().equals(200)], }, }) ``` **Use cases**: Early performance warnings, gradual degradation detection. Maximum response time in milliseconds before the monitor is marked as failed. **Usage:** ```ts highlight={3} theme={null} new UrlMonitor("fast-site", { name: "Fast site", maxResponseTime: 3000, // 3 seconds max request: { url: "https://fast.example.com", }, }) ``` **Examples:** ```ts theme={null} // Fast website requirement new UrlMonitor("performance-critical", { name: "Performance Critical Site", maxResponseTime: 1000, // Fail at 1 second degradedResponseTime: 500, // Warning at 500ms request: { url: "https://critical.example.com", }, }) // API with reasonable timeout new UrlMonitor("api-timeout", { name: "API with Timeout", maxResponseTime: 10000, // 10 seconds request: { url: "https://api.example.com/slow-operation", }, }) ``` **Use cases**: Performance monitoring, SLA compliance, user experience optimization. ### `UrlMonitor` Assertions To define `assertions` for the `request` of an `UrlMonitor` you should use the `UrlAssertionBuilder`. The following source is available for URL monitor assertions: * `statusCode()`: Assert the HTTP status code for the HTTP response, e.g. 200 or 201 Here is an example: * Assert the status code of a HTTP request ```ts theme={null} UrlAssertionBuilder.statusCode().equals(200) // Equivalent to: { source: 'STATUS_CODE', comparison: 'EQUALS', target: '200' } ``` ```ts theme={null} UrlAssertionBuilder.statusCode().lessThan(300) // Equivalent to: { source: 'STATUS_CODE', comparison: 'LESS_THAN', target: '300' } ``` Learn more in our docs on [Assertions](/docs/detect/assertions). ### General Monitor Options Friendly name for your URL monitor that will be displayed in the Checkly dashboard and used in notifications. **Usage:** ```ts highlight={2} theme={null} new UrlMonitor("my-monitor", { name: "Website Uptime Monitor", /* More options ... */ }) ``` How often the URL monitor should run. Use the `Frequency` enum to set the check interval. **Usage:** ```ts highlight={2} theme={null} new UrlMonitor("my-monitor", { frequency: Frequency.EVERY_1M, /* More options ... */ }) ``` **Examples:** ```ts theme={null} // Critical service monitoring new UrlMonitor("critical-service", { name: "Critical Service Uptime", frequency: Frequency.EVERY_30S, // Every 30 seconds maxResponseTime: 2000 }) ``` ```ts theme={null} // Regular website monitoring new UrlMonitor("website-monitor", { name: "Website Availability", frequency: Frequency.EVERY_5M, // Every 5 minutes maxResponseTime: 5000 }) ``` ```ts theme={null} // Background service monitoring new UrlMonitor("background-service", { name: "Background Service Health", frequency: Frequency.EVERY_30M, // Every 30 minutes maxResponseTime: 10000 }) ``` **Available frequencies**: `EVERY_10S`, `EVERY_20S`, `EVERY_30S`, `EVERY_1M`, `EVERY_2M`, `EVERY_5M`, `EVERY_10M`, `EVERY_15M`, `EVERY_30M`, `EVERY_1H`, `EVERY_2H`, `EVERY_3H`, `EVERY_6H`, `EVERY_12H`, `EVERY_24H` Array of public location codes where the URL monitor should run from. Multiple locations provide geographic coverage. **Usage:** ```ts highlight={2} theme={null} new UrlMonitor("global-monitor", { locations: ["us-east-1", "eu-west-1", "ap-southeast-1"] }) ``` **Examples:** ```ts theme={null} // Worldwide monitoring new UrlMonitor("global-website", { name: "Global Website Monitoring", frequency: Frequency.EVERY_2M, locations: [ "us-east-1", // N. Virginia "us-west-1", // N. California "eu-west-1", // Ireland "ap-southeast-1", // Singapore "ap-northeast-1" // Tokyo ], maxResponseTime: 5000 }) ``` ```ts theme={null} // European users focus new UrlMonitor("eu-service", { name: "European Service Monitor", frequency: Frequency.EVERY_1M, locations: ["eu-west-1", "eu-central-1"] }) ``` **Use cases**: Global performance monitoring, regional compliance, CDN performance validation. Whether the URL monitor is enabled and will run according to its schedule. **Usage:** ```ts highlight={2} theme={null} new UrlMonitor("my-monitor", { activated: false // Disabled monitor }) ``` **Examples:** ```ts theme={null} // Temporarily disable a monitor new UrlMonitor("maintenance-site", { name: "Site Under Maintenance", activated: false, request: { url: "https://maintenance.example.com" } }) ``` ## Examples ```ts theme={null} new UrlMonitor("website-availability", { name: "Main Website Availability", frequency: Frequency.EVERY_1M, locations: ["us-east-1", "eu-west-1", "ap-southeast-1"], maxResponseTime: 3000, degradedResponseTime: 1500, tags: ["website", "critical"], request: { url: "https://example.com", followRedirects: true, skipSSL: false, assertions: [UrlAssertionBuilder.statusCode().equals(200)], }, }) ``` ```ts theme={null} new UrlMonitor("api-health-check", { name: "API Health Endpoint", frequency: Frequency.EVERY_30S, locations: ["us-east-1", "eu-west-1"], maxResponseTime: 2000, degradedResponseTime: 1000, tags: ["api", "health", "critical"], request: { url: "https://api.example.com/health", followRedirects: false, assertions: [ UrlAssertionBuilder.statusCode().equals(200) ] } }) ``` ```ts theme={null} new UrlMonitor("cdn-performance", { name: "CDN Asset Performance", frequency: Frequency.EVERY_5M, locations: ["us-east-1", "eu-west-1", "ap-southeast-1"], maxResponseTime: 5000, degradedResponseTime: 2000, tags: ["cdn", "assets", "performance"], request: { url: "https://cdn.example.com/assets/main.css", followRedirects: true, assertions: [UrlAssertionBuilder.statusCode().equals(200)], }, }) ``` ```ts theme={null} new UrlMonitor("redirect-chain", { name: "Redirect Chain Monitor", frequency: Frequency.EVERY_10M, maxResponseTime: 4000, degradedResponseTime: 2000, tags: ["redirects", "seo"], request: { url: "https://old.example.com/page", followRedirects: true, assertions: [ UrlAssertionBuilder.statusCode().equals(200) ] } }) ``` ```ts theme={null} new UrlMonitor("ssl-certificate-check", { name: "SSL Certificate Validity", frequency: Frequency.EVERY_1H, locations: ["us-east-1"], maxResponseTime: 10000, degradedResponseTime: 5000, tags: ["ssl", "security"], request: { url: "https://secure.example.com", followRedirects: false, skipSSL: false, // Ensure SSL validation assertions: [UrlAssertionBuilder.statusCode().equals(200)], }, }) ``` ```ts theme={null} new UrlMonitor("maintenance-page", { name: "Maintenance Page Check", frequency: Frequency.EVERY_5M, maxResponseTime: 3000, degradedResponseTime: 1500, tags: ["maintenance", "status"], request: { url: "https://status.example.com", followRedirects: true, assertions: [ // Accept both 200 (normal) and 503 (maintenance) UrlAssertionBuilder.statusCode().between(200, 200), UrlAssertionBuilder.statusCode().between(503, 503) ] } }) ``` URL monitors only support status code assertions. For more complex assertions on response bodies, headers, or response time, use [API checks](/docs/constructs/api-check) instead. When `skipSSL` is set to `true`, SSL certificate validation is bypassed. Use this only for testing environments or when monitoring services with self-signed certificates. # WebhookAlertChannel Construct Source: https://www.checklyhq.com/docs/constructs/webhook-alert-channel Learn how to configure webhook alert channels with the Checkly CLI. For general information about alerting, see our docs on [webhook alerts](/docs/integrations/alerts/webhooks) and [alerting with Checkly](/docs/communicate/alerts/overview/). Sends alert notifications as HTTP requests to any URL. This is the most flexible alert channel type, allowing integration with any service that accepts webhooks. You can customize the payload with our [Handlebars-style variables and helpers](/docs/integrations/alerts/webhooks#using-variables). ```ts Basic Example theme={null} import { WebhookAlertChannel } from "checkly/constructs" const webhookChannel = new WebhookAlertChannel("webhook-channel-1", { name: "Basic Webhook", method: "POST", url: new URL("https://api.example.com/webhooks/checkly"), template: JSON.stringify({ message: "Check {{ALERT_TITLE}} is {{ALERT_TYPE}}", timestamp: "{{STARTED_AT}}", }), }) ``` ```ts Advanced Example theme={null} import { WebhookAlertChannel } from 'checkly/constructs' const webhookChannel = new WebhookAlertChannel('webhook-channel-1', { name: 'Pushover webhook', method: 'POST', url: new URL('https://api.pushover.net/1/messages.json'), headers: [{ key: 'X-My-Header', value: 'myToken' }], queryParameters: [{ key: 'source', value: 'checkly' }], template: `{ "token":"FILL_IN_YOUR_SECRET_TOKEN_FROM_PUSHOVER", "user":"FILL_IN_YOUR_USER_FROM_PUSHOVER", "title":"{{ALERT_TITLE}}", "html":1, "priority":2, "retry":30, "expire":10800, "message":"{{ALERT_TYPE}} {{STARTED_AT}} ({{RESPONSE_TIME}}ms) {{RESULT_LINK}}" }`, sendRecovery: true, sendFailure: true, sendDegraded: true, sslExpiry: true, sslExpiryThreshold: 30, }) ``` If you need to reference existing alert channels that were created outside of your CLI project, use [`fromId()`](/docs/constructs/alert-channel#using-fromid-to-reference-an-existing-channel). ## Configuration ### Webhook Alert Channel Options Target URL for the webhook request. ```ts highlight={4} theme={null} new WebhookAlertChannel('webhook-channel-1', { name: 'Pushover webhook', method: 'POST', url: new URL('https://api.pushover.net/1/messages.json'), }) ``` The HTTP method, either `GET`, `POST`, `PUT`, `PATCH`, `HEAD` or `DELETE`. Friendly name for the webhook channel. The request body template, usually JSON. You can use [Handlebars-style template variables](/docs/integrations/alerts/webhooks#using-variables) to further customize the template. ```ts highlight={5-14} theme={null} new WebhookAlertChannel('webhook-channel-1', { name: 'Pushover webhook', method: 'POST', url: new URL('https://api.pushover.net/1/messages.json'), template: `{ "token":"FILL_IN_YOUR_SECRET_TOKEN_FROM_PUSHOVER", "user":"FILL_IN_YOUR_USER_FROM_PUSHOVER", "title":"{{ALERT_TITLE}}", "html":1, "priority":2, "retry":30, "expire":10800, "message":"{{ALERT_TYPE}} {{STARTED_AT}} ({{RESPONSE_TIME}}ms) {{RESULT_LINK}}" }` }) ``` An array of `{ key, value }` objects to define HTTP headers. ```ts highlight={5} theme={null} new WebhookAlertChannel('webhook-channel-1', { name: 'Pushover webhook', method: 'POST', url: new URL('https://api.pushover.net/1/messages.json'), headers: [{ key: 'X-My-Header', value: '123' }], }) ``` An array of `{ key, value }` objects to define query parameters. ```ts highlight={5} theme={null} new WebhookAlertChannel('webhook-channel-1', { name: 'Pushover webhook', method: 'POST', url: new URL('https://api.pushover.net/1/messages.json'), queryParameters: [{ key: 'my-param', value: '123' }], }) ``` Secret token that you can use to validate the authenticity of the webhook and its payload. [Learn more about webhook secrets.](/docs/integrations/alerts/webhooks#webhook-secrets) ### General Alert Channel Options These options are valid for all alert channels types. Whether to send notifications when checks recover from a [failed or degraded state](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [fail](/docs/communicate/alerts/overview/#alert-channels). Default value is `true`. Whether to send notifications when checks [become degraded](/docs/communicate/alerts/overview/#alert-channels). Default value is `false`. Whether to send notifications when a SSL/TLS certificate is about to expire. Default value is `false`. ```ts highlight={3} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) Number of days before the SSL/TLS certificate expiry date to send notifications. Only relevant when `sslExpiry` is enabled. Default value is `30`. ```ts highlight={4} theme={null} new EmailAlertChannel("email-channel-1", { address: "alerts@acme.com", sslExpiry: true, sslExpiryThreshold: 30, // Alert 30 days before expiry }) ``` [Learn more about SSL alerts.](/docs/communicate/alerts/ssl-expiration/) # Defining Assertions Source: https://www.checklyhq.com/docs/detect/assertions Add assertions to validate your check results Uptime monitors and API checks allow you to define assertions to validate a response and check its data for correctness. ## How assertions work Assertions let you validate specific parts of a check's response. For example: * **URL monitor**: HTTP response status equals 200. * **TCP monitor**: Response contains expected string (e.g. OK). * **DNS monitor**: Resolved IP equals 93.184.216.34. * **API check**: HTTP response header "X-Custom-Header" equals "SomeValue". ### Sources In each assertion, a **source** is connected to a **comparison** and a **target**. api monitoring assertions example 1 In some cases a [property](#property) is added, for example when asserting API check headers or JSON response bodies. api monitoring assertions example 2 Assertions are executed from top to bottom. If one assertion fails, the full check is considered as failed. Supported assertion sources vary by monitor type. Refer to the documentation of the specific monitor (API, DNS, TCP, etc.) to see which sources are available. ### Property The property field is a free-form text input that lets you point to a specific part of the data you want to validate. It’s available for the following types of assertion [sources](#sources): * **JSON response bodies**: Use a JSON path expression in the form of dot-separated strings to target nested properties in an object, i.e. `$.product.size` or an item in an array, i.e. `$.[1].key`. [Learn more](#json-responses-with-json-path). * **Text response bodies**: Provide a regular expression with a capture group to pick out parts, i.e. ``. [Learn more](#text-body-assertions-with-regular-expressions). * **API check headers**: Enter the header name you want to assert on i.e. `Content-Type`. You can even add a regular expression after that to tease out a specific part of the header. [Learn more](#using-regular-expressions). ## Comparison Comparisons are the operators that work on the source data and target data, e.g. * Response time is `LESS THAN` 150 milliseconds. * Status code `EQUALS` 200. * Header X-MY-HEADER `CONTAINS` the string `some value`. The following comparisons are available. Note that some comparisons don't make sense when paired with a specific source. Response time is empty? JSON Object is less than? We block out the comparisons when they are not applicable to the source. * Equals / Not equals * Is empty / Not empty * Greater than * Less than * Contains / Not contains * Is null / Not null ## Target The target field is a free form text field that determines the desired outcome of your assertion. ## JSON responses with JSON path For monitors that support JSON body assertions, you can use **JSON path** to specify which field of a JSON response body should be asserted. JSON path is a query language similar to Xpath for XML, but in general a lot more intuitive and simpler to use. ### JSON path primer The following JSONPath operators are available: | JSONPath | Description | | ------------------ | -------------------------------------------------------------------- | | `$` | The root object/element | | `@` | The current object/element | | `.` | Child member operator | | `..` | Recursive descendant operator; JSONPath borrows this syntax from E4X | | `*` | Wildcard matching all objects/elements regardless their names | | `[]` | Subscript operator | | `[,]` | Union operator for alternate names or array indices as a set | | `[start:end:step]` | Array slice operator borrowed from ES4 / Python | | `?()` | Applies a filter (script) expression via static evaluation | | `()` | Script expression via static evaluation | | `.length` | returns the length of an array | > JSON path expressions in Checkly assertions must start with a `$` (The root object/element) symbol. Given this sample data set, see example expressions below: ```javascript theme={null} { "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99 }, { "category": "fiction", "author": "Herman Melville", "title": "Moby Dick", "isbn": "0-553-21311-3", "price": 8.99 }, { "category": "fiction", "author": "J. R. R. Tolkien", "title": "The Lord of the Rings", "isbn": "0-395-19395-8", "price": 22.99 } ], "bicycle": { "color": "red", "price": 19.95 } } } ``` JSON path expressions using the store example above: | JSONPath | Description | | ------------------------------------------------- | ----------------------------------------------------------- | | `$.store.book[*].author` | The authors of all books in the store | | `$..author` | All authors | | `$.store.*` | All things in store, which are some books and a red bicycle | | `$.store..price` | The price of everything in the store | | `$.store.book.length` | The length of the book array | | `$..book[2]` | The third book | | `$..book[-1:]` | The last book via slice | | `$..book[0,1]` | The first two books via subscript union | | `$..book[:2]` | The first two books via subscript array slice. | | `$..book[?(@.isbn)]` | Filter all books with isbn number | | `$..book[?(@.price<10)]` | Filter all books cheaper than 10 | | `$..book[?(@.price==8.95)]` | Filter all books that cost 8.95 | | `$..book[?(@.price<30 && @.category=="fiction")]` | Filter all fiction books cheaper than 30 | | `$..*` | All members of JSON structure | Use this [online editor](https://jsonpath.com/) to try out your own JSONPath expressions. For a full description of the syntax and semantics, see [RFC 9535](https://datatracker.ietf.org/doc/rfc9535/). In addition to the RFC-defined syntax, we support a few convenience extensions (for example, `.length`) to make common assertions easier to write. ### Asserting basic types Asserting string, boolean and number values works exactly as you'd expect, e.g. the example below asserts the number value of the `id` property is greater than `2000`. api monitoring assertions example 4 ### Nested properties You can traverse a JSON object using a dot notation. In the example below we are checking the string-based `size` property that is part of the `product` object in the JSON response. api monitoring assertions JSON object This next example checks for a **boolean** value in the `owner.site_admin` property: api monitoring assertions nested JSON object ### Asserting arrays For response bodies with JSON arrays you use JSON path's `[]` expressions. In the first example below we check if the first item in our result array has a property `title`: api monitoring assertions nested JSON array In the next example we pick the last item in the array and check if the `customerId` property has the value `123abc`: api monitoring assertions nested JSON array pick item In this example we pick the item with index value 4. This is the 5th item as array indexes start at 0. We then assert that the `responseTime` property is less than `2000`. api monitoring assertions nested JSON array pick nth item In the last example we check if the returned array has more than 10 items. api monitoring array has more than 10 items > If the JSON path expression in an assertion returns an array of values, Checkly will perform the comparison for > **every element of the array**, chaining them with a logical `AND` (&&). > For example, if the JSON path expression returns an array: `[1,5,2]`, and we use a `Less than` comparison, with `3` > as the target, the assertion **will fail**, because the comparison is **falsy** for the second element of the array > (`5` is greater than `3`). ## Using regular expressions Regular expressions give you the power to extract specific parts of text from a larger text using **capturing groups**. You can use regular expressions with two assertions sources: 1. **Text body:** Use the property field to add your regex. 2. **API check headers:** First select the header you are interested in the property field, then click "add regex". We *do not use the `/g` modifier* and return the first matched group the expression finds. Here is an example input: ``` The quick brown fox jumps over the lazy dog. It barked. ``` And the following regular expression: ``` /quick (.*) fox/ ``` The assertion extracts: ``` brown ``` In the example above we return the string `brown` because it is the first capture group, the `(.*)` bit. The first item `quick brown fox` is the full match, which we do not return. > Remember: regular expressions in assertions only return the **first capturing group** ### Text body assertions with regular expressions When a check returns a text-based response, you can use regular expressions to extract and assert on specific parts of the response body. For example, an HTML document might include a `lang="en"` attribute on the `` element. You can capture the two-character language code using the following regular expression: api monitoring use regular expression on text body The expression `lang="(.{2})"` means 'grab any of the first two characters between `lang="` and the next `"`'. If we were sure there are only non-capital characters, we could tighten it up a bit with `lang="([a-z]*)"`. ### API check header assertions with regular expressions We can use regular expressions with [API check headers](/docs/detect/synthetic-monitoring/api-checks/configuration#headers) too. In this example, we check if the `max-age` property of a `Strict-Transport-Security` response header is above a `100000`. api monitoring use regular expression on http header # Checkly Detect Source: https://www.checklyhq.com/docs/detect/overview Comprehensive monitoring and testing platform to ensure your applications are reliable, performant, and user-friendly. **Checkly Detect** provides global reliability infrastructure to help test and monitor applications and services for exceptional user experiences. By combining automated testing and monitoring, Checkly helps you identify issues across the entire SDLC; and most importantly, **before they impact your users**. Monitor availability and response times across your website and infrastructure Proactively validate real user interactions with API, browser, and multistep checks Run automated Playwright tests to validate functionality and user workflows before production ## Key Benefits * **Early, Proactive Issue Detection** — Identify problems before they impact users through proactive monitoring and testing across all application layers. * **Comprehensive, Global Coverage** — Monitor everything from basic uptime to complex user workflows with multiple monitoring types and global locations. * **Historical Performance Insights** — Track response times, availability percentages, and user experience metrics to optimize application performance. * **Automated Validation** — Reduce manual testing overhead with automated checks that run continuously and provide immediate feedback. ## How Checkly Works Start with the monitoring approach that best fits your immediate needs: * Create them inside the Checkly UI * Create them in your repository as [constructs](/docs/constructs/overview) Once Checks are created, you configure where you want to run them, how often they should run, and how you want to be alerted when they fail. Run them as tests in your CI/CD pipeline. This ensures they are run in production like any other test. * `npx checkly test` Runs all of your local checks in your project * `npx checkly trigger` Runs all of your active checks in your account Once you are happy with your monitoring, you can deploy them to production. * `npx checkly deploy` Deploys all of your checks to production * Or just save your checks in the UI and they will start to run ## Reliability In Depth Strategy Implement testing and monitoring across multiple layers for a comprehensive view of your application's reliability, from infrastructure to user experience. With Checkly, monitor everything from homepage availability to the most complex user journeys in a single platform. * **Automated Testing** — Run unit, integration, and end-to-end tests to validate functionality and user workflows before production * **Uptime Monitoring** — Monitor servers, databases, and network connectivity to ensure availability and responsiveness * **API Synthetic Monitoring** — Validate API endpoints and microservice communication * **Browser Synthetic Monitoring** — Validate user journeys and interactions in a real browser environment ## Getting Started Ready to start monitoring your applications? Choose the approach that best fits your current needs: Begin with automated testing for development workflows Set up basic availability monitoring for critical services Create comprehensive user experience validation For maximum reliability, combine all three monitoring approaches. Start with one type and gradually expand your coverage to create a comprehensive monitoring strategy. # API Check Structure Source: https://www.checklyhq.com/docs/detect/synthetic-monitoring/api-checks/api-structure Learn how to structure your API checks with Playwright. **Monitoring as Code**: Learn more about the [API Check Construct](/docs/constructs/api-check). ## API Check Test Structure ```typescript theme={null} import { ApiCheck, AssertionBuilder, Frequency } from 'checkly/constructs' new ApiCheck('user-api-health', { name: 'User API Health Check', frequency: Frequency.EVERY_5M, request: { method: 'GET', url: 'https://api.example.com/v1/users/health', headers: [ { key: 'Authorization', value: 'Bearer {{API_TOKEN}}' } ], assertions: [ AssertionBuilder.statusCode().equals(200), AssertionBuilder.responseTime().lessThan(2000), AssertionBuilder.jsonBody('$.status').equals('healthy') ] } }) ``` ## Request Configuration ### HTTP Methods Support for all standard HTTP methods: * **GET**: Retrieve data from endpoints * **POST**: Create resources or submit data * **PUT**: Update existing resources * **PATCH**: Partial resource updates * **DELETE**: Remove resources * **HEAD**: Check resource existence without body * **OPTIONS**: Discover allowed methods ### Request Components ```yaml theme={null} # Example API check configuration Method: POST URL: https://api.example.com/v1/users Headers: Content-Type: "application/json" Authorization: "Bearer {{api_token}}" Body: | { "name": "John Doe", "email": "john@example.com" } ``` ### Authentication Support * **Bearer Token**: JWT and OAuth token authentication * **Basic Auth**: Username/password authentication * **API Keys**: Custom header or query parameter authentication * **Custom Headers**: Flexible authentication patterns ## Response Validation ### Status Code Assertions Validate HTTP response codes: ```javascript theme={null} // Status code validation expect(response.status).to.equal(200) expect(response.status).to.be.oneOf([200, 201, 202]) expect(response.status).to.be.below(400) ``` ### Content Validation Validate response content and structure: ```javascript theme={null} // JSON response validation const data = JSON.parse(response.body) expect(data.success).to.be.true expect(data.user.id).to.be.a('number') expect(data.user.email).to.include('@') // Text content validation expect(response.body).to.include('success') expect(response.body).to.not.include('error') ``` ### Header Validation Check response headers: ```javascript theme={null} // Header validation expect(response.headers['content-type']).to.include('application/json') expect(response.headers['cache-control']).to.exist expect(response.headers['x-rate-limit-remaining']).to.be.above(0) ``` ### JSON Schema Validation Validate complex response structures: ```json theme={null} { "type": "object", "properties": { "id": {"type": "integer"}, "name": {"type": "string"}, "email": {"type": "string", "format": "email"}, "created_at": {"type": "string", "format": "date-time"} }, "required": ["id", "name", "email"] } ``` ## Advanced Features ### Environment Variables Use variables for dynamic content: ```javascript theme={null} // Reference environment variables const baseUrl = process.env.API_BASE_URL const apiKey = process.env.API_KEY // Dynamic request configuration const userId = Math.floor(Math.random() * 1000) ``` ### Request Chaining Use previous responses in subsequent requests: ```javascript theme={null} // Setup script - create test user const userResponse = await fetch('https://api.example.com/users', { method: 'POST', body: JSON.stringify({ name: 'Test User', email: `test+${Date.now()}@example.com` }) }) const userData = await userResponse.json() process.env.TEST_USER_ID = userData.id // Main request uses created user ID // URL: https://api.example.com/users/{{TEST_USER_ID}}/profile ``` ### GraphQL Support Monitor GraphQL APIs: ```javascript theme={null} // GraphQL query example const query = ` query GetUser($id: ID!) { user(id: $id) { id name email profile { avatar bio } } } ` // Request body { "query": query, "variables": { "id": "123" } } ``` # Client certificates Source: https://www.checklyhq.com/docs/detect/synthetic-monitoring/api-checks/client-certificates Authenticate API checks against APIs that require mutual TLS (mTLS) by adding client certificates, private keys, and a CA per domain on the Enterprise plan. Use client certificates to authenticate your API checks to APIs that require mutual TLS (mTLS) authentication, or any other authentication scheme where the requester needs to provide a certificate. Each client certificate is specific to a domain name, e.g. `acme.com` and will be used automatically by any API checks targeting that domain. You can optionally restrict a certificate to a URL path, so that different routes on the same host use different certificates. Client certificates are available on the [**Enterprise** plan](https://www.checklyhq.com/pricing/) only. ## Adding a certificate Go to the **[Client Certificates](https://app.checklyhq.com/settings/account/client-certificates)** tab on the Account settings screen. api checks client certificates 1. Click "Add client certificate". 2. Provide the **host name** for the certificate. You can use wildcard like `*.acme.com`. Under the hood we use [minimatch](https://www.npmjs.com/package/minimatch) 3. Optionally provide a **path** to restrict the certificate to one route of that host, e.g. `/partner/api`. See [Restricting a certificate to a path](#restricting-a-certificate-to-a-path). 4. Select the **certificate file** and **private key** file. Both need to be in `PEM` format. 5. If your client certificate requires a custom **Certificate Authority**, you can add another `PEM` file that contains one or more concatenated CA certificates. 6. If you provided a **passphrase** when generating your certificate and private key files, provide it in the passphrase input. You can leave it empty if no passphrase is needed. Note that your passphrase will be encrypted at rest, in transit and only used at very end when executing your API check. ## Using a certificate Client certificates are automatically used by API checks and Multistep checks whose request matches the host name of the certificate. Client certificates are active account wide and cannot be limited to a specific group. You can add multiple certificates for the same host. In this case we match the certificate by the following rules, in order: 1. A certificate whose **path** matches the request URL wins over one without a path. If several path-scoped certificates match, the longest path wins. 2. A certificate with a full hostname wins over one that matches on a wildcard, e.g. `www.acme.com` wins from `*.acme.com` for the host `www.acme.com`. 3. The most recently added certificate wins. ## Restricting a certificate to a path A certificate with a **path** is only used for requests whose URL path is that path or lies under it, on whole path segments: a certificate for `/partner` applies to `/partner` and `/partner/orders`, but not to `/partnership`. * The path must start with `/`, must not be just `/`, and may not contain a query string, a fragment, whitespace, empty segments (`//`) or `.`/`..` segments. A trailing `/` is dropped when the certificate is saved. * The path is compared against the check's request URL after environment variables have been rendered. A URL rewritten in a setup script is not re-matched (see [Known limitations](#known-limitations)). * Only API checks and Multistep checks match on path. gRPC, SSL and TCP monitors have no request path and never use a path-scoped certificate; give those hosts a certificate without a path. * Multistep checks running on a [private location](/docs/platform/private-locations/overview) need a Checkly Agent version with path support (see the [agent change log](/docs/platform/private-locations/change-log)). Older agents ignore the path and select the certificate by the host-only rules above: exact host over wildcard, then the most recently added. ## Editing a certificate Client certificates cannot be edited. You can only remove or add client certificates. ## Removing a certificate You can remove a certificate by going to [Client Certificates](https://app.checklyhq.com/settings/account/client-certificates) tab and clicking the **delete** icon. Note that any API checks that require a client certificate will start failing. ## Known limitations 1. Because we need to match your certificate to your target endpoint for your API checks, you cannot change the `request.url` in [a setup script as described here](/docs/detect/synthetic-monitoring/api-checks/setup-and-teardown#request). 2. We do not support `PKCS12` certificate bundles. You can convert your `PKCS12` bundles to `PEM` format using `openssl` ```bash theme={null} openssl pkcs12 -in .p12 -out .key -nodes -nocerts openssl pkcs12 -in .p12 -out .cert -nokeys ``` # Configuration Source: https://www.checklyhq.com/docs/detect/synthetic-monitoring/api-checks/configuration Configure your API checks to validate responses and ensure your endpoints behave as expected. While configuring up your API check, you can run the request and its assertions using the **Run request** button. This will run the API check on production infrastructure and help you debug any issues. ## Basic Setup Start by specifying the endpoint you want to track. api monitoring request configuration * **URL**: The HTTP(S) URL to monitor (e.g. [https://checklyhq.com](https://checklyhq.com)). URL's are checked for correctness and must start with either `http://` or `https://`. * **Request methods**: Available methods are `GET, POST, PUT, HEAD, DELETE, PATCH`. * **IP family**: Defaults to IPv4. * **Skip SSL**: Skip SSL certificate validation. * **Follow redirects**: Automatically follow 30x redirects. * **This request should fail**: Treat HTTP error codes (4xx and 5xx) as passed. Please note that successful responses still pass. Only failed assertions will cause the check to fail. ## Body Add body content to your request by formatting your content as text. Selecting the type of content will automatically set the correct `Content-Type` header for your request. ### JSON This option sets the `Content-Type` request header to `application/json`. Format your input as standard JSON, i.e: ```js theme={null} { "key1": "val2", "key2": { "nestedKey1": "val2" } } ``` JSON bodies are commonly used with REST APIs. ### GraphQL This option also sets the `Content-Type` request header to `application/json`, but allows you to type GraphQL queries and format them as such, i.e. ```graphql theme={null} query { allUsers { posts { id } } } ``` ### Form parameters This option sets `Content-Type` request header to `application/x-www-form-urlencoded`. Format your input as a string of key/value pairs concatenated with ampersands, i.e: ```bash theme={null} key1=value1&key2=value2 ``` Form encodes bodies are commonly used "traditional" HTML form submissions. ### Raw data If the predefined data types don't work for you, use `Raw data`. Make sure to define your `Content-Type` header explicitly then. > To monitor an XML/SOAP-based API define `text/xml; charset=utf-8` as `Content-Type` header, send your XML as `Raw data` and [use a setup script to parse required access tokens](/docs/detect/synthetic-monitoring/api-checks/examples#parse-xmlsoap-data). ## Headers Add HTTP request headers. The type ahead feature is pre-populated with the most common headers, but you can add any custom headers you want. api monitoring HTTP headers Clicking the **lock icon** toggles between encrypting the value of the header on the Checkly backend and hiding it from your screen. ## Query parameters This section allows you to add query parameters to the request URL in a structured way. You can add as many query parameters as you want. The interface is the same as for the HTTP headers: you can use the lock icon to toggle encryption and screen hiding. > You can also just leave the query parameters as part of the URL. Whatever works for you. ## Basic authentication Add [HTTP basic authentication parameters](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication) to your API request by entering a username and password in the Authentication tab. ## Accessing environment variables [Environment variables](/docs/platform/variables) are exposed to your API checks using the common Handlebars/Moustache templating delimiters, i.e. `{{USER_API_KEY}}`. Note that Handlebars (double brackets) variables will be URI encoded. To avoid encoding, you can access your environment variables with triple brackets, i.e. `{{{USER_API_KEY}}}`. Variables can be used in the following API checks fields: * URL * Body * Header values * Query parameters values * Basic authentication username and password ### Using helpers and built-in variables Next to your own variables, we've added some built-in ones. These variables are specific to API checks: | Helper | Description | | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `{{GROUP_BASE_URL}}` | If your check belongs to a group, this resolves to the group's configured base URL. | | `{{REQUEST_URL}}` | The request URL. | | `{{$UUID}}` | Generates a random UUID/v4, i.e. 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d. | | `{{$RANDOM_NUMBER}}` | Generates a random decimal number between 0 and 10000, i.e. 345. | | `{{moment}}` | Generates a date or time using **moment.js** and allows for formatting:
  • `{{moment "YYYY-MM-DD"}}` generates a date, i.e. 2020-08-26
  • `{{moment "2 days ago" "YYYY-MM-DD"}}` generates the date two days ago: 2020-08-24
  • `{{moment "last week" "X"}}` generates a UNIX timestamp from last week: 1597924480
| A practical example of using the `{{moment}}` helper would be setting the pagination options on a typical API endpoint: ``` GET https://api.acme.com/events?from={{moment "last week" "X"}}&to={{moment "X"}} ``` For a full overview of date formatting option, check the [moment.js docs](https://momentjs.com/docs/#/displaying/format/). In addition, you have access to these generic variables available to all checks: | Variable | Description | Availability | | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ACCOUNT_ID` | The ID of the account the check belongs to. | | | `CHECK_ID` | The UUID of the check being executed. | Only available after saving the check. | | `CHECK_NAME` | The name of the check being executed. | | | `CHECK_RESULT_ID` | The UUID where the result will be saved. | Only available on scheduled runs. | | `CHECK_RUN_ID` | The UUID of the check run execution. | Only available on scheduled runs. | | `CHECK_TYPE` | The type of the check, e.g. `BROWSER`. | | | `CHECKLY_TRACE_ID` | The OpenTelemetry trace ID of the check run. Use it to correlate the run with the trace in your own observability backend. | Only in Browser checks, Multistep checks, Playwright Check Suites, and API setup & teardown scripts, and only when [Traces](/docs/resolve/traces/overview) is active for the check, unset otherwise. | | `CHECKLY_TRACEPARENT` | The W3C `traceparent` header value of the check run's trace. Use it to propagate the trace context to your own tooling. | Only in Browser checks, Multistep checks, Playwright Check Suites, and only when [Traces](/docs/resolve/traces/overview) is active for the check, unset otherwise. | | `CHECKLY_TRACESTATE` | The W3C `tracestate` header value of the check run's trace. Use it with `CHECKLY_TRACEPARENT` to propagate the full trace context. | Only in Browser checks, Multistep checks, Playwright Check Suites, and only when [Traces](/docs/resolve/traces/overview) is active for the check, unset otherwise. | | `PUBLIC_IP_V4` | The IPv4 of the check run execution. | | | `PUBLIC_IP_V6` | The IPv6 of the check run execution. | | | `REGION` | The current region, e.g. `us-west-1`. | | | `RUNTIME_VERSION` | The version of the runtime, e.g, `2023.09`. | Only in Browser, Multistep, and API setup/teardown scripts. | ## Import a cURL request You can import the request method, url, headers and body from a [cURL](https://curl.haxx.se/) command. Arguments `--user-agent`, `--cookie` and `--compressed` also work. ## Import a Swagger / OpenAPI specification If your API implements the Swagger 2.0 or OpenAPI spec, you can import the `swagger.json` spec. The importer parses your spec and prompts you to make some decisions about which requests are to be imported and how. Light mode interface Dark mode interface * **Name:** you can set the check name to the "description" or "url" from your spec. * **Tags:** import tags from you spec. * **Headers:** import HTTP headers from you spec. * **Query parameters:** import query parameters from your spec. * **Add a "group" tag:** Copy the name of you spec to a tag and add it to each imported request. This helps filtering and grouping related checks in the Checkly dashboard. ## Assertions The response of an API request can be checked for correctness and timeliness by using assertions on the response data. This allows you to verify things such as: * HTTP response status equals 200. * HTTP response body equals the text "success". * HTTP response time is lower than 2000 milliseconds. * HTTP response header "X-Custom-Header" equals "SomeValue". * HTTP response JSON object has a key called "accountBalance" with a value greater than 9999. api check assertions On each API check assertion, the following sources are available: * **Status code:** The HTTP response status, parsed as an integer. * **JSON body:** The response body parsed as a JSON object. To enable parsing, the Content-Type header of the response should be set to application/json. * **Text body:** The response body as plain text. * **Headers:** The response headers as an array of key/value pairs. * **Response time:** The response time of the full API request in milliseconds, parsed as an integer value. For more details, see our documentation on [Assertions](/docs/detect/assertions). ## Responses In almost all cases, you have access to the HTTP response for assertions. Checkly reads up to 25MB of the response body. For larger responses, only the first 25MB is available to assertions and teardown scripts. The response body stored with the result can be truncated further to fit result-size limits. ### Previewing image response bodies Checkly displays a preview and download option in API check results when the raw response body is 50KB or smaller and the response `Content-Type` is one of these supported raster image types: * `image/png` * `image/jpeg` * `image/gif` * `image/webp` * `image/avif` * `image/apng` * `image/bmp` * `image/x-icon` * `image/vnd.microsoft.icon` Checkly uses the `Content-Type` header rather than the file extension to identify images. Images larger than 50KB are truncated when stored and cannot be previewed. SVG, TIFF, other unsupported image types, and results created before image preview support cannot be previewed either. Slack alerts do not include a response body preview for supported images. Additionally, if your API responds with a binary type body, i.e. a PDF or video file, we scrub the body and replace it with a short text saying that we scrubbed it. We determine the body content type by looking at the `Content-Type` response header. This list shows all content types that we scrub from the response data. | content type | | ------------------------------- | | `application/pdf` | | `audio/wave` | | `audio/wav` | | `audio/x-wav` | | `audio/x-pn-wav` | | `audio/mpeg` | | `audio/x-ms-wma` | | `audio/vnd.rn-realaudio` | | `application/octet-stream` | | `application/ogg` | | `application/x-shockwave-flash` | | `application/zip` | | `video/mpeg` | | `video/mp4` | | `video/quicktime` | | `video/x-ms-wmv` | | `video/x-msvideo` | | `video/x-flv` | | `video/webm` | ### Asserting on binary response bodies Adding a **Text body** assertion disables binary scrubbing for the entire check. The assertion, teardown scripts, and stored result receive the response body instead of the scrubbed message. Use this when a server labels a textual payload with a binary content type, such as `application/octet-stream`. This does not decode binary formats such as PDF, ZIP, audio, or video files. The assertion evaluates the response body up to the 25MB limit above. Its *Actual* value is truncated to 10KB for display, and the stored response body remains subject to result-size limits. Checks without a Text body assertion keep the scrubbing behavior described in this section. ## Additional Settings * **Name:** Give your check a clear name to identify it in dashboards and alerts * **Description:** Add context about what this check does and why it matters. Supports markdown, max 500 characters. When a failure occurs, [Rocky AI](/docs/ai/rocky-ai) uses the description to provide more accurate [root cause and user impact analysis](/docs/resolve/ai-root-cause-analysis/overview) * **Tags:** Use tags to organize checks across [dashboards](/docs/communicate/dashboards/overview/) and [maintenance windows](/docs/communicate/maintenance-windows/overview) * **Retries:** Define how failed runs should be retried. See [retry strategies](/docs/communicate/alerts/retries) * **Alerting:** Configure your [alert settings](/docs/communicate/alerts/configuration), [alert channels](/docs/communicate/alerts/channels), or set up [webhooks](/docs/integrations/alerts/webhooks) for custom integrations # Creating Checks from an OpenAPI Spec Source: https://www.checklyhq.com/docs/detect/synthetic-monitoring/api-checks/openapi-spec Step-by-step guide to creating your first API check in Checkly using the web UI and CLI. If your API implements the Swagger 2.0 or OpenAPI spec, you can import the `swagger.json` spec. The importer parses your spec and prompts you to make some decisions about which requests are to be imported and how. Navigate to the Create API Check page and select the Import from Swagger / OpenAPI button. Light mode interface Dark mode interface Add a valid URL to the Swagger / OpenAPI specification and click the Import Specfication button. ## Configuring Your Checks ### Groups & Tagging You can add your OpenAPI endpoints checks to a group to help you manage them. Light mode interface Dark mode interface A tag will be added to each imported check. ### Name The name of the check will be the name of the OpenAPI endpoint. ### Response time limits Sometimes APIs can be slow, but not broken. We call this degraded. You can set [response time limits](/docs/detect/synthetic-monitoring/api-checks/response-limits) to specify when an API check should be marked as degraded and when it should be marked as failed. ### Assertions This is where you determine whether the response of the HTTP request is correct or not. You can assert on different sources. These could be: * The HTTP status code returned from the API * Something missing or required within the response body * A specific response header * A specific response time [Read more about assertions](/docs/detect/assertions) ### Scheduling & locations You can configure your checks to run from our [public](/docs/concepts/locations) locations, or use a Checkly Agent to host your own [private](/docs/platform/private-locations/overview) locations. If you don't select more than one location and you've disabled retrying checks from the same location, we will pick a random location when retrying checks. Checkly runs your API checks based on an interval you set. The shortest interval you can run is every 10 seconds and the longest is every 24 hours. A 1-second interval is available upon request — [contact us](mailto:support@checklyhq.com) if you'd like to learn more. ### Retries & alerting Select your preferred [retry strategy](/docs/communicate/alerts/retries) for failed checks. Choose which [alert channels](/docs/communicate/alerts/channels) to get notified through when your check runs into issues. If we don't have your preferred alert method, why not try out our [webhooks](/docs/integrations/alerts/webhooks)? ### Testing You can run your check as an [E2E test](/docs/detect/testing/overview) locally or from your CI/CD pipeline to validate your freshly deployed application. Use the Checkly CLI, or configure integrations with Vercel and GitHub. # API Checks Overview Source: https://www.checklyhq.com/docs/detect/synthetic-monitoring/api-checks/overview Monitor API endpoints with comprehensive HTTP request validation, performance testing, and detailed response analysis. **Monitoring as Code**: Learn more about the [API Check Construct](/docs/constructs/api-check). API check overview API check overview ## What are API Checks? API checks are automated HTTP requests that validate API endpoint functionality by checking status codes, response content, headers, and performance metrics. They simulate real API usage patterns and help catch issues before they impact your users. You can create API checks in the UI, via the [API Check Construct](/docs/constructs/api-check) or by importing your existing Swagger/OpenAPI spec. **API checks are perfect for:** * REST API endpoint monitoring * GraphQL API validation * Authentication system testing * Third-party API dependency monitoring * Payment and transaction APIs - HTTP method support (GET, POST, PUT, DELETE, etc.) - Request/response validation - JSON schema validation - Authentication handling - Performance measurement - Global monitoring locations If you are looking to monitor complex API flows or data processing, you might want to consider using [Multistep Checks](/docs/detect/synthetic-monitoring/multistep-checks/overview). ## How API Checks Work API checks perform comprehensive endpoint validation: 1. **HTTP Request** - Sends configured requests with headers, body, and authentication 2. **Response Analysis** - Captures status codes, headers, body content, and timing 3. **Validation** - Runs assertions against response data and performance metrics 4. **Performance Tracking** - Measures response times and identifies trends 5. **Alert Generation** - Notifies teams when endpoints fail or degrade API checks are ideal for testing both internal services and external API dependencies your application relies on. ## API Check Results API check results will expose key performance and correctness data about the HTTP response received from the target endpoint. api check results detail page These include: * The request performed * Any assertions that were included in the check * All data related to the request and its response, such as: * Response body * Request & response headers * Query params * Check job log * Timings phases: * `dns`: Duration of DNS lookup * `tcp`: Duration of TCP connection * `firstByte`: Duration of HTTP server response * `download`: Duration of HTTP download Learn more in our documentation on [Results](/docs/concepts/results). # Creating An API Check Source: https://www.checklyhq.com/docs/detect/synthetic-monitoring/api-checks/quickstart Step-by-step guide to creating your first API check in Checkly using the web UI and CLI. Learn more about all the [API Check capabilities](/docs/detect/synthetic-monitoring/api-checks/overview) in the general overview. Screenshot of the create API check page ### Name, tags, and description * **Name:** A meaningful name helps you and your team quickly identify checks and improves the clarity of alerts when something fails * **Tags:** let you group related checks and control which ones appear on your [dashboards](/docs/communicate/dashboards/overview) * **Descriptions:** add context about what a check does or why it exists Together, these fields improve alert clarity and play an important role in incident investigation. [Rocky AI](/docs/resolve/ai-root-cause-analysis/overview) uses this information to provide more accurate root cause and user impact analysis. ### HTTP request This is where you configure the API endpoint. The most important part of your API check is its URL and method. Optionally, you can define body data, headers, query parameters and authentication for the API check. These [request settings](/docs/detect/synthetic-monitoring/api-checks/configuration) determine the actions taken by the API and the response sent back. Endpoints can be accessed and manipulated through [HTTP methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods). Not all methods are valid for all endpoints. You can import a cURL command, Swagger.json or OpenAPI specification here too. ### Setup and teardown scripts Setup scripts allow you to do last minute processing of test data and request options. These scripts execute before any requests are made. Teardown scripts are run after the HTTP request has finished, but before any assertions are validated. With a maximum execution time of 10 seconds, these scripts are useful for things like signing HMAC requests, requesting tokens, setting up or cleaning up test data and scrubbing sensitive response data for regulatory reasons. [Read more about setup and teardown scripts](/docs/detect/synthetic-monitoring/api-checks/setup-and-teardown) ### Response time limits Sometimes APIs can be slow, but not broken. We call this degraded. You can set [response time limits](/docs/detect/synthetic-monitoring/api-checks/response-limits) to specify when an API check should be marked as degraded and when it should be marked as failed. ### Assertions This is where you determine whether the response of the HTTP request is correct or not. You can assert on different sources. These could be: * The HTTP status code returned from the API * Something missing or required within the response body * A specific response header * A specific response time [Read more about assertions](/docs/detect/assertions) ### Scheduling & locations You can configure your checks to run from our [public](/docs/concepts/locations) locations, or use a Checkly Agent to host your own [private](/docs/platform/private-locations/overview) locations. If you don't select more than one location and you've disabled retrying checks from the same location, we will pick a random location when retrying checks. Checkly runs your API checks based on an interval you set. The shortest interval you can run is every 10 seconds and the longest is every 24 hours. A 1-second interval is available upon request — [contact us](mailto:support@checklyhq.com) if you'd like to learn more. ### Retries & alerting Select your preferred [retry strategy](/docs/communicate/alerts/retries) for failed checks. Choose which [alert channels](/docs/communicate/alerts/channels) to get notified through when your check runs into issues. If we don't have your preferred alert method, why not try out our [webhooks](/docs/integrations/alerts/webhooks)? ### Testing You can run your check as an [E2E test](/docs/detect/testing/overview) locally or from your CI/CD pipeline to validate your freshly deployed application. Use the Checkly CLI, or configure integrations with Vercel and GitHub. ## CLI example The [Checkly CLI](/docs/guides/getting-started-with-monitoring-as-code/) gives you a JavaScript/TypeScript-native workflow for coding, testing and deploying synthetic monitoring at scale, from your code base. You can define an API check via the CLI. For example: ```ts hello-api.check.ts theme={null} import { ApiCheck, AssertionBuilder, Frequency } from 'checkly/constructs' new ApiCheck('hello-api-1', { name: 'Hello API', activated: true, frequency: Frequency.EVERY_1M, request: { method: 'GET', url: 'https://mac-demo-repo.vercel.app/api/hello', assertions: [ AssertionBuilder.statusCode().equals(200) ], } }) ``` The above example defines: * The basic check properties like `name`, `activated` etc. * The `GET` HTTP method and target `url` of the request. * An array of assertions to assert the HTTP response status is correct. For more options, see the [Check construct reference](/docs/constructs/overview). # Setup and Teardown Scripts Source: https://www.checklyhq.com/docs/detect/synthetic-monitoring/api-checks/setup-and-teardown Learn how to use setup and teardown scripts to prepare requests and process responses in API checks. Setup and teardown scripts execute arbitrary JavaScript/TypeScript code before and after an API check's HTTP request. Both script types have access to environment variables, runtime objects like `request` and `response`, and popular npm packages like `moment`, `axios`, and `lodash`. To get the most power out of API checks with setup and teardown scripts, we advise using [the Checkly CLI](/docs/cli/overview). You can also use them [via the web UI](#using-setup-and-teardown-scripts-via-the-ui). > Setup and teardown scripts have a **maximum execution time of 10 seconds** each. Check the video below for a quick overview of using setup and teardown scripts through the web UI and with the CLI. ## How it works Setup and teardown scripts run at specific points in the API check lifecycle. Understanding this flow helps you use them effectively. ```mermaid theme={null} sequenceDiagram participant S as Session participant Setup as Setup Scripts participant R as HTTP Request participant T as Teardown Scripts participant A as Assertions S->>Setup: Execute (10s timeout) Note over Setup: Can modify request Setup-->>S: Error? ABORT check Setup->>R: Execute HTTP request R->>T: Execute (10s timeout) Note over T: Can modify response T-->>A: Error? Mark failed, continue T->>A: Evaluate assertions ``` **Execution order:** 1. Setup scripts run first and can modify the request before it's sent. 2. The HTTP request executes. 3. Teardown scripts run and can access or modify the response. 4. Assertions evaluate against the (possibly modified) response. ## Setup scripts Setup scripts execute before the HTTP request. Use them to prepare test data, configure request parameters, and handle authentication. You have access to [built-in variables](#built-in-variables) to modify the HTTP request and a set of [libraries available in each runtime](/docs/platform/runtimes/runtime-specification). ### Modifying the request You can modify any property of the `request` object: ```ts theme={null} // Set a custom header request.headers['X-Custom-Header'] = 'my value' // Append a value to the request URL request.url = request.url + '/extra' // Set query parameters request.queryParameters['filter'] = 'active' // Modify the request body request.body = JSON.stringify({ userId: 123 }) // Change the HTTP method request.method = 'POST' ``` ### Authentication example A common task for setup scripts is fetching or signing session tokens. You can centralize this logic and reuse it across API checks. 1. Create an API check and reference the setup script (`setup.ts`) using the `entrypoint` property. 2. Encapsulate authentication logic in a separate `auth-client.ts` file. 3. In the `setup.ts` file, import the auth client and update the `request` object. Your folder structure: ``` . |-- api-1.check.ts |-- setup.ts `-- common `-- auth-client.ts ``` The API check performs a `GET` on an authenticated endpoint: ```ts api.check.ts theme={null} import { ApiCheck } from 'checkly/constructs' import * as path from 'path' new ApiCheck('api-check-1', { name: 'Fetch Product Data', setupScript: { entrypoint: path.join(__dirname, 'setup.ts'), }, request: { method: 'GET', url: 'https://api.acme.com/v1/products' } }) ``` The setup script uses the auth client and sets the `Authorization` header: ```ts setup.ts theme={null} import { getToken } from './common/auth-client' const token = await getToken() request.headers['Authorization'] = `Bearer ${token}` ``` The auth client reads a static environment variable for authentication: ```ts common/auth-client.ts theme={null} import axios from 'axios' export async function getToken () { console.log('Fetching session token from auth server') const { data } = await axios.get('https://api.checklyhq.com/v1/runtimes', { headers: { authorization: process.env.AUTH_SERVER_TOKEN } }) return data.token } ``` Benefits of this structure: * Reuse authentication logic across multiple API checks * Test authentication logic separately from Checkly-specific code Check our [setup script examples](/docs/detect/synthetic-monitoring/api-checks/examples) for OAuth2, HMAC signing, JWT tokens, and other auth methods. ### Error handling in setup scripts If a setup script throws an error or times out, the check **aborts immediately**. The HTTP request never executes, and assertions don't run. ```ts theme={null} // This error will abort the check if (!process.env.API_KEY) { throw new Error('API_KEY environment variable is required') } ``` ## Teardown scripts Teardown scripts run after the HTTP request completes but before assertions evaluate. They have access to both the `request` and `response` objects. Common use cases: * Cleaning up test data created during the check * Scrubbing sensitive data from responses before logging * Normalizing response data for consistent assertions * Extracting and storing values for subsequent checks ### Accessing the response The `response` object contains the full HTTP response: ```ts theme={null} // Log response details console.log('Status:', response.statusCode) console.log('Headers:', JSON.stringify(response.headers)) // Parse JSON body const body = JSON.parse(response.body) console.log('User ID:', body.userId) ``` ### Modifying the response You can modify response properties before assertions run. This is useful for scrubbing sensitive data or normalizing inconsistent API responses. ```ts theme={null} // Scrubbing sensitive data before logging const body = JSON.parse(response.body) if (body.user) { body.user.ssn = '[REDACTED]' body.user.creditCard = '[REDACTED]' } response.body = JSON.stringify(body) ``` ```ts theme={null} // Normalizing timestamps for consistent assertions const body = JSON.parse(response.body) // Replace dynamic timestamps with a static value body.createdAt = '2024-01-01T00:00:00Z' body.updatedAt = '2024-01-01T00:00:00Z' response.body = JSON.stringify(body) ``` ### Cleaning up test data If your setup script creates test data, use the teardown script to clean it up: ```ts theme={null} // Delete the test user created in setup const testUserId = process.env.TEST_USER_ID if (testUserId) { const axios = require('axios') await axios.delete(`https://api.acme.com/users/${testUserId}`, { headers: { Authorization: `Bearer ${process.env.API_KEY}` } }) console.log('Cleaned up test user:', testUserId) } ``` ### Error handling in teardown scripts Unlike setup scripts, teardown errors **do not abort** the check. The check continues and assertions still evaluate. However, if an error occurs, it may mark the check as failed depending on the error type. | Aspect | Setup Scripts | Teardown Scripts | | ------------ | ---------------------------- | ------------------- | | On error | Check **aborts** immediately | Check **continues** | | HTTP request | Never executes | Already completed | | Assertions | Never run | Still evaluate | ## Built-in variables Inside each script, you have access to specific data structures from the API check lifecycle. ### Environment variables You have access to all environment variables configured in your account. You can create, read, update, and delete attributes, but mutations only persist for the duration of a single check run. The current data center location is exposed as the region code in the `REGION` constant, e.g., `eu-west-1` or `us-east-1`. ```typescript theme={null} // Read values const myValue = process.env.MY_KEY // Write values process.env.MY_KEY = myValue + 10 // Add a new key/value pair process.env.NEW_KEY = 'new value' // Remove a key delete process.env.SOME_OTHER_KEY ``` In setup scripts, the modified environment object is used for the subsequent HTTP request. In teardown scripts, modifications are only available for the remainder of that script's execution. [More about using environment variables](/docs/platform/variables) ### Request Request properties are exposed as a standard JavaScript object. This object is available in both setup and teardown scripts. | Property | Description | Type | Modifiable | | ------------------------- | ----------------------------------------------- | ------ | ---------- | | `request.method` | The HTTP request method, e.g., 'GET', 'POST'. | String | Setup only | | `request.url` | The request URL. Query parameters are appended. | String | Setup only | | `request.body` | The request body in string format. | String | Setup only | | `request.headers` | The request headers. | Object | Setup only | | `request.queryParameters` | The request query parameters. | Object | Setup only | ### Response Response properties are exposed as a standard JavaScript object. These are only available in teardown scripts. | Property | Description | Type | Modifiable | | ----------------------- | ---------------------------------------------------------------- | ------ | ---------- | | `response.statusCode` | The response status code, e.g., 200 or 404. | Number | No | | `response.statusText` | The response status text, e.g., 'Ok' or 'Not found'. | String | No | | `response.body` | The response body in string format. Use `JSON.parse()` for JSON. | String | Yes | | `response.headers` | The response headers. | Object | No | | `response.timings` | Timestamps for each request stage relative to start time. | Object | No | | `response.timingPhases` | Time durations for each request phase. | Object | No | ### Built-in runtime variables The [setup and teardown runtime](/docs/platform/runtimes/overview) exposes specific environment variables, in addition to generic runtime variables like `process.env.CHECK_NAME`. #### Setup & teardown specific variables | Variable | Description | | ---------------- | -------------------------------------------------------- | | `GROUP_BASE_URL` | The `{{GROUP_BASE_URL}}` value of the grouped API check. | | `REQUEST_URL` | The request URL of the API check. | #### Generic runtime variables | Variable | Description | Availability | | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ACCOUNT_ID` | The ID of the account the check belongs to. | | | `CHECK_ID` | The UUID of the check being executed. | Only available after saving the check. | | `CHECK_NAME` | The name of the check being executed. | | | `CHECK_RESULT_ID` | The UUID where the result will be saved. | Only available on scheduled runs. | | `CHECK_RUN_ID` | The UUID of the check run execution. | Only available on scheduled runs. | | `CHECK_TYPE` | The type of the check, e.g. `BROWSER`. | | | `CHECKLY_TRACE_ID` | The OpenTelemetry trace ID of the check run. Use it to correlate the run with the trace in your own observability backend. | Only in Browser checks, Multistep checks, Playwright Check Suites, and API setup & teardown scripts, and only when [Traces](/docs/resolve/traces/overview) is active for the check, unset otherwise. | | `CHECKLY_TRACEPARENT` | The W3C `traceparent` header value of the check run's trace. Use it to propagate the trace context to your own tooling. | Only in Browser checks, Multistep checks, Playwright Check Suites, and only when [Traces](/docs/resolve/traces/overview) is active for the check, unset otherwise. | | `CHECKLY_TRACESTATE` | The W3C `tracestate` header value of the check run's trace. Use it with `CHECKLY_TRACEPARENT` to propagate the full trace context. | Only in Browser checks, Multistep checks, Playwright Check Suites, and only when [Traces](/docs/resolve/traces/overview) is active for the check, unset otherwise. | | `PUBLIC_IP_V4` | The IPv4 of the check run execution. | | | `PUBLIC_IP_V6` | The IPv6 of the check run execution. | | | `REGION` | The current region, e.g. `us-west-1`. | | | `RUNTIME_VERSION` | The version of the runtime, e.g, `2023.09`. | Only in Browser, Multistep, and API setup/teardown scripts. | ## Technical reference ### Included libraries All setup and teardown scripts run in a sandboxed environment. You do not have full access to the Node.js standard library or arbitrary npm packages. Check [our runtimes documentation](/docs/platform/runtimes/runtime-specification) for a full specification of included modules. ### Limitations * Setup and teardown scripts are implicitly wrapped in an async function. You can always use `await` statements. * You cannot use nested callbacks as there is no way to determine the callback function. Always use `await` statements. * You need to include modules and libraries explicitly, e.g., `const moment = require('moment')`. * You can pass a maximum of 256KB of data to and from the check's main request. ## Using setup and teardown scripts via the UI When using the Checkly web UI, you can use setup and teardown scripts in two modes: **1. Inline scripts** Write JS/TS code directly in the editor. Best for quick, one-off pieces of code. setup and teardown script for http requests **2. Snippets** Use [snippets](/docs/detect/synthetic-monitoring/api-checks/snippets/) to share code across multiple checks. This approach is similar to working with the CLI but less flexible. reusable code snippets Select snippets from the dropdown in the setup and teardown section of your API check. setup and teardown script for http requests with snippets You can also import snippets from within your setup or teardown scripts. See the [snippet documentation](/docs/detect/synthetic-monitoring/api-checks/snippets/) for details. ### Using environment variables via Handlebars If your API check's request body relies on data from a setup script, use environment variables to pass it. ```typescript theme={null} // Define a variable in the setup script process.env.MY_VALUE = 'my value' ``` Access environment variables in the request body with `{{MY_VALUE}}` notation. Checkly API check editor showing a JSON request body that uses the MY_VALUE environment variable. For more examples, check our [setup script examples](/docs/detect/synthetic-monitoring/api-checks/examples). # API Check Snippets Source: https://www.checklyhq.com/docs/detect/synthetic-monitoring/api-checks/snippets Snippets are JavaScript files which can be reused across [Browser checks](/docs/detect/synthetic-monitoring/browser-checks/overview), as well as [setup and teardown scripts](/docs/detect/synthetic-monitoring/api-checks/setup-and-teardown) for API checks. By reusing code with snippets, checks can be made more maintainable and easier to develop. Snippets can be useful for: * a common login procedure * a common navigation flow * a common setup or teardown procedure **Snippets are not supported in CLI-managed checks.** If you manage your checks with the [Checkly CLI](/docs/cli/overview), use standard `import`/`require` against local files in your repo. See [local dependencies](/docs/cli/dependencies#local-dependencies) for details. ## How to use snippets To create a snippet, access the snippets section on the left side of the UI. When creating a snippet, note that the snippet name will be used as its filename. It's not necessary to name the snippet with the `.js` file extension since this will be added automatically. A snippet can be imported in Browser checks as well as setup and teardown scripts using the Node.js `require` function. When a check or script runs, snippets will be available in the `./snippets` directory. Find simplified file and directory structures for API and Browser checks below. ``` ├── script.js (the Browser check script or the API check setup / teardown script) └── snippets ├── snippet1.js └── snippet2.js ``` Snippets work like any Javascript file on your local disk in Node.js, making it possible to expose functions and properties on the `module.exports` object. Require a snippet named `setup-library` from within a Browser check, a setup or teardown script as follows: ```ts theme={null} import setupLibrary from './snippets/setup-library.js' ``` ```js theme={null} const setupLibrary = require('./snippets/setup-library.js') ``` Snippets can also import other snippets. Since snippets are stored in the same directory, it isn't necessary to include `./snippets` in the path when requiring. For example, to import a snippet named `setup-library` from another snippet: ```ts theme={null} import setupLibrary from './setup-library.js' ``` ```js theme={null} const setupLibrary = require('./setup-library.js') ``` Do you use [reusable code snippets for a setup or teardown script](/docs/detect/synthetic-monitoring/api-checks/setup-and-teardown)? In this case, the setup / teardown snippet will be executed as `script.js` rather than be placed in the snippets directory. To import other snippets, the setup / teardown snippet should include the `snippets` directory in the path. For example, import a snippet named `setup-library` using `require('./snippets/helper.js')`. ## Example: GitHub login Say we want to validate some parts of the GitHub website only available to logged in users. We want to have separate, small Browser checks to have granular feedback whether each part functions. Create a snippet named `github_login` in the "code snippets" section with a function that executes the login routine. ```ts theme={null} async function gitHubLogin (page, username, password) { await page.goto('https://github.com/login') await page.getByLabel('Username or email address').type(username) await page.getByLabel('Password').type(password) await page.getByRole('button', { name: 'Sign in' }) } module.exports = { gitHubLogin } ``` ```js theme={null} async function gitHubLogin (page, username, password) { await page.goto('https://github.com/login') await page.getByLabel('Username or email address').type(username) await page.getByLabel('Password').type(password) await page.getByRole('button', { name: 'Sign in' }) } module.exports = { gitHubLogin } ``` Notice three things: * We created a standard `async` function that expects three parameters: the `page` object, a `username` and a `password` variable. * We exported this function on the standard `module.exports` object. * You now have a function you can call in any of your Browser checks to perform a login on GitHub. Your snippet should look like this now. github login snippet example Create a new Browser check and import the code snippet you just created. ```ts theme={null} import { test } from '@playwright/test' import { gitHubLogin } from './snippets/github_login.js' test('Github login', async ({ page }) => { await gitHubLogin(page, process.env.GITHUB_USER, process.env.GITHUB_PWD) // your normal check code await page.click('.header-search-input') }) ``` ```js theme={null} const { test } = require('@playwright/test') const { gitHubLogin } = require('./snippets/github_login.js') test('Github login', async ({ page }) => { await gitHubLogin(page, process.env.GITHUB_USER, process.env.GITHUB_PWD) // your normal check code await page.click('.header-search-input') }) ``` Notice we are referencing the `GITHUB_USER` and `GITHUB_PWD` environment variables and passing them to the `gitHubLogin()` function. You should store these in [your environment variables](/docs/platform/variables). # API Check Troubleshooting Source: https://www.checklyhq.com/docs/detect/synthetic-monitoring/api-checks/troubleshooting Learn how to troubleshoot API checks with Checkly. API checks can be tricky to troubleshoot. Here are some common issues and solutions: ## Getting the `Error: ESOCKETTIMEDOUT` error Sometimes API checks return this error, without any other information on what caused it. * This is a socket timeout error. Essentially there is no successful connection with the API at the TCP and/or DNS level. Then, Checkly is closing the connection after the usual 30 seconds timeout, because the server didn’t respond. * Usually the root cause for this error is intermittent network issues on the application side. * There will probably be no errors in the application logs, as it was not even possible to establish a connection. * The response headers will be empty. If Checkly doesn't get a connection, there is nothing to send back, e.g. the response headers. ## Authentication Problems **Issue: 401/403 status codes, authorization errors** **Solutions**: 1. Verify API credentials are correct and active 2. Check token expiration and refresh if needed 3. Validate authentication headers format 4. Test API manually with same credentials ## Timeout Issues **Issue: Requests timing out, slow responses** **Solutions**: 1. Check API server performance and load 2. Verify network connectivity from monitoring locations 3. Increase timeout thresholds if appropriate 4. Investigate API infrastructure capacity ## Assertion Failures **Issue: Unexpected response content or format** **Solutions**: 1. Review actual API response vs. expected format 2. Update assertions for API changes 3. Check for environment-specific differences 4. Validate test data and dependencies # Degraded state Source: https://www.checklyhq.com/docs/detect/synthetic-monitoring/browser-checks/degraded Degraded state with soft assertions If you want to monitor your service for non-critical errors or performance degradations you can use the degraded check state. This allows you to signal that parts of a Browser check performed slower than expected, or that it triggered assertions that are of lower criticality. The degraded state does not affect your check's success ratio like a failed state does. You can [configure alert channels](/docs/communicate/alerts/channels#managing-alert-channels) to notify you when a check has degraded. To catch errors that are relevant for a degraded scenario you can use soft assertions. Soft assertions keeps your Playwright test running after it has encountered an error, unlike regular assertions which terminate the test. See the [playwright docs](https://playwright.dev/docs/test-assertions#soft-assertions) for more information on soft assertions. To trigger a degraded state, checks use a helper library, `@checkly/playwright-helpers`, which is included in runtimes `2023.09` and later. The helper library contains two methods, `markCheckAsDegraded` and `getAPIResponseTime`. ### Installing and Importing ```bash theme={null} npm i @checkly/playwright-helpers ``` ```ts theme={null} import { getAPIResponseTime, markCheckAsDegraded } from '@checkly/playwright-helpers' ``` ```js theme={null} const { getAPIResponseTime, markCheckAsDegraded } = require('@checkly/playwright-helpers') ``` ### Getting The Request Response Time To get the request response time, call `getAPIResponseTime`. **Usage** ```ts theme={null} if (getAPIResponseTime(response) > 100) { markCheckAsDegraded('Response was too slow.') } ``` ### Marking A Check As Degraded To mark a check as degraded, call `markCheckAsDegraded`. This can be used when: * The check is failing with soft assertions, or * The check has no failures If your check is failing due to a timeout or failed non-soft assertion it will be considered failing, even if `markCheckAsDegraded` is called. **Usage** ```ts theme={null} if (foo.length > 100) { markCheckAsDegraded('Foo is too long.') } ``` **Arguments** * `reason` String *(optional)*. Logged when the method is called. Used to identify which method caused the degradation. **Arguments** * `response` [APIResponse](https://playwright.dev/docs/api/class-apiresponse) *(required)*. A response from a Playwright API request. ### Example of Marking A Check As Degraded A check is marked as degraded when `markCheckAsDegraded` is called and there are no regular assertions triggered. In this example we do a simple site navigation and measure the time the test takes. At the end of the check we mark the check as degraded if the duration of the test is too long, or if the site header has changed. ```ts degraded.spec.ts theme={null} import { expect, test, Page } from '@playwright/test'; import { markCheckAsDegraded } from "@checkly/playwright-helpers"; // Import the necessary method from the Checkly helpers library. test.setTimeout(30000); const TEST_DEGRADATION_LIMIT = 400; // The limit for how long the test can run before it is considered degraded. test("Visit Checkly and go to the docs", async ({ page }) => { const startTime = Date.now(); // Note the time when the test starts const response = await page.goto('https://www.checklyhq.com/welcome/'); expect(response.status(), 'should respond with correct status code').toBeLessThan(400) // Ensure that the welcome page loaded successfully await page.getByRole('link', { name: '/docs' }).click(); // Navigate to the documentation page const header = await page.getByText('Get Started'); expect.soft(header).toBeTruthy(); // A soft assert example const endTime = Date.now(); // Note the time when the test completes const duration = endTime - startTime; // Calculate the test duration if (duration > TEST_DEGRADATION_LIMIT || test.info().errors.length) { // Trigger the degradation if the duration is longer than our set limit, or if the soft assert is triggered. markCheckAsDegraded(`Test duration took longer than ${TEST_DEGRADATION_LIMIT}`); } }) ``` Triggering a soft assertion in a check but not calling `markCheckAsDegraded` will fail the check at the end instead of marking as degraded. # Browser Check Structure Source: https://www.checklyhq.com/docs/detect/synthetic-monitoring/browser-checks/mac-structure Learn how to structure your Browser Checks with Monitoring as Code. Monitoring as Code works by connecting Playwrighttest files with Checkly constructs to handle the end-to-endconfiguration of your Browser Check. ## Browser Check Construct The Browser Check construct is used to configure your monitoring settings, such as frequency, locations, and tags. Learn more about the [Browser Check Construct](/docs/constructs/browser-check) ```ts browser-check.ts theme={null} import { BrowserCheck, Frequency } from 'checkly/constructs' import * as path from 'path' new BrowserCheck('browser-check-1', { name: 'Browser check #1', frequency: Frequency.EVERY_10M, locations: ['us-east-1', 'eu-west-1'], code: { entrypoint: path.join(__dirname, 'login.spec.js') } }) ``` ## Test Script Structure Checkly uses Playwright to power Browser Checks. [Playwright](https://playwright.dev/docs/intro) is a robust, open-source framework for browser automation and end-to-end web application testing. It enables you to write atomic, reliable tests and easily control interactions within a web page. Browser checks execute automated test scripts in real browsers. ```typescript login.spec.ts theme={null} // Use environment-specific URLs and credentials const baseURL = process.env.BASE_URL || 'https://app.example.com' const testUser = process.env.TEST_USER_EMAIL const testPassword = process.env.TEST_USER_PASSWORD test('Environment-aware test', async ({ page }) => { await page.goto(`${baseURL}/login`) await page.fill('[name="email"]', testUser) await page.fill('[name="password"]', testPassword) // ... rest of test }) ``` ## Environment variables [Check, group and global variables](/docs/platform/variables) are accessible in your code using the standard Node.js `process.env.MY_VAR` notation. For example, the code snippet below show how you can log into GitHub. ```ts variables.spec.ts theme={null} import { test } from '@playwright/test' test('GitHub login', async ({ page }) => { await page.goto('https://github.com/login') await page.getByLabel('Username or email address').type(process.env.GITHUB_USER) await page.getByLabel('Password').type(process.env.GITHUB_PWD) await page.getByRole('button', { name: 'Sign in' }).click() }) ``` ```js variables.spec.js theme={null} const { test } = require('@playwright/test') test('GitHub login', async ({ page }) => { await page.goto('https://github.com/login') await page.getByLabel('Username or email address').type(process.env.GITHUB_USER) await page.getByLabel('Password').type(process.env.GITHUB_PWD) await page.getByRole('button', { name: 'Sign in' }).click() }) ``` ### Built-in runtime variables Our [check runtimes](/docs/platform/runtimes/overview/) also expose a set of environment variables (e.g. `process.env.CHECK_NAME`) to figure out what check, check type etc. you are running. | Variable | Description | Availability | | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ACCOUNT_ID` | The ID of the account the check belongs to. | | | `CHECK_ID` | The UUID of the check being executed. | Only available after saving the check. | | `CHECK_NAME` | The name of the check being executed. | | | `CHECK_RESULT_ID` | The UUID where the result will be saved. | Only available on scheduled runs. | | `CHECK_RUN_ID` | The UUID of the check run execution. | Only available on scheduled runs. | | `CHECK_TYPE` | The type of the check, e.g. `BROWSER`. | | | `CHECKLY_TRACE_ID` | The OpenTelemetry trace ID of the check run. Use it to correlate the run with the trace in your own observability backend. | Only in Browser checks, Multistep checks, Playwright Check Suites, and API setup & teardown scripts, and only when [Traces](/docs/resolve/traces/overview) is active for the check, unset otherwise. | | `CHECKLY_TRACEPARENT` | The W3C `traceparent` header value of the check run's trace. Use it to propagate the trace context to your own tooling. | Only in Browser checks, Multistep checks, Playwright Check Suites, and only when [Traces](/docs/resolve/traces/overview) is active for the check, unset otherwise. | | `CHECKLY_TRACESTATE` | The W3C `tracestate` header value of the check run's trace. Use it with `CHECKLY_TRACEPARENT` to propagate the full trace context. | Only in Browser checks, Multistep checks, Playwright Check Suites, and only when [Traces](/docs/resolve/traces/overview) is active for the check, unset otherwise. | | `PUBLIC_IP_V4` | The IPv4 of the check run execution. | | | `PUBLIC_IP_V6` | The IPv6 of the check run execution. | | | `REGION` | The current region, e.g. `us-west-1`. | | | `RUNTIME_VERSION` | The version of the runtime, e.g, `2023.09`. | Only in Browser, Multistep, and API setup/teardown scripts. | # Browser Checks Overview Source: https://www.checklyhq.com/docs/detect/synthetic-monitoring/browser-checks/overview Monitor end-to-end user flows and realistic interactions with automated browser testing using Playwright. **Monitoring as Code**: Learn more about the [Browser Check Construct](/docs/constructs/browser-check). Browser check overview Browser check overview ## What are Browser Checks? Browser checks are automated tests that use real browsers to interact with your web applications. They simulate user journeys like logging in, filling out forms, making purchases, or navigating through complex workflows, ensuring your critical user paths work and perform correctly. **Browser checks are perfect for detecting downtime and performance issues in:** * User authentication flows * E-commerce checkout processes * Form submissions and user journey validation * Frontend performance monitoring Supported Browsers: * **Chromium**: Default browser, fast and reliable * **Chrome**: Google Chrome for production-like testing * **Mobile Simulation**: Test responsive designs and mobile workflows ## How Browser Checks Work Checkly uses Playwright to power your Browser checks. [Playwright](https://playwright.dev/docs/intro) is a robust, open-source framework for browser automation and end-to-end web application testing. It enables you to write idiomatic, reliable tests and easily control interactions within a web page. Browser checks execute automated test scripts in real browsers: 1. **Browser Launch** - Starts a real browser instance (Chromium or Chrome) 2. **Page Navigation** - Navigates to your web application 3. **User Interactions** - Simulates clicks, typing, form fills, and navigation 4. **Assertions** - Validates page content, elements, and user experience 5. **Performance Monitoring** - Captures Core Web Vitals and timing metrics 6. **Results Collection** - Records screenshots, videos, and detailed logs 7. **Alerts** - Triggers alerts if any of the assertions fail ## Check Structure Browser check dashboard Create your Playwright test file in the Checkly IDE, then configure the check settings in the Checkly UI. Browser checks use Playwright's test framework with a familiar structure. It works by connecting constructs to handle the configuration of your Browser Check, and then referencing the test file in your repository. ```ts browser-check.ts theme={null} import { BrowserCheck, Frequency } from 'checkly/constructs' import * as path from 'path' new BrowserCheck('browser-check-1', { name: 'Browser check #1', frequency: Frequency.EVERY_10M, locations: ['us-east-1', 'eu-west-1'], code: { entrypoint: path.join(__dirname, 'home.spec.js') } }) ``` ```typescript home.spec.ts theme={null} import { test, expect } from '@playwright/test' test('User login workflow', async ({ page }) => { // Navigate to login page await page.goto('https://app.example.com/login') // Fill in credentials await page.fill('[data-testid="email"]', 'user@example.com') await page.fill('[data-testid="password"]', 'securepassword') // Submit login form await page.click('[data-testid="login-button"]') // Verify successful login await expect(page.locator('[data-testid="dashboard"]')).toBeVisible() await expect(page).toHaveURL(/.*dashboard/) }) ``` To learn more about Playwright, see the our [Playwright documentation](/docs/learn/playwright/overview). ## Browser Check Results Individual browser check results contain: * A short check summary, including errors broken down by category check results browser summary * When using Playwright Test Runner you will have an additional section displaying the test steps, error message, and assets (traces, videos, screenshots) * An error log, only if your script failed check results browser error log * Expandable tabs on page your script navigated to check results browser page navigation When expanded, each tab shows its own navigation/loading time ribbon and web vitals... check results browser page navigation top ...together with browser console logs, network logs and any screenshots that had been taken (including one screenshot taken automatically on failure) check results browser page navigation bottom * A job log for the check check results browser job log Learn more in our documentation on [Results](/docs/concepts/results). ## Key Capabilities Execute scripts in real Chromium browsers to test complex user interactions, JavaScript functionality, and dynamic content. Write tests using Playwright's powerful API for cross-browser automation with built-in waiting, assertions, and debugging capabilities. Capture and compare screenshots to detect unintended visual changes in your application's UI. Monitor Core Web Vitals, page load times, and custom performance metrics to ensure optimal user experience. Test responsive designs and mobile-specific functionality by emulating various devices and screen sizes. Run checks from multiple worldwide locations to verify performance and availability across different regions. # Performance & Web Vitals Source: https://www.checklyhq.com/docs/detect/synthetic-monitoring/browser-checks/performance-metrics Web Vitals for browser checks Checkly automatically collect Network Waterfalls & Performance signals (**Web Vitals**) for each of the pages you visit in the browser session. Light mode interface Dark mode interface Checkly only collects tracing and web vitals data if your browser check meets the following criteria: * It is based on **Playwright**. * It runs on any **runtime above [2021.06](/docs/cli/checkly-runtimes)** Running a Playwright Check Suite instead? See [Web Vitals for Playwright Check Suites](/docs/detect/synthetic-monitoring/playwright-checks/performance-metrics), which reports Web Vitals per page visit and adds LCP and INP attribution. ## Network Waterfalls For each page you visit, we automatically collect the following: 1. Any `error`, `warning` or `info` level console messages. 2. Any network requests, like `xhr/fetch`, `javascript`, `css` and others. You can use this data to quickly find issues with the pages you visit. Use cases are: * Finding critical errors in your JavaScript by scanning the console logs. * Pinpoint missing images or other resources: they will show a `404` in the network tab. ## Web Performance Vitals For each page your script visits, we automatically collect a set of five [Web Vitals](https://web.dev/learn-web-vitals/). Web Vitals are user focused quality signals for web pages that indicate a good, ok or poor user experience. **Initial Content Display** Measures the time from when the page starts loading to when any content is rendered. A large FCP means users see a white screen for too long, doubting whether the page works at all. [Read more about FCP over at web.dev](https://web.dev/fcp/) **Main Content Loading** Measures the time to render the largest visual item within the browser viewport. High LCP means users wait too long before the most useful part of your page loads. [Read more about LCP over at web.dev](https://web.dev/lcp/) **Visual Stability** An aggregate metric that signals screen elements "jumping around" as the page loads. Low CLS means you have a stable page layout. [Read more about CLS over at web.dev](https://web.dev/cls/) **Main Thread Responsiveness** Reflects the time a web page is "blocked" from receiving user input because the main rendering thread is busy. High TBT means sluggish user interactions. [Read more about TBT over at web.dev](https://web.dev/tbt/) **Server Response Time** Indicates how long it took for your server to respond with the first byte of content. TTFB can vary based on location and network conditions. [Read more about TTFB over at web.dev](https://web.dev/time-to-first-byte/) Web Vitals are a part [Google Lighthouse](https://developers.google.com/web/tools/lighthouse), but the two are not the same: Web Vitals are a lighter, higher-level tool built on existing browser APIs. Being less resource-intensive than Lighthouse, Web Vitals can be reliably calculated for you on cloud resources every minute. ### Why are some Web Vitals not reported? Checkly automatically instruments your Playwright code to collect Web Vitals metrics. However, in some cases we will not be able to collect a good measurement. There are multiple reasons for this: #### Route-Based Navigation A Single Page App like a React, Vue or Angular app only has one HTML page load event and then relies on route changes. The underlying [library we use for collecting Web Vitals](https://github.com/GoogleChrome/web-vitals) does not yet account for this. The folks over at Google are aware of this and [posted an FAQ](https://web.dev/vitals-spa-faq/). #### Insufficient Measurement Time Cumulative Layout Shift (CLS) relies on layout events accumulating over time. If your script exits very fast, or triggers a redirect, there might not be enough time to actually "catch" this metric. #### User Interaction Needed Some metrics require a small amount of interaction to effectively "trigger". Clicking a button or other screen element in your Playwright script can help here. We are constantly tweaking and updating our Web Vitals collection code, so expect improvements in the future! ### Lab metrics vs. Field metrics Checkly collects "lab" metrics for you. These are different from "field" metrics. **Controlled Environment** * Collected in synthetic environments * Generated by your Browser check scripts * Useful for establishing baselines * Helps identify performance regressions * Perfect for pre-deployment testing **Real User Monitoring (RUM)** * Based on real user traffic * Collected "in the wild" * Varies by device, location, network * Provides actual user experience data * Essential for production monitoring # Playwright Support in Checkly Source: https://www.checklyhq.com/docs/detect/synthetic-monitoring/browser-checks/playwright-support See which Playwright features Checkly's browser checks support, from trace files and video recordings to auto-waiting, locators, and visual regression testing. Checkly natively supports running complex browser checks that mimic real user actions using Playwright, the best automation framework. Playwright and Checkly together elevate your monitoring and debugging experience by providing: * Detailed trace files with step-by-step information on your test cases * Video recordings of browser sessions * Automatic `awaits` for reliable automation * Diverse set of assertions like `toContainText()`, `toHaveURL()` * Easy to use locators like `getByTitle`, `getByRole` * Visual regression testing ## Features This is the list of Playwright features that are currently supported. We will update it as more features become supported. | Feature | Supported? | | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | | Trace files | Yes | | Video recordings | Yes | | API testing | Yes | | Custom fixtures | Yes | | Reporters | JSON | | Typescript | Yes | | Global configuration | Yes, a subset of playwright config options. | | Visual comparisons | Yes | | Test retry | No, enable Checkly's ["Double-check on failure"](/docs/communicate/alerts/configuration) in the check settings to retry a check. | | Parallelism and sharding | No | ## Supported configuration options We currently support the following configuration options. We will update this list as more options become supported. > We do not support the `projects`, `globalSetup`, `globalTeardown` and `storageState` options yet, but will in a future release. | Option | Supported | | ---------------- | --------- | | `timeout` | ✅ | | `use` | ✅ | | `expect` | ✅ | | `testDir` | ❌ | | `fullyParallel` | ❌ | | `forbidOnly` | ❌ | | `retries` | ❌ | | `workers` | ❌ | | `reporter` | ❌ | | `testMatch` | ❌ | | `testIgnore` | ❌ | | `outputDir` | ❌ | | `globalSetup` | ❌ | | `globalTeardown` | ❌ | | `projects` | ❌ | | `webServer` | ❌ | For more information about the `global` options you can check playwright official documentation [Test configuration](https://playwright.dev/docs/test-configuration) | Option | Supported | | -------------------- | --------- | | `baseURL` | ✅ | | `colorScheme` | ✅ | | `geolocation` | ✅ | | `locale` | ✅ | | `permissions` | ✅ | | `timezoneId` | ✅ | | `viewport` | ✅ | | `deviceScaleFactor` | ✅ | | `hasTouch ` | ✅ | | `isMobile ` | ✅ | | `javaScriptEnabled ` | ✅ | | `extraHTTPHeaders` | ✅ | | `httpCredentials` | ✅ | | `ignoreHTTPSErrors` | ✅ | | `offline` | ✅ | | `actionTimeout` | ✅ | | `navigationTimeout ` | ✅ | | `testIdAttribute` | ✅ | | `connectOptions` | ✅ | | `contextOptions` | ✅ | | `bypassCSP` | ✅ | | `proxy` | ✅ | | `launchOptions` | ❌ | | `storageState` | ❌ | | `browserName` | ❌ | | `channel` | ❌ | | `headless` | ❌ | | `screenshot` | ❌ | | `trace` | ❌ | | `video` | ❌ | For more information about the `use` options you can check playwright official documentation [Test use options](https://playwright.dev/docs/test-use-options) | Option | Supported | | ------------------- | --------- | | `timeout` | ✅ | | `toHaveScreenshot ` | ✅ | | `toMatchSnapshot ` | ✅ | For more information about the `expect` options you can check playwright official documentation [Test Expect options](https://playwright.dev/docs/test-configuration#expect-options) A check using [the Playwright Test Runner (`@playwright/test`)](https://playwright.dev/docs/intro) will currently run around 30-50% longer than [a regular Playwright check (`playwright`)](https://playwright.dev/docs/library). This is caused by the automatic creation of trace and video assets. We are aware of this and are investigating solutions. If this is significantly degrading the performance of your check, we recommend to divide longer tests into multiple checks. When `use.extraHTTPHeaders` is missing from the Playwright configuration, Checkly adds its trace headers automatically. See how to [add Checkly's trace headers to your custom HTTP headers](/docs/resolve/traces/overview#add-trace-headers-to-custom-http-headers). ## Hooks Playwright Test Runner offers hook functions such as `test.afterEach()` and `test.beforeEach()` that run before or after individual test cases or `test.afterAll()` and `test.beforeAll()` that run before or after all tests have started/finished. You can find more information on available methods in the [official documentation](https://playwright.dev/docs/api/class-test). ## Viewing trace files When a `@playwright/test` test case fails, Checkly will record and make its trace files available via the UI. You can download the trace files for manual inspection or view them directly with [trace.playwright.dev](https://trace.playwright.dev). Using the Playwright Trace Viewer you can effortlessly view your test, skip back and forth between actions, view snapshots and metadata, and more. This makes it very easy to inspect individual traces and debug failing tests.