Use this request to add a new notification rule for a base.
Input Parameters
workspace_id [int, required]
The ID of the workspace where the base is stored.
base_name [string, required]
The name of the base.
RuleData [JSON object, required]
In this JSON object, use the following params to define this notification rule:
run_condition [enum(
per_day
,per_update
__), required]Define whether the action should be triggered by date or table update. For Records near deadline, use
per_day
and for Records modified and Records meet specific conditions after modification, useper_update
. Details see below.trigger [JSON object, required]
In this JSON object, define the trigger of the rule with the following params:
rule_name [string, required]
The name of the rule.
table_id [string, required]
The ID of the table.
view_id [string, required]
The ID of the view.
condition [enum(
rows_modified
,near_deadline
__,filters_satisfy
__), required]
- For 'Records near deadline', use
per_day
in the run_condition param andnear_deadline
here.- For 'Records modified', use
per_update
in the run_condition param androws_modified
here.- For 'Records meet specific conditions after modification', use
per_update
in the run_condition param andfilters_satisfy
here.For the case Records near deadline, when
run_condition
isper_day
andcondition
isnear_deadline
, you'll define which date column to use as deadline dates, and optionally define how many days before and to which time of the day should the notification be sent:date_column_name [string, required]
For 'Records near deadline', give the name of the date column that contains the deadline dates. If left blank, the first date column in the table will be taken as deadline.
alarm_days [int, optional]
Use a number to define how many days before the deadline should the notification be triggered.
notify_hour [int(0-23), optional]
Specify to which hour of the day should the notification be sent.
For the case Records modified, when
run_condition
isper_update
andcondition
isrows_modified
, a notification is sent right away inside the base editor. If this notification is not read within two hours, it'll be sent via email, if the receiver has enabled email notification in their personal settings:There is no further trigger conditions necessary.
For the case Records meet specific conditions after modification, when
run_condition
isper_update
andcondition
isfilters_satisfy
, you can define which fields to watch and set filters:watch_all_columns _[enum(
true
,false
, optional,true
by default)]Use
true
or leave this param blank, if you want all columns to be watched.column_keys _[list, optional]
When certain columns should be watched, use this list to include their keys, so only when there's modification in these columns, this notification rule will be triggered.
filters and filter_conjunction refer to the API Request Base Operations > Rows > List Filtered Rows. You can define filters for all the fields in the table as a combination to the watched fields. So that only when the filtered records in the watched fields are modified, will this notification rule be triggered.
action [JSON object, required]
In this JSON object, define the users to be notified with the following params:
type [enum(
notify
), optional]For the moment, there's only one option to notify the user. The
notify
value means a notification will be sent inside the base editor, and when this isn't read within 2 hours, it'll be sent via email to the user, if the user's email setting is activated. In the near future, SeaTable will provide the option to send emails directly to users even outside your organization by configuring an email sending service.users [list, optional]
In this list, provide the users' IDs to be notified. Alternatively, use the
users_column_key
to automatically select users from a collaborator column.users_column_key [string, optional]
Select users to be notified from a collaborator column by providing its key.
default_msg [string, optional]
Here you can write a short message to remind notified users why this notification is sent, for example "The battery has to be changed in 2 days!".