Run agent

This endpoint runs the agent with the provided input message.

POST /Agent/run

This 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

PropertyTypeRequiredDescriptionConstraints
filestring · binaryNo——
AgentIdinteger · int32No——
ConversationIdinteger · int32No——
UserInputMessagestringNo——
MessageTypeMessageTypeNo——
ProgressRunIdstringNo——
DocumentIdinteger · int32No——

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

StatusDescriptionResponse body
200Execution completed successfullyapplication/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
PropertyTypeRequiredDescriptionConstraints
providerAgentAITypeNo——
modelstringNo—nullable
succeededbooleanNo——
failureReasonstringNo—nullable
durationMillisecondsinteger · int64No——
usageAgentRunUsageNo——
AgentRunTextResponseDto
PropertyTypeRequiredDescriptionConstraints
modelstringNo—nullable
agentAITypeAgentAITypeNo——
modelPolicyIdinteger · int32No—nullable
modelPolicyVersioninteger · int32No—nullable
fallbackUsedbooleanNo——
modelAttemptsarray<AgentModelCallAttempt>No—nullable
quotaExceededbooleanNo——
conversationIdinteger · int32No——
titlestringNoConversation 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
userMessageIdinteger · int32No——
attachmentMessageIdinteger · int32No—nullable
assistantMessageIdinteger · int32No——
replystringNo—nullable
AgentRunUsage
PropertyTypeRequiredDescriptionConstraints
inputTokensinteger · int32No——
outputTokensinteger · int32No——
totalTokensinteger · int32No——
cachedInputTokensinteger · int32No——
reasoningTokensinteger · int32No——
MessageType

0 = Text; 1 = Image; 2 = File; 3 = Audio; 4 = Video; 5 = Internal; 6 = TemplateMarketing; 7 = TemplateUtility; 8 = Location; 9 = Contact

integer