curl --request PUT \
--url https://go.aiinsurance.io/api/v1/companies/{companyId}/entities/{entityType}/{entityId}/legacy-activity \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entries": [
{
"sourceId": "0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11",
"sourceRowIds": [
"0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11",
"5b0e9a77-23c1-4f0e-8a64-9a0d1a4f7c22"
],
"occurredAt": "2024-03-20T15:04:00Z",
"actorName": "Maria Okafor",
"actorEmail": "maria.okafor@example.com",
"category": "Event Information",
"headline": "Edited Claim",
"lines": [
{
"label": "Date of Loss",
"before": null,
"after": "3/14/2024"
},
{
"label": "Policy",
"after": {
"text": "PL-2041",
"entityType": "policy",
"entityId": "550e8400-e29b-41d4-a716-446655440020"
}
}
]
},
{
"sourceId": "8a1c4e90-7d2b-4c11-b0f3-3e5d6f7a8b33",
"occurredAt": "2023-01-05T09:00:00Z",
"actorName": "Maria Okafor",
"headline": "Event Created"
}
]
}
'import requests
url = "https://go.aiinsurance.io/api/v1/companies/{companyId}/entities/{entityType}/{entityId}/legacy-activity"
payload = { "entries": [
{
"sourceId": "0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11",
"sourceRowIds": ["0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11", "5b0e9a77-23c1-4f0e-8a64-9a0d1a4f7c22"],
"occurredAt": "2024-03-20T15:04:00Z",
"actorName": "Maria Okafor",
"actorEmail": "maria.okafor@example.com",
"category": "Event Information",
"headline": "Edited Claim",
"lines": [
{
"label": "Date of Loss",
"before": None,
"after": "3/14/2024"
},
{
"label": "Policy",
"after": {
"text": "PL-2041",
"entityType": "policy",
"entityId": "550e8400-e29b-41d4-a716-446655440020"
}
}
]
},
{
"sourceId": "8a1c4e90-7d2b-4c11-b0f3-3e5d6f7a8b33",
"occurredAt": "2023-01-05T09:00:00Z",
"actorName": "Maria Okafor",
"headline": "Event Created"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entries: [
{
sourceId: '0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11',
sourceRowIds: ['0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11', '5b0e9a77-23c1-4f0e-8a64-9a0d1a4f7c22'],
occurredAt: '2024-03-20T15:04:00Z',
actorName: 'Maria Okafor',
actorEmail: 'maria.okafor@example.com',
category: 'Event Information',
headline: 'Edited Claim',
lines: [
{label: 'Date of Loss', before: null, after: '3/14/2024'},
{
label: 'Policy',
after: {
text: 'PL-2041',
entityType: 'policy',
entityId: '550e8400-e29b-41d4-a716-446655440020'
}
}
]
},
{
sourceId: '8a1c4e90-7d2b-4c11-b0f3-3e5d6f7a8b33',
occurredAt: '2023-01-05T09:00:00Z',
actorName: 'Maria Okafor',
headline: 'Event Created'
}
]
})
};
fetch('https://go.aiinsurance.io/api/v1/companies/{companyId}/entities/{entityType}/{entityId}/legacy-activity', 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://go.aiinsurance.io/api/v1/companies/{companyId}/entities/{entityType}/{entityId}/legacy-activity",
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([
'entries' => [
[
'sourceId' => '0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11',
'sourceRowIds' => [
'0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11',
'5b0e9a77-23c1-4f0e-8a64-9a0d1a4f7c22'
],
'occurredAt' => '2024-03-20T15:04:00Z',
'actorName' => 'Maria Okafor',
'actorEmail' => 'maria.okafor@example.com',
'category' => 'Event Information',
'headline' => 'Edited Claim',
'lines' => [
[
'label' => 'Date of Loss',
'before' => null,
'after' => '3/14/2024'
],
[
'label' => 'Policy',
'after' => [
'text' => 'PL-2041',
'entityType' => 'policy',
'entityId' => '550e8400-e29b-41d4-a716-446655440020'
]
]
]
],
[
'sourceId' => '8a1c4e90-7d2b-4c11-b0f3-3e5d6f7a8b33',
'occurredAt' => '2023-01-05T09:00:00Z',
'actorName' => 'Maria Okafor',
'headline' => 'Event Created'
]
]
]),
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://go.aiinsurance.io/api/v1/companies/{companyId}/entities/{entityType}/{entityId}/legacy-activity"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"sourceId\": \"0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11\",\n \"sourceRowIds\": [\n \"0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11\",\n \"5b0e9a77-23c1-4f0e-8a64-9a0d1a4f7c22\"\n ],\n \"occurredAt\": \"2024-03-20T15:04:00Z\",\n \"actorName\": \"Maria Okafor\",\n \"actorEmail\": \"maria.okafor@example.com\",\n \"category\": \"Event Information\",\n \"headline\": \"Edited Claim\",\n \"lines\": [\n {\n \"label\": \"Date of Loss\",\n \"before\": null,\n \"after\": \"3/14/2024\"\n },\n {\n \"label\": \"Policy\",\n \"after\": {\n \"text\": \"PL-2041\",\n \"entityType\": \"policy\",\n \"entityId\": \"550e8400-e29b-41d4-a716-446655440020\"\n }\n }\n ]\n },\n {\n \"sourceId\": \"8a1c4e90-7d2b-4c11-b0f3-3e5d6f7a8b33\",\n \"occurredAt\": \"2023-01-05T09:00:00Z\",\n \"actorName\": \"Maria Okafor\",\n \"headline\": \"Event Created\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://go.aiinsurance.io/api/v1/companies/{companyId}/entities/{entityType}/{entityId}/legacy-activity")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entries\": [\n {\n \"sourceId\": \"0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11\",\n \"sourceRowIds\": [\n \"0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11\",\n \"5b0e9a77-23c1-4f0e-8a64-9a0d1a4f7c22\"\n ],\n \"occurredAt\": \"2024-03-20T15:04:00Z\",\n \"actorName\": \"Maria Okafor\",\n \"actorEmail\": \"maria.okafor@example.com\",\n \"category\": \"Event Information\",\n \"headline\": \"Edited Claim\",\n \"lines\": [\n {\n \"label\": \"Date of Loss\",\n \"before\": null,\n \"after\": \"3/14/2024\"\n },\n {\n \"label\": \"Policy\",\n \"after\": {\n \"text\": \"PL-2041\",\n \"entityType\": \"policy\",\n \"entityId\": \"550e8400-e29b-41d4-a716-446655440020\"\n }\n }\n ]\n },\n {\n \"sourceId\": \"8a1c4e90-7d2b-4c11-b0f3-3e5d6f7a8b33\",\n \"occurredAt\": \"2023-01-05T09:00:00Z\",\n \"actorName\": \"Maria Okafor\",\n \"headline\": \"Event Created\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://go.aiinsurance.io/api/v1/companies/{companyId}/entities/{entityType}/{entityId}/legacy-activity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entries\": [\n {\n \"sourceId\": \"0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11\",\n \"sourceRowIds\": [\n \"0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11\",\n \"5b0e9a77-23c1-4f0e-8a64-9a0d1a4f7c22\"\n ],\n \"occurredAt\": \"2024-03-20T15:04:00Z\",\n \"actorName\": \"Maria Okafor\",\n \"actorEmail\": \"maria.okafor@example.com\",\n \"category\": \"Event Information\",\n \"headline\": \"Edited Claim\",\n \"lines\": [\n {\n \"label\": \"Date of Loss\",\n \"before\": null,\n \"after\": \"3/14/2024\"\n },\n {\n \"label\": \"Policy\",\n \"after\": {\n \"text\": \"PL-2041\",\n \"entityType\": \"policy\",\n \"entityId\": \"550e8400-e29b-41d4-a716-446655440020\"\n }\n }\n ]\n },\n {\n \"sourceId\": \"8a1c4e90-7d2b-4c11-b0f3-3e5d6f7a8b33\",\n \"occurredAt\": \"2023-01-05T09:00:00Z\",\n \"actorName\": \"Maria Okafor\",\n \"headline\": \"Event Created\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"entryCount": 2,
"sourceRowCount": 3,
"movedEntryCount": 0
}Replace Record Legacy Activity
Preserves a record’s activity from the legacy system. The body carries the
record’s whole legacy activity feed, each entry already worded as the
legacy system displayed it, and replaces whatever was preserved on the
record before. Repeating the request leaves the same entries, so a
migration can be rerun. Send an empty entries array to clear the record.
The entries appear on the record’s Activity tab under Before migration, newest first, below the activity recorded since. They are read-only and are shown as sent.
An entry is held by one record at a time. When a sourceId in the request
is already preserved on another record, the entry moves to this record, and
movedEntryCount counts such entries.
To check that every legacy activity row was preserved, add up
sourceRowCount across the migrated records and compare it with the legacy
system’s row count.
Required permission: <resource>.import for the path’s {entityType}
(event.import, exposure.import, policy.import, quote.import,
submission.import). An entry with privileged: true also requires
note.view-privileged.
curl --request PUT \
--url https://go.aiinsurance.io/api/v1/companies/{companyId}/entities/{entityType}/{entityId}/legacy-activity \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entries": [
{
"sourceId": "0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11",
"sourceRowIds": [
"0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11",
"5b0e9a77-23c1-4f0e-8a64-9a0d1a4f7c22"
],
"occurredAt": "2024-03-20T15:04:00Z",
"actorName": "Maria Okafor",
"actorEmail": "maria.okafor@example.com",
"category": "Event Information",
"headline": "Edited Claim",
"lines": [
{
"label": "Date of Loss",
"before": null,
"after": "3/14/2024"
},
{
"label": "Policy",
"after": {
"text": "PL-2041",
"entityType": "policy",
"entityId": "550e8400-e29b-41d4-a716-446655440020"
}
}
]
},
{
"sourceId": "8a1c4e90-7d2b-4c11-b0f3-3e5d6f7a8b33",
"occurredAt": "2023-01-05T09:00:00Z",
"actorName": "Maria Okafor",
"headline": "Event Created"
}
]
}
'import requests
url = "https://go.aiinsurance.io/api/v1/companies/{companyId}/entities/{entityType}/{entityId}/legacy-activity"
payload = { "entries": [
{
"sourceId": "0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11",
"sourceRowIds": ["0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11", "5b0e9a77-23c1-4f0e-8a64-9a0d1a4f7c22"],
"occurredAt": "2024-03-20T15:04:00Z",
"actorName": "Maria Okafor",
"actorEmail": "maria.okafor@example.com",
"category": "Event Information",
"headline": "Edited Claim",
"lines": [
{
"label": "Date of Loss",
"before": None,
"after": "3/14/2024"
},
{
"label": "Policy",
"after": {
"text": "PL-2041",
"entityType": "policy",
"entityId": "550e8400-e29b-41d4-a716-446655440020"
}
}
]
},
{
"sourceId": "8a1c4e90-7d2b-4c11-b0f3-3e5d6f7a8b33",
"occurredAt": "2023-01-05T09:00:00Z",
"actorName": "Maria Okafor",
"headline": "Event Created"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entries: [
{
sourceId: '0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11',
sourceRowIds: ['0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11', '5b0e9a77-23c1-4f0e-8a64-9a0d1a4f7c22'],
occurredAt: '2024-03-20T15:04:00Z',
actorName: 'Maria Okafor',
actorEmail: 'maria.okafor@example.com',
category: 'Event Information',
headline: 'Edited Claim',
lines: [
{label: 'Date of Loss', before: null, after: '3/14/2024'},
{
label: 'Policy',
after: {
text: 'PL-2041',
entityType: 'policy',
entityId: '550e8400-e29b-41d4-a716-446655440020'
}
}
]
},
{
sourceId: '8a1c4e90-7d2b-4c11-b0f3-3e5d6f7a8b33',
occurredAt: '2023-01-05T09:00:00Z',
actorName: 'Maria Okafor',
headline: 'Event Created'
}
]
})
};
fetch('https://go.aiinsurance.io/api/v1/companies/{companyId}/entities/{entityType}/{entityId}/legacy-activity', 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://go.aiinsurance.io/api/v1/companies/{companyId}/entities/{entityType}/{entityId}/legacy-activity",
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([
'entries' => [
[
'sourceId' => '0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11',
'sourceRowIds' => [
'0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11',
'5b0e9a77-23c1-4f0e-8a64-9a0d1a4f7c22'
],
'occurredAt' => '2024-03-20T15:04:00Z',
'actorName' => 'Maria Okafor',
'actorEmail' => 'maria.okafor@example.com',
'category' => 'Event Information',
'headline' => 'Edited Claim',
'lines' => [
[
'label' => 'Date of Loss',
'before' => null,
'after' => '3/14/2024'
],
[
'label' => 'Policy',
'after' => [
'text' => 'PL-2041',
'entityType' => 'policy',
'entityId' => '550e8400-e29b-41d4-a716-446655440020'
]
]
]
],
[
'sourceId' => '8a1c4e90-7d2b-4c11-b0f3-3e5d6f7a8b33',
'occurredAt' => '2023-01-05T09:00:00Z',
'actorName' => 'Maria Okafor',
'headline' => 'Event Created'
]
]
]),
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://go.aiinsurance.io/api/v1/companies/{companyId}/entities/{entityType}/{entityId}/legacy-activity"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"sourceId\": \"0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11\",\n \"sourceRowIds\": [\n \"0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11\",\n \"5b0e9a77-23c1-4f0e-8a64-9a0d1a4f7c22\"\n ],\n \"occurredAt\": \"2024-03-20T15:04:00Z\",\n \"actorName\": \"Maria Okafor\",\n \"actorEmail\": \"maria.okafor@example.com\",\n \"category\": \"Event Information\",\n \"headline\": \"Edited Claim\",\n \"lines\": [\n {\n \"label\": \"Date of Loss\",\n \"before\": null,\n \"after\": \"3/14/2024\"\n },\n {\n \"label\": \"Policy\",\n \"after\": {\n \"text\": \"PL-2041\",\n \"entityType\": \"policy\",\n \"entityId\": \"550e8400-e29b-41d4-a716-446655440020\"\n }\n }\n ]\n },\n {\n \"sourceId\": \"8a1c4e90-7d2b-4c11-b0f3-3e5d6f7a8b33\",\n \"occurredAt\": \"2023-01-05T09:00:00Z\",\n \"actorName\": \"Maria Okafor\",\n \"headline\": \"Event Created\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://go.aiinsurance.io/api/v1/companies/{companyId}/entities/{entityType}/{entityId}/legacy-activity")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entries\": [\n {\n \"sourceId\": \"0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11\",\n \"sourceRowIds\": [\n \"0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11\",\n \"5b0e9a77-23c1-4f0e-8a64-9a0d1a4f7c22\"\n ],\n \"occurredAt\": \"2024-03-20T15:04:00Z\",\n \"actorName\": \"Maria Okafor\",\n \"actorEmail\": \"maria.okafor@example.com\",\n \"category\": \"Event Information\",\n \"headline\": \"Edited Claim\",\n \"lines\": [\n {\n \"label\": \"Date of Loss\",\n \"before\": null,\n \"after\": \"3/14/2024\"\n },\n {\n \"label\": \"Policy\",\n \"after\": {\n \"text\": \"PL-2041\",\n \"entityType\": \"policy\",\n \"entityId\": \"550e8400-e29b-41d4-a716-446655440020\"\n }\n }\n ]\n },\n {\n \"sourceId\": \"8a1c4e90-7d2b-4c11-b0f3-3e5d6f7a8b33\",\n \"occurredAt\": \"2023-01-05T09:00:00Z\",\n \"actorName\": \"Maria Okafor\",\n \"headline\": \"Event Created\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://go.aiinsurance.io/api/v1/companies/{companyId}/entities/{entityType}/{entityId}/legacy-activity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entries\": [\n {\n \"sourceId\": \"0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11\",\n \"sourceRowIds\": [\n \"0f7d3c52-6f0b-4a39-9d53-1c7f0c2f6b11\",\n \"5b0e9a77-23c1-4f0e-8a64-9a0d1a4f7c22\"\n ],\n \"occurredAt\": \"2024-03-20T15:04:00Z\",\n \"actorName\": \"Maria Okafor\",\n \"actorEmail\": \"maria.okafor@example.com\",\n \"category\": \"Event Information\",\n \"headline\": \"Edited Claim\",\n \"lines\": [\n {\n \"label\": \"Date of Loss\",\n \"before\": null,\n \"after\": \"3/14/2024\"\n },\n {\n \"label\": \"Policy\",\n \"after\": {\n \"text\": \"PL-2041\",\n \"entityType\": \"policy\",\n \"entityId\": \"550e8400-e29b-41d4-a716-446655440020\"\n }\n }\n ]\n },\n {\n \"sourceId\": \"8a1c4e90-7d2b-4c11-b0f3-3e5d6f7a8b33\",\n \"occurredAt\": \"2023-01-05T09:00:00Z\",\n \"actorName\": \"Maria Okafor\",\n \"headline\": \"Event Created\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"entryCount": 2,
"sourceRowCount": 3,
"movedEntryCount": 0
}Authorizations
User-principal OAuth 2.0 Bearer authentication. Send a user-scoped Auth0 access token (audience = the app API audience) as Authorization: Bearer <jwt>. The request resolves to the user's identity and is authorized by their Role on the {companyId} in the path — the same role-based permissions the web app enforces. This is the path the MCP connector uses to act on a user's behalf; endpoints that accept it list both BearerAuth and ApiKeyAuth.
