Skip to main content
POST
/
v1
/
risk-score
/
ca-garaging
Calculate Risk Score
curl --request POST \
  --url https://api.example.com/v1/risk-score/ca-garaging \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "policy_holder_id": "<string>",
  "vehicles": [
    {
      "vehicle_id": "<string>",
      "garaging_location": {
        "latitude": 36.890333,
        "longitude": -95.967285
      },
      "body_type": "passenger-car"
    }
  ],
  "version": "v2",
  "naics_code": "492110",
  "effective_date": "2023-11-07T05:31:56Z"
}
'
import requests

url = "https://api.example.com/v1/risk-score/ca-garaging"

payload = {
"policy_holder_id": "<string>",
"vehicles": [
{
"vehicle_id": "<string>",
"garaging_location": {
"latitude": 36.890333,
"longitude": -95.967285
},
"body_type": "passenger-car"
}
],
"version": "v2",
"naics_code": "492110",
"effective_date": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
policy_holder_id: '<string>',
vehicles: [
{
vehicle_id: '<string>',
garaging_location: {latitude: 36.890333, longitude: -95.967285},
body_type: 'passenger-car'
}
],
version: 'v2',
naics_code: '492110',
effective_date: '2023-11-07T05:31:56Z'
})
};

fetch('https://api.example.com/v1/risk-score/ca-garaging', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/risk-score/ca-garaging",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'policy_holder_id' => '<string>',
'vehicles' => [
[
'vehicle_id' => '<string>',
'garaging_location' => [
'latitude' => 36.890333,
'longitude' => -95.967285
],
'body_type' => 'passenger-car'
]
],
'version' => 'v2',
'naics_code' => '492110',
'effective_date' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.example.com/v1/risk-score/ca-garaging"

payload := strings.NewReader("{\n \"policy_holder_id\": \"<string>\",\n \"vehicles\": [\n {\n \"vehicle_id\": \"<string>\",\n \"garaging_location\": {\n \"latitude\": 36.890333,\n \"longitude\": -95.967285\n },\n \"body_type\": \"passenger-car\"\n }\n ],\n \"version\": \"v2\",\n \"naics_code\": \"492110\",\n \"effective_date\": \"2023-11-07T05:31:56Z\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.example.com/v1/risk-score/ca-garaging")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"policy_holder_id\": \"<string>\",\n \"vehicles\": [\n {\n \"vehicle_id\": \"<string>\",\n \"garaging_location\": {\n \"latitude\": 36.890333,\n \"longitude\": -95.967285\n },\n \"body_type\": \"passenger-car\"\n }\n ],\n \"version\": \"v2\",\n \"naics_code\": \"492110\",\n \"effective_date\": \"2023-11-07T05:31:56Z\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/risk-score/ca-garaging")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"policy_holder_id\": \"<string>\",\n \"vehicles\": [\n {\n \"vehicle_id\": \"<string>\",\n \"garaging_location\": {\n \"latitude\": 36.890333,\n \"longitude\": -95.967285\n },\n \"body_type\": \"passenger-car\"\n }\n ],\n \"version\": \"v2\",\n \"naics_code\": \"492110\",\n \"effective_date\": \"2023-11-07T05:31:56Z\"\n}"

response = http.request(request)
puts response.read_body
{
  "policy_holder_id": "<string>",
  "vehicle_risk_scores": [
    {
      "vehicle_id": "<string>",
      "vehicle_risk_score": 0.5,
      "metadata": {
        "coverage": [
          {
            "usstate": "OH",
            "years": [
              2020,
              2021,
              2022,
              2023
            ]
          }
        ],
        "effective_date": "2020-01-01T00:00:00",
        "garaging_location": {
          "latitude": 39.9526,
          "longitude": -83.0036,
          "urbanicity": "rural",
          "usstate": "OH"
        },
        "naics_code": {
          "code": "492110",
          "description": "Retail Trade"
        }
      }
    }
  ],
  "job_type": "ca-garaging-risk-score",
  "version": "v2",
  "errors": null
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
policy_holder_id
string
required

Unique identifier for the policyholder.

Example:

"policy-holder-123"

vehicles
VehicleGaragingData · object[]
required

List of vehicles with their garaging locations. Max 50 vehicles per request.

Required array length: 1 - 50 elements
version
enum<string>
default:v2

Version of the risk scoring model used.

Available options:
v1,
v2
Examples:

"v1"

"v2"

naics_code
string | null

Optional NAICS code for the policyholder.

Required string length: 2 - 6
Example:

"492110"

effective_date
string<date-time> | null

Start date of the policy. Defaults to the current date and time unless overridden, typically for backtesting. Will not pull in data after this date.

Response

Successful Response

policy_holder_id
string
required

Unique identifier for the policyholder.

Example:

"policy-holder-123"

vehicle_risk_scores
CA_VehicleGaragingRiskScore · object[]
required

Risk scores for each vehicle based on their garaging locations.

job_type
string
default:ca-garaging-risk-score

Type of job that was run.

Allowed value: "ca-garaging-risk-score"
Example:

"ca-garaging-risk-score"

version
enum<string>
default:v2

Version of the risk scoring model used.

Available options:
v1,
v2
Examples:

"v1"

"v2"

errors
CA_VehicleGaragingRiskScoreError · object[] | null

Any vehicles that could not be scored.

Example:

null