Build Agent Configuration
Build Agent Configuration with the DialNexa API. Generates a draft configuration from structured answers. This operation does not save or publish an agent.
curl --request POST \
--url https://api.dialnexa.com/v1/agent-builder/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"structured_input": {
"company_and_offering": {
"description": "Company and offering",
"value": "Acme provides appointment scheduling software."
},
"target_customer": {
"description": "Target customer",
"value": "Small business owners who requested a demo."
},
"primary_goal": {
"description": "Call goal",
"value": "Arrange a product demo."
},
"success_criteria": {
"description": "Success criteria",
"value": "Confirm interest and a preferred callback time."
},
"information_to_collect": {
"description": "Information to collect",
"value": "Name and preferred callback time."
},
"objections_and_faqs": {
"description": "Questions",
"value": "Explain that the demo is free."
},
"agent_tone": {
"description": "Tone",
"value": "Friendly, concise, and professional."
},
"additional_context": {
"description": "Context",
"value": "Do not promise pricing or unavailable appointment slots."
}
}
}
'import requests
url = "https://api.dialnexa.com/v1/agent-builder/run"
payload = { "structured_input": {
"company_and_offering": {
"description": "Company and offering",
"value": "Acme provides appointment scheduling software."
},
"target_customer": {
"description": "Target customer",
"value": "Small business owners who requested a demo."
},
"primary_goal": {
"description": "Call goal",
"value": "Arrange a product demo."
},
"success_criteria": {
"description": "Success criteria",
"value": "Confirm interest and a preferred callback time."
},
"information_to_collect": {
"description": "Information to collect",
"value": "Name and preferred callback time."
},
"objections_and_faqs": {
"description": "Questions",
"value": "Explain that the demo is free."
},
"agent_tone": {
"description": "Tone",
"value": "Friendly, concise, and professional."
},
"additional_context": {
"description": "Context",
"value": "Do not promise pricing or unavailable appointment slots."
}
} }
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({
structured_input: {
company_and_offering: {
description: 'Company and offering',
value: 'Acme provides appointment scheduling software.'
},
target_customer: {
description: 'Target customer',
value: 'Small business owners who requested a demo.'
},
primary_goal: {description: 'Call goal', value: 'Arrange a product demo.'},
success_criteria: {
description: 'Success criteria',
value: 'Confirm interest and a preferred callback time.'
},
information_to_collect: {
description: 'Information to collect',
value: 'Name and preferred callback time.'
},
objections_and_faqs: {description: 'Questions', value: 'Explain that the demo is free.'},
agent_tone: {description: 'Tone', value: 'Friendly, concise, and professional.'},
additional_context: {
description: 'Context',
value: 'Do not promise pricing or unavailable appointment slots.'
}
}
})
};
fetch('https://api.dialnexa.com/v1/agent-builder/run', 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.dialnexa.com/v1/agent-builder/run",
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([
'structured_input' => [
'company_and_offering' => [
'description' => 'Company and offering',
'value' => 'Acme provides appointment scheduling software.'
],
'target_customer' => [
'description' => 'Target customer',
'value' => 'Small business owners who requested a demo.'
],
'primary_goal' => [
'description' => 'Call goal',
'value' => 'Arrange a product demo.'
],
'success_criteria' => [
'description' => 'Success criteria',
'value' => 'Confirm interest and a preferred callback time.'
],
'information_to_collect' => [
'description' => 'Information to collect',
'value' => 'Name and preferred callback time.'
],
'objections_and_faqs' => [
'description' => 'Questions',
'value' => 'Explain that the demo is free.'
],
'agent_tone' => [
'description' => 'Tone',
'value' => 'Friendly, concise, and professional.'
],
'additional_context' => [
'description' => 'Context',
'value' => 'Do not promise pricing or unavailable appointment slots.'
]
]
]),
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.dialnexa.com/v1/agent-builder/run"
payload := strings.NewReader("{\n \"structured_input\": {\n \"company_and_offering\": {\n \"description\": \"Company and offering\",\n \"value\": \"Acme provides appointment scheduling software.\"\n },\n \"target_customer\": {\n \"description\": \"Target customer\",\n \"value\": \"Small business owners who requested a demo.\"\n },\n \"primary_goal\": {\n \"description\": \"Call goal\",\n \"value\": \"Arrange a product demo.\"\n },\n \"success_criteria\": {\n \"description\": \"Success criteria\",\n \"value\": \"Confirm interest and a preferred callback time.\"\n },\n \"information_to_collect\": {\n \"description\": \"Information to collect\",\n \"value\": \"Name and preferred callback time.\"\n },\n \"objections_and_faqs\": {\n \"description\": \"Questions\",\n \"value\": \"Explain that the demo is free.\"\n },\n \"agent_tone\": {\n \"description\": \"Tone\",\n \"value\": \"Friendly, concise, and professional.\"\n },\n \"additional_context\": {\n \"description\": \"Context\",\n \"value\": \"Do not promise pricing or unavailable appointment slots.\"\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.dialnexa.com/v1/agent-builder/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"structured_input\": {\n \"company_and_offering\": {\n \"description\": \"Company and offering\",\n \"value\": \"Acme provides appointment scheduling software.\"\n },\n \"target_customer\": {\n \"description\": \"Target customer\",\n \"value\": \"Small business owners who requested a demo.\"\n },\n \"primary_goal\": {\n \"description\": \"Call goal\",\n \"value\": \"Arrange a product demo.\"\n },\n \"success_criteria\": {\n \"description\": \"Success criteria\",\n \"value\": \"Confirm interest and a preferred callback time.\"\n },\n \"information_to_collect\": {\n \"description\": \"Information to collect\",\n \"value\": \"Name and preferred callback time.\"\n },\n \"objections_and_faqs\": {\n \"description\": \"Questions\",\n \"value\": \"Explain that the demo is free.\"\n },\n \"agent_tone\": {\n \"description\": \"Tone\",\n \"value\": \"Friendly, concise, and professional.\"\n },\n \"additional_context\": {\n \"description\": \"Context\",\n \"value\": \"Do not promise pricing or unavailable appointment slots.\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dialnexa.com/v1/agent-builder/run")
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 \"structured_input\": {\n \"company_and_offering\": {\n \"description\": \"Company and offering\",\n \"value\": \"Acme provides appointment scheduling software.\"\n },\n \"target_customer\": {\n \"description\": \"Target customer\",\n \"value\": \"Small business owners who requested a demo.\"\n },\n \"primary_goal\": {\n \"description\": \"Call goal\",\n \"value\": \"Arrange a product demo.\"\n },\n \"success_criteria\": {\n \"description\": \"Success criteria\",\n \"value\": \"Confirm interest and a preferred callback time.\"\n },\n \"information_to_collect\": {\n \"description\": \"Information to collect\",\n \"value\": \"Name and preferred callback time.\"\n },\n \"objections_and_faqs\": {\n \"description\": \"Questions\",\n \"value\": \"Explain that the demo is free.\"\n },\n \"agent_tone\": {\n \"description\": \"Tone\",\n \"value\": \"Friendly, concise, and professional.\"\n },\n \"additional_context\": {\n \"description\": \"Context\",\n \"value\": \"Do not promise pricing or unavailable appointment slots.\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"error": false,
"statusCode": 201,
"message": "Success",
"data": {
"organizationId": "<string>",
"structuredInput": {
"company_and_offering": {
"description": "<string>",
"value": "<string>"
},
"target_customer": {
"description": "<string>",
"value": "<string>"
},
"primary_goal": {
"description": "<string>",
"value": "<string>"
},
"success_criteria": {
"description": "<string>",
"value": "<string>"
},
"information_to_collect": {
"description": "<string>",
"value": "<string>"
},
"objections_and_faqs": {
"description": "<string>",
"value": "<string>"
},
"agent_tone": {
"description": "<string>",
"value": "<string>"
},
"additional_context": {
"description": "<string>",
"value": "<string>"
},
"validation_clarifications": {
"description": "<string>",
"value": "<string>"
}
},
"pipeline": "cascaded",
"targetShape": "spa",
"buildAttempt": 123,
"maxBuildAttempts": 123,
"agentBrief": {
"agent_name": "<string>",
"company_name": "<string>",
"agent_role": "<string>",
"tone": "<string>",
"language_rules": "<string>",
"caller_type": "<string>",
"call_type": "<string>",
"primary_goal": "<string>",
"secondary_goals": [
"<string>"
],
"known_variables": [
"<string>"
],
"available_context": [
"<string>"
],
"required_information_to_collect": [
"<string>"
],
"call_flow_steps": [
"<string>"
],
"guardrails": [
"<string>"
],
"special_rules": [
"<string>"
],
"faqs": [
"<string>"
],
"objections": [
"<string>"
],
"success_criteria": [
"<string>"
],
"failure_criteria": [
"<string>"
],
"post_call_fields_requested": [
"<string>"
],
"known_terms": [
"<string>"
],
"unknowns_or_missing_info": [
"<string>"
]
},
"voicePreferences": {
"language": "<string>",
"accent": "<string>",
"gender": "<string>",
"keywords": [
"<string>"
]
},
"missingQuestions": [
"<string>"
],
"inventory": {
"llms": [
{
"id": "<string>",
"name": "<string>",
"model_category": "<string>"
}
],
"transcribers": [
{
"id": "<string>",
"name": "<string>",
"provider": "<string>",
"model_id": "<string>"
}
],
"languages": [
{
"id": "<string>",
"name": "<string>",
"code": "<string>"
}
]
},
"technicalProfile": {
"agent_type": "Single_Prompt_Agent",
"pipeline_type": "Cascaded",
"llm_id": "<string>",
"llm_name": "<string>",
"voice_id": "<string>",
"voice_name": "<string>",
"voice_model_id": "<string>",
"transcriber_id": "<string>",
"transcriber_name": "<string>",
"language_id": "<string>",
"language_code": "<string>",
"boosted_keywords": "<string>",
"fallback_stt_enabled": true,
"stt_fallback_transcriber_id": "<string>",
"stt_fallback_wait_ms": 123,
"audio_cache_enabled": true,
"denoising_mode": "remove_noise",
"max_call_duration_sec": 123,
"system_prompt_text": "<string>",
"llm_temperature": 123,
"fallback_llm_enabled": true,
"llm_fallback_model": "<string>",
"llm_fallback_model_name": "<string>",
"llm_fallback_delay_ms": 123,
"optimization_summary": "<string>"
},
"promptSections": {
"identity": "<string>",
"context_and_variables": "<string>",
"primary_goal": "<string>",
"call_flow": "<string>",
"guardrails": "<string>",
"faqs_and_objections": "<string>",
"closing_rules": "<string>",
"ai_identity_if_asked": "<string>"
},
"promptText": "<string>",
"welcomeMessage": "<string>",
"postcallAnalysis": [
{
"field_name": "<string>",
"field_type": "TEXT",
"field_description": "<string>",
"additional_fields": {}
}
],
"boostedKeywords": "<string>",
"simulations": [
"<string>"
],
"evaluation": {
"overall_pass": true,
"prompt_score": 123,
"conversation_score": 123,
"pca_score": 123,
"technical_fit_score": 123,
"issues": [
"<string>"
],
"prompt_fixes": [
"<string>"
],
"pca_fixes": [
"<string>"
],
"technical_profile_fixes": [
"<string>"
],
"human_review_required": true,
"summary": "<string>"
},
"draftAgent": {
"agent_type": "Single_Prompt_Agent",
"pipeline_type": "Cascaded",
"ivr_menu": {},
"agent_identity": "<string>",
"agent_background": "<string>",
"node_positions": "<string>",
"title": "<string>",
"description": "<string>",
"prompt_text": "<string>",
"system_prompt_text": "<string>",
"welcome_message": "<string>",
"default_dynamic_variables": {},
"postcall_analysis": [
{
"field_name": "<string>",
"field_type": "TEXT",
"field_description": "<string>",
"additional_fields": {}
}
],
"llm_id": "<string>",
"voice_id": "<string>",
"voice_model_id": "<string>",
"transcriber_id": "<string>",
"language_id": "<string>",
"boosted_keywords": "<string>",
"conversation_start_type": "<string>",
"llm_temperature": 123,
"fallback_llm_enabled": true,
"llm_fallback_model": "<string>",
"llm_fallback_delay_ms": 123,
"fallback_stt_enabled": true,
"stt_fallback_transcriber_id": "<string>",
"stt_fallback_wait_ms": 123,
"audio_cache_enabled": true,
"denoising_mode": "remove_noise",
"max_call_duration_sec": 123
},
"events": [
{
"node": "<string>",
"status": "started",
"message": "<string>",
"timestamp": "<string>",
"artifact": {}
}
],
"status": "needs_input",
"error": "<string>"
},
"timestamp": "2023-11-07T05:31:56Z"
}{
"statusCode": 400,
"error": true,
"success": false,
"data": [],
"message": "build_attempt must not be greater than 2, pipeline must be one of the following values: cascaded, s2s",
"errors": [
"build_attempt must not be greater than 2",
"pipeline must be one of the following values: cascaded, s2s"
]
}{
"statusCode": 401,
"error": true,
"success": false,
"data": [],
"message": "Invalid API key",
"errors": []
}{
"statusCode": 500,
"error": true,
"success": false,
"data": [],
"message": "Internal server error",
"errors": []
}Before you begin
Use a server-side API key for the intended workspace.Build Agent Configuration request
The request panel lists supported query parameters and body fields. For a request body, the example below supplies the required fields. Replace sample values with your own inputs.curl --request POST 'https://api.dialnexa.com/v1/agent-builder/run' \
--header "Authorization: Bearer $DIALNEXA_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"structured_input": {
"company_and_offering": {
"description": "Company and offering",
"value": "Acme provides appointment scheduling software."
},
"target_customer": {
"description": "Target customer",
"value": "Small business owners who requested a demo."
},
"primary_goal": {
"description": "Call goal",
"value": "Arrange a product demo."
},
"success_criteria": {
"description": "Success criteria",
"value": "Confirm interest and a preferred callback time."
},
"information_to_collect": {
"description": "Information to collect",
"value": "Name and preferred callback time."
},
"objections_and_faqs": {
"description": "Questions",
"value": "Explain that the demo is free."
},
"agent_tone": {
"description": "Tone",
"value": "Friendly, concise, and professional."
},
"additional_context": {
"description": "Context",
"value": "Do not promise pricing or unavailable appointment slots."
}
}
}'
Verify the result
Expect HTTP201. Read the data property in the success envelope; the response panel documents its fields.
Inspect data.status: needs_input requires answers to missingQuestions; human_review requires review of the evaluation; failed includes an error. completed provides draftAgent. Review its configuration, then map the fields into Create Agent. A build never publishes an agent automatically.
A build can take longer than the 60 second HTTP timeout. For long builds, use Stream Agent Build, which keeps the connection open until the result is sent.
This operation also accepts the matching /v1/assistant path. The request and result contracts are shared. Use one path consistently for your integration.
Retry safety
This operation does not modify workspace resources. Retry after a transient connection failure.Errors and recovery
401: Missing, expired, or invalid API key.400: The body failed validation, for examplebuild_attemptoutside1to2or an unknownpipeline. The message lists each problem.
Related endpoints
- Get Agent Builder Inventory
- Stream Agent Build
- Generate Agent Objectives
- Generate Agent Tone
- API authentication
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Structured blueprint submission - each field has a description (field guidance) and value (user answer)
Show child attributes
Show child attributes
Build attempt number (1-2). Validation runs only on attempt 1; attempt 2 skips re-validation.
1 <= x <= 2Engine for the generated agent. "s2s" builds the realtime pipeline on the same single-prompt agent; anything else builds the cascaded pipeline.
cascaded, s2s Kind of agent to build. "cfa" writes a conversation-flow document (a step graph), "ivr" writes a touch-tone menu; anything else builds a single-prompt agent.
spa, cfa, ivr Response
Builder run completed or needs more input
curl --request POST \
--url https://api.dialnexa.com/v1/agent-builder/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"structured_input": {
"company_and_offering": {
"description": "Company and offering",
"value": "Acme provides appointment scheduling software."
},
"target_customer": {
"description": "Target customer",
"value": "Small business owners who requested a demo."
},
"primary_goal": {
"description": "Call goal",
"value": "Arrange a product demo."
},
"success_criteria": {
"description": "Success criteria",
"value": "Confirm interest and a preferred callback time."
},
"information_to_collect": {
"description": "Information to collect",
"value": "Name and preferred callback time."
},
"objections_and_faqs": {
"description": "Questions",
"value": "Explain that the demo is free."
},
"agent_tone": {
"description": "Tone",
"value": "Friendly, concise, and professional."
},
"additional_context": {
"description": "Context",
"value": "Do not promise pricing or unavailable appointment slots."
}
}
}
'import requests
url = "https://api.dialnexa.com/v1/agent-builder/run"
payload = { "structured_input": {
"company_and_offering": {
"description": "Company and offering",
"value": "Acme provides appointment scheduling software."
},
"target_customer": {
"description": "Target customer",
"value": "Small business owners who requested a demo."
},
"primary_goal": {
"description": "Call goal",
"value": "Arrange a product demo."
},
"success_criteria": {
"description": "Success criteria",
"value": "Confirm interest and a preferred callback time."
},
"information_to_collect": {
"description": "Information to collect",
"value": "Name and preferred callback time."
},
"objections_and_faqs": {
"description": "Questions",
"value": "Explain that the demo is free."
},
"agent_tone": {
"description": "Tone",
"value": "Friendly, concise, and professional."
},
"additional_context": {
"description": "Context",
"value": "Do not promise pricing or unavailable appointment slots."
}
} }
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({
structured_input: {
company_and_offering: {
description: 'Company and offering',
value: 'Acme provides appointment scheduling software.'
},
target_customer: {
description: 'Target customer',
value: 'Small business owners who requested a demo.'
},
primary_goal: {description: 'Call goal', value: 'Arrange a product demo.'},
success_criteria: {
description: 'Success criteria',
value: 'Confirm interest and a preferred callback time.'
},
information_to_collect: {
description: 'Information to collect',
value: 'Name and preferred callback time.'
},
objections_and_faqs: {description: 'Questions', value: 'Explain that the demo is free.'},
agent_tone: {description: 'Tone', value: 'Friendly, concise, and professional.'},
additional_context: {
description: 'Context',
value: 'Do not promise pricing or unavailable appointment slots.'
}
}
})
};
fetch('https://api.dialnexa.com/v1/agent-builder/run', 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.dialnexa.com/v1/agent-builder/run",
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([
'structured_input' => [
'company_and_offering' => [
'description' => 'Company and offering',
'value' => 'Acme provides appointment scheduling software.'
],
'target_customer' => [
'description' => 'Target customer',
'value' => 'Small business owners who requested a demo.'
],
'primary_goal' => [
'description' => 'Call goal',
'value' => 'Arrange a product demo.'
],
'success_criteria' => [
'description' => 'Success criteria',
'value' => 'Confirm interest and a preferred callback time.'
],
'information_to_collect' => [
'description' => 'Information to collect',
'value' => 'Name and preferred callback time.'
],
'objections_and_faqs' => [
'description' => 'Questions',
'value' => 'Explain that the demo is free.'
],
'agent_tone' => [
'description' => 'Tone',
'value' => 'Friendly, concise, and professional.'
],
'additional_context' => [
'description' => 'Context',
'value' => 'Do not promise pricing or unavailable appointment slots.'
]
]
]),
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.dialnexa.com/v1/agent-builder/run"
payload := strings.NewReader("{\n \"structured_input\": {\n \"company_and_offering\": {\n \"description\": \"Company and offering\",\n \"value\": \"Acme provides appointment scheduling software.\"\n },\n \"target_customer\": {\n \"description\": \"Target customer\",\n \"value\": \"Small business owners who requested a demo.\"\n },\n \"primary_goal\": {\n \"description\": \"Call goal\",\n \"value\": \"Arrange a product demo.\"\n },\n \"success_criteria\": {\n \"description\": \"Success criteria\",\n \"value\": \"Confirm interest and a preferred callback time.\"\n },\n \"information_to_collect\": {\n \"description\": \"Information to collect\",\n \"value\": \"Name and preferred callback time.\"\n },\n \"objections_and_faqs\": {\n \"description\": \"Questions\",\n \"value\": \"Explain that the demo is free.\"\n },\n \"agent_tone\": {\n \"description\": \"Tone\",\n \"value\": \"Friendly, concise, and professional.\"\n },\n \"additional_context\": {\n \"description\": \"Context\",\n \"value\": \"Do not promise pricing or unavailable appointment slots.\"\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.dialnexa.com/v1/agent-builder/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"structured_input\": {\n \"company_and_offering\": {\n \"description\": \"Company and offering\",\n \"value\": \"Acme provides appointment scheduling software.\"\n },\n \"target_customer\": {\n \"description\": \"Target customer\",\n \"value\": \"Small business owners who requested a demo.\"\n },\n \"primary_goal\": {\n \"description\": \"Call goal\",\n \"value\": \"Arrange a product demo.\"\n },\n \"success_criteria\": {\n \"description\": \"Success criteria\",\n \"value\": \"Confirm interest and a preferred callback time.\"\n },\n \"information_to_collect\": {\n \"description\": \"Information to collect\",\n \"value\": \"Name and preferred callback time.\"\n },\n \"objections_and_faqs\": {\n \"description\": \"Questions\",\n \"value\": \"Explain that the demo is free.\"\n },\n \"agent_tone\": {\n \"description\": \"Tone\",\n \"value\": \"Friendly, concise, and professional.\"\n },\n \"additional_context\": {\n \"description\": \"Context\",\n \"value\": \"Do not promise pricing or unavailable appointment slots.\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dialnexa.com/v1/agent-builder/run")
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 \"structured_input\": {\n \"company_and_offering\": {\n \"description\": \"Company and offering\",\n \"value\": \"Acme provides appointment scheduling software.\"\n },\n \"target_customer\": {\n \"description\": \"Target customer\",\n \"value\": \"Small business owners who requested a demo.\"\n },\n \"primary_goal\": {\n \"description\": \"Call goal\",\n \"value\": \"Arrange a product demo.\"\n },\n \"success_criteria\": {\n \"description\": \"Success criteria\",\n \"value\": \"Confirm interest and a preferred callback time.\"\n },\n \"information_to_collect\": {\n \"description\": \"Information to collect\",\n \"value\": \"Name and preferred callback time.\"\n },\n \"objections_and_faqs\": {\n \"description\": \"Questions\",\n \"value\": \"Explain that the demo is free.\"\n },\n \"agent_tone\": {\n \"description\": \"Tone\",\n \"value\": \"Friendly, concise, and professional.\"\n },\n \"additional_context\": {\n \"description\": \"Context\",\n \"value\": \"Do not promise pricing or unavailable appointment slots.\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"error": false,
"statusCode": 201,
"message": "Success",
"data": {
"organizationId": "<string>",
"structuredInput": {
"company_and_offering": {
"description": "<string>",
"value": "<string>"
},
"target_customer": {
"description": "<string>",
"value": "<string>"
},
"primary_goal": {
"description": "<string>",
"value": "<string>"
},
"success_criteria": {
"description": "<string>",
"value": "<string>"
},
"information_to_collect": {
"description": "<string>",
"value": "<string>"
},
"objections_and_faqs": {
"description": "<string>",
"value": "<string>"
},
"agent_tone": {
"description": "<string>",
"value": "<string>"
},
"additional_context": {
"description": "<string>",
"value": "<string>"
},
"validation_clarifications": {
"description": "<string>",
"value": "<string>"
}
},
"pipeline": "cascaded",
"targetShape": "spa",
"buildAttempt": 123,
"maxBuildAttempts": 123,
"agentBrief": {
"agent_name": "<string>",
"company_name": "<string>",
"agent_role": "<string>",
"tone": "<string>",
"language_rules": "<string>",
"caller_type": "<string>",
"call_type": "<string>",
"primary_goal": "<string>",
"secondary_goals": [
"<string>"
],
"known_variables": [
"<string>"
],
"available_context": [
"<string>"
],
"required_information_to_collect": [
"<string>"
],
"call_flow_steps": [
"<string>"
],
"guardrails": [
"<string>"
],
"special_rules": [
"<string>"
],
"faqs": [
"<string>"
],
"objections": [
"<string>"
],
"success_criteria": [
"<string>"
],
"failure_criteria": [
"<string>"
],
"post_call_fields_requested": [
"<string>"
],
"known_terms": [
"<string>"
],
"unknowns_or_missing_info": [
"<string>"
]
},
"voicePreferences": {
"language": "<string>",
"accent": "<string>",
"gender": "<string>",
"keywords": [
"<string>"
]
},
"missingQuestions": [
"<string>"
],
"inventory": {
"llms": [
{
"id": "<string>",
"name": "<string>",
"model_category": "<string>"
}
],
"transcribers": [
{
"id": "<string>",
"name": "<string>",
"provider": "<string>",
"model_id": "<string>"
}
],
"languages": [
{
"id": "<string>",
"name": "<string>",
"code": "<string>"
}
]
},
"technicalProfile": {
"agent_type": "Single_Prompt_Agent",
"pipeline_type": "Cascaded",
"llm_id": "<string>",
"llm_name": "<string>",
"voice_id": "<string>",
"voice_name": "<string>",
"voice_model_id": "<string>",
"transcriber_id": "<string>",
"transcriber_name": "<string>",
"language_id": "<string>",
"language_code": "<string>",
"boosted_keywords": "<string>",
"fallback_stt_enabled": true,
"stt_fallback_transcriber_id": "<string>",
"stt_fallback_wait_ms": 123,
"audio_cache_enabled": true,
"denoising_mode": "remove_noise",
"max_call_duration_sec": 123,
"system_prompt_text": "<string>",
"llm_temperature": 123,
"fallback_llm_enabled": true,
"llm_fallback_model": "<string>",
"llm_fallback_model_name": "<string>",
"llm_fallback_delay_ms": 123,
"optimization_summary": "<string>"
},
"promptSections": {
"identity": "<string>",
"context_and_variables": "<string>",
"primary_goal": "<string>",
"call_flow": "<string>",
"guardrails": "<string>",
"faqs_and_objections": "<string>",
"closing_rules": "<string>",
"ai_identity_if_asked": "<string>"
},
"promptText": "<string>",
"welcomeMessage": "<string>",
"postcallAnalysis": [
{
"field_name": "<string>",
"field_type": "TEXT",
"field_description": "<string>",
"additional_fields": {}
}
],
"boostedKeywords": "<string>",
"simulations": [
"<string>"
],
"evaluation": {
"overall_pass": true,
"prompt_score": 123,
"conversation_score": 123,
"pca_score": 123,
"technical_fit_score": 123,
"issues": [
"<string>"
],
"prompt_fixes": [
"<string>"
],
"pca_fixes": [
"<string>"
],
"technical_profile_fixes": [
"<string>"
],
"human_review_required": true,
"summary": "<string>"
},
"draftAgent": {
"agent_type": "Single_Prompt_Agent",
"pipeline_type": "Cascaded",
"ivr_menu": {},
"agent_identity": "<string>",
"agent_background": "<string>",
"node_positions": "<string>",
"title": "<string>",
"description": "<string>",
"prompt_text": "<string>",
"system_prompt_text": "<string>",
"welcome_message": "<string>",
"default_dynamic_variables": {},
"postcall_analysis": [
{
"field_name": "<string>",
"field_type": "TEXT",
"field_description": "<string>",
"additional_fields": {}
}
],
"llm_id": "<string>",
"voice_id": "<string>",
"voice_model_id": "<string>",
"transcriber_id": "<string>",
"language_id": "<string>",
"boosted_keywords": "<string>",
"conversation_start_type": "<string>",
"llm_temperature": 123,
"fallback_llm_enabled": true,
"llm_fallback_model": "<string>",
"llm_fallback_delay_ms": 123,
"fallback_stt_enabled": true,
"stt_fallback_transcriber_id": "<string>",
"stt_fallback_wait_ms": 123,
"audio_cache_enabled": true,
"denoising_mode": "remove_noise",
"max_call_duration_sec": 123
},
"events": [
{
"node": "<string>",
"status": "started",
"message": "<string>",
"timestamp": "<string>",
"artifact": {}
}
],
"status": "needs_input",
"error": "<string>"
},
"timestamp": "2023-11-07T05:31:56Z"
}{
"statusCode": 400,
"error": true,
"success": false,
"data": [],
"message": "build_attempt must not be greater than 2, pipeline must be one of the following values: cascaded, s2s",
"errors": [
"build_attempt must not be greater than 2",
"pipeline must be one of the following values: cascaded, s2s"
]
}{
"statusCode": 401,
"error": true,
"success": false,
"data": [],
"message": "Invalid API key",
"errors": []
}{
"statusCode": 500,
"error": true,
"success": false,
"data": [],
"message": "Internal server error",
"errors": []
}