Executes the specified agent and returns a non-streaming JSON response with the complete agent output. The agent must be in active status and belong to the specified account. locationId is required in
Executes the specified agent and returns a non-streaming JSON response with the complete agent output. The agent must be in active status and belong to the specified account. locationId is required in the request body.Session Management:
For the first message in a new session, do not include the executionId in the request payload.
The API will return an executionId along with the agent response, which uniquely identifies this conversation session.
To continue the conversation within the same session, include the executionId from the previous response in subsequent requests. This allows the agent to maintain conversation context and history across multiple interactions.
POST https://services.leadconnectorhq.com/agent-studio/agent/{agentId}/execute
Unique session identifier that maintains conversational context across multiple interactions within the same agent session. Omit this field for the first message in a new session. Include the executionId returned from the previous response to maintain context in subsequent messages.
Unique session identifier that maintains conversational context across multiple interactions within the same agent session. Use this ID in subsequent requests to continue the conversation.
Unique identifier for a single interaction cycle, consisting of one user input and the corresponding agent response. Each message exchange generates a new interactionId.
{ "success": true, "executionId": "a1b2c3d4e5f6g7h8i9j0k1l2", "interactionId": "m9n8o7p6q5r4s3t2u1v0w9x8", "response": "I can help you with various tasks...", "type": "text", "nextExpectedInput": "text", "goalCompletion": false, "executionStatus": "completed", "flowSwitch": false, "attachments": [], "generativeOutputs": []}
400 - Agent is not active or invalid request - locationId is required
401 - Unauthorized
{}
403 - User does not have required scopes to execute this agent