Update a notification rule
PATCH /v1/notification-rules/{notification_rule_id}
| Property | Value |
|---|---|
| Operation | update_notification_rule |
| Group | Notification rules |
| Scope | messages:write |
| Route class | control |
| Idempotency | No Idempotency-Key |
| Audit | Audited channels.notification_rule.update (mutation) |
| Released in | 1.60.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Changes the rule at the revision If-Match names, checked as a create is (1.60.0).
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the messages:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl -X PATCH "$VOCAL_API/v1/notification-rules/ntr_..." \
-H "Authorization: Bearer $VOCAL_API_KEY" \
-H 'If-Match: "1"' \
-H "Content-Type: application/json" \
-d '{}'const response = await fetch(`${process.env.VOCAL_API}/v1/notification-rules/ntr_...`, {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
'If-Match': '"1"',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
console.log(response.status, await response.text());import os
import requests
response = requests.patch(
f"{os.environ['VOCAL_API']}/v1/notification-rules/ntr_...",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
"If-Match": '"1"',
},
json={},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
notification_rule_id | path | NotificationRuleId | yes | The id of a notification rule: ntr_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
if-match | header | string | yes | The revision the change was made against, quoted as the ETag returns it, or * to overwrite. |
Request body
Content type application/json, required: NotificationRuleUpdateRequest.
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | no | |
event_types | array of NotificationEventType | no | |
filter | string or null | no | |
fixed_arguments | NotificationArgumentsInput | no | |
name | string | no | |
template | string | no |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | NotificationRule | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden, org_suspended |
404 | application/json | ErrorEnvelope | not_found |
409 | application/json | ErrorEnvelope | connection_revoked |
412 | application/json | ErrorEnvelope | revision_mismatch |
422 | application/json | ErrorEnvelope | validation_failed |
428 | application/json | ErrorEnvelope | precondition_required |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is NotificationRule.
| Field | Type | Required | Description |
|---|---|---|---|
connection_id | ConnectionId | yes | |
created_at | Timestamp | yes | |
enabled | boolean | yes | |
event_types | array of NotificationEventType | yes | The record event types it delivers (RECORD_EVENT_TYPES). |
filter | string or null | yes | A ZEN expression over the event envelope; null delivers every event. |
fixed_arguments | NotificationArguments | yes | Every argument but the text, fixed at save, such as the destination channel. |
id | NotificationRuleId | yes | |
name | string | yes | |
object | "notification_rule" | yes | |
organization_id | OrganizationId | yes | |
revision | integer | yes | |
template | string | yes | The text in the closed template language of prompt-manager.md section 3, over the event envelope's fields; in PHI mode the envelope carries identifiers only. |
tool | UpstreamToolName | yes | A notify tool of the Connection's Connector. |
updated_at | Timestamp | yes |