API reference

Download spec
post

Create notification rule

Creates a rule that delivers matching events to the specified channels. At least one event type and one channel target are required.

Required API key scope
notifications:create
/api/v1/team/notifications/rules

Code samples

curl --request POST \
  --url https://api.emailguard.co/api/v1/team/notifications/rules \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{}'

Parameters

Request body

Rule name, event types, and channel targets

channelsunknown[]required

One or more channel targets to notify when matching events occur.

conditionsobject

Optional rule conditions (e.g. usage_threshold for USAGE_API_THRESHOLD).

descriptionstring

Optional longer description of what the rule does.

event_typesstring[]required

Event type identifiers this rule listens for (at least one required).

itemsstring
is_enabledboolean

When false, the rule is stored but does not deliver events.

namestringrequired

Display name for the rule.

Responses

200
OK
OK
codestringrequired

Machine-readable status code (for example OK or INVALID_BODY).

idstring

UUID of the created or referenced record.

messagestring

Human-readable detail when the code is not OK.

400
Bad Request
Bad Request
codestringrequired

Machine-readable status code (for example OK or INVALID_BODY).

messagestring

Human-readable detail when the code is not OK.

401
Unauthorized
Unauthorized
codestringrequired

Machine-readable status code (for example OK or INVALID_BODY).

messagestring

Human-readable detail when the code is not OK.

403
Forbidden
Forbidden
codestringrequired

Machine-readable status code (for example OK or INVALID_BODY).

messagestring

Human-readable detail when the code is not OK.