curl --request POST \
--url https://api.canary.effectiveai.app/api/v2/insurance/form-comparisons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"variants": [
{
"key": "verus",
"documents": [
"01a150b0-b6a4-774f-a0e0-ad385dbc5028"
],
"label": "<string>",
"context": {
"product": {
"id": "product_00001AB",
"state": "CA"
},
"documents": [
"01a150b0-b6a4-774f-a0e0-ad385dbc5028"
],
"facts": "<string>"
}
}
],
"sharedContext": {
"product": {
"id": "product_00001AB",
"state": "CA"
},
"documents": [
"01a150b0-b6a4-774f-a0e0-ad385dbc5028"
],
"facts": "<string>"
},
"knowledge": [
"01a150b0-b6a4-774f-a0e0-ad385dbc5028"
],
"focus": [
"<string>"
],
"scenarios": [
{
"id": "water-backup",
"facts": "<string>",
"question": "<string>",
"expectations": [
{
"id": "<string>",
"assertion": "<string>",
"variant": "<string>"
}
]
}
],
"reviewMaterial": [
"01a150b0-b6a4-774f-a0e0-ad385dbc5028"
]
}
'import requests
url = "https://api.canary.effectiveai.app/api/v2/insurance/form-comparisons"
payload = {
"variants": [
{
"key": "verus",
"documents": ["01a150b0-b6a4-774f-a0e0-ad385dbc5028"],
"label": "<string>",
"context": {
"product": {
"id": "product_00001AB",
"state": "CA"
},
"documents": ["01a150b0-b6a4-774f-a0e0-ad385dbc5028"],
"facts": "<string>"
}
}
],
"sharedContext": {
"product": {
"id": "product_00001AB",
"state": "CA"
},
"documents": ["01a150b0-b6a4-774f-a0e0-ad385dbc5028"],
"facts": "<string>"
},
"knowledge": ["01a150b0-b6a4-774f-a0e0-ad385dbc5028"],
"focus": ["<string>"],
"scenarios": [
{
"id": "water-backup",
"facts": "<string>",
"question": "<string>",
"expectations": [
{
"id": "<string>",
"assertion": "<string>",
"variant": "<string>"
}
]
}
],
"reviewMaterial": ["01a150b0-b6a4-774f-a0e0-ad385dbc5028"]
}
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({
variants: [
{
key: 'verus',
documents: ['01a150b0-b6a4-774f-a0e0-ad385dbc5028'],
label: '<string>',
context: {
product: {id: 'product_00001AB', state: 'CA'},
documents: ['01a150b0-b6a4-774f-a0e0-ad385dbc5028'],
facts: '<string>'
}
}
],
sharedContext: {
product: {id: 'product_00001AB', state: 'CA'},
documents: ['01a150b0-b6a4-774f-a0e0-ad385dbc5028'],
facts: '<string>'
},
knowledge: ['01a150b0-b6a4-774f-a0e0-ad385dbc5028'],
focus: ['<string>'],
scenarios: [
{
id: 'water-backup',
facts: '<string>',
question: '<string>',
expectations: [{id: '<string>', assertion: '<string>', variant: '<string>'}]
}
],
reviewMaterial: ['01a150b0-b6a4-774f-a0e0-ad385dbc5028']
})
};
fetch('https://api.canary.effectiveai.app/api/v2/insurance/form-comparisons', 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.canary.effectiveai.app/api/v2/insurance/form-comparisons",
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([
'variants' => [
[
'key' => 'verus',
'documents' => [
'01a150b0-b6a4-774f-a0e0-ad385dbc5028'
],
'label' => '<string>',
'context' => [
'product' => [
'id' => 'product_00001AB',
'state' => 'CA'
],
'documents' => [
'01a150b0-b6a4-774f-a0e0-ad385dbc5028'
],
'facts' => '<string>'
]
]
],
'sharedContext' => [
'product' => [
'id' => 'product_00001AB',
'state' => 'CA'
],
'documents' => [
'01a150b0-b6a4-774f-a0e0-ad385dbc5028'
],
'facts' => '<string>'
],
'knowledge' => [
'01a150b0-b6a4-774f-a0e0-ad385dbc5028'
],
'focus' => [
'<string>'
],
'scenarios' => [
[
'id' => 'water-backup',
'facts' => '<string>',
'question' => '<string>',
'expectations' => [
[
'id' => '<string>',
'assertion' => '<string>',
'variant' => '<string>'
]
]
]
],
'reviewMaterial' => [
'01a150b0-b6a4-774f-a0e0-ad385dbc5028'
]
]),
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.canary.effectiveai.app/api/v2/insurance/form-comparisons"
payload := strings.NewReader("{\n \"variants\": [\n {\n \"key\": \"verus\",\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"label\": \"<string>\",\n \"context\": {\n \"product\": {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n },\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"facts\": \"<string>\"\n }\n }\n ],\n \"sharedContext\": {\n \"product\": {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n },\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"facts\": \"<string>\"\n },\n \"knowledge\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"focus\": [\n \"<string>\"\n ],\n \"scenarios\": [\n {\n \"id\": \"water-backup\",\n \"facts\": \"<string>\",\n \"question\": \"<string>\",\n \"expectations\": [\n {\n \"id\": \"<string>\",\n \"assertion\": \"<string>\",\n \"variant\": \"<string>\"\n }\n ]\n }\n ],\n \"reviewMaterial\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ]\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.canary.effectiveai.app/api/v2/insurance/form-comparisons")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"variants\": [\n {\n \"key\": \"verus\",\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"label\": \"<string>\",\n \"context\": {\n \"product\": {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n },\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"facts\": \"<string>\"\n }\n }\n ],\n \"sharedContext\": {\n \"product\": {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n },\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"facts\": \"<string>\"\n },\n \"knowledge\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"focus\": [\n \"<string>\"\n ],\n \"scenarios\": [\n {\n \"id\": \"water-backup\",\n \"facts\": \"<string>\",\n \"question\": \"<string>\",\n \"expectations\": [\n {\n \"id\": \"<string>\",\n \"assertion\": \"<string>\",\n \"variant\": \"<string>\"\n }\n ]\n }\n ],\n \"reviewMaterial\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.canary.effectiveai.app/api/v2/insurance/form-comparisons")
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 \"variants\": [\n {\n \"key\": \"verus\",\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"label\": \"<string>\",\n \"context\": {\n \"product\": {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n },\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"facts\": \"<string>\"\n }\n }\n ],\n \"sharedContext\": {\n \"product\": {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n },\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"facts\": \"<string>\"\n },\n \"knowledge\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"focus\": [\n \"<string>\"\n ],\n \"scenarios\": [\n {\n \"id\": \"water-backup\",\n \"facts\": \"<string>\",\n \"question\": \"<string>\",\n \"expectations\": [\n {\n \"id\": \"<string>\",\n \"assertion\": \"<string>\",\n \"variant\": \"<string>\"\n }\n ]\n }\n ],\n \"reviewMaterial\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"idempotencyExpiresAt": "2023-11-07T05:31:56Z",
"status": "queued"
}{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"idempotencyExpiresAt": "2023-11-07T05:31:56Z",
"status": "queued"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}Compare versions of insurance wording
Not implemented yet: returns 501 until the implementation ships. Start a cited comparison of 2–4 versions of insurance wording (“variants”): an endpoint or a set of forms per variant, plus optional shared or per-variant context (product, documents, facts), knowledge files, focus questions, scenarios and reviewer annotations. Each input is a file you can read and download; its current version is pinned and only pinned inputs can be cited. Poll getFormComparison with the returned id (or follow Location), or subscribe to the form_comparison.completed and form_comparison.failed webhooks; a comparison not finished 30 minutes after launch fails with execution_timeout. Send an Idempotency-Key to retry safely: a retry with the same key and request returns the same comparison (202 while queued or running, 200 once finished) and never starts new work; the same key with a different request is 409 idempotency_conflict. Without a key, every POST starts a new comparison. Keys last 7 days (idempotencyExpiresAt). Inputs must have extracted text: 409 input_not_ready while extraction runs (retry after Retry-After), 422 input_unreadable when a file has no text (scanned PDFs are not OCRed). Knowledge files must pass validateFormKnowledge without errors. Limits: 20 inputs, 50 annotations, 64 KiB. Billed by session credits; read-only members cannot create comparisons.
curl --request POST \
--url https://api.canary.effectiveai.app/api/v2/insurance/form-comparisons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"variants": [
{
"key": "verus",
"documents": [
"01a150b0-b6a4-774f-a0e0-ad385dbc5028"
],
"label": "<string>",
"context": {
"product": {
"id": "product_00001AB",
"state": "CA"
},
"documents": [
"01a150b0-b6a4-774f-a0e0-ad385dbc5028"
],
"facts": "<string>"
}
}
],
"sharedContext": {
"product": {
"id": "product_00001AB",
"state": "CA"
},
"documents": [
"01a150b0-b6a4-774f-a0e0-ad385dbc5028"
],
"facts": "<string>"
},
"knowledge": [
"01a150b0-b6a4-774f-a0e0-ad385dbc5028"
],
"focus": [
"<string>"
],
"scenarios": [
{
"id": "water-backup",
"facts": "<string>",
"question": "<string>",
"expectations": [
{
"id": "<string>",
"assertion": "<string>",
"variant": "<string>"
}
]
}
],
"reviewMaterial": [
"01a150b0-b6a4-774f-a0e0-ad385dbc5028"
]
}
'import requests
url = "https://api.canary.effectiveai.app/api/v2/insurance/form-comparisons"
payload = {
"variants": [
{
"key": "verus",
"documents": ["01a150b0-b6a4-774f-a0e0-ad385dbc5028"],
"label": "<string>",
"context": {
"product": {
"id": "product_00001AB",
"state": "CA"
},
"documents": ["01a150b0-b6a4-774f-a0e0-ad385dbc5028"],
"facts": "<string>"
}
}
],
"sharedContext": {
"product": {
"id": "product_00001AB",
"state": "CA"
},
"documents": ["01a150b0-b6a4-774f-a0e0-ad385dbc5028"],
"facts": "<string>"
},
"knowledge": ["01a150b0-b6a4-774f-a0e0-ad385dbc5028"],
"focus": ["<string>"],
"scenarios": [
{
"id": "water-backup",
"facts": "<string>",
"question": "<string>",
"expectations": [
{
"id": "<string>",
"assertion": "<string>",
"variant": "<string>"
}
]
}
],
"reviewMaterial": ["01a150b0-b6a4-774f-a0e0-ad385dbc5028"]
}
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({
variants: [
{
key: 'verus',
documents: ['01a150b0-b6a4-774f-a0e0-ad385dbc5028'],
label: '<string>',
context: {
product: {id: 'product_00001AB', state: 'CA'},
documents: ['01a150b0-b6a4-774f-a0e0-ad385dbc5028'],
facts: '<string>'
}
}
],
sharedContext: {
product: {id: 'product_00001AB', state: 'CA'},
documents: ['01a150b0-b6a4-774f-a0e0-ad385dbc5028'],
facts: '<string>'
},
knowledge: ['01a150b0-b6a4-774f-a0e0-ad385dbc5028'],
focus: ['<string>'],
scenarios: [
{
id: 'water-backup',
facts: '<string>',
question: '<string>',
expectations: [{id: '<string>', assertion: '<string>', variant: '<string>'}]
}
],
reviewMaterial: ['01a150b0-b6a4-774f-a0e0-ad385dbc5028']
})
};
fetch('https://api.canary.effectiveai.app/api/v2/insurance/form-comparisons', 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.canary.effectiveai.app/api/v2/insurance/form-comparisons",
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([
'variants' => [
[
'key' => 'verus',
'documents' => [
'01a150b0-b6a4-774f-a0e0-ad385dbc5028'
],
'label' => '<string>',
'context' => [
'product' => [
'id' => 'product_00001AB',
'state' => 'CA'
],
'documents' => [
'01a150b0-b6a4-774f-a0e0-ad385dbc5028'
],
'facts' => '<string>'
]
]
],
'sharedContext' => [
'product' => [
'id' => 'product_00001AB',
'state' => 'CA'
],
'documents' => [
'01a150b0-b6a4-774f-a0e0-ad385dbc5028'
],
'facts' => '<string>'
],
'knowledge' => [
'01a150b0-b6a4-774f-a0e0-ad385dbc5028'
],
'focus' => [
'<string>'
],
'scenarios' => [
[
'id' => 'water-backup',
'facts' => '<string>',
'question' => '<string>',
'expectations' => [
[
'id' => '<string>',
'assertion' => '<string>',
'variant' => '<string>'
]
]
]
],
'reviewMaterial' => [
'01a150b0-b6a4-774f-a0e0-ad385dbc5028'
]
]),
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.canary.effectiveai.app/api/v2/insurance/form-comparisons"
payload := strings.NewReader("{\n \"variants\": [\n {\n \"key\": \"verus\",\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"label\": \"<string>\",\n \"context\": {\n \"product\": {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n },\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"facts\": \"<string>\"\n }\n }\n ],\n \"sharedContext\": {\n \"product\": {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n },\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"facts\": \"<string>\"\n },\n \"knowledge\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"focus\": [\n \"<string>\"\n ],\n \"scenarios\": [\n {\n \"id\": \"water-backup\",\n \"facts\": \"<string>\",\n \"question\": \"<string>\",\n \"expectations\": [\n {\n \"id\": \"<string>\",\n \"assertion\": \"<string>\",\n \"variant\": \"<string>\"\n }\n ]\n }\n ],\n \"reviewMaterial\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ]\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.canary.effectiveai.app/api/v2/insurance/form-comparisons")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"variants\": [\n {\n \"key\": \"verus\",\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"label\": \"<string>\",\n \"context\": {\n \"product\": {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n },\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"facts\": \"<string>\"\n }\n }\n ],\n \"sharedContext\": {\n \"product\": {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n },\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"facts\": \"<string>\"\n },\n \"knowledge\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"focus\": [\n \"<string>\"\n ],\n \"scenarios\": [\n {\n \"id\": \"water-backup\",\n \"facts\": \"<string>\",\n \"question\": \"<string>\",\n \"expectations\": [\n {\n \"id\": \"<string>\",\n \"assertion\": \"<string>\",\n \"variant\": \"<string>\"\n }\n ]\n }\n ],\n \"reviewMaterial\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.canary.effectiveai.app/api/v2/insurance/form-comparisons")
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 \"variants\": [\n {\n \"key\": \"verus\",\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"label\": \"<string>\",\n \"context\": {\n \"product\": {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n },\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"facts\": \"<string>\"\n }\n }\n ],\n \"sharedContext\": {\n \"product\": {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n },\n \"documents\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"facts\": \"<string>\"\n },\n \"knowledge\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ],\n \"focus\": [\n \"<string>\"\n ],\n \"scenarios\": [\n {\n \"id\": \"water-backup\",\n \"facts\": \"<string>\",\n \"question\": \"<string>\",\n \"expectations\": [\n {\n \"id\": \"<string>\",\n \"assertion\": \"<string>\",\n \"variant\": \"<string>\"\n }\n ]\n }\n ],\n \"reviewMaterial\": [\n \"01a150b0-b6a4-774f-a0e0-ad385dbc5028\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"idempotencyExpiresAt": "2023-11-07T05:31:56Z",
"status": "queued"
}{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"idempotencyExpiresAt": "2023-11-07T05:31:56Z",
"status": "queued"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"accessUrl": "<string>"
}Authorizations
Effective API key. Send Authorization: Bearer sk-eai-...
Headers
Client-chosen key for safe retries: 1-128 letters, digits, -, _, . or :. Use a new random UUID for each intended operation and the same key when retrying it. Do not put customer data or credentials in the key.
1 - 128^[A-Za-z0-9\-_.:]+$Body
2–4 versions of the wording to compare, in the order to present them.
2 - 4 elementsShow child attributes
Show child attributes
Context applied to every variant. It supplements each variant's own context; conflicts are reported as gaps.
Show child attributes
Show child attributes
Up to 10 knowledge files (see validateFormKnowledge). They must validate without errors. Reasoning context, never form evidence.
10A file the caller can read and download: a bare file UUID, or an object with an ID, label and annotations. A bare UUID gets the ID input-, where n is its one-based position among all inputs in request order (variants in order, each with its documents then its context documents; then sharedContext documents, knowledge and reviewMaterial).
"01a150b0-b6a4-774f-a0e0-ad385dbc5028"
Up to 10 questions to focus on, 1–1,000 characters each. Omit for material similarities and differences.
101 - 1000Up to 10 hypothetical scenarios to answer for each variant.
10Show child attributes
Show child attributes
Up to 10 files holding saved earlier output or reviewer notes to reconcile. Never counted as policy evidence.
10A file the caller can read and download: a bare file UUID, or an object with an ID, label and annotations. A bare UUID gets the ID input-, where n is its one-based position among all inputs in request order (variants in order, each with its documents then its context documents; then sharedContext documents, knowledge and reviewMaterial).
"01a150b0-b6a4-774f-a0e0-ad385dbc5028"
Response
A retried key whose comparison has finished: its current representation.
- Option 1
- Option 2
- Option 3
- Option 4
Form comparison UUID.
When the comparison was accepted.
When the Idempotency-Key binding expires (7 days after acceptance); null without a key.
Accepted; the agent has not started.
queued