canonical: https://jentic.com/apis/ritc.io/ritc-main

# Ritc

The Ritc API runs business rules in the cloud: it links triggers to actions through channels and executes them on request. A rule bundles triggerIds and actionIds, each trigger and action points at a channelId and functionId, and channels expose the functions an app can call. Rules run one at a time, as a rule group, across every active rule in an app, or for a single app user, with an option to stop when the first rule fires.

## For AI agents

Define Ritc rules from triggers and actions, attach them to channels and users, and run a rule, rule group, or an app's active rules on demand.

## Scope

Does not host application code, send email or SMS itself, or schedule cron jobs. Use for defining and running trigger-and-action rules on Ritc only.

## Capabilities

- Compose a rule from triggerIds and actionIds and set its status
- Run a single rule, a rule group from a list of rule ids, or all active rules in an app
- Stop rule-group execution early with the break_when_rule_fires query flag
- Define triggers and actions that call a channel function with parameters
- Register channels and the functions each channel exposes
- Assign app users to channels and rules, then run a rule for one user
- Store external API credentials per channel for an app

## Use cases

### Agent-triggered rule execution

A developer has encoded business logic as Ritc rules and wants an agent to fire them at the right moment rather than reimplementing the logic in prompts. Through Jentic the agent searches for 'run a Ritc rule', loads the runRule operation, and calls POST `/rules/{rule_id}/run` with the API key added by the developer's own instance. The rule's triggers and actions then execute on Ritc as defined.

Example prompt: Call GET /rules to find the rule named 'late-invoice-reminder', then call POST `/rules/{rule_id}/run` with that rule's id

### Building a rule from triggers and actions

A new automation is assembled in three steps: create a trigger with POST /triggers (name, channelId, and functionId are required), create an action with POST /actions using the same required fields, then create the rule with POST /rules passing triggerIds and actionIds. The rule can be updated later with PATCH `/rules/{rule_id}` or removed with DELETE `/rules/{rule_id}.`

Example prompt: Call POST /triggers with name 'order-over-500', channelId 'shop', and functionId 'fn-001', call POST /actions with name 'notify-sales', channelId 'mail', and functionId 'fn-002', then call POST /rules with both ids in triggerIds and actionIds

### Batch evaluation of an app's rules

When an event arrives that several rules could match, POST `/apps/rules/run` evaluates every active rule in the app, and POST `/apps/rulegroup/run/{rule_id_list}` runs only a chosen list. Both accept break_when_rule_fires so evaluation can stop at the first rule that fires, which keeps mutually exclusive rules from all acting on the same event.

Example prompt: Call POST `/apps/rulegroup/run/{rule_id_list}` with rule_id_list '12,13,14' and break_when_rule_fires true

### Per-user rule assignment

Rules can target individual app users. POST /users creates an app user, POST `/users/{user_id}/rules/{rule_id}` assigns a rule to them, and POST `/users/{user_id}/rules/{rule_id}/run` executes that rule for that user only, with GET `/users/{user_id}/rules` listing what the user is subscribed to.

Example prompt: Call POST `/users/{user_id}/rules/{rule_id}` to assign rule 7 to user 'u-981', then call POST `/users/{user_id}/rules/{rule_id}/run` for the same pair

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/rules` | Create a rule |
| POST | `/rules/{rule_id}/run` | Run a rule |
| POST | `/apps/rules/run` | Run active app rules |
| POST | `/apps/rulegroup/run/{rule_id_list}` | Run a rule group |
| POST | `/triggers` | Create a trigger |
| POST | `/actions` | Create an action |
| GET | `/channels/{channel_id}/functions` | List channel functions |
| POST | `/users/{user_id}/rules/{rule_id}/run` | Run a rule for a user |

## Key resources

- **Rules** — Named rules that combine triggerIds and actionIds with a status
- **Triggers and actions** — Conditions and effects, each bound to a channelId and functionId with parameters
- **Channels** — Integration endpoints and the functions they expose to rules
- **Apps** — Containers for rules, rule groups, channel users, and external credentials
- **Users** — App users and admin users, with channel and rule assignments

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 60 / 100
- **Maturity:** Foundational
- **Dimensions:**
  - Foundational Compliance: 74 / 100
  - Developer Experience & Jentic Compatibility: 68 / 100
  - AI-Readiness & Agent Experience: 38 / 100
  - Agent Usability: 92 / 100
  - Security: 50 / 100
  - AI Discoverability: 100 / 100
- **View full report:** https://jentic.com/apis/ritc.io/ritc-main/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring Ritc by hand means building its Authorization header as a Base64-encoded API key with a trailing colon, then learning how rules, triggers, actions, channels, and functions reference each other by id. Through Jentic you install once, import Ritc from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** Ritc puts the rule id in the URL path (`/rules/{rule_id}/run`), so a rule in Jentic can pin your agent to running specific Ritc rules. You choose the operations it may call, so destructive ones like DELETE `/channels/{channel_id}` or removing external credentials are not included unless you add them.
- **Credential handling:** Your Ritc API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'run a rule' or 'create a trigger', and Jentic returns the matching Ritc operation with its input schema, including required fields like channelId and functionId.

## Related APIs

- **n8n** — Self-hostable workflow automation with node-based triggers and actions
- **Ritc** — Another directory entry for the same Ritc rules API
- **AWS Step Functions** — Managed state machines that orchestrate serverless steps on AWS

## FAQ

### What authentication does the Ritc API use?

The Ritc OpenAPI spec declares an apiKey scheme sent in the Authorization header. Its description says Ritc treats this as HTTP Basic with the API key as the username and an empty password, in the form Base64encode(api-key:), and also accepts the key as plaintext. Through Jentic the key is stored by your own instance and added to the header at call time.

### Can I run several Ritc rules at once?

Yes. POST `/apps/rules/run` runs every active rule in the app, and POST `/apps/rulegroup/run/{rule_id_list}` runs only the rules you list in the path. Both take a break_when_rule_fires query parameter that stops evaluation once a rule fires.

### What are the rate limits for the Ritc API?

The OpenAPI spec does not specify rate limits. Check the Ritc site at https://ritc.io/ for current limits on your plan.

### Is there a Ritc MCP server?

You do not need an MCP server to give your agent Ritc. Jentic connects it directly from the API Directory: import it, store your API key once, and your agent finds operations like runRule or addTrigger by intent when it needs them.

### How do I run a Ritc rule through Jentic?

Search Jentic for 'run a Ritc rule', load the POST `/rules/{rule_id}/run` operation, and execute it with the rule id. Use GET /rules first if the agent only knows the rule's name. To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Can I limit what my agent is allowed to do with the Ritc API?

Yes. Write a rule that allows only GET /rules and POST `/rules/{rule_id}/run` for the rule ids you choose, so the agent can look up and fire those rules but cannot edit triggers, delete channels, or touch external credentials, and every call it makes is logged.
