curl --request POST \
--url https://api.canary.effectiveai.app/api/v2/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"message": "<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/sessions"
payload = {
"title": "<string>",
"message": "<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({
title: '<string>',
message: '<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/sessions', 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/sessions",
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([
'title' => '<string>',
'message' => '<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/sessions"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"message\": \"<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/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"message\": \"<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/sessions")
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 \"title\": \"<string>\",\n \"message\": \"<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": "00000000-0000-4000-8000-000000000001",
"status": "idle",
"message": {
"id": "00000000-0000-4000-8000-000000000002",
"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>"
}Start a session with the Effective agent
Start a conversation with the Effective agent. Send a first message to have the agent start right away, and add scope to point it at products, filings or files. Follow the first message with GET /sessions//messages/. Repeating POST starts another session; if the outcome is uncertain, list sessions before retrying. The session also appears in the Effective web app.
curl --request POST \
--url https://api.canary.effectiveai.app/api/v2/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"message": "<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/sessions"
payload = {
"title": "<string>",
"message": "<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({
title: '<string>',
message: '<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/sessions', 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/sessions",
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([
'title' => '<string>',
'message' => '<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/sessions"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"message\": \"<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/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"message\": \"<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/sessions")
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 \"title\": \"<string>\",\n \"message\": \"<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": "00000000-0000-4000-8000-000000000001",
"status": "idle",
"message": {
"id": "00000000-0000-4000-8000-000000000002",
"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>"
}Authorizations
Effective API key. Send Authorization: Bearer sk-eai-...
Body
Name shown for the session in Effective. Defaults to "API session".
1 - 120First message. When present the agent starts on it right away; otherwise the session waits for POST /sessions/{id}/messages.
1 - 20000Research context for the first message, in the same shape answers take. The agent may also consult other sources you can access. Requires message.
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Response
Session started.
Session UUID, e.g. 00000000-0000-4000-8000-000000000001.
"00000000-0000-4000-8000-000000000001"
running while the agent is working on a message; idle otherwise.
idle, running The first message, when one was sent. Follow it with GET /sessions/{id}/messages/{messageId}.
Show child attributes
Show child attributes