---
title: "Create"
method: POST
path: "/api/cp/alert"
tags: ["Alert"]
---

# Create

`POST /api/cp/alert`

Create a new Alert record.

## Request body

- AlertInput
  - `id` integer — Id
  - `company_id` integer, required — Company Id (references company.id)
  - `title` string — Title
  - `area` string, required — Area
  - `operator` '<' | '<=' | '=' | '>' | '>=' | 'always' — Operator
  - `threshold` number — Threshold
  - `reset_threshold` number — Reset Threshold
  - `sample_period` integer — Sample Period
  - `recipient` string — Recipient
  - `template` string — Template
  - `state` 'Paused' | 'Ready' | 'Fired' | 'Sent' | 'Simulate' — State
  - `penalty` integer — Penalty
  - `reset_timeout` string, date-time — Reset Timeout
  - `cron` string — Cron
  - `sandbox_id` integer — Sandbox Id
  - `last_ran` string, date-time, nullable — Last Ran
  - `next_run` string, date-time — Next Run
  - `tag` string — Tag
  - `notice_level` 'none' | 'warning' | 'error', required — Notice Level
  - `table_change` string — Table Change
  - `query` string — Query

## Response `200`

Successful response

- CreateResponse
  - `id` union — The ID of the newly created record
    - integer
    - string
  - `status` string — Operation status

## Other responses

- `400` — Bad Request - Invalid parameters or request body
- `401` — Authentication information is missing or invalid
- `403` — Access denied - insufficient permissions or dependency access failure
- `409` — Conflict - foreign key or unique constraint violation on write
- `500` — Internal server error

---

[API](https://skmtc.dev/connexcs/apis/connexcs-control-panel-api.md) · [All operations](https://skmtc.dev/connexcs/apis/connexcs-control-panel-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/connexcs/connexcs-control-panel-api/revisions/54bc2ed6edae/schema)
