Post an alert to an automation
POST
/api/alerts/{id}Polaris' JSON, with the alert address's secret as a bearer token. The automation whose trigger owns the address runs. ntfy's JSON publish is also taken here, with the secret as its topic field. Unknown fields are refused.
On this page
Parameters
| Field | In | Type | Description |
|---|---|---|---|
idrequired | path | string | The alert address's id.
|
Request body
| Field | Type | Description |
|---|---|---|
message | string |
|
title | string |
|
severity | number | string | |
priority | number | string | |
tags | string | string[] | |
click | string |
|
icon | string |
|
attach | string |
|
markdown | boolean | |
actions | string | object[] | |
dedupKey | string |
|
JSON schema
{
"type": "object",
"properties": {
"message": {
"type": "string",
"maxLength": 16384
},
"title": {
"type": "string",
"maxLength": 250
},
"severity": {
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"maxLength": 10
}
]
},
"priority": {
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"maxLength": 10
}
]
},
"tags": {
"anyOf": [
{
"type": "string",
"maxLength": 510
},
{
"type": "array",
"items": {
"type": "string",
"maxLength": 50
}
}
]
},
"click": {
"type": "string",
"maxLength": 2048
},
"icon": {
"type": "string",
"maxLength": 2048
},
"attach": {
"type": "string",
"maxLength": 2048
},
"markdown": {
"type": "boolean"
},
"actions": {
"anyOf": [
{
"type": "string",
"maxLength": 6384
},
{
"type": "array",
"items": {
"type": "object",
"properties": {
"action": {
"type": "string",
"maxLength": 20
},
"label": {
"type": "string",
"maxLength": 60
},
"url": {
"type": "string",
"maxLength": 2048
},
"clear": {
"type": "boolean"
},
"method": {
"type": "string",
"maxLength": 10
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string",
"maxLength": 500
}
},
"body": {
"type": "string",
"maxLength": 4096
},
"intent": {
"type": "string",
"maxLength": 200
},
"extras": {
"type": "object",
"additionalProperties": {
"type": "string",
"maxLength": 500
}
}
},
"required": [
"action",
"label"
],
"additionalProperties": false
}
}
]
},
"dedupKey": {
"type": "string",
"maxLength": 200
}
},
"additionalProperties": false
}Example request
curl -X POST "https://polaris.example.com/api/alerts/{id}" \
-H "Authorization: Bearer $POLARIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "string",
"title": "string",
"severity": 0,
"priority": 0,
"tags": "string",
"click": "string",
"icon": "string",
"attach": "string",
"markdown": false,
"actions": "string",
"dedupKey": "string"
}'Responses
| Status | Meaning |
|---|---|
200 | OK |
Can also answer the common errors 400, 401, 403, 404, 429. See common errors