# Create agent conversation

This endpoint creates a new conversation between a user and the agent.

Source: https://zild.ai/en-US/docs/api-reference/post-api-Agent-conversation

POST `/Agent/conversation`

This endpoint creates a new conversation between a user and the agent.

## 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:** `application/json` · **Schema:** `AgentConversationRequestDto`



<table class="api-params"><thead><tr><th>Property</th><th>Type</th><th>Required</th><th>Description</th><th>Constraints</th></tr></thead><tbody><tr><td><code>agentId</code></td><td><code>integer · int32</code></td><td>No</td><td>—</td><td>—</td></tr><tr><td><code>inputMessage</code></td><td><code>string</code></td><td>No</td><td>—</td><td>nullable</td></tr><tr><td><code>messageType</code></td><td><code>MessageType</code></td><td>No</td><td>—</td><td>—</td></tr><tr><td><code>mediaFileName</code></td><td><code>string</code></td><td>No</td><td>—</td><td>nullable</td></tr><tr><td><code>mediaUrl</code></td><td><code>string</code></td><td>No</td><td>—</td><td>nullable</td></tr><tr><td><code>documentId</code></td><td><code>integer · int32</code></td><td>No</td><td>—</td><td>—</td></tr></tbody></table>



## Example request



```
curl --request POST \
  --url 'https://api.zild.ai/Agent/conversation' \
  --header 'X-API-Key: YOUR_USER_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "agentId": 0,
  "inputMessage": "string",
  "messageType": 0,
  "mediaFileName": "string",
  "mediaUrl": "string",
  "documentId": 0
}'
```



## Responses



<table class="api-params"><thead><tr><th>Status</th><th>Description</th><th>Response body</th></tr></thead><tbody><tr><td><code>200</code></td><td>Conversation created successfully</td><td>No response body is defined.</td></tr></tbody></table>



## Data models

`AgentConversationRequestDto`

<table class="api-params"><thead><tr><th>Property</th><th>Type</th><th>Required</th><th>Description</th><th>Constraints</th></tr></thead><tbody><tr><td><code>agentId</code></td><td><code>integer · int32</code></td><td>No</td><td>—</td><td>—</td></tr><tr><td><code>inputMessage</code></td><td><code>string</code></td><td>No</td><td>—</td><td>nullable</td></tr><tr><td><code>messageType</code></td><td><code>MessageType</code></td><td>No</td><td>—</td><td>—</td></tr><tr><td><code>mediaFileName</code></td><td><code>string</code></td><td>No</td><td>—</td><td>nullable</td></tr><tr><td><code>mediaUrl</code></td><td><code>string</code></td><td>No</td><td>—</td><td>nullable</td></tr><tr><td><code>documentId</code></td><td><code>integer · int32</code></td><td>No</td><td>—</td><td>—</td></tr></tbody></table>

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

`integer`
