EvaluateLeadNextActionAPI mirrors the erdo_evaluate_lead_next_action MCP
curl --request POST \
--url https://api.erdo.ai/v1/datasets/{datasetSlug}/leads/{leadRef}/next-actions/evaluate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"body": "<string>"
}
'import requests
url = "https://api.erdo.ai/v1/datasets/{datasetSlug}/leads/{leadRef}/next-actions/evaluate"
payload = {
"agent_id": "<string>",
"body": "<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({agent_id: '<string>', body: JSON.stringify('<string>')})
};
fetch('https://api.erdo.ai/v1/datasets/{datasetSlug}/leads/{leadRef}/next-actions/evaluate', 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.erdo.ai/v1/datasets/{datasetSlug}/leads/{leadRef}/next-actions/evaluate",
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([
'agent_id' => '<string>',
'body' => '<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.erdo.ai/v1/datasets/{datasetSlug}/leads/{leadRef}/next-actions/evaluate"
payload := strings.NewReader("{\n \"agent_id\": \"<string>\",\n \"body\": \"<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.erdo.ai/v1/datasets/{datasetSlug}/leads/{leadRef}/next-actions/evaluate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"body\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erdo.ai/v1/datasets/{datasetSlug}/leads/{leadRef}/next-actions/evaluate")
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 \"agent_id\": \"<string>\",\n \"body\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"agent": {
"id": "<string>",
"name": "<string>",
"phone_number": "<string>",
"slug": "<string>"
},
"evaluation": {
"action_input": {
"accompanying_email": {
"body_markdown": "<string>",
"sent_at": "2023-11-07T05:31:56Z",
"subject": "<string>",
"to": "<string>",
"to_name": "<string>"
},
"agent": {
"id": "<string>",
"name": "<string>",
"phone_number": "<string>",
"slug": "<string>"
},
"agent_instructions": {
"instructions": "<string>",
"objective": "<string>"
},
"dataset_id": "<string>",
"development": "<string>",
"downgrade_cause": "<string>",
"email": {
"body_markdown": "<string>",
"subject": "<string>"
},
"handoff": {
"suggested_channel": "<string>",
"summary": "<string>"
},
"hold_until": "2023-11-07T05:31:56Z",
"lead_contact": "<string>",
"lead_email": "<string>",
"lead_name": "<string>",
"lead_phone": "<string>",
"lead_reference": "<string>",
"lead_zone": {
"evidence": "<string>",
"source": "<string>",
"timezone": "<string>"
},
"note": "<string>",
"original_kind": "<string>",
"playbook_revision": 123,
"reachability": "<string>",
"reached_via": "<string>",
"signature_name": "<string>",
"sms": {
"body": "<string>"
},
"suggestion_id": "<string>",
"to": "<string>",
"to_name": "<string>"
},
"action_kind": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"facts": {
"bedrooms": {
"source_column": "<string>",
"value": "<string>"
},
"broker": {
"source_column": "<string>",
"value": "<string>"
},
"budget": {
"source_column": "<string>",
"value": "<string>"
},
"financing": {
"source_column": "<string>",
"value": "<string>"
},
"language": {
"source_column": "<string>",
"value": "<string>"
},
"purpose": {
"source_column": "<string>",
"value": "<string>"
},
"timeline": {
"source_column": "<string>",
"value": "<string>"
}
},
"mode": "<string>",
"model": "<string>",
"priority": "<string>",
"priority_reason": "<string>",
"proposed_kind": "<string>",
"rationale": "<string>",
"reachability": "<string>",
"reached_via": "<string>",
"rule": "<string>",
"rule_verified": true,
"stage": "<string>"
},
"read_back": {
"accompanying_email": {
"mode": "<string>",
"when": "<string>"
},
"actions": [
{
"kind": "<string>",
"mode": "<string>",
"when": "<string>"
}
],
"cadence": {
"confirmed": {
"between_channels": [
{
"after": "<string>",
"minutes": 123,
"next": "<string>"
}
],
"call_minutes": 123,
"email_minutes": 123,
"sms_minutes": 123
},
"new_lead_grace_minutes": 123,
"unconfirmed": {
"between_channels": [
{
"after": "<string>",
"minutes": 123,
"next": "<string>"
}
],
"call_minutes": 123,
"email_minutes": 123,
"sms_minutes": 123
}
},
"limits": [
{
"kind": "<string>",
"mode": "<string>",
"reason": "<string>"
}
],
"priority": {
"forbidden_factors": [
"<string>"
],
"high": [
"<string>"
],
"low": [
"<string>"
],
"medium": [
"<string>"
]
},
"stages": [
{
"actions": [
"<string>"
],
"name": "<string>",
"summary": "<string>"
}
],
"working_hours": {
"days": [
"<string>"
],
"end": "<string>",
"start": "<string>",
"timezone": "<string>"
}
},
"timeline": {
"canonical_lead_id": "<string>",
"dataset_id": "<string>",
"dataset_slug": "<string>",
"emails": [
"<string>"
],
"entries": [
{
"at": "2023-11-07T05:31:56Z",
"detail": "<string>",
"direction": "<string>",
"from_playbook": true,
"kind": "<string>",
"ref": "<string>",
"status": "<string>",
"summary": "<string>"
}
],
"lead_reference": "<string>",
"phones": [
"<string>"
],
"row": {},
"timing": {
"awaiting_our_reply": true,
"captured_at": "2023-11-07T05:31:56Z",
"days_since_capture": 123,
"days_since_last_outbound": 123,
"days_since_last_response": 123,
"last_meeting_at": "2023-11-07T05:31:56Z",
"last_outbound_at": "2023-11-07T05:31:56Z",
"last_outbound_by_channel": {},
"last_response_at": "2023-11-07T05:31:56Z",
"lead_zone": {
"evidence": "<string>",
"source": "<string>",
"timezone": "<string>"
},
"local_time": "<string>",
"next_meeting_at": "2023-11-07T05:31:56Z",
"next_working_window_start": "2023-11-07T05:31:56Z",
"now": "2023-11-07T05:31:56Z",
"outbound_messages": 123,
"phone_hours": {
"local_time": "<string>",
"next_working_window_start": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"within_working_hours": true
},
"reachability": "<string>",
"reached_at": "2023-11-07T05:31:56Z",
"reached_via": "<string>",
"timezone": "<string>",
"unanswered_outbound_in_a_row": 123,
"within_working_hours": true
},
"unavailable": {}
}
}{
"code": "not_found",
"details": {},
"message": "<string>"
}API Reference
EvaluateLeadNextActionAPI mirrors the erdo_evaluate_lead_next_action MCP
tool. Nothing is stored and nothing is sent.
POST
/
v1
/
datasets
/
{datasetSlug}
/
leads
/
{leadRef}
/
next-actions
/
evaluate
EvaluateLeadNextActionAPI mirrors the erdo_evaluate_lead_next_action MCP
curl --request POST \
--url https://api.erdo.ai/v1/datasets/{datasetSlug}/leads/{leadRef}/next-actions/evaluate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"body": "<string>"
}
'import requests
url = "https://api.erdo.ai/v1/datasets/{datasetSlug}/leads/{leadRef}/next-actions/evaluate"
payload = {
"agent_id": "<string>",
"body": "<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({agent_id: '<string>', body: JSON.stringify('<string>')})
};
fetch('https://api.erdo.ai/v1/datasets/{datasetSlug}/leads/{leadRef}/next-actions/evaluate', 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.erdo.ai/v1/datasets/{datasetSlug}/leads/{leadRef}/next-actions/evaluate",
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([
'agent_id' => '<string>',
'body' => '<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.erdo.ai/v1/datasets/{datasetSlug}/leads/{leadRef}/next-actions/evaluate"
payload := strings.NewReader("{\n \"agent_id\": \"<string>\",\n \"body\": \"<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.erdo.ai/v1/datasets/{datasetSlug}/leads/{leadRef}/next-actions/evaluate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"body\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erdo.ai/v1/datasets/{datasetSlug}/leads/{leadRef}/next-actions/evaluate")
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 \"agent_id\": \"<string>\",\n \"body\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"agent": {
"id": "<string>",
"name": "<string>",
"phone_number": "<string>",
"slug": "<string>"
},
"evaluation": {
"action_input": {
"accompanying_email": {
"body_markdown": "<string>",
"sent_at": "2023-11-07T05:31:56Z",
"subject": "<string>",
"to": "<string>",
"to_name": "<string>"
},
"agent": {
"id": "<string>",
"name": "<string>",
"phone_number": "<string>",
"slug": "<string>"
},
"agent_instructions": {
"instructions": "<string>",
"objective": "<string>"
},
"dataset_id": "<string>",
"development": "<string>",
"downgrade_cause": "<string>",
"email": {
"body_markdown": "<string>",
"subject": "<string>"
},
"handoff": {
"suggested_channel": "<string>",
"summary": "<string>"
},
"hold_until": "2023-11-07T05:31:56Z",
"lead_contact": "<string>",
"lead_email": "<string>",
"lead_name": "<string>",
"lead_phone": "<string>",
"lead_reference": "<string>",
"lead_zone": {
"evidence": "<string>",
"source": "<string>",
"timezone": "<string>"
},
"note": "<string>",
"original_kind": "<string>",
"playbook_revision": 123,
"reachability": "<string>",
"reached_via": "<string>",
"signature_name": "<string>",
"sms": {
"body": "<string>"
},
"suggestion_id": "<string>",
"to": "<string>",
"to_name": "<string>"
},
"action_kind": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"facts": {
"bedrooms": {
"source_column": "<string>",
"value": "<string>"
},
"broker": {
"source_column": "<string>",
"value": "<string>"
},
"budget": {
"source_column": "<string>",
"value": "<string>"
},
"financing": {
"source_column": "<string>",
"value": "<string>"
},
"language": {
"source_column": "<string>",
"value": "<string>"
},
"purpose": {
"source_column": "<string>",
"value": "<string>"
},
"timeline": {
"source_column": "<string>",
"value": "<string>"
}
},
"mode": "<string>",
"model": "<string>",
"priority": "<string>",
"priority_reason": "<string>",
"proposed_kind": "<string>",
"rationale": "<string>",
"reachability": "<string>",
"reached_via": "<string>",
"rule": "<string>",
"rule_verified": true,
"stage": "<string>"
},
"read_back": {
"accompanying_email": {
"mode": "<string>",
"when": "<string>"
},
"actions": [
{
"kind": "<string>",
"mode": "<string>",
"when": "<string>"
}
],
"cadence": {
"confirmed": {
"between_channels": [
{
"after": "<string>",
"minutes": 123,
"next": "<string>"
}
],
"call_minutes": 123,
"email_minutes": 123,
"sms_minutes": 123
},
"new_lead_grace_minutes": 123,
"unconfirmed": {
"between_channels": [
{
"after": "<string>",
"minutes": 123,
"next": "<string>"
}
],
"call_minutes": 123,
"email_minutes": 123,
"sms_minutes": 123
}
},
"limits": [
{
"kind": "<string>",
"mode": "<string>",
"reason": "<string>"
}
],
"priority": {
"forbidden_factors": [
"<string>"
],
"high": [
"<string>"
],
"low": [
"<string>"
],
"medium": [
"<string>"
]
},
"stages": [
{
"actions": [
"<string>"
],
"name": "<string>",
"summary": "<string>"
}
],
"working_hours": {
"days": [
"<string>"
],
"end": "<string>",
"start": "<string>",
"timezone": "<string>"
}
},
"timeline": {
"canonical_lead_id": "<string>",
"dataset_id": "<string>",
"dataset_slug": "<string>",
"emails": [
"<string>"
],
"entries": [
{
"at": "2023-11-07T05:31:56Z",
"detail": "<string>",
"direction": "<string>",
"from_playbook": true,
"kind": "<string>",
"ref": "<string>",
"status": "<string>",
"summary": "<string>"
}
],
"lead_reference": "<string>",
"phones": [
"<string>"
],
"row": {},
"timing": {
"awaiting_our_reply": true,
"captured_at": "2023-11-07T05:31:56Z",
"days_since_capture": 123,
"days_since_last_outbound": 123,
"days_since_last_response": 123,
"last_meeting_at": "2023-11-07T05:31:56Z",
"last_outbound_at": "2023-11-07T05:31:56Z",
"last_outbound_by_channel": {},
"last_response_at": "2023-11-07T05:31:56Z",
"lead_zone": {
"evidence": "<string>",
"source": "<string>",
"timezone": "<string>"
},
"local_time": "<string>",
"next_meeting_at": "2023-11-07T05:31:56Z",
"next_working_window_start": "2023-11-07T05:31:56Z",
"now": "2023-11-07T05:31:56Z",
"outbound_messages": 123,
"phone_hours": {
"local_time": "<string>",
"next_working_window_start": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"within_working_hours": true
},
"reachability": "<string>",
"reached_at": "2023-11-07T05:31:56Z",
"reached_via": "<string>",
"timezone": "<string>",
"unanswered_outbound_in_a_row": 123,
"within_working_hours": true
},
"unavailable": {}
}
}{
"code": "not_found",
"details": {},
"message": "<string>"
}Authorizations
An Erdo API key (erdo_api_...) or scoped token (erdo_token_...).
Response
Success response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Only Actions[].Mode and WorkingHours are enforced; the stages and the priority ladder are a picture of the text drawn for the person who wrote it, and every evaluation still reads the whole text.
Show child attributes
Show child attributes
Show child attributes
Show child attributes

