curl --request POST \
--url https://api.canary.effectiveai.app/api/v2/webhook-endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"enabledEvents": [],
"filters": {
"employerIds": [
"<string>"
],
"programIds": [
"<string>"
],
"states": [
"<string>"
]
},
"description": "<string>"
}
'import requests
url = "https://api.canary.effectiveai.app/api/v2/webhook-endpoints"
payload = {
"url": "<string>",
"enabledEvents": [],
"filters": {
"employerIds": ["<string>"],
"programIds": ["<string>"],
"states": ["<string>"]
},
"description": "<string>"
}
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({
url: '<string>',
enabledEvents: [],
filters: {employerIds: ['<string>'], programIds: ['<string>'], states: ['<string>']},
description: '<string>'
})
};
fetch('https://api.canary.effectiveai.app/api/v2/webhook-endpoints', 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/webhook-endpoints",
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([
'url' => '<string>',
'enabledEvents' => [
],
'filters' => [
'employerIds' => [
'<string>'
],
'programIds' => [
'<string>'
],
'states' => [
'<string>'
]
],
'description' => '<string>'
]),
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/webhook-endpoints"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"enabledEvents\": [],\n \"filters\": {\n \"employerIds\": [\n \"<string>\"\n ],\n \"programIds\": [\n \"<string>\"\n ],\n \"states\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\"\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/webhook-endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"enabledEvents\": [],\n \"filters\": {\n \"employerIds\": [\n \"<string>\"\n ],\n \"programIds\": [\n \"<string>\"\n ],\n \"states\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.canary.effectiveai.app/api/v2/webhook-endpoints")
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 \"url\": \"<string>\",\n \"enabledEvents\": [],\n \"filters\": {\n \"employerIds\": [\n \"<string>\"\n ],\n \"programIds\": [\n \"<string>\"\n ],\n \"states\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"url": "<string>",
"description": "<string>",
"enabledEvents": [
"answer.completed"
],
"filters": {
"employerIds": [
"<string>"
],
"programIds": [
"<string>"
],
"states": [
"<string>"
]
},
"status": "enabled",
"disabledReason": "caller",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"secret": "<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,
"executionId": "<string>",
"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,
"executionId": "<string>",
"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,
"executionId": "<string>",
"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,
"executionId": "<string>",
"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,
"executionId": "<string>",
"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,
"executionId": "<string>",
"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,
"executionId": "<string>",
"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,
"executionId": "<string>",
"accessUrl": "<string>"
}Create a webhook endpoint
Register a URL to receive events. The response includes the signing secret once; it cannot be read again. Events that happen from now on are sent; earlier ones are not. Each organization can have up to 20 endpoints.
POST is not idempotent: if the outcome is uncertain, list endpoints before retrying.
curl --request POST \
--url https://api.canary.effectiveai.app/api/v2/webhook-endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"enabledEvents": [],
"filters": {
"employerIds": [
"<string>"
],
"programIds": [
"<string>"
],
"states": [
"<string>"
]
},
"description": "<string>"
}
'import requests
url = "https://api.canary.effectiveai.app/api/v2/webhook-endpoints"
payload = {
"url": "<string>",
"enabledEvents": [],
"filters": {
"employerIds": ["<string>"],
"programIds": ["<string>"],
"states": ["<string>"]
},
"description": "<string>"
}
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({
url: '<string>',
enabledEvents: [],
filters: {employerIds: ['<string>'], programIds: ['<string>'], states: ['<string>']},
description: '<string>'
})
};
fetch('https://api.canary.effectiveai.app/api/v2/webhook-endpoints', 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/webhook-endpoints",
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([
'url' => '<string>',
'enabledEvents' => [
],
'filters' => [
'employerIds' => [
'<string>'
],
'programIds' => [
'<string>'
],
'states' => [
'<string>'
]
],
'description' => '<string>'
]),
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/webhook-endpoints"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"enabledEvents\": [],\n \"filters\": {\n \"employerIds\": [\n \"<string>\"\n ],\n \"programIds\": [\n \"<string>\"\n ],\n \"states\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\"\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/webhook-endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"enabledEvents\": [],\n \"filters\": {\n \"employerIds\": [\n \"<string>\"\n ],\n \"programIds\": [\n \"<string>\"\n ],\n \"states\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.canary.effectiveai.app/api/v2/webhook-endpoints")
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 \"url\": \"<string>\",\n \"enabledEvents\": [],\n \"filters\": {\n \"employerIds\": [\n \"<string>\"\n ],\n \"programIds\": [\n \"<string>\"\n ],\n \"states\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"url": "<string>",
"description": "<string>",
"enabledEvents": [
"answer.completed"
],
"filters": {
"employerIds": [
"<string>"
],
"programIds": [
"<string>"
],
"states": [
"<string>"
]
},
"status": "enabled",
"disabledReason": "caller",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"secret": "<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,
"executionId": "<string>",
"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,
"executionId": "<string>",
"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,
"executionId": "<string>",
"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,
"executionId": "<string>",
"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,
"executionId": "<string>",
"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,
"executionId": "<string>",
"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,
"executionId": "<string>",
"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,
"executionId": "<string>",
"accessUrl": "<string>"
}Authorizations
Body
1 - 14 elementsanswer.completed and answer.failed fire when an answer finishes. session.message.completed and session.message.failed fire when the agent finishes replying to a message in a session started with POST /sessions, and session.message.needs_input when it stops to ask questions about that message. form_comparison.completed and form_comparison.failed fire when a form comparison finishes. loss_review.completed and loss_review.failed fire when a loss review finishes; saved partial matters remain available. osha.employer.event_added fires when an OSHA inspection, accident or other event first appears for an employer; it needs the OSHA dataset. rsl_log.written fires when a write to an RSL program’s log is kept: the log opening, and each write that records entries. underwriting_submission.extraction.completed and underwriting_submission.extraction.failed fire once when an extraction of an underwriting submission ends (failed also when it is cancelled), only to endpoints whose owner (who created the endpoint, or last changed its url) can read the submission. underwriting_submission.updated fires on each write to an underwriting submission’s log (a value set or accepted, a quote, a bind or a decline), with the log’s status after it, only to such endpoints; read the submission for its stage, rating and quotes.
answer.completed, answer.failed, form_comparison.completed, form_comparison.failed, loss_review.completed, loss_review.failed, osha.employer.event_added, rsl_log.written, session.message.completed, session.message.failed, session.message.needs_input, underwriting_submission.extraction.completed, underwriting_submission.extraction.failed, underwriting_submission.updated Response
Endpoint created, with its signing secret.
answer.completed and answer.failed fire when an answer finishes. session.message.completed and session.message.failed fire when the agent finishes replying to a message in a session started with POST /sessions, and session.message.needs_input when it stops to ask questions about that message. form_comparison.completed and form_comparison.failed fire when a form comparison finishes. loss_review.completed and loss_review.failed fire when a loss review finishes; saved partial matters remain available. osha.employer.event_added fires when an OSHA inspection, accident or other event first appears for an employer; it needs the OSHA dataset. rsl_log.written fires when a write to an RSL program’s log is kept: the log opening, and each write that records entries. underwriting_submission.extraction.completed and underwriting_submission.extraction.failed fire once when an extraction of an underwriting submission ends (failed also when it is cancelled), only to endpoints whose owner (who created the endpoint, or last changed its url) can read the submission. underwriting_submission.updated fires on each write to an underwriting submission’s log (a value set or accepted, a quote, a bind or a decline), with the log’s status after it, only to such endpoints; read the submission for its stage, rating and quotes.
answer.completed, answer.failed, form_comparison.completed, form_comparison.failed, loss_review.completed, loss_review.failed, osha.employer.event_added, rsl_log.written, session.message.completed, session.message.failed, session.message.needs_input, underwriting_submission.extraction.completed, underwriting_submission.extraction.failed, underwriting_submission.updated