Generate customer-facing AI agent preview reply
POST
/v1/ai/agents/{agentID}/preview/messagesAuthorization
bearerAuthbearerAuthrequiredor
apiKeyAuthapiKeyAuthrequiredPath parameters
agentIDstringrequiredRequest body
requiredapplication/jsoncontact_idstringmessagestringmessagesAISmithMessageInput[] | nullShow propertiesHide properties
Array of
AISmithMessageInputcontentstringrequiredMessage content
rolestringMessage role (user/assistant/system)
session_idstringResponses
200OK
agent_idstringrequiredconfidence_scorenumber<double>created_atstringmessagestringrequiredmessage_idstringmodelstringrequiredproviderstringrequiredsession_idstring400Bad Request
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstring401Unauthorized
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstring403Forbidden
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstring404Not Found
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstring422Unprocessable Entity
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstring500Internal Server Error
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstringRequest
curl -X POST "/v1/ai/agents/string/preview/messages" \
-H "Content-Type: application/json" \
-d '{
"contact_id": "string",
"message": "string",
"messages": [
{
"content": "string",
"role": "string"
}
],
"session_id": "string"
}'const response = await fetch("/v1/ai/agents/string/preview/messages", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"contact_id": "string",
"message": "string",
"messages": [
{
"content": "string",
"role": "string"
}
],
"session_id": "string"
})
});import requests
response = requests.post(
"/v1/ai/agents/string/preview/messages",
headers={
"Content-Type": "application/json"
},
json={
"contact_id": "string",
"message": "string",
"messages": [
{
"content": "string",
"role": "string"
}
],
"session_id": "string"
},
)Response
{
"agent_id": "string",
"confidence_score": 0,
"created_at": "string",
"message": "string",
"message_id": "string",
"model": "string",
"provider": "string",
"session_id": "string"
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}