curl --request PUT \
--url https://go.aiinsurance.io/api/v1/companies/{companyId}/events/{eventId}/open-close-history \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"eventOpenCloseHistory": [
{
"action": "open",
"effectiveOnDate": {
"date": "2020-01-15",
"timezone": "America/New_York"
},
"actionTakenDate": {
"date": "2020-01-15",
"timezone": "America/New_York"
}
},
{
"action": "close",
"effectiveOnDate": {
"date": "2020-06-01",
"timezone": "America/New_York"
},
"actionTakenDate": {
"date": "2020-06-03",
"timezone": "America/New_York"
}
},
{
"action": "reopen",
"effectiveOnDate": {
"date": "2021-02-10",
"timezone": "America/New_York"
},
"actionTakenDate": {
"date": "2021-02-10",
"timezone": "America/New_York"
}
},
{
"action": "close",
"effectiveOnDate": {
"date": "2021-08-20",
"timezone": "America/New_York"
},
"actionTakenDate": {
"date": "2021-08-22",
"timezone": "America/New_York"
}
}
]
}
'import requests
url = "https://go.aiinsurance.io/api/v1/companies/{companyId}/events/{eventId}/open-close-history"
payload = { "eventOpenCloseHistory": [
{
"action": "open",
"effectiveOnDate": {
"date": "2020-01-15",
"timezone": "America/New_York"
},
"actionTakenDate": {
"date": "2020-01-15",
"timezone": "America/New_York"
}
},
{
"action": "close",
"effectiveOnDate": {
"date": "2020-06-01",
"timezone": "America/New_York"
},
"actionTakenDate": {
"date": "2020-06-03",
"timezone": "America/New_York"
}
},
{
"action": "reopen",
"effectiveOnDate": {
"date": "2021-02-10",
"timezone": "America/New_York"
},
"actionTakenDate": {
"date": "2021-02-10",
"timezone": "America/New_York"
}
},
{
"action": "close",
"effectiveOnDate": {
"date": "2021-08-20",
"timezone": "America/New_York"
},
"actionTakenDate": {
"date": "2021-08-22",
"timezone": "America/New_York"
}
}
] }
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({
eventOpenCloseHistory: [
{
action: 'open',
effectiveOnDate: {date: '2020-01-15', timezone: 'America/New_York'},
actionTakenDate: {date: '2020-01-15', timezone: 'America/New_York'}
},
{
action: 'close',
effectiveOnDate: {date: '2020-06-01', timezone: 'America/New_York'},
actionTakenDate: {date: '2020-06-03', timezone: 'America/New_York'}
},
{
action: 'reopen',
effectiveOnDate: {date: '2021-02-10', timezone: 'America/New_York'},
actionTakenDate: {date: '2021-02-10', timezone: 'America/New_York'}
},
{
action: 'close',
effectiveOnDate: {date: '2021-08-20', timezone: 'America/New_York'},
actionTakenDate: {date: '2021-08-22', timezone: 'America/New_York'}
}
]
})
};
fetch('https://go.aiinsurance.io/api/v1/companies/{companyId}/events/{eventId}/open-close-history', 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}/events/{eventId}/open-close-history",
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([
'eventOpenCloseHistory' => [
[
'action' => 'open',
'effectiveOnDate' => [
'date' => '2020-01-15',
'timezone' => 'America/New_York'
],
'actionTakenDate' => [
'date' => '2020-01-15',
'timezone' => 'America/New_York'
]
],
[
'action' => 'close',
'effectiveOnDate' => [
'date' => '2020-06-01',
'timezone' => 'America/New_York'
],
'actionTakenDate' => [
'date' => '2020-06-03',
'timezone' => 'America/New_York'
]
],
[
'action' => 'reopen',
'effectiveOnDate' => [
'date' => '2021-02-10',
'timezone' => 'America/New_York'
],
'actionTakenDate' => [
'date' => '2021-02-10',
'timezone' => 'America/New_York'
]
],
[
'action' => 'close',
'effectiveOnDate' => [
'date' => '2021-08-20',
'timezone' => 'America/New_York'
],
'actionTakenDate' => [
'date' => '2021-08-22',
'timezone' => 'America/New_York'
]
]
]
]),
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://go.aiinsurance.io/api/v1/companies/{companyId}/events/{eventId}/open-close-history"
payload := strings.NewReader("{\n \"eventOpenCloseHistory\": [\n {\n \"action\": \"open\",\n \"effectiveOnDate\": {\n \"date\": \"2020-01-15\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2020-01-15\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"close\",\n \"effectiveOnDate\": {\n \"date\": \"2020-06-01\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2020-06-03\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"reopen\",\n \"effectiveOnDate\": {\n \"date\": \"2021-02-10\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2021-02-10\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"close\",\n \"effectiveOnDate\": {\n \"date\": \"2021-08-20\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2021-08-22\",\n \"timezone\": \"America/New_York\"\n }\n }\n ]\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://go.aiinsurance.io/api/v1/companies/{companyId}/events/{eventId}/open-close-history")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"eventOpenCloseHistory\": [\n {\n \"action\": \"open\",\n \"effectiveOnDate\": {\n \"date\": \"2020-01-15\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2020-01-15\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"close\",\n \"effectiveOnDate\": {\n \"date\": \"2020-06-01\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2020-06-03\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"reopen\",\n \"effectiveOnDate\": {\n \"date\": \"2021-02-10\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2021-02-10\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"close\",\n \"effectiveOnDate\": {\n \"date\": \"2021-08-20\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2021-08-22\",\n \"timezone\": \"America/New_York\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://go.aiinsurance.io/api/v1/companies/{companyId}/events/{eventId}/open-close-history")
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 \"eventOpenCloseHistory\": [\n {\n \"action\": \"open\",\n \"effectiveOnDate\": {\n \"date\": \"2020-01-15\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2020-01-15\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"close\",\n \"effectiveOnDate\": {\n \"date\": \"2020-06-01\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2020-06-03\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"reopen\",\n \"effectiveOnDate\": {\n \"date\": \"2021-02-10\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2021-02-10\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"close\",\n \"effectiveOnDate\": {\n \"date\": \"2021-08-20\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2021-08-22\",\n \"timezone\": \"America/New_York\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"eventId": "550e8400-e29b-41d4-a716-446655440020",
"eventStatus": "closed"
}Replace Event Open/Close History
Replaces an event’s whole open/close-history log with the one you send,
then derives the event’s status from it, in one atomic call: the stored log
is discarded wholesale, eventStatus and Close Date are set from the
new log’s final entry (close → closed with that entry’s
effectiveOnDate; open/reopen → open with no close date).
This is the path for historical imports and history corrections. An
already-closed historical claim is created open and then closed by this
call (or resolved at create time by supplying eventOpenCloseHistory);
a log that was loaded wrong is fixed by sending the corrected one. For
day-to-day lifecycle changes use
Close Event and
Re-open Event, which append
to the log instead of replacing it.
Every entry sub-field is yours to supply — including actionTakenDate,
the date the action was taken. A historical log carries the true dates;
nothing is server-stamped here.
The log must be well-formed. It must be non-empty, its first entry’s
action must be open, actions must strictly alternate close/reopen
after that (a claim cannot close twice in a row, or re-open while open),
and effectiveOnDates must be non-decreasing in the order the entries are
listed. A malformed log returns 400.
Restricted field. If your company’s configuration gives
eventOpenCloseHistory a writePermission, this call also requires that
field write group (event.field-<value>), exactly as a generic event
update naming the field would. A key without it receives 403 with error
code field-write-permission-required. Close Event and Re-open Event are
not affected: they append one server-built entry rather than letting you
author the log.
Required permission: event.edit
curl --request PUT \
--url https://go.aiinsurance.io/api/v1/companies/{companyId}/events/{eventId}/open-close-history \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"eventOpenCloseHistory": [
{
"action": "open",
"effectiveOnDate": {
"date": "2020-01-15",
"timezone": "America/New_York"
},
"actionTakenDate": {
"date": "2020-01-15",
"timezone": "America/New_York"
}
},
{
"action": "close",
"effectiveOnDate": {
"date": "2020-06-01",
"timezone": "America/New_York"
},
"actionTakenDate": {
"date": "2020-06-03",
"timezone": "America/New_York"
}
},
{
"action": "reopen",
"effectiveOnDate": {
"date": "2021-02-10",
"timezone": "America/New_York"
},
"actionTakenDate": {
"date": "2021-02-10",
"timezone": "America/New_York"
}
},
{
"action": "close",
"effectiveOnDate": {
"date": "2021-08-20",
"timezone": "America/New_York"
},
"actionTakenDate": {
"date": "2021-08-22",
"timezone": "America/New_York"
}
}
]
}
'import requests
url = "https://go.aiinsurance.io/api/v1/companies/{companyId}/events/{eventId}/open-close-history"
payload = { "eventOpenCloseHistory": [
{
"action": "open",
"effectiveOnDate": {
"date": "2020-01-15",
"timezone": "America/New_York"
},
"actionTakenDate": {
"date": "2020-01-15",
"timezone": "America/New_York"
}
},
{
"action": "close",
"effectiveOnDate": {
"date": "2020-06-01",
"timezone": "America/New_York"
},
"actionTakenDate": {
"date": "2020-06-03",
"timezone": "America/New_York"
}
},
{
"action": "reopen",
"effectiveOnDate": {
"date": "2021-02-10",
"timezone": "America/New_York"
},
"actionTakenDate": {
"date": "2021-02-10",
"timezone": "America/New_York"
}
},
{
"action": "close",
"effectiveOnDate": {
"date": "2021-08-20",
"timezone": "America/New_York"
},
"actionTakenDate": {
"date": "2021-08-22",
"timezone": "America/New_York"
}
}
] }
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({
eventOpenCloseHistory: [
{
action: 'open',
effectiveOnDate: {date: '2020-01-15', timezone: 'America/New_York'},
actionTakenDate: {date: '2020-01-15', timezone: 'America/New_York'}
},
{
action: 'close',
effectiveOnDate: {date: '2020-06-01', timezone: 'America/New_York'},
actionTakenDate: {date: '2020-06-03', timezone: 'America/New_York'}
},
{
action: 'reopen',
effectiveOnDate: {date: '2021-02-10', timezone: 'America/New_York'},
actionTakenDate: {date: '2021-02-10', timezone: 'America/New_York'}
},
{
action: 'close',
effectiveOnDate: {date: '2021-08-20', timezone: 'America/New_York'},
actionTakenDate: {date: '2021-08-22', timezone: 'America/New_York'}
}
]
})
};
fetch('https://go.aiinsurance.io/api/v1/companies/{companyId}/events/{eventId}/open-close-history', 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}/events/{eventId}/open-close-history",
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([
'eventOpenCloseHistory' => [
[
'action' => 'open',
'effectiveOnDate' => [
'date' => '2020-01-15',
'timezone' => 'America/New_York'
],
'actionTakenDate' => [
'date' => '2020-01-15',
'timezone' => 'America/New_York'
]
],
[
'action' => 'close',
'effectiveOnDate' => [
'date' => '2020-06-01',
'timezone' => 'America/New_York'
],
'actionTakenDate' => [
'date' => '2020-06-03',
'timezone' => 'America/New_York'
]
],
[
'action' => 'reopen',
'effectiveOnDate' => [
'date' => '2021-02-10',
'timezone' => 'America/New_York'
],
'actionTakenDate' => [
'date' => '2021-02-10',
'timezone' => 'America/New_York'
]
],
[
'action' => 'close',
'effectiveOnDate' => [
'date' => '2021-08-20',
'timezone' => 'America/New_York'
],
'actionTakenDate' => [
'date' => '2021-08-22',
'timezone' => 'America/New_York'
]
]
]
]),
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://go.aiinsurance.io/api/v1/companies/{companyId}/events/{eventId}/open-close-history"
payload := strings.NewReader("{\n \"eventOpenCloseHistory\": [\n {\n \"action\": \"open\",\n \"effectiveOnDate\": {\n \"date\": \"2020-01-15\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2020-01-15\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"close\",\n \"effectiveOnDate\": {\n \"date\": \"2020-06-01\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2020-06-03\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"reopen\",\n \"effectiveOnDate\": {\n \"date\": \"2021-02-10\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2021-02-10\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"close\",\n \"effectiveOnDate\": {\n \"date\": \"2021-08-20\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2021-08-22\",\n \"timezone\": \"America/New_York\"\n }\n }\n ]\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://go.aiinsurance.io/api/v1/companies/{companyId}/events/{eventId}/open-close-history")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"eventOpenCloseHistory\": [\n {\n \"action\": \"open\",\n \"effectiveOnDate\": {\n \"date\": \"2020-01-15\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2020-01-15\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"close\",\n \"effectiveOnDate\": {\n \"date\": \"2020-06-01\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2020-06-03\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"reopen\",\n \"effectiveOnDate\": {\n \"date\": \"2021-02-10\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2021-02-10\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"close\",\n \"effectiveOnDate\": {\n \"date\": \"2021-08-20\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2021-08-22\",\n \"timezone\": \"America/New_York\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://go.aiinsurance.io/api/v1/companies/{companyId}/events/{eventId}/open-close-history")
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 \"eventOpenCloseHistory\": [\n {\n \"action\": \"open\",\n \"effectiveOnDate\": {\n \"date\": \"2020-01-15\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2020-01-15\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"close\",\n \"effectiveOnDate\": {\n \"date\": \"2020-06-01\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2020-06-03\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"reopen\",\n \"effectiveOnDate\": {\n \"date\": \"2021-02-10\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2021-02-10\",\n \"timezone\": \"America/New_York\"\n }\n },\n {\n \"action\": \"close\",\n \"effectiveOnDate\": {\n \"date\": \"2021-08-20\",\n \"timezone\": \"America/New_York\"\n },\n \"actionTakenDate\": {\n \"date\": \"2021-08-22\",\n \"timezone\": \"America/New_York\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"eventId": "550e8400-e29b-41d4-a716-446655440020",
"eventStatus": "closed"
}Authorizations
API key authentication. Send your raw API key as the Authorization header value with NO scheme prefix — Authorization: YOUR-API-KEY. Do NOT prefix it with Bearer or ApiKey, and do not use an X-API-Key header; those are not accepted.
Path Parameters
Company identifier
Event (claim or incident) identifier
Body
The complete replacement log, in the order the actions
happened: open first, then alternating close/reopen.
1Show child attributes
Show child attributes
