Schedule an answer to a question
curl --request POST \
--url https://api.canary.effectiveai.app/api/v2/answers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"question": "<string>",
"scope": {
"products": [
{
"id": "product_00001AB",
"state": "CA"
}
],
"trackingNumbers": [
"NXUS-G134874599"
],
"fileIds": [
"00000000-0000-4000-8000-000000000001"
]
}
}
'import requests
url = "https://api.canary.effectiveai.app/api/v2/answers"
payload = {
"question": "<string>",
"scope": {
"products": [
{
"id": "product_00001AB",
"state": "CA"
}
],
"trackingNumbers": ["NXUS-G134874599"],
"fileIds": ["00000000-0000-4000-8000-000000000001"]
}
}
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({
question: '<string>',
scope: {
products: [{id: 'product_00001AB', state: 'CA'}],
trackingNumbers: ['NXUS-G134874599'],
fileIds: ['00000000-0000-4000-8000-000000000001']
}
})
};
fetch('https://api.canary.effectiveai.app/api/v2/answers', 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/answers",
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([
'question' => '<string>',
'scope' => [
'products' => [
[
'id' => 'product_00001AB',
'state' => 'CA'
]
],
'trackingNumbers' => [
'NXUS-G134874599'
],
'fileIds' => [
'00000000-0000-4000-8000-000000000001'
]
]
]),
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/answers"
payload := strings.NewReader("{\n \"question\": \"<string>\",\n \"scope\": {\n \"products\": [\n {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n }\n ],\n \"trackingNumbers\": [\n \"NXUS-G134874599\"\n ],\n \"fileIds\": [\n \"00000000-0000-4000-8000-000000000001\"\n ]\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/answers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"question\": \"<string>\",\n \"scope\": {\n \"products\": [\n {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n }\n ],\n \"trackingNumbers\": [\n \"NXUS-G134874599\"\n ],\n \"fileIds\": [\n \"00000000-0000-4000-8000-000000000001\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.canary.effectiveai.app/api/v2/answers")
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 \"question\": \"<string>\",\n \"scope\": {\n \"products\": [\n {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n }\n ],\n \"trackingNumbers\": [\n \"NXUS-G134874599\"\n ],\n \"fileIds\": [\n \"00000000-0000-4000-8000-000000000001\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "answer_7KQ2M9A",
"status": "queued"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}Answers
Schedule an answer to a question
Schedule an answer to a question using the required selections as research context. The agent may consult other authorized sources; cited versions are pinned at submission. Poll GET /api/v2/answers/. Requests are limited to 64 KiB. Repeating POST creates a new answer; poll the returned ID to follow the accepted request.
POST
/
answers
Schedule an answer to a question
curl --request POST \
--url https://api.canary.effectiveai.app/api/v2/answers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"question": "<string>",
"scope": {
"products": [
{
"id": "product_00001AB",
"state": "CA"
}
],
"trackingNumbers": [
"NXUS-G134874599"
],
"fileIds": [
"00000000-0000-4000-8000-000000000001"
]
}
}
'import requests
url = "https://api.canary.effectiveai.app/api/v2/answers"
payload = {
"question": "<string>",
"scope": {
"products": [
{
"id": "product_00001AB",
"state": "CA"
}
],
"trackingNumbers": ["NXUS-G134874599"],
"fileIds": ["00000000-0000-4000-8000-000000000001"]
}
}
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({
question: '<string>',
scope: {
products: [{id: 'product_00001AB', state: 'CA'}],
trackingNumbers: ['NXUS-G134874599'],
fileIds: ['00000000-0000-4000-8000-000000000001']
}
})
};
fetch('https://api.canary.effectiveai.app/api/v2/answers', 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/answers",
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([
'question' => '<string>',
'scope' => [
'products' => [
[
'id' => 'product_00001AB',
'state' => 'CA'
]
],
'trackingNumbers' => [
'NXUS-G134874599'
],
'fileIds' => [
'00000000-0000-4000-8000-000000000001'
]
]
]),
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/answers"
payload := strings.NewReader("{\n \"question\": \"<string>\",\n \"scope\": {\n \"products\": [\n {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n }\n ],\n \"trackingNumbers\": [\n \"NXUS-G134874599\"\n ],\n \"fileIds\": [\n \"00000000-0000-4000-8000-000000000001\"\n ]\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/answers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"question\": \"<string>\",\n \"scope\": {\n \"products\": [\n {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n }\n ],\n \"trackingNumbers\": [\n \"NXUS-G134874599\"\n ],\n \"fileIds\": [\n \"00000000-0000-4000-8000-000000000001\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.canary.effectiveai.app/api/v2/answers")
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 \"question\": \"<string>\",\n \"scope\": {\n \"products\": [\n {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n }\n ],\n \"trackingNumbers\": [\n \"NXUS-G134874599\"\n ],\n \"fileIds\": [\n \"00000000-0000-4000-8000-000000000001\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "answer_7KQ2M9A",
"status": "queued"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"upgradeUrl": "<string>"
}Authorizations
Effective API key. Send Authorization: Bearer sk-eai-...
Body
application/json
Question to answer. 1–2,000 characters after trimming surrounding whitespace.
Required string length:
1 - 2000Required research context: the union of these selections. The agent may consult other authorized sources; at least one list must be nonempty.
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Response
Initial message accepted by the session runtime.