Ejento APIs
V2
  • V2
  • V1
  1. Agent Response
Ejento APIs
V2
  • V2
  • V1
  • Overview
  • Changelog
  • Versioning
  • Legacy
    • Introduction to Legacy APIs
    • Agent
      • Create Agent By Agent Builder
      • Create Agent By Configure
      • Get All Agents
      • Get Agent By Team
      • Get Agent By User Team
      • Agent Filtered
      • Get Agent
      • Edit Agent
      • Get Recent Agents
      • Create Recent Agent
      • Delete Recent Agent
      • Get Starred Agents
      • Create Starred Agent
      • Delete Starred Agent
    • Agent Corpus Connection
      • Create Agent Corpus Connection
      • Get Agent Corpus Connection
      • Edit Agent Corpus Connection
      • Delete Agent Corpus Connection
      • Get All Agent Corpus Connections
      • Delete All Agent Corpus Connections
    • Agent Response
      • Create Agent Response
        POST
      • Get All Agent Responses
        GET
      • Get Agent Responses By User
        GET
      • Get Agent Responses By Project
        GET
      • Get Agent Responses By Chat Thread
        GET
      • Get Agent Response
        GET
      • Delete Agent Response
        DELETE
      • Create Agent Response Comment
        POST
      • Get Agent Response Comment
        GET
      • Get Agent Response Dashboard
        POST
      • Create Agent Response Feedback
        POST
      • Create Agent Response Log
        POST
      • Pin Agent Response
        PUT
      • Unpin Agent Response
        DELETE
      • Get Pinned Agent Responses
        GET
    • Agent Reviews
      • Create Review
      • Get All Reviews
      • Get Reviews by Agent
      • Delete Review
    • Agent Rating
      • Get All Agent Ratings
      • Get Agent Rating
      • Update Agent Rating
    • Agent Alias
      • Get All Agent Aliases
      • Create Agent Alias
      • Update Agent Alias
      • Delete Agent Alias
    • Agent Access
      • Get Agent Access
      • Update Agent Access
    • Agent Type
      • Get All Agent Types
      • Get Agent Type
      • Update Agent Type
    • Agent User
      • Add Users to Agent
      • Get Users Of Agent
      • Delete User from Agent
      • Get User Agent Permission
      • Get All Agents with Users
    • Agent Tags
      • Get All Distinct Agent Tags
      • Annotate an Agent with Tags
    • Agent Vote
      • Create Agent Vote
      • Get Agent Vote
    • Agent Comment
      • Create Comment on an Agent
      • Get Comments for an Agent
      • Edit Agent Comment
    • Chat Thread
      • Create Chat Thread
      • Get All Chat Threads Of An Agent
      • Get All Chat Threads With Admin Panel Filters And Pagination
      • Get Reduced Chatlogs by Thread ID for Admin Panel
      • Get Chat Thread
      • Edit Chat Thread
      • Delete Chat Thread
      • Add ChatThread-Corpus Connection
      • Get ChatThread-Corpus Connection
      • Delete ChatThread-Corpus Connection
    • Project
      • Create Project
      • Get All Projects
      • Project Filtered
      • Get All Agents Of Project
      • Get All Projects By Team
      • Get Project
      • Edit Project
      • Delete Project
      • Fetch Project Details
      • Add Recent Project
      • Get Recent Projects
    • User Project
      • Add Users To Project
      • Get All Projects By User Teams
      • Get Projects By User and Team
      • Delete Users from Project
    • Document
      • Get Document
      • Edit Document
      • Add Or Remove Tags On Document
      • Document Polling
    • Corpus
      • Create Corpus
      • Get All Corpus
      • Get Corpus
      • Edit Corpus
      • Delete Corpus
      • Create Document In Corpus
      • Get All Documents From Corpus
      • Delete All Documents from Corpus
      • Check Duplicate Documents
      • Get All Agents By Corpus
      • Get Corpus Permissions
      • Get Corpus Permission By User
      • Annotate Corpus
    • Notification
      • Create Notification
      • Retrieve All Notifications
      • Read Notifications By User ID
      • Retrieve Notification
      • Read Notification
      • Delete Notification
    • Feature Flag
      • Get All Feature Flags
      • Get DALL-E Feature Flag
      • Get Share Agent Feature Flag
      • Get Agent Alias Feature Flag
      • Get SharePoint Index Feature Flag
      • Get Chat Agent Creation Feature Flag
      • Get OAuth Feature Flags
      • Get Google OAuth Feature Flag
      • Get LinkedIn OAuth Feature Flag
      • Get MS SSO OAuth Feature Flag
      • Get Github OAuth Feature Flag
    • Team
      • Create Team
      • Get All Teams
      • Get Team Details
      • Edit Team
      • Delete Team
      • Create Recent Team
      • Get Recent Teams
      • Add Users to Team
      • Get Users in a Team
      • Get Teams Of User
      • Get User Role By Team
      • Get Agents Of User Team
      • Get Projects And Team
    • User
      • Create User In Organization
      • Get All Users By Organization
      • Get User
      • Edit User
      • Delete User
      • Batch Delete Users
      • User Filtered
      • Create User Permission
      • Get User Permission
      • Edit User Permission
      • Delete User Permission
    • Email Indexing Authorization
      • Email Authorize
    • Conversation Starters
      • Create Conversation Starter
      • Get Conversation Starters
    • Tool
      • Create Tool
      • Get All Tools
      • Get Tool
      • Edit Tool
      • Delete Tool
    • Agent Tool Connection
      • Enable Agent Tool
      • Get All Agent Tools
      • Disable Agent Tool
    • Organization Tool
      • Enable Organization Tool
    • API Tool Template
      • Create API Tool Template
      • Get All API Tool Templates
    • LLM Config
      • Get All LLM Configs
      • Get Active Config
      • Get LLM Config
      • Get Model Deployment
      • Get Org Configs
      • Set Agent Config View
  • Latest
    • Introduction to Latest APIs
    • Agents
      • Agent Access
        • Get Agent Access
        • Update Agent Access
      • Agent Alias
        • Get Agent Alias
        • Create an Agent Alias
        • Update an Agent Alias
        • Delete an Agent Alias
        • Get all Agent Aliases
      • Agent Tags
        • Add or Remove Tags from an Agent
        • Get all Tags for a given Project, Team, or Organization
        • Get all Tags grouped by Agent for a given Project, Team, or Organization
      • Agent Comment
        • Get all Comments for an Agent
        • Create a Comment
        • Update a Comment
        • Delete a Comment
      • Agent Rating
        • Get Ratings of an Agent
        • Update Agent Rating
        • Get all Agent Ratings
      • Agent Review
        • Get all Reviews for specific Agent
        • Create a new Review
        • Get all Reviews of the Authenticated User
        • Update a Review
        • Delete a Review
      • Agent Tools
        • List all Tools with their enabled status for the given Agent
        • Unlink an Agent from a Tool
        • Link an Agent to a Tool
        • List all tools that are connected to the Agent
      • Agent User
        • Get Users of an Agent
        • Add user to Agent
        • Delete User from Agent
        • Get all Agents Users
      • Agent User Permission
        • Get User Agent Permission
      • Agent Vote
        • Get Vote Information for an Agent
        • Vote on an Agent
      • Agent Type
        • Get all Agent Types
        • Get a specific Agent Type
        • Update a specific Agent Type
      • Get all Agents
      • Create a new Agent
      • Get an Agent
      • Update an Agent
      • Delete an Agent
      • Activate an Agent
      • Get agent history with pagination
      • Restore an agent to a previous checkpoint
      • Get Agent Prompt History
      • Create a Recent Agent
      • Delete a Recent Agent
      • Create Starred Agent
      • Delete Starred Agent
      • Get the Status of an Agent
      • Get User's Team Role for an Agent
      • Create or Update an Agent using the Agent Builder
      • Get Agent Filter
      • Generate an image for an agent based on the provided description
      • Get all Agents by Project
      • Get list of Recent Agents
      • Get all Starred Agents of the Authenticated User
      • Get Agents accessible to the Current User across their Teams
      • Get Agents by Project team, User team
    • Agent Response Steps
      • List Steps for Agent Response
      • Create Step for Agent Response
      • Delete All Steps for Agent Response
      • Retrieve a Step for Agent Response
      • Update a Step for Agent Response
      • Delete a Step for Agent Response
    • Corpora
      • Get all Corpus
      • Create a Corpus
      • Get a Corpus
      • Update a Corpus
      • Delete a Corpus
      • Get Corpus Agent Connections
      • Get Default Corpus Agent Connection
      • Annotate/Tag a Corpus
      • Get Conversation Starters for a Corpus
      • Get all Documents for a Corpus
      • Upload a Document to a Corpus
      • Delete Document(s) from a Corpus
      • Check Duplicate Documents in a Corpus
      • Get all Permissions for a Corpus
      • Create a new Permission for a Corpus
      • Delete a user permission for a corpus
      • Get all user permissions for a corpus
    • Documents
      • Get a Document
      • Update a Document
      • Delete a Document
      • Annotate a Document
      • Retrieve multiple Documents by IDs
    • Chat Logs
      • Get Chat Log Details
      • Get Chat Log Search Results
    • Chat Thread
      • Agent Response
        • Get Agent Responses for a Chat Thread
        • Delete Agent Responses for a Chat Thread
      • Chat Logs
        • Get Chat Logs for a Chat Thread
      • Corpus Connection
        • Get Corpus Connection by ChatThread ID
        • Delete Corpus Connection by ChatThread ID
        • Get a ChatThread-Corpus connection
        • Create a ChatThread-Corpus connection
        • Delete a ChatThread-Corpus connection
      • Documents
        • Get Documents in Chat Thread
      • Get Chat Thread
      • Update Chat Thread
      • Delete Chat Thread
      • Get Chat Threads based on various filters
    • Configurations
      • Update the LLM configuration for an Agent
      • Get OAuth-related Feature Flags
    • Evaluations
      • Retrieve all evaluations or filter by dataset
      • Create a new evaluation
      • Delete a set of evaluations or a specific evaluation
      • Retrieve all evaluation datasets for a specific agent
      • Create a new evaluation dataset for the given agent
      • Delete multiple datasets or all datasets for an agent
      • Retrieve a specific evaluation
      • Update an evaluation run
      • Delete a specific evaluation
      • List query results for an evaluation run
      • Create a query result and save metrics
      • Retrieve a specific dataset
      • Update an evaluation dataset
      • Delete a specific dataset
      • Retrieve queries for an evaluation dataset
      • Create a new query for evaluation
      • Retrieve all unique tags from all datasets in the organization
      • Get a specific metric result by ID
      • Retrieve all metrics or filter by category name
      • Create a new metric
      • Retrieve a specific metric
      • Update a metric
      • Delete a metric
      • Get all metric results for a specific metric
      • Create a new metric result entry for the given metric
      • Retrieve a specific evaluation query
      • Update an evaluation query
      • Delete an evaluation query
      • Get a specific query result with metrics
      • Update a query result
    • SharePoint
      • Get SharePoint Item By Full Path
      • Get SharePoint Item
      • Create a SharePoint Item
      • Update a SharePoint Item
      • Delete SharePoint Hierarchy Item
    • SharePoint Connector
      • Get Corpus IDs by SharePoint Drive ID
      • Get SharePoint URLs by Corpus ID
      • Get SharePoint Drive Mappings
      • Create or Update SharePoint Drive Mapping
      • Update SharePoint Drive Mapping Token or Subscription
      • Get SharePoint Drive Token Information
      • Get All SharePoint Subscriptions
    • Guardrails
      • Get available guardrail types for agent
      • Enable/disable a guardrail type for agent
      • Get Guardrails
      • Update Guardrails
      • Delete Guardrails
      • Get Guardrails in Organization
      • Create Guardrail in Organization
      • Enable or Disable Guardrail for Organization
    • Conversation Starters
      • Get Conversation Starters for an Agent
      • Create a new Conversation Starter.
    • Analytics
      • Get Agent Cost Data
      • Get Agent Document Count Data
      • Get Agent Indexing Mode Data
      • Get Agent Most Active Data
      • Get Agent Query Count Data
      • Get Recent Agent Data
      • Get Agent Summary Statistics
      • Get Agent Token Data
      • Get Agent Vote Data
      • Get Corpus Document Count Data
      • Get Corpus Indexing Mode Data
      • Get Cost Data
      • Get Document Count Data
      • Get Indexing Mode Data
      • Get Project Cost Data
      • Get Project Document Count Data
      • Get Project Indexing Mode Data
      • Get Project Most Active Data
      • Get Project Query Count Data
      • Get Recent Project Data
      • Get Project Summary Statistics
      • Get Project Token Data
      • Get Project Vote Data
      • Get Overall Summary Statistics
      • Get Team Cost Data
      • Get Team Document Count Data
      • Get Team Indexing Mode Data
      • Get Team Most Active Data
      • Get Team Query Count Data
      • Get Recent Team Data
      • Get Team Summary Statistics
      • Get Team Token Data
      • Get Team Vote Data
      • Get Total Entity Counts
      • Get User Cost Data
      • Get User Document Count Data
      • Get User Indexing Mode Data
      • Get User Most Active Data
      • Get User Query Count Data
      • Get Recent User Data
      • Get User Summary Statistics
      • Get User Token Data
      • Get User Vote Data
      • Get Vote Count Data
      • Get Query Count Data
      • Get Token Data
    • Teammates
      • Get All Active Carousels
      • Create Carousel
    • Tools
      • Get Tool by ID
      • Update Tool by ID
      • Delete Tool by ID
      • Get all Tools
    • Feature Flags
      • Get All Feature Flags
      • Get Agent Alias Feature Flag
      • Get Api Tools Feature Flag
      • Get Chat Agent Creation Feature Flag
      • Get dall_e Image Generation Feature Flag
      • Get Developer Portal Feature Flag
      • Get Guardrail Feature Flag
      • Get PII Redaction Feature Flag
      • Get Share Agent Feature Flag
      • Get Sharepoint Index Feature Flag
      • Get Youtube Index Feature Flag
    • Users
      • Get a User
      • Update a User
      • Delete a User
      • Get all User Permissions
      • Create a new User Organization Permission
      • Update the Organization Permission of a User
      • Delete a User Organization Permission
      • Delete multiple Users
      • Get a specific User by user_email
      • Get all Users
      • Get authenticated User
    • Notifications
      • Get all Notifications
      • Create a new Notification
      • Get a Notification
      • Update a Notification
      • Delete a Notification
    • Projects
      • Retrieve all Projects
      • Create a Project
      • Get a Project
      • Update a Project
      • Delete a Project
      • Get Agent Responses using Project ID
      • Add a Recent Project for a User
      • Add Users to a Project
      • Remove a User from a Project
      • Get multiple Projects by their IDs
      • Get Projects based on filters
      • Get Recent Projects for a User
      • Get Projects with Team Details
    • Teams
      • Get all Teams
      • Create a Team
      • Get a Team
      • Update a Team
      • Delete a Team
      • Get all Projects of a Team
      • Create a Recent Team
      • Get all Users in a Team
      • Add Users to a Team
      • Get Recent Teams
      • Get all Teams of the Authenticated User
      • Get all Agents of User's Team
    • Organizations
      • Get all Configurations
      • Get active configuration for an Organization
      • Get the Model Deployment for an Organization
      • Get Organization Logo
      • Get all Tools in an Organization
      • Disable a Tool for all Agents in an Organization
      • Enable a Tool for all Agents in an Organization
      • Get all API Tool Templates
      • Create a new API Tool Template
      • Create a new API tool
      • Create an attachment tool
      • Create a new RAG tool in an Organization
      • Create a Web Search Tool in an Organization
      • Get all Users in an Organization
      • Create a User in an Organization
      • Get all Configurations of user's Organization
      • Get all LLM configurations of the user's Organization
      • Get a specific LLM configuration by ID
  1. Agent Response

Create Agent Response

POST
/v2/api/agent/{agent_id}/response
Agent Response
The Create Agent Response API endpoint allows generating a new response from a specific agent based on user input. This endpoint processes the user’s query, utilizes AI models, and optionally retrieves information from predefined sources before returning a response.

How This Endpoint Works#

Requires the agent_id as a path parameter to specify which agent should generate the response.
Accepts a structured request body containing conversation history, AI model preferences, and additional configurations.
Returns an AI-generated response tailored to the provided context.

Request Body Details#

History: A list of past messages exchanged between the user and the agent to maintain context.
Model: Specifies the AI model (e.g., gpt4-o) to be used for generating responses.
Chat Thread ID: Links the response to an ongoing conversation thread for better tracking.
Overrides: Allows enabling/disabling specific settings, such as retrieving responses from external sources.
Query Source: Defines the origin of the request (e.g., web)

Viewing Your Agent ID#

If you are unsure where to find your agent_id, refer to this guide:
How to View Your Agent ID
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/v2/api/agent//response' \
--header 'Content-Type: application/json' \
--data-raw '{
    "history": [
        {
            "user": "hi",
            "bot": "Hello! How can I assist you today?"
        },
        {
            "user": "Can you tell me about RAG from the sources?"
        }
    ],
    "model": "gpt4-o",
    "chat_thread_id": 4329,
    "overrides": {
        "sources": true
    },
    "query_source": "web"
}'
Response Response Example
{
    "success": true,
    "message": "Agent Response Created Successfully.",
    "data": {
        "answer": "Retrieval-Augmented Generation (RAG) is a technique in natural language processing that enhances the capabilities of generative language models by integrating real-time data retrieval. This approach addresses the limitations of traditional generative models, which rely solely on their training data and may produce outdated or incorrect information if the data is not current. RAG ensures that the responses generated are both contextually appropriate and grounded in factual information by incorporating real-time data from external sources.",
        "sources": "[0]",
        "followup_questions": [
            "string"
        ],
        "indexes": [
            "string"
        ],
        "query": "Explain how Retrieval-Augmented Generation (RAG) works.",
        "total_tokens": 4809,
        "prompt_tokens": 4329,
        "completion_tokens": 480,
        "cache_hit": false,
        "history": [
            {
                "user": "string",
                "bot": "string"
            }
        ],
        "prompt_prefix": "You are an AI assistant specializing in providing legal advice on regulatory requirements, compliance issues, and legal barriers to market entry.",
        "instructions": [
            "string"
        ],
        "agent_mode": "QnA",
        "references": [
            {
                "number": 0,
                "url": "Introduction to RAG1738098993.txt",
                "order": 1
            }
        ],
        "success": true,
        "corpus_ids": [
            645
        ],
        "run_id": "bb7b49f8-fa06-4504-9e39-dec8f10cb0b9",
        "chat_thread_name": "RAG Process",
        "thread_id": 4354,
        "agent_response_id": 10954
    }
}

Request

Path Params
agent_id
integer 
required
The ID of the agent for which the response is being created.
Body Params application/json
history
array [object {2}] 
optional
The conversation history between the user and the bot.
user
string 
optional
User's input in the conversation.
Example:
Can you tell me about RAG from the sources?
bot
string 
optional
Bot's response to the user's input.
Example:
Sorry, I cannot find the answer in the available sources.
model
string 
optional
The model to be used for generating the response.
Example:
gpt4-o
chat_thread_id
integer 
optional
The ID of the chat thread.
Example:
4329
overrides
object 
optional
Additional settings to override the response generation behavior.
sources
boolean 
optional
Include sources in the response.
Example:
true
corpus_ids
array[integer]
optional
Narrow down multiple corpora to a few specific ones.
Example:
[645]
suggest_followup_questions
boolean 
optional
Enable follow-up questions suggestion.
Example:
true
cache_skip
boolean 
optional
Skip fetching the response from cache.
Example:
true
semantic_ranker
boolean 
optional
Enable semantic ranking for the results.
Example:
true
semantic_captions
boolean 
optional
Include semantic captions in the results.
Example:
false
top
integer 
optional
Limit the number of results to this value.
Example:
32
query_source
string 
optional
The source of the query.
Example:
web
Examples

Responses

🟢200OK
application/json
Response created successfully.
Body
success
boolean 
optional
Whether the request was successful.
Example:
true
message
string 
optional
Success message.
Example:
Agent Response Created Successfully.
data
object 
optional
Response details.
answer
string 
optional
The generated response for the user query.
Example:
Retrieval-Augmented Generation (RAG) is a technique in natural language processing that enhances the capabilities of generative language models by integrating real-time data retrieval. This approach addresses the limitations of traditional generative models, which rely solely on their training data and may produce outdated or incorrect information if the data is not current. RAG ensures that the responses generated are both contextually appropriate and grounded in factual information by incorporating real-time data from external sources.
sources
string 
optional
Sources referenced during the response generation.
Example:
[0]
followup_questions
array[string]
optional
Suggested follow-up questions based on the response.
indexes
array[string]
optional
Indexes associated with the response.
query
string 
optional
The user query that prompted the response.
Example:
Explain how Retrieval-Augmented Generation (RAG) works.
total_tokens
integer 
optional
Total number of tokens used during the request.
Example:
4809
prompt_tokens
integer 
optional
Number of tokens used for the prompt.
Example:
4329
completion_tokens
integer 
optional
Number of tokens used for the completion.
Example:
480
cache_hit
boolean 
optional
Indicates whether the response was fetched from the cache.
Example:
false
history
array [object {2}] 
optional
Updated conversation history.
prompt_prefix
string 
optional
Prefix used in the prompt.
Example:
You are an AI assistant specializing in providing legal advice on regulatory requirements, compliance issues, and legal barriers to market entry.
instructions
array[string]
optional
Additional instructions.
agent_mode
string 
optional
The mode in which the agent operated.
Example:
QnA
references
array [object {3}] 
optional
References used during the response generation.
success
boolean 
optional
Indicates the success of the operation.
Example:
true
corpus_ids
array[integer]
optional
IDs of corpora used in response generation.
Example:
[645]
run_id
string 
optional
ID of the specific execution run.
Example:
bb7b49f8-fa06-4504-9e39-dec8f10cb0b9
chat_thread_name
string 
optional
Name of the chat thread.
Example:
RAG Process
thread_id
integer 
optional
The ID of the chat thread.
Example:
4354
agent_response_id
integer 
optional
The ID of the created agent response.
Example:
10954
Previous
Delete All Agent Corpus Connections
Next
Get All Agent Responses