`POST /v1/orgs/{org}/notification-rules`.
const url = 'https://api.updawg.net/v1/orgs/example/notification-rules';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"channel_ids":["example"],"enabled":true,"event_types":["example"],"filter":{"known_exploited":true,"min_severity":"none","proposal_kinds":["example"]},"name":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.updawg.net/v1/orgs/example/notification-rules \ --header 'Content-Type: application/json' \ --data '{ "channel_ids": [ "example" ], "enabled": true, "event_types": [ "example" ], "filter": { "known_exploited": true, "min_severity": "none", "proposal_kinds": [ "example" ] }, "name": "example" }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Organization slug.
Request Bodyrequired
Section titled “Request Bodyrequired”object
nch_… ids. May be empty: a rule for proposal.auto_merged with no
channels is how auto-merges are silenced.
proposal.opened, proposal.auto_merged, proposal.approved,
proposal.merged, proposal.halted, host.stale, host.recovered,
release.eol.
What a rule narrows its events by. Every field optional; all given must hold. The proposal fields do not narrow host events.
Responses
Section titled “Responses”Saved.
object
nch_… ids.
What a rule narrows its events by. Every field optional; all given must hold. The proposal fields do not narrow host events.
nru_….
Example
{ "filter": { "min_severity": "none" }}No name, no event type or one that does not exist, a channel id that is not one of this organization’s, or a filter with a field that does not exist.
object
Examplegenerated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}No session.
object
Examplegenerated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}Not permitted for this role.
object
Examplegenerated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}No such organization, or not yours — one answer for both.
object
Examplegenerated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}A rule with that name exists.
object
Examplegenerated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}Over the organization’s request limit. Retry-After says when to try again; RateLimit-Limit is the burst.
object
Examplegenerated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}