Run agent
This endpoint runs the agent with the provided input message.
POST
/Agent/runThis endpoint runs the agent with the provided input message.
Authentication
Authentication required. Send your user API key in the X-API-Key header.
Parameters
This operation has no path, query, or header parameters.
Request body
Content type: multipart/form-data · Schema: object
| Property | Type | Required | Description | Constraints |
|---|---|---|---|---|
file | string · binary | No | — | — |
AgentId | integer · int32 | No | — | — |
ConversationId | integer · int32 | No | — | — |
UserInputMessage | string | No | — | — |
MessageType | MessageType | No | — | — |
ProgressRunId | string | No | — | — |
DocumentId | integer · int32 | No | — | — |
Example request
curl --request POST \
--url 'https://api.zild.ai/Agent/run' \
--header 'X-API-Key: YOUR_USER_API_KEY' \
--form 'file=@file' \
--form 'AgentId={AgentId}' \
--form 'ConversationId={ConversationId}' \
--form 'UserInputMessage={UserInputMessage}' \
--form 'MessageType={MessageType}' \
--form 'ProgressRunId={ProgressRunId}' \
--form 'DocumentId={DocumentId}'
Responses
| Status | Description | Response body |
|---|---|---|
200 | Execution completed successfully | application/json · AgentRunTextResponseDto |
Example response (200):
{
"model": "string",
"agentAIType": 0,
"modelPolicyId": 0,
"modelPolicyVersion": 0,
"fallbackUsed": true,
"modelAttempts": [
{
"provider": 0,
"model": "string",
"succeeded": true,
"failureReason": "string",
"durationMilliseconds": 0,
"usage": {
"inputTokens": 0,
"outputTokens": 0,
"totalTokens": 0,
"cachedInputTokens": 0,
"reasoningTokens": 0
}
}
],
"quotaExceeded": true,
"conversationId": 0,
"title": "string",
"userMessageId": 0,
"attachmentMessageId": 0,
"assistantMessageId": 0,
"reply": "string"
}
Data models
AgentAIType
0 = AzureOpenAI; 1 = OpenAI; 2 = RetellAI; 3 = ElevenLabs; 4 = Lovable; 5 = n8n; 6 = Aws; 7 = MicrosoftCopilot; 8 = GoogleGemini; 9 = AnthropicClaude; 10 = Alteryx
integer
AgentModelCallAttempt
| Property | Type | Required | Description | Constraints |
|---|---|---|---|---|
provider | AgentAIType | No | — | — |
model | string | No | — | nullable |
succeeded | boolean | No | — | — |
failureReason | string | No | — | nullable |
durationMilliseconds | integer · int64 | No | — | — |
usage | AgentRunUsage | No | — | — |
AgentRunTextResponseDto
| Property | Type | Required | Description | Constraints |
|---|---|---|---|---|
model | string | No | — | nullable |
agentAIType | AgentAIType | No | — | — |
modelPolicyId | integer · int32 | No | — | nullable |
modelPolicyVersion | integer · int32 | No | — | nullable |
fallbackUsed | boolean | No | — | — |
modelAttempts | array<AgentModelCallAttempt> | No | — | nullable |
quotaExceeded | boolean | No | — | — |
conversationId | integer · int32 | No | — | — |
title | string | No | Conversation title generated by the agent after the first chat interaction. Falls back to Nova conversa if generation fails or its quota is exhausted. Existing conversations are not backfilled. | nullable |
userMessageId | integer · int32 | No | — | — |
attachmentMessageId | integer · int32 | No | — | nullable |
assistantMessageId | integer · int32 | No | — | — |
reply | string | No | — | nullable |
AgentRunUsage
| Property | Type | Required | Description | Constraints |
|---|---|---|---|---|
inputTokens | integer · int32 | No | — | — |
outputTokens | integer · int32 | No | — | — |
totalTokens | integer · int32 | No | — | — |
cachedInputTokens | integer · int32 | No | — | — |
reasoningTokens | integer · int32 | No | — | — |
MessageType
0 = Text; 1 = Image; 2 = File; 3 = Audio; 4 = Video; 5 = Internal; 6 = TemplateMarketing; 7 = TemplateUtility; 8 = Location; 9 = Contact
integer