Start a session with the Effective agent
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>",
"agentId": "<string>",
"agentVersion": "<string>",
"appId": "<string>",
"missionControlId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope": {
"products": [
{
"id": "product_00001AB",
"state": "CA"
}
],
"trackingNumbers": [
"NXUS-G134874599"
],
"artifactIds": [
"00000000-0000-4000-8000-000000000001"
],
"fileIds": [
"00000000-0000-4000-8000-000000000001"
]
}
}
'import requests
url = "https://api.canary.effectiveai.app/api/v2/sessions"
payload = {
"title": "<string>",
"message": "<string>",
"agentId": "<string>",
"agentVersion": "<string>",
"appId": "<string>",
"missionControlId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope": {
"products": [
{
"id": "product_00001AB",
"state": "CA"
}
],
"trackingNumbers": ["NXUS-G134874599"],
"artifactIds": ["00000000-0000-4000-8000-000000000001"],
"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>',
agentId: '<string>',
agentVersion: '<string>',
appId: '<string>',
missionControlId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
scope: {
products: [{id: 'product_00001AB', state: 'CA'}],
trackingNumbers: ['NXUS-G134874599'],
artifactIds: ['00000000-0000-4000-8000-000000000001'],
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>',
'agentId' => '<string>',
'agentVersion' => '<string>',
'appId' => '<string>',
'missionControlId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'scope' => [
'products' => [
[
'id' => 'product_00001AB',
'state' => 'CA'
]
],
'trackingNumbers' => [
'NXUS-G134874599'
],
'artifactIds' => [
'00000000-0000-4000-8000-000000000001'
],
'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 \"agentId\": \"<string>\",\n \"agentVersion\": \"<string>\",\n \"appId\": \"<string>\",\n \"missionControlId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scope\": {\n \"products\": [\n {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n }\n ],\n \"trackingNumbers\": [\n \"NXUS-G134874599\"\n ],\n \"artifactIds\": [\n \"00000000-0000-4000-8000-000000000001\"\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 \"agentId\": \"<string>\",\n \"agentVersion\": \"<string>\",\n \"appId\": \"<string>\",\n \"missionControlId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scope\": {\n \"products\": [\n {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n }\n ],\n \"trackingNumbers\": [\n \"NXUS-G134874599\"\n ],\n \"artifactIds\": [\n \"00000000-0000-4000-8000-000000000001\"\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 \"agentId\": \"<string>\",\n \"agentVersion\": \"<string>\",\n \"appId\": \"<string>\",\n \"missionControlId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scope\": {\n \"products\": [\n {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n }\n ],\n \"trackingNumbers\": [\n \"NXUS-G134874599\"\n ],\n \"artifactIds\": [\n \"00000000-0000-4000-8000-000000000001\"\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,
"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>"
}{
"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>"
}Sessions
Start a session with the Effective agent
Start a conversation with the Effective agent, or select a saved agent or an app’s published agent. The session pins a saved agent’s version at creation. App sessions retain that deployment and stop if it changes. 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/.
Supply Idempotency-Key to recover the same session and first message after a disconnect. Repeating POST without a key starts another session. The session also appears in the Effective web app.
POST
/
sessions
Start a session with the Effective agent
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>",
"agentId": "<string>",
"agentVersion": "<string>",
"appId": "<string>",
"missionControlId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope": {
"products": [
{
"id": "product_00001AB",
"state": "CA"
}
],
"trackingNumbers": [
"NXUS-G134874599"
],
"artifactIds": [
"00000000-0000-4000-8000-000000000001"
],
"fileIds": [
"00000000-0000-4000-8000-000000000001"
]
}
}
'import requests
url = "https://api.canary.effectiveai.app/api/v2/sessions"
payload = {
"title": "<string>",
"message": "<string>",
"agentId": "<string>",
"agentVersion": "<string>",
"appId": "<string>",
"missionControlId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope": {
"products": [
{
"id": "product_00001AB",
"state": "CA"
}
],
"trackingNumbers": ["NXUS-G134874599"],
"artifactIds": ["00000000-0000-4000-8000-000000000001"],
"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>',
agentId: '<string>',
agentVersion: '<string>',
appId: '<string>',
missionControlId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
scope: {
products: [{id: 'product_00001AB', state: 'CA'}],
trackingNumbers: ['NXUS-G134874599'],
artifactIds: ['00000000-0000-4000-8000-000000000001'],
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>',
'agentId' => '<string>',
'agentVersion' => '<string>',
'appId' => '<string>',
'missionControlId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'scope' => [
'products' => [
[
'id' => 'product_00001AB',
'state' => 'CA'
]
],
'trackingNumbers' => [
'NXUS-G134874599'
],
'artifactIds' => [
'00000000-0000-4000-8000-000000000001'
],
'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 \"agentId\": \"<string>\",\n \"agentVersion\": \"<string>\",\n \"appId\": \"<string>\",\n \"missionControlId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scope\": {\n \"products\": [\n {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n }\n ],\n \"trackingNumbers\": [\n \"NXUS-G134874599\"\n ],\n \"artifactIds\": [\n \"00000000-0000-4000-8000-000000000001\"\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 \"agentId\": \"<string>\",\n \"agentVersion\": \"<string>\",\n \"appId\": \"<string>\",\n \"missionControlId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scope\": {\n \"products\": [\n {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n }\n ],\n \"trackingNumbers\": [\n \"NXUS-G134874599\"\n ],\n \"artifactIds\": [\n \"00000000-0000-4000-8000-000000000001\"\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 \"agentId\": \"<string>\",\n \"agentVersion\": \"<string>\",\n \"appId\": \"<string>\",\n \"missionControlId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scope\": {\n \"products\": [\n {\n \"id\": \"product_00001AB\",\n \"state\": \"CA\"\n }\n ],\n \"trackingNumbers\": [\n \"NXUS-G134874599\"\n ],\n \"artifactIds\": [\n \"00000000-0000-4000-8000-000000000001\"\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,
"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>"
}{
"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
Headers
Body
application/json
Response
Session started.