Queue Risk Score Calculation
curl --request POST \
--url https://api.example.com/v1/risk-score/ca-telematics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form version=v1 \
--form policy_holder_id=policy-holder-123 \
--form naics_code=492110import requests
url = "https://api.example.com/v1/risk-score/ca-telematics"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"version": "v1",
"policy_holder_id": "policy-holder-123",
"naics_code": "492110"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('version', 'v1');
form.append('policy_holder_id', 'policy-holder-123');
form.append('naics_code', '492110');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.example.com/v1/risk-score/ca-telematics', 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-telematics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\nv1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"policy_holder_id\"\r\n\r\npolicy-holder-123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"naics_code\"\r\n\r\n492110\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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-telematics"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\nv1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"policy_holder_id\"\r\n\r\npolicy-holder-123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"naics_code\"\r\n\r\n492110\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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-telematics")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\nv1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"policy_holder_id\"\r\n\r\npolicy-holder-123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"naics_code\"\r\n\r\n492110\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/risk-score/ca-telematics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\nv1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"policy_holder_id\"\r\n\r\npolicy-holder-123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"naics_code\"\r\n\r\n492110\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"job_id": "job_2fb5792c",
"status": "pending",
"error_message": ""
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}CA Telematics Risk Score
Queue Risk Score Calculation
Queue a job to calculate the risk score for a commercial auto policy using telematics data. This endpoint returns a job_id, which can be used to track the job status and retrieve the result once the calculation is complete.
POST
/
v1
/
risk-score
/
ca-telematics
Queue Risk Score Calculation
curl --request POST \
--url https://api.example.com/v1/risk-score/ca-telematics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form version=v1 \
--form policy_holder_id=policy-holder-123 \
--form naics_code=492110import requests
url = "https://api.example.com/v1/risk-score/ca-telematics"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"version": "v1",
"policy_holder_id": "policy-holder-123",
"naics_code": "492110"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('version', 'v1');
form.append('policy_holder_id', 'policy-holder-123');
form.append('naics_code', '492110');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.example.com/v1/risk-score/ca-telematics', 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-telematics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\nv1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"policy_holder_id\"\r\n\r\npolicy-holder-123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"naics_code\"\r\n\r\n492110\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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-telematics"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\nv1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"policy_holder_id\"\r\n\r\npolicy-holder-123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"naics_code\"\r\n\r\n492110\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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-telematics")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\nv1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"policy_holder_id\"\r\n\r\npolicy-holder-123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"naics_code\"\r\n\r\n492110\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/risk-score/ca-telematics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\nv1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"policy_holder_id\"\r\n\r\npolicy-holder-123\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"naics_code\"\r\n\r\n492110\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"job_id": "job_2fb5792c",
"status": "pending",
"error_message": ""
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
multipart/form-data
Expected CSV Format
-
Filename & Format
- Must be a CSV file (
.csvextension). - The file cannot be empty and cannot contain rows with null (empty) values.
- Must be a CSV file (
-
Required Columns
- latitude (
float) WGS84 format (e.g.37.7749) - longitude (
float) WGS84 format (e.g.-122.4194) - timestamp (
datetimein ISO 8601 format, e.g.2023-01-15T13:45:30Z)
Optional Column
- vehicle_id (
string,integerornull) if not provided, the vehicle_id will be set tovehicle_1
You can download a sample file here.
- latitude (
-
Data Validation & Constraints
- Extra columns are ignored.
- Every row must have valid values in each required column (no nulls or missing values).
- latitude and longitude are used to join external risk data, so they should be accurate real-world coordinates in WGS84 format.
- timestamp must be parseable in strict ISO 8601 format.
- Files failing these validations are rejected.
- The file must be less than 1GB.
- Files are deleted after request is processed.
Version of the risk scoring model used.
Allowed value:
"v1"Example:
"v1"
Unique identifier for the policyholder.
Example:
"policy-holder-123"
Optional NAICS code for the policyholder.
Required string length:
2 - 6Example:
"492110"

