Skip to main content
POST
/
agent-studio
/
public-api
/
agents
/
{agentId}
/
execute
Execute Agent
curl --request POST \
  --url https://services.leadconnectorhq.com/agent-studio/public-api/agents/{agentId}/execute \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Version: <version>' \
  --data '
{
  "locationId": "loc_abc123",
  "message": "What services do you offer?",
  "executionId": "exec_abc123",
  "contactId": "contact_abc123"
}
'
{
  "executionId": "exec_abc123",
  "agentId": "<string>",
  "response": "<string>",
  "actions": [
    {
      "type": "<string>",
      "status": "<string>",
      "result": {}
    }
  ],
  "metadata": {
    "tokensUsed": 123,
    "executionTimeMs": 123
  }
}

Authorizations

Authorization
string
header
required

Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.

Headers

Version
enum<string>
required

API Version

Available options:
2021-04-15

Path Parameters

agentId
string
required

The agent identifier to execute

Body

application/json
locationId
string
required

The location where the agent belongs (required)

Example:

"loc_abc123"

message
string
required

The user message to send to the agent

Example:

"What services do you offer?"

executionId
string

Include for continuing existing conversation sessions. Omit for new sessions.

Example:

"exec_abc123"

contactId
string

Contact ID to associate with the conversation

Example:

"contact_abc123"

Response

Agent executed successfully

executionId
string

Execution session ID. Include this in follow-up requests to continue the conversation.

Example:

"exec_abc123"

agentId
string

ID of the executed agent

response
string

The agent's complete response text

actions
object[]

Actions triggered during execution

metadata
object

Additional execution metadata

Last modified on March 7, 2026