Skip to main content

Alerts API

Alert channels define where and how your team gets notified when incidents occur. You can configure multiple channels per organization, such as email, Slack, webhooks, and more.

Alert Channel Object​

{
"id": "ach_abc123def456",
"orgId": "org_abc123",
"type": "SLACK",
"name": "Engineering Alerts",
"enabled": true,
"createdAt": "2025-01-15T08:30:00.000Z",
"updatedAt": "2025-01-15T08:30:00.000Z"
}
FieldTypeDescription
idstringUnique alert channel identifier
orgIdstringOrganization that owns the channel
typestringChannel type: EMAIL, SLACK, WEBHOOK, DISCORD, TEAMS, TELEGRAM, GOOGLE_CHAT, MATTERMOST, PAGERDUTY, OPSGENIE
namestringHuman-readable channel name
enabledbooleanWhether the channel is active
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last update timestamp
note

The channel configuration (e.g., webhook URL, Slack token) is encrypted at rest and never returned in API responses for security reasons.


List Alert Channels​

GET /v1/alert-channels

Returns all alert channels for your organization.

Example Request​

curl https://api.sentro.dev/v1/alert-channels \
-H "Authorization: Bearer sentro_sk_live_your_key_here"

Response 200 OK​

{
"data": [
{
"id": "ach_abc123def456",
"orgId": "org_abc123",
"type": "SLACK",
"name": "Engineering Alerts",
"enabled": true,
"createdAt": "2025-01-15T08:30:00.000Z",
"updatedAt": "2025-01-15T08:30:00.000Z"
},
{
"id": "ach_ghi789jkl012",
"orgId": "org_abc123",
"type": "EMAIL",
"name": "On-Call Email",
"enabled": true,
"createdAt": "2025-01-10T12:00:00.000Z",
"updatedAt": "2025-01-10T12:00:00.000Z"
},
{
"id": "ach_mno345pqr678",
"orgId": "org_abc123",
"type": "WEBHOOK",
"name": "Custom Webhook",
"enabled": false,
"createdAt": "2025-01-05T09:15:00.000Z",
"updatedAt": "2025-01-12T14:30:00.000Z"
}
],
"meta": {
"total": 3
}
}
Try it

Fetch all alert channels configured for your organization.

GET/v1/alert-channels
Click ⚙ to configure your API key, then hit Send.

Create Alert Channel​

POST /v1/alert-channels

Creates a new alert channel for your organization.

Request Body​

FieldTypeRequiredDescription
typestringYesEMAIL, SLACK, WEBHOOK, DISCORD, TEAMS, TELEGRAM, GOOGLE_CHAT, MATTERMOST, PAGERDUTY, OPSGENIE
namestringYesDisplay name for the channel
configobjectYesChannel-specific configuration (see below)
enabledbooleanNoWhether the channel is active (default: true)

Configuration by Type​

EMAIL:

{
"type": "EMAIL",
"name": "Team Alerts",
"config": {
"recipients": ["oncall@example.com", "team@example.com"]
}
}

SLACK:

{
"type": "SLACK",
"name": "Engineering Channel",
"config": {
"webhookUrl": "https://hooks.slack.com/services/T00/B00/xxx"
}
}

WEBHOOK:

{
"type": "WEBHOOK",
"name": "Custom Integration",
"config": {
"url": "https://example.com/webhooks/sentro",
"secret": "whsec_your_signing_secret"
}
}

DISCORD: (Starter+)

{
"type": "DISCORD",
"name": "Ops Discord",
"config": {
"webhookUrl": "https://discord.com/api/webhooks/123456/abc..."
}
}

TEAMS: (Pro+)

{
"type": "TEAMS",
"name": "Engineering Teams",
"config": {
"webhookUrl": "https://xxx.webhook.office.com/webhookb2/..."
}
}

TELEGRAM: (Pro+)

{
"type": "TELEGRAM",
"name": "Ops Telegram",
"config": {
"botToken": "123456789:AAF...",
"chatId": "-1001234567890"
}
}

GOOGLE_CHAT: (Pro+)

{
"type": "GOOGLE_CHAT",
"name": "Ops Chat",
"config": {
"webhookUrl": "https://chat.googleapis.com/v1/spaces/.../messages?key=..."
}
}

MATTERMOST: (Pro+)

{
"type": "MATTERMOST",
"name": "Ops Mattermost",
"config": {
"webhookUrl": "https://mattermost.example.com/hooks/abc123"
}
}

PAGERDUTY: (Max)

{
"type": "PAGERDUTY",
"name": "On-Call PagerDuty",
"config": {
"integrationKey": "abc123def456..."
}
}

OPSGENIE: (Max)

{
"type": "OPSGENIE",
"name": "On-Call OpsGenie",
"config": {
"apiKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
}

Response 201 Created​

{
"data": {
"id": "ach_new123abc456",
"orgId": "org_abc123",
"type": "SLACK",
"name": "Engineering Channel",
"enabled": true,
"createdAt": "2025-01-15T10:00:00.000Z",
"updatedAt": "2025-01-15T10:00:00.000Z"
}
}

Validation Error​

{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid alert channel data",
"details": {
"type": ["Invalid alert channel type"],
"config": ["Required"]
}
}
}
Try it

Create a new alert channel for incident notifications.

POST/v1/alert-channels
Request Body
Click ⚙ to configure your API key, then hit Send.

Delete Alert Channel​

DELETE /v1/alert-channels/:id

Permanently deletes an alert channel. Any monitors using this channel will stop sending alerts through it.

Path Parameters​

ParameterTypeDescription
idstringThe alert channel ID

Response 200 OK​

{
"data": {
"id": "ach_abc123def456",
"deleted": true
}
}

Error​

{
"error": {
"code": "NOT_FOUND",
"message": "AlertChannel with id 'ach_invalid' not found"
}
}
Try it

Permanently delete an alert channel.

DELETE/v1/alert-channels/:id
Path Parameters
Click ⚙ to configure your API key, then hit Send.

Webhook Payload​

When an incident is triggered, Sentro sends a POST request to your webhook URL with the following payload:

{
"event": "incident.triggered",
"timestamp": "2025-01-15T09:28:00.000Z",
"data": {
"incident": {
"id": "inc_abc123def456",
"monitorId": "cly1abc2d0001abcdef012345",
"startedAt": "2025-01-15T09:28:00.000Z",
"cause": "Expected status 200, got 503"
},
"monitor": {
"id": "cly1abc2d0001abcdef012345",
"name": "Production API",
"url": "https://api.example.com/health"
}
}
}

Webhook events include:

EventDescription
incident.triggeredA new incident has been detected
incident.acknowledgedAn incident has been acknowledged
incident.resolvedAn incident has been resolved