# Resolve a public Web app link

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

Short-code responses include agent_id; webapp/t form returns agent_name only. Resolution checks publication availability, not whether the agent can currently run, a session was issued, or business calls succeed.


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

## 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/resolve" \
  --header "Content-Type: application/json" \
  --data @- <<JSON
{"k": "${WEBAPP_SHORT_CODE}"}
JSON
```

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

| Parameter | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `k` | Body | string | Condition | 22-character short code; mutually exclusive with webapp/t. |
| `webapp` | Body | string | Condition | Agent ID from a legacy link; provide together with t. |
| `t` | Body | string | Condition | Publication token from a legacy link; provide together with webapp. |

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

## Successful response

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

```json
{
  "code": 0,
  "data": {
    "agent_name": "示例智能体",
    "agent_id": "agent-example"
  }
}
```

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

Success returns HTTP 200 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.
