Enable or disable an agent Web application¶
Change public access availability while retaining the current link token.
PATCH https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agents/{agent_id}/webapp
Before you call this API¶
BASE_URL uses the product API prefix https://api.moi.matrixorigin.cn/v5. For a dedicated deployment, use its corresponding product API address.
Prepare publication management identity and objects.
Request¶
curl --request PATCH \
"$BASE_URL/workspaces/$WORKSPACE_ID/agents/$AGENT_ID/webapp" \
--header "X-API-Key: $MOI_KEY" \
--header "X-Workspace-ID: $WORKSPACE_ID" \
--header "Content-Type: application/json" \
--data '{"enabled":false}'
Parameter |
Location |
Type |
Required |
Description |
|---|---|---|---|---|
|
Path |
string |
Yes |
Publication Workspace ID in the same environment. |
|
Path |
string |
Yes |
Target agent ID. |
|
Body |
boolean |
Yes |
true enables; false disables. Omitted/null is rejected. |
Repeating the current state succeeds without rewriting the publication record. Disabling retains the token, and reenabling restores the same link. Read state after changing it and after errors/timeouts; do not assume it did not take effect.
Successful response¶
{
"code": 0,
"data": {
"agent_id": "agent-example",
"enabled": false,
"url": "https://app.example.invalid/webapp?k=example-short-code",
"token": "example-publication-token",
"created_at": "2026-11-12T01:00:00Z",
"updated_at": "2026-11-12T01:00:00Z",
"last_rotated_at": null
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
Success code. |
|
object |
Error response¶
Errors and read-back distinguishes parameters, permissions, and write results for this entry point.