# Management API v2 Version: With the Management API, you can programmatically manage checks and integrations in your account. ## API Endpoints
Endpoint Name | Endpoint Address ------------------------------------------------------|------- **Checks**| [List existing checks](#list-checks) | `GET SITE_ROOT/api/v2/checks/` [Get a single check](#get-check) | `GET SITE_ROOT/api/v2/checks/{"tags": "reports staging"}desc : string, optional. Description of the check. timeout : number, optional, default value: {{ default_timeout }}. The expected period of this check in seconds. Minimum: 60 (one minute), maximum: 31536000 (365 days). Example for a 5-minute timeout:
{"timeout": 300}grace : number, optional, default value: {{ default_grace }}. The grace period for this check in seconds. Minimum: 60 (one minute), maximum: 31536000 (365 days). schedule : string, optional, default value: "`* * * * *`". A cron expression defining this check's schedule. If you specify both `timeout` and `schedule` parameters, SITE_NAME will create a Cron check and ignore the `timeout` value. Example for a check running every half-hour:
{"schedule": "0,30 * * * *"}tz : string, optional, default value: "UTC". Server's timezone. This setting only has an effect in combination with the `schedule` parameter. Example:
{"tz": "Europe/Riga"}manual_resume : boolean, optional, default value: false. Controls whether a paused check automatically resumes when pinged (the default) or not. If set to false, a paused check will leave the paused state when it receives a ping. If set to true, a paused check will ignore pings and stay paused until you manually resume it from the web dashboard. methods : string, optional, default value: "". Specifies the allowed HTTP methods for making ping requests. Must be one of the two values: "" (an empty string) or "POST". Set this field to "" (an empty string) to allow HEAD, GET, and POST requests. Set this field to "POST" to allow only POST requests. Example:
{"methods": "POST"}channels : string, optional By default, this API call assigns no integrations to the newly created check. Set this field to a special value "*" to automatically assign all existing integrations. Example:
{"channels": "*"}To assign specific integrations, use a comma-separated list of integration UUIDs. You can look up integration UUIDs using the [List Existing Integrations](#list-channels) API call. Example:
{"channels": "4ec5a071-2d08-4baa-898a-eb4eb3cd6941,746a083e-f542-4554-be1a-707ce16d3acc"}Alternatively, if you have named your integrations in SITE_NAME dashboard, you can specify integrations by their names. For this to work, your integrations need non-empty unique names, and they must not contain commas. The names must match exactly, whitespace is significant. Example:
{"channels": "Email to Alice,SMS to Alice"}unique : array of string values, optional, default value: []. Enables "upsert" functionality. Before creating a check, SITE_NAME looks for existing checks, filtered by fields listed in `unique`. If SITE_NAME does not find a matching check, it creates a new check and returns it with the HTTP status code 201. If SITE_NAME finds a matching check, it updates the existing check and returns it with HTTP status code 200. The accepted values for the `unique` field are `name`, `tags`, `timeout`, and `grace`. Example:
{"name": "Backups", unique: ["name"]}In this example, if a check named "Backups" exists, it will be returned. Otherwise, a new check will be created and returned. start_kw : string, optional, default value: "". Specifies the keywords for classifying inbound email messages as "Start" signals. Separate multiple keywords using commas. Use this field in combination with the `filter_subject` and `filter_body` fields. Setting `filter_subject` to `true` enables filtering on the email subject line, `filter_body` enables filtering on the entire email body. SITE_NAME supports both plain text and HTML email messages. Example:
{"filter_subject": true, "start_kw": "STARTED"}In this example, SITE_NAME classifies the email as a start signal if the Subject line contains the word "STARTED". success_kw : string, optional, default value: "". Specifies the keywords for classifying inbound email messages as "Success" signals. Separate multiple keywords using commas. Use this field in combination with the `filter_subject` and `filter_body` fields. Setting `filter_subject` to `true` enables filtering on the email subject line, `filter_body` enables filtering on the entire email body. SITE_NAME supports both plain text and HTML email messages. Example:
{"filter_subject": true, "success_kw": "SUCCESS,COMPLETED"}In this example, the email counts as success if the Subject line contains either the word "SUCCESS" or the word "COMPLETED". failure_kw : string, optional, default value: "". Specifies the keywords for classifying inbound email messages as "Failure" signals. Separate multiple keywords using commas. Use this field in combination with the `filter_subject` and `filter_body` fields. Setting `filter_subject` to `true` enables filtering on the email subject line, `filter_body` enables filtering on the entire email body. SITE_NAME supports both plain text and HTML email messages. Example:
{"filter_subject": true, "failure_kw": "FAILED, ERROR"}In this example, the email counts as failure if the Subject line contains either the word "FAILED" or the word "ERROR". filter_subject : boolean, optional, default value: false. Enables filtering of inbound email messages by looking for keywords in their subject lines. See also the `success_kw` and `failure_kw` fields. filter_body : boolean, optional, default value: false. Enables filtering of inbound email messages by looking for keywords in their message body. See also the `success_kw` and `failure_kw` fields. subject : string, optional, default value: "". **Deprecated**. Use the `success_kw`, `filter_subject` and `filter_body` fields instead. Specifies the keywords for classifying inbound email messages as "Success" signals. Separate multiple keywords using commas. If any of the keywords is found in an email message's Subject line, the email message will count as "Success". Set this field to "" (an empty string) to consider all inbound email messages as "Success" (unless they match any keywords listed in `subject_fail` and are thus classified as "Failure"). Example:
SUCCESS,COMPLETEDIn this example, the email counts as success if the Subject line contains either the word "SUCCESS" or the word "COMPLETED". subject_fail : string, optional, default value: "". **Deprecated**. Use the `failure_kw`, `filter_subject` and `filter_body` fields instead. Specifies the keywords for classifying inbound email messages as "Failure" signals. Separate multiple keywords using commas. If any of the keywords is found in an email message's Subject line, the email message will count as "Failure". Set this field to "" (an empty string) to perform no "Failure" classification. Example:
FAILED,ERRORIn this example, the email counts as failure if the Subject line contains either the word "FAILED" or the word "ERROR". ### Response Codes 201 Created : A new check was successfully created. 200 OK : An existing check was found and updated. 400 Bad Request : The request is not well-formed, violates schema, or uses invalid field values. 401 Unauthorized : The API key is either missing or invalid. 403 Forbidden : The account has hit its check limit. For free accounts, the limit is 20 checks per account. ### Example Request ```bash curl SITE_ROOT/api/v2/checks/ \ --header "X-Api-Key: your-api-key" \ --data '{"name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}' ``` Or, alternatively: ```bash curl SITE_ROOT/api/v2/checks/ \ --data '{"api_key": "your-api-key", "name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}' ``` ### Example Response ```json { "channels": "", "desc": "", "grace": 60, "last_ping": null, "n_pings": 0, "name": "Backups", "slug": "backups", "next_ping": null, "manual_resume": false, "methods": "", "start_kw": "", "success_kw": "", "failure_kw": "", "filter_subject": false, "filter_body": false, "pause_url": "SITE_ROOT/api/v2/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause", "resume_url": "SITE_ROOT/api/v2/checks/f618072a-7bde-4eee-af63-71a77c5723bc/resume", "ping_url": "PING_ENDPOINTf618072a-7bde-4eee-af63-71a77c5723bc", "status": "new", "started": false, "tags": "prod www", "timeout": 3600, "update_url": "SITE_ROOT/api/v2/checks/f618072a-7bde-4eee-af63-71a77c5723bc", } ``` ## Update an Existing Check {: #update-check .rule } `POST SITE_ROOT/api/v2/checks/
{"tags": "reports staging"}desc : string, optional. Description of the check. timeout : number, optional. The expected period of this check in seconds. Minimum: 60 (one minute), maximum: 31536000 (365 days). Example for a 5-minute timeout:
{"timeout": 300}grace : number, optional. The grace period for this check in seconds. Minimum: 60 (one minute), maximum: 31536000 (365 days). schedule : string, optional. A cron expression defining this check's schedule. If you specify both `timeout` and `schedule` parameters, SITE_NAME will save the `schedule` parameter and ignore the `timeout`. Example for a check running every half-hour:
{"schedule": "0,30 * * * *"}tz : string, optional. Server's timezone. This setting only has an effect in combination with the "schedule" parameter. Example:
{"tz": "Europe/Riga"}manual_resume : boolean, optional, default value: false. Controls whether a paused ping automatically resumes when pinged (the default), or not. If set to false, a paused check will leave the paused state when it receives a ping. If set to true, a paused check will ignore pings and stay paused until you manually resume it from the web dashboard. methods : string, optional, default value: "". Specifies the allowed HTTP methods for making ping requests. Must be one of the two values: "" (an empty string) or "POST". Set this field to "" (an empty string) to allow HEAD, GET, and POST requests. Set this field to "POST" to allow only POST requests. Example:
{"methods": "POST"}channels : string, optional. Set this field to a special value "*" to automatically assign all existing integrations. Example:
{"channels": "*"}Set this field to a special value "" (empty string) to automatically *unassign* all existing integrations. Example:
{"channels": ""}To assign specific integrations, use a comma-separated list of integration UUIDs. You can look up integration UUIDs using the [List Existing Integrations](#list-channels) API call. Example:
{"channels": "4ec5a071-2d08-4baa-898a-eb4eb3cd6941,746a083e-f542-4554-be1a-707ce16d3acc"}Alternatively, if you have named your integrations in SITE_NAME dashboard, you can specify integrations by their names. For this to work, your integrations need non-empty and unique names, and they must not contain commas. The names must match exactly, whitespace is significant. Example:
{"channels": "Email to Alice,SMS to Alice"}start_kw : string, optional, default value: "". Specifies the keywords for classifying inbound email messages as "Start" signals. Separate multiple keywords using commas. Use this field in combination with the `filter_subject` and `filter_body` fields. Setting `filter_subject` to `true` enables filtering on the email subject line, `filter_body` enables filtering on the entire email body. SITE_NAME supports both plain text and HTML email messages. Example:
{"filter_subject": true, "start_kw": "STARTED"}In this example, SITE_NAME classifies the email as a start signal if the Subject line contains the word "STARTED". success_kw : string, optional, default value: "". Specifies the keywords for classifying inbound email messages as "Success" signals. Separate multiple keywords using commas. Use this field in combination with the `filter_subject` and `filter_body` fields. Setting `filter_subject` to `true` enables filtering on the email subject line, `filter_body` enables filtering on the entire email body. SITE_NAME supports both plain text and HTML email messages. Example:
{"filter_subject": true, "success_kw": "SUCCESS,COMPLETED"}In this example, the email counts as success if the Subject line contains either the word "SUCCESS" or the word "COMPLETED". failure_kw : string, optional, default value: "". Specifies the keywords for classifying inbound email messages as "Failure" signals. Separate multiple keywords using commas. Use this field in combination with the `filter_subject` and `filter_body` fields. Setting `filter_subject` to `true` enables filtering on the email subject line, `filter_body` enables filtering on the entire email body. SITE_NAME supports both plain text and HTML email messages. Example:
{"filter_subject": true, "failure_kw": "FAILED, ERROR"}In this example, the email counts as failure if the Subject line contains either the word "FAILED" or the word "ERROR". filter_subject : boolean, optional, default value: false. Enables filtering of inbound email messages by looking for keywords in their subject lines. See also the `success_kw` and `failure_kw` fields. filter_body : boolean, optional, default value: false. Enables filtering of inbound email messages by looking for keywords in their message body. See also the `success_kw` and `failure_kw` fields. subject : string, optional, default value: "". **Deprecated**. Use the `success_kw`, `filter_subject` and `filter_body` fields instead. Specifies the keywords for classifying inbound email messages as "Success" signals. Separate multiple keywords using commas. If any of the keywords is found in an email message's Subject line, the email message will count as "Success". Set this field to "" (an empty string) to consider all inbound email messages as "Success" (unless they match any keywords listed in `subject_fail` and are thus classified as "Failure"). Example:
SUCCESS,COMPLETEDIn this example, the email counts as success if the Subject line contains either the word "SUCCESS" or the word "COMPLETED". subject_fail : string, optional, default value: "". **Deprecated**. Use the `failure_kw`, `filter_subject` and `filter_body` fields instead. Specifies the keywords for classifying inbound email messages as "Failure" signals. Separate multiple keywords using commas. If any of the keywords is found in an email message's Subject line, the email message will count as "Failure". Set this field to "" (an empty string) to perform no "Failure" classification. Example:
FAILED,ERRORIn this example, the email counts as failure if the Subject line contains either the word "FAILED" or the word "ERROR". ### Response Codes 200 OK : The check was successfully updated. 400 Bad Request : The request is not well-formed, violates schema, or uses invalid field values. 401 Unauthorized : The API key is either missing or invalid. 403 Forbidden : Access denied, wrong API key. 404 Not Found : The specified check does not exist. ### Example Request ```bash curl SITE_ROOT/api/v2/checks/f618072a-7bde-4eee-af63-71a77c5723bc \ --header "X-Api-Key: your-api-key" \ --data '{"name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}' ``` Or, alternatively: ```bash curl SITE_ROOT/api/v2/checks/f618072a-7bde-4eee-af63-71a77c5723bc \ --data '{"api_key": "your-api-key", "name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}' ``` ### Example Response ```json { "channels": "", "desc": "", "grace": 60, "last_ping": null, "n_pings": 0, "name": "Backups", "slug": "backups", "next_ping": null, "manual_resume": false, "methods": "", "start_kw": "", "success_kw": "", "failure_kw": "", "filter_subject": false, "filter_body": false, "pause_url": "SITE_ROOT/api/v2/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause", "resume_url": "SITE_ROOT/api/v2/checks/f618072a-7bde-4eee-af63-71a77c5723bc/resume", "ping_url": "PING_ENDPOINTf618072a-7bde-4eee-af63-71a77c5723bc", "status": "new", "started": false, "tags": "prod www", "timeout": 3600, "update_url": "SITE_ROOT/api/v2/checks/f618072a-7bde-4eee-af63-71a77c5723bc", } ``` ## Pause Monitoring of a Check {: #pause-check .rule } `POST SITE_ROOT/api/v2/checks/