Update Exposure
curl --request PUT \
--url https://app.aiinsurance.io/api/v1/external/companies/{companyId}/exposures/{exposureId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"exposureName": "Acme Corp (Updated)",
"exposureType": "business",
"numberOfEmployees": 200,
"riskLevel": "High"
}
'import requests
url = "https://app.aiinsurance.io/api/v1/external/companies/{companyId}/exposures/{exposureId}"
payload = {
"exposureName": "Acme Corp (Updated)",
"exposureType": "business",
"numberOfEmployees": 200,
"riskLevel": "High"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
exposureName: 'Acme Corp (Updated)',
exposureType: 'business',
numberOfEmployees: 200,
riskLevel: 'High'
})
};
fetch('https://app.aiinsurance.io/api/v1/external/companies/{companyId}/exposures/{exposureId}', 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://app.aiinsurance.io/api/v1/external/companies/{companyId}/exposures/{exposureId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'exposureName' => 'Acme Corp (Updated)',
'exposureType' => 'business',
'numberOfEmployees' => 200,
'riskLevel' => 'High'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://app.aiinsurance.io/api/v1/external/companies/{companyId}/exposures/{exposureId}"
payload := strings.NewReader("{\n \"exposureName\": \"Acme Corp (Updated)\",\n \"exposureType\": \"business\",\n \"numberOfEmployees\": 200,\n \"riskLevel\": \"High\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.put("https://app.aiinsurance.io/api/v1/external/companies/{companyId}/exposures/{exposureId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"exposureName\": \"Acme Corp (Updated)\",\n \"exposureType\": \"business\",\n \"numberOfEmployees\": 200,\n \"riskLevel\": \"High\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.aiinsurance.io/api/v1/external/companies/{companyId}/exposures/{exposureId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"exposureName\": \"Acme Corp (Updated)\",\n \"exposureType\": \"business\",\n \"numberOfEmployees\": 200,\n \"riskLevel\": \"High\"\n}"
response = http.request(request)
puts response.read_body{
"id": "550e8400-e29b-41d4-a716-446655440200",
"companyId": "550e8400-e29b-41d4-a716-446655440000",
"fieldModelV1Data": {
"exposureName": "Acme Corp (Updated)",
"exposureType": "business",
"numberOfEmployees": 200,
"riskLevel": "High"
},
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-20T14:00:00.000Z",
"createdBy": "google-oauth2|123456789",
"updatedBy": "google-oauth2|987654321"
}Exposures
Update Exposure
Updates a Field Model V1 exposure. The request body is a flat JSON object
with field referenceIds as keys — the same shape as the create request.
This is a full replacement of the exposure’s field data, not a merge. Include all fields you want the exposure to have after the update.
Required permission: insured:update
PUT
/
api
/
v1
/
external
/
companies
/
{companyId}
/
exposures
/
{exposureId}
Update Exposure
curl --request PUT \
--url https://app.aiinsurance.io/api/v1/external/companies/{companyId}/exposures/{exposureId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"exposureName": "Acme Corp (Updated)",
"exposureType": "business",
"numberOfEmployees": 200,
"riskLevel": "High"
}
'import requests
url = "https://app.aiinsurance.io/api/v1/external/companies/{companyId}/exposures/{exposureId}"
payload = {
"exposureName": "Acme Corp (Updated)",
"exposureType": "business",
"numberOfEmployees": 200,
"riskLevel": "High"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
exposureName: 'Acme Corp (Updated)',
exposureType: 'business',
numberOfEmployees: 200,
riskLevel: 'High'
})
};
fetch('https://app.aiinsurance.io/api/v1/external/companies/{companyId}/exposures/{exposureId}', 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://app.aiinsurance.io/api/v1/external/companies/{companyId}/exposures/{exposureId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'exposureName' => 'Acme Corp (Updated)',
'exposureType' => 'business',
'numberOfEmployees' => 200,
'riskLevel' => 'High'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://app.aiinsurance.io/api/v1/external/companies/{companyId}/exposures/{exposureId}"
payload := strings.NewReader("{\n \"exposureName\": \"Acme Corp (Updated)\",\n \"exposureType\": \"business\",\n \"numberOfEmployees\": 200,\n \"riskLevel\": \"High\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.put("https://app.aiinsurance.io/api/v1/external/companies/{companyId}/exposures/{exposureId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"exposureName\": \"Acme Corp (Updated)\",\n \"exposureType\": \"business\",\n \"numberOfEmployees\": 200,\n \"riskLevel\": \"High\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.aiinsurance.io/api/v1/external/companies/{companyId}/exposures/{exposureId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"exposureName\": \"Acme Corp (Updated)\",\n \"exposureType\": \"business\",\n \"numberOfEmployees\": 200,\n \"riskLevel\": \"High\"\n}"
response = http.request(request)
puts response.read_body{
"id": "550e8400-e29b-41d4-a716-446655440200",
"companyId": "550e8400-e29b-41d4-a716-446655440000",
"fieldModelV1Data": {
"exposureName": "Acme Corp (Updated)",
"exposureType": "business",
"numberOfEmployees": 200,
"riskLevel": "High"
},
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-20T14:00:00.000Z",
"createdBy": "google-oauth2|123456789",
"updatedBy": "google-oauth2|987654321"
}Authorizations
Path Parameters
Body
application/json
Flat JSON object with field referenceIds as keys (full replacement)
Response
Exposure updated successfully
A Field Model V1 exposure entity with dynamic field data.
Was this page helpful?
