# Create a visitor Web app conversation

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

201 returns data.id, not conversation_id. See shared objects for the complete object; the example is a field excerpt. The agent must be active. A visitor binding is created after the tenant conversation write; binding failure may leave a publicly inaccessible record.


```http
POST https://api.moi.matrixorigin.cn/v5/public/webapp/conversations
```

## Before you call this API

Set `BASE_URL` to the product API prefix `https://api.moi.matrixorigin.cn/v5`. For private deployments, use the corresponding product API URL.

[Prepare links and visitor identity in the same environment](identity-lifecycle.md#prepare). Do not supply a product PAT or Workspace request header.

## Request

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
curl --request POST \
  "$BASE_URL/public/webapp/conversations?s=$WEBAPP_SESSION" \
  --header "Content-Type: application/json" \
  --data @- <<JSON
{"webapp": "${AGENT_ID}", "t": "${WEBAPP_TOKEN}"}
JSON
```

:::::
:::::{tab-item} Parameters

| Parameter | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `s` | Queries | string | Yes | Issued visitor session. |
| `webapp` | Body | string | Yes | Agent ID. |
| `t` | Body | string | Yes | Current publication credential. |

:::::
::::::
:::::::

## Successful response

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": 0,
  "data": {
    "id": "conversation-example",
    "workspace_id": "workspace-example",
    "agent_workspace_id": "workspace-example",
    "agent_id": "agent-example",
    "title_user_edited": false,
    "status": "active",
    "purpose": "webapp",
    "visibility": "visible",
    "pinned": false,
    "created_at": "2026-11-12T01:00:00Z",
    "updated_at": "2026-11-12T01:00:00Z"
  }
}
```

:::::
:::::{tab-item} Fields

Success returns HTTP 201 with numeric code=0. Read data's [Object descriptions](objects.md) with the example; the conversation-creation example shows a field excerpt only.

:::::
::::::
:::::::

## Error responses

[Public errors and identity handling](identity-lifecycle.md#errors) distinguishes unavailable links, disablement, invalid sessions, parameters, and system failures.
