Execute Agent
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 location. locationId is required in the request body.
Session Management:
- For the first message in a new session, do not include the
executionIdin the request payload. - The API will return an
executionIdalong with the agent response, which uniquely identifies this conversation session. - To continue the conversation within the same session, include the
executionIdfrom the previous response in subsequent requests. This allows the agent to maintain conversation context and history across multiple interactions.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your access token.
agent-studio. writeOAuthPrivate IntegrationSub-Account TokenRequest
Headers
API Version
v3v3Path Parameters
Agent ID to execute (must be in active status and belong to the location)
p1q2r3s4t5u6v7w8x9y0z1a2Query Parameters
Origin channel attributed to this execution for auditing (e.g. public_api, internal)
apiBody
Message to send to the agent
How can you help me with my marketing?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.
a1b2c3d4e5f6g7h8i9j0k1l2Input variables to pass to the agent. These should match the input variables defined in the agent configuration.
Published version ID to execute. If not provided, the latest published production version will be used.
b2b1c1d2-3e4f-5a6b-7c8d-9e0f1a2b3c4dAttachments for the message
Location ID
C2QujeCh8ZnC7al2InWRContact ID to associate with this execution. When provided, contact data will be hydrated and made available to the agent.
cid_abc123def456Response
Agent executed successfully
Success status
trueUnique session identifier that maintains conversational context across multiple interactions within the same agent session. Use this ID in subsequent requests to continue the conversation.
a1b2c3d4e5f6g7h8i9j0k1l2Unique identifier for a single interaction cycle, consisting of one user input and the corresponding agent response. Each message exchange generates a new interactionId.
m9n8o7p6q5r4s3t2u1v0w9x8Agent response text
I can help you with various tasks...Response type
textExpected input type for next interaction
textWhen end node is added in the graph, this will be true if the agent reached the end node in the graph
falseExecution status
completedWhether flow was switched
falseResponse attachments
[]Generated outputs
[]