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>"
}
]
}Calculate Risk Score
Calculate the risk score for a commercial auto policy with garaging data
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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Unique identifier for the policyholder.
"policy-holder-123"
List of vehicles with their garaging locations. Max 50 vehicles per request.
1 - 50 elementsShow child attributes
Show child attributes
Version of the risk scoring model used.
v1, v2 "v1"
"v2"
Optional NAICS code for the policyholder.
2 - 6"492110"
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
Unique identifier for the policyholder.
"policy-holder-123"
Risk scores for each vehicle based on their garaging locations.
Show child attributes
Show child attributes
Type of job that was run.
"ca-garaging-risk-score""ca-garaging-risk-score"
Version of the risk scoring model used.
v1, v2 "v1"
"v2"
Any vehicles that could not be scored.
Show child attributes
Show child attributes
null

