Skip to main content
POST
/
apps
/
{appId}
/
notification-rules
Create Notification Rule
curl --request POST \
  --url https://api.vela.dev/v1/apps/{appId}/notification-rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Alert on large payment failure",
  "eventName": "payment.failed",
  "enabled": true,
  "conditions": [
    {
      "id": "cond-1",
      "field": "amountCents",
      "operator": "greater_than",
      "value": 10000
    }
  ],
  "actions": [
    {
      "id": "action-1",
      "destinationId": "dest-uuid",
      "channel": "slack",
      "enabled": true
    }
  ]
}
'
{
  "id": "rule-uuid",
  "appId": "app-uuid",
  "name": "Alert on large payment failure",
  "eventName": "payment.failed",
  "conditions": [
    {
      "id": "cond-1",
      "field": "amountCents",
      "operator": "greater_than",
      "value": 10000
    }
  ],
  "actions": [
    {
      "id": "action-1",
      "destinationId": "dest-uuid",
      "channel": "slack",
      "target": null,
      "enabled": true
    }
  ],
  "enabled": true,
  "lastTriggeredAt": null,
  "triggerCount": 0,
  "createdAt": "2024-06-01T12:00:00.000Z"
}

Authorizations

Authorization
string
header
required

Client secret for management API access. Format: vela_cs_...

Path Parameters

appId
string
required

App UUID or slug

Body

application/json
name
string
required

Rule display name

eventName
string
required

Event name to watch

conditions
object[]
required

Array of conditions (empty array = trigger on all)

actions
object[]
required

Array of delivery actions

enabled
boolean
default:true

Response

201 - application/json

Rule created

id
string

Rule identifier

appId
string<uuid>
name
string

Rule display name

eventName
string

Event name to watch

conditions
object[]

Conditions to evaluate (empty = trigger on all)

actions
object[]

Delivery actions

enabled
boolean
lastTriggeredAt
string<date-time> | null
triggerCount
integer
createdAt
string<date-time>