# Create a new webhook Add a new webhook. The secret can be set or left blank. If left blank, a random secret will be generated and returned in the response. This is then used to sign the webhook payloads to verify that they are from MyCirrus. Requires an API key with the webhooks:write scope. Endpoint: POST /webhooks Version: 1.0.1 Security: apikey ## Request fields (application/json): - `id` (string) ID of the webhook (auto-generated) - `type` (string, required) Type of webhook Enum: "NewMeasurement", "NewEvent", "InstrumentStatus", "CalibrationFinished", "SicFinished" - `instrument` (string, required) Serial number of the instrument - `url` (string, required) URL to send the webhook message to. Must use HTTPS. - `secret` (string) Secret used to sign the webhook message. If not set, a random secret will be generated. ## Response 201 fields (application/json): - `id` (string) ID of the webhook (auto-generated) - `type` (string, required) Type of webhook Enum: "NewMeasurement", "NewEvent", "InstrumentStatus", "CalibrationFinished", "SicFinished" - `instrument` (string, required) Serial number of the instrument - `url` (string, required) URL to send the webhook message to. Must use HTTPS. - `secret` (string) Secret used to sign the webhook message. If not set, a random secret will be generated. ## Response 400 fields (application/json): - `error` (string) Error code - `description` (string) Description of the error ## Response 401 fields (application/json): - `error` (string) Error code - `description` (string) Description of the error ## Response 403 fields (application/json): - `error` (string) Error code - `description` (string) Description of the error ## Response 429 fields (application/json): - `error` (string) Error code - `description` (string) Description of the error