Skip to main content
Hosted rating runs one program version on Effective’s servers. You send one policy as JSON. The native RSL engine checks the policy against the program’s input rules, then rates it. You get the premium and its parts, or a list of each rule the policy failed. You need an Effective API key with raters:run, and your organization needs access to run the program. Get a rating program explains access and subscriptions.

1. Find a program

List rating programs and filter by state:
Each item in programs has an id, its carrier, product and states, and access.canRun. Use a program whose access.canRun is true. Then list its versions and choose a version. To find the program that rates a product in a state on a date, use List which rating program versions rate a product in a state.

2. Read the input schema

Each version has its own input. The input is the program’s root record, such as Policy, with its related records (drivers, vehicles) nested inside it. Programs from different carriers ask for different fields, so read the schema of the version you rate:
Get the input and output schemas returns inputSchema and outputSchema as JSON Schema. Each field holds its type, its allowed values, and its range. You or your tooling can build and check a request from inputSchema alone.

3. Rate

Rate a submission with the policy in inputs. This example uses Effective’s synthetic effective.example-ca-ppa program:
A 200 response holds the outputs in result, in the shape of outputSchema, and the exact engine that rated them:
Numbers in result are JSON numbers with 64-bit float precision, about 15 significant digits. Keep programId, version and bundleId with each result: together they identify the engine that rated it. The request changes nothing, so you can repeat it.

Errors

Every error has a stable code and an error message. Rating errors also explain the cause:
In violations, path locates the field in your input, value repeats what you sent, and constraint is the rule it failed. violationsTruncated is true when there were more violations than the response lists.

Rate a book in Python

To rate many policies, or the same book across several programs, use Relativities. It downloads each program and rates locally on the same native engine:
Program.rate maps one shared book onto each carrier’s own input, so one book rates against every program. See Rate a book with a program.