Create rule
Create an automation rule: trigger, conditions and actions. Pro plan.
POST https://cotlet.dev/api/v1/inoreader/rules
Creates a rule in the Automate tab. Scope sets the trigger (account, feed, folder or tag), conditions match on title and/or content, author, URL, language or RSS category and are joined with any (OR) or all (AND), and actions can assign a tag, save to Read later, mark as read, send by email, notify or call a webhook. Rules need the Pro plan and count against its 30 rules. Email and webhook actions reach other people and services. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| name string required | string | Rule name. |
| scope enum required | enum | account, feed, folder or tag: where the rule watches for new articles. |
| scope_name string | string | Folder or tag name, or feed ID. Required unless scope is account. |
| operator enum | enum | all (AND) or any (OR) for the conditions. Default: all. |
| conditions array required | array | Objects with field (title_or_content, author, url, language, rss_category) and contains. |
| actions array required | array | Objects with type (assign_tag, read_later, mark_as_read, email, notification, webhook) and value where one is needed. |
| run_on_existing boolean | boolean | Also run the rule on articles you already have. Default: false. |
Request
curl -X POST https://cotlet.dev/api/v1/inoreader/rules \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Competitor pricing","scope":"folder","scope_name":"Competitors","operator":"any","conditions":[{"field":"title_or_content","contains":"pricing"},{"field":"title_or_content","contains":"price increase"}],"actions":[{"type":"assign_tag","value":"pricing-watch"},{"type":"email"}]}' result = client.call("inoreader", "create_rule", {"name":"Competitor pricing","scope":"folder","scope_name":"Competitors","operator":"any","conditions":[{"field":"title_or_content","contains":"pricing"},{"field":"title_or_content","contains":"price increase"}],"actions":[{"type":"assign_tag","value":"pricing-watch"},{"type":"email"}]}) const result = await cotlet.call('inoreader', 'create_rule', {"name":"Competitor pricing","scope":"folder","scope_name":"Competitors","operator":"any","conditions":[{"field":"title_or_content","contains":"pricing"},{"field":"title_or_content","contains":"price increase"}],"actions":[{"type":"assign_tag","value":"pricing-watch"},{"type":"email"}]}); cotlet call inoreader create_rule --data '{"name":"Competitor pricing","scope":"folder","scope_name":"Competitors","operator":"any","conditions":[{"field":"title_or_content","contains":"pricing"},{"field":"title_or_content","contains":"price increase"}],"actions":[{"type":"assign_tag","value":"pricing-watch"},{"type":"email"}]}' Example response
{
"rule_id": "r_219",
"name": "Competitor pricing",
"enabled": true,
"slots_used": 12,
"slots_total": 30
}