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):
{
"conversationId": 0,
"userMessageId": 0,
"attachmentMessageId": 0,
"assistantMessageId": 0,
"reply": "string"
}
Data models
AgentRunTextResponseDto
| Property | Type | Required | Description | Constraints |
|---|---|---|---|---|
conversationId | integer · int32 | No | — | — |
userMessageId | integer · int32 | No | — | — |
attachmentMessageId | integer · int32 | No | — | nullable |
assistantMessageId | integer · int32 | No | — | — |
reply | string | No | — | nullable |
MessageType
0 = Text; 1 = Image; 2 = File; 3 = Audio; 4 = Video; 5 = Internal; 6 = TemplateMarketing; 7 = TemplateUtility; 8 = Location; 9 = Contact
integer