---
title: "Create a new status check template."
method: POST
path: "/templates/statuschecks"
tags: ["templates"]
---

# Create a new status check template.

`POST /templates/statuschecks`

Pass a JSON object to create a new status check template.

## Request body

- GithubComChaosMeshChaosMeshPkgDashboardApiserverTypesStatusCheckTemplate
  - `description` string
  - `name` string
  - `namespace` string
  - `spec` GithubComChaosMeshChaosMeshApiV1alpha1StatusCheckTemplate
    - `duration` string — Duration defines the duration of the whole status check if the number of failed execution does not exceed the failure threshold. Duration is available to both `Synchronous` and `Continuous` mode. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". +optional
    - `failureThreshold` integer — FailureThreshold defines the minimum consecutive failure for the status check to be considered failed. +optional +kubebuilder:default=3 +kubebuilder:validation:Minimum=1
    - `http` GithubComChaosMeshChaosMeshApiV1alpha1HTTPStatusCheck
      - `body` string — +optional
      - `criteria` GithubComChaosMeshChaosMeshApiV1alpha1HTTPCriteria
        - `statusCode` string — StatusCode defines the expected http status code for the request. A statusCode string could be a single code (e.g. 200), or an inclusive range (e.g. 200-400, both `200` and `400` are included).
      - `headers` HttpHeader
      - `method` string — +optional +kubebuilder:validation:Enum=GET;POST +kubebuilder:default=GET
      - `url` string
    - `intervalSeconds` integer — IntervalSeconds defines how often (in seconds) to perform an execution of status check. +optional +kubebuilder:default=10 +kubebuilder:validation:Minimum=1
    - `mode` 'Synchronous' | 'Continuous'
    - `recordsHistoryLimit` integer — RecordsHistoryLimit defines the number of record to retain. +optional +kubebuilder:default=100 +kubebuilder:validation:Minimum=1 +kubebuilder:validation:Maximum=1000
    - `successThreshold` integer — SuccessThreshold defines the minimum consecutive successes for the status check to be considered successful. SuccessThreshold only works for `Synchronous` mode. +optional +kubebuilder:default=1 +kubebuilder:validation:Minimum=1
    - `timeoutSeconds` integer — TimeoutSeconds defines the number of seconds after which an execution of status check times out. +optional +kubebuilder:default=1 +kubebuilder:validation:Minimum=1
    - `type` 'HTTP'

## Response `200`

OK

- GithubComChaosMeshChaosMeshPkgDashboardApiserverTypesStatusCheckTemplate
  - `description` string
  - `name` string
  - `namespace` string
  - `spec` GithubComChaosMeshChaosMeshApiV1alpha1StatusCheckTemplate
    - `duration` string — Duration defines the duration of the whole status check if the number of failed execution does not exceed the failure threshold. Duration is available to both `Synchronous` and `Continuous` mode. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". +optional
    - `failureThreshold` integer — FailureThreshold defines the minimum consecutive failure for the status check to be considered failed. +optional +kubebuilder:default=3 +kubebuilder:validation:Minimum=1
    - `http` GithubComChaosMeshChaosMeshApiV1alpha1HTTPStatusCheck
      - `body` string — +optional
      - `criteria` GithubComChaosMeshChaosMeshApiV1alpha1HTTPCriteria
        - `statusCode` string — StatusCode defines the expected http status code for the request. A statusCode string could be a single code (e.g. 200), or an inclusive range (e.g. 200-400, both `200` and `400` are included).
      - `headers` HttpHeader
      - `method` string — +optional +kubebuilder:validation:Enum=GET;POST +kubebuilder:default=GET
      - `url` string
    - `intervalSeconds` integer — IntervalSeconds defines how often (in seconds) to perform an execution of status check. +optional +kubebuilder:default=10 +kubebuilder:validation:Minimum=1
    - `mode` 'Synchronous' | 'Continuous'
    - `recordsHistoryLimit` integer — RecordsHistoryLimit defines the number of record to retain. +optional +kubebuilder:default=100 +kubebuilder:validation:Minimum=1 +kubebuilder:validation:Maximum=1000
    - `successThreshold` integer — SuccessThreshold defines the minimum consecutive successes for the status check to be considered successful. SuccessThreshold only works for `Synchronous` mode. +optional +kubebuilder:default=1 +kubebuilder:validation:Minimum=1
    - `timeoutSeconds` integer — TimeoutSeconds defines the number of seconds after which an execution of status check times out. +optional +kubebuilder:default=1 +kubebuilder:validation:Minimum=1
    - `type` 'HTTP'

## Other responses

- `400` — Bad Request
- `500` — Internal Server Error

---

[API](https://skmtc.net/chaos-mesh/apis/chaos-mesh-dashboard-api.md) · [All operations](https://skmtc.net/chaos-mesh/apis/chaos-mesh-dashboard-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/chaos-mesh/chaos-mesh-dashboard-api/versions/c965f06ffb38/schema)
