notification channels API

notification channels

Configure alert channels for trip/recover notifications.

GET /v1/projects/:project_id/notification-channels

List notification channels

Auth: User API key

Parameters

Name In Type Required Description
project_id path uuid Yes Project ID

Responses

200 List of channels
channels
- Array of channel objects (secrets masked)

Example

Request
curl https://api.tripswitch.dev/v1/projects/PROJECT_ID/notification-channels \
  -H "Authorization: Bearer YOUR_USER_API_KEY"
Response
{
  "channels": [
    {
      "id": "ch_abc123",
      "channel": "slack",
      "enabled": true,
      "events": ["trip", "recover"],
      "config": {"webhook_url": "hooks.slack.com/***"}
    }
  ]
}
POST /v1/projects/:project_id/notification-channels

Create a notification channel

Auth: User API key

Parameters

Name In Type Required Description
project_id path uuid Yes Project ID

Request Body

channel *
string Channel type (slack, pagerduty, email, webhook)
config *
object Channel-specific configuration
enabled
boolean Whether channel is active
events
array Events to notify on (trip, recover)

Responses

201 Channel created
channel
- Created channel object
422 Validation failed

Example

Request
curl -X POST https://api.tripswitch.dev/v1/projects/PROJECT_ID/notification-channels \
  -H "Authorization: Bearer YOUR_USER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "channel": "slack",
    "enabled": true,
    "events": ["trip", "recover"],
    "config": {"webhook_url": "https://hooks.slack.com/services/..."}
  }'
Response
{
  "channel": {
    "id": "ch_abc123",
    "channel": "slack",
    "enabled": true,
    "events": ["trip", "recover"],
    "config": {"webhook_url": "hooks.slack.com/***"}
  }
}
PATCH /v1/projects/:project_id/notification-channels/:id

Update a notification channel

Auth: User API key

Parameters

Name In Type Required Description
project_id path uuid Yes Project ID
id path string Yes Channel ID

Request Body

config
object
enabled
boolean
events
array

Responses

200 Channel updated
channel
- Updated channel object
404 Channel not found
422 Validation failed

Example

Request
curl -X PATCH https://api.tripswitch.dev/v1/projects/PROJECT_ID/notification-channels/ch_abc123 \
  -H "Authorization: Bearer YOUR_USER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled": false}'
Response
{
  "channel": {
    "id": "ch_abc123",
    "channel": "slack",
    "enabled": false,
    "events": ["trip", "recover"],
    "config": {"webhook_url": "hooks.slack.com/***"}
  }
}
DELETE /v1/projects/:project_id/notification-channels/:id

Delete a notification channel

Auth: User API key

Parameters

Name In Type Required Description
project_id path uuid Yes Project ID
id path string Yes Channel ID

Responses

204 Channel deleted
404 Channel not found

Example

Request
curl -X DELETE https://api.tripswitch.dev/v1/projects/PROJECT_ID/notification-channels/ch_abc123 \
  -H "Authorization: Bearer YOUR_USER_API_KEY"
Response
(empty body, 204 No Content)
POST /v1/projects/:project_id/notification-channels/:id/test

Send a test notification

Auth: User API key

Parameters

Name In Type Required Description
project_id path uuid Yes Project ID
id path string Yes Channel ID

Responses

200 Test notification sent
message
- Confirmation message
status
- ok
404 Channel not found
422 Send failed

Example

Request
curl -X POST https://api.tripswitch.dev/v1/projects/PROJECT_ID/notification-channels/ch_abc123/test \
  -H "Authorization: Bearer YOUR_USER_API_KEY"
Response
{
  "status": "ok",
  "message": "Test notification sent"
}