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"
}
| Field | Type | Description |
|---|---|---|
id | string | Unique alert channel identifier |
orgId | string | Organization that owns the channel |
type | string | Channel type: EMAIL, SLACK, WEBHOOK, DISCORD, TEAMS, TELEGRAM, GOOGLE_CHAT, MATTERMOST, PAGERDUTY, OPSGENIE |
name | string | Human-readable channel name |
enabled | boolean | Whether the channel is active |
createdAt | string | ISO 8601 creation timestamp |
updatedAt | string | ISO 8601 last update timestamp |
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
}
}
Fetch all alert channels configured for your organization.
/v1/alert-channelsCreate Alert Channel
POST /v1/alert-channels
Creates a new alert channel for your organization.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | EMAIL, SLACK, WEBHOOK, DISCORD, TEAMS, TELEGRAM, GOOGLE_CHAT, MATTERMOST, PAGERDUTY, OPSGENIE |
name | string | Yes | Display name for the channel |
config | object | Yes | Channel-specific configuration (see below) |
enabled | boolean | No | Whether 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"]
}
}
}
Create a new alert channel for incident notifications.
/v1/alert-channelsDelete 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
| Parameter | Type | Description |
|---|---|---|
id | string | The 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"
}
}
Permanently delete an alert channel.
/v1/alert-channels/:idWebhook 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:
| Event | Description |
|---|---|
incident.triggered | A new incident has been detected |
incident.acknowledged | An incident has been acknowledged |
incident.resolved | An incident has been resolved |