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.
Body
Required
-
ID of the webhook (auto-generated)
-
Type of webhook
Values are
NewMeasurement
,NewEvent
,InstrumentStatus
,CalibrationFinished
, orSicFinished
. -
Serial number of the instrument
-
URL to send the webhook message to. Must use HTTPS.
-
Secret used to sign the webhook message. If not set, a random secret will be generated.
POST
/webhooks
curl \
--request POST 'https://api.mycirrus.cloud/v1/webhooks' \
--header "Content-Type: application/json" \
--data '{"id":"xxxxxxxxxxxx","url":"https://example.com/mywebhook","type":"NewMeasurement","secret":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","instrument":"QT123456"}'
Request example
{
"id": "xxxxxxxxxxxx",
"url": "https://example.com/mywebhook",
"type": "NewMeasurement",
"secret": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"instrument": "QT123456"
}
Response examples (201)
{
"id": "xxxxxxxxxxxx",
"url": "https://example.com/mywebhook",
"type": "NewMeasurement",
"secret": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"instrument": "QT123456"
}
Response examples (400)
Example 1
{
"error": "MissingParam",
"description": "The required parameter StartTime was missing from the request."
}
{
"error": "NotFound",
"description": "The instrument QT123456 could not be found."
}
Response examples (401)
{
"error": "TokenExpired",
"description": "Your access token is invalid or has expired. Try refreshing the token."
}
Response examples (403)
{
"error": "AccessDenied",
"description": "You do not have permission to access this data."
}
Response examples (429)
{
"error": "TooManyRequests",
"description": "You have made too many requests in a short time. Please wait before trying again."
}