Skip to main content
PATCH
/
apps
/
{appId}
/
notification-rules
/
{ruleId}
Update Notification Rule
curl --request PATCH \
  --url https://api.vela.dev/v1/apps/{appId}/notification-rules/{ruleId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "enabled": false
}
'
import requests

url = "https://api.vela.dev/v1/apps/{appId}/notification-rules/{ruleId}"

payload = { "enabled": False }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: false})
};

fetch('https://api.vela.dev/v1/apps/{appId}/notification-rules/{ruleId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vela.dev/v1/apps/{appId}/notification-rules/{ruleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.vela.dev/v1/apps/{appId}/notification-rules/{ruleId}"

payload := strings.NewReader("{\n \"enabled\": false\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.vela.dev/v1/apps/{appId}/notification-rules/{ruleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": false\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.vela.dev/v1/apps/{appId}/notification-rules/{ruleId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": false\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "appId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "eventName": "<string>",
  "conditions": [
    {
      "id": "<string>",
      "field": "<string>",
      "value": "<string>"
    }
  ],
  "actions": [
    {
      "id": "<string>",
      "destinationId": "<string>",
      "target": "<string>",
      "enabled": true
    }
  ],
  "enabled": true,
  "lastTriggeredAt": "2023-11-07T05:31:56Z",
  "triggerCount": 123,
  "createdAt": "2023-11-07T05:31:56Z"
}
{
"statusCode": 404,
"error": "Not Found",
"message": "Resource not found"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

appId
string
required

App UUID or slug

ruleId
string
required

Notification rule identifier

Body

application/json
name
string

New display name

eventName
string

New event name to watch

conditions
object[]

Updated conditions array

actions
object[]

Updated actions array

enabled
boolean

Enable or disable the rule

Response

Updated rule

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>