Rotate an agent Web application link¶
Replace the access token and corresponding public link for the same publication record.
POST https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agents/{agent_id}/webapp/rotate
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 POST \
"$BASE_URL/workspaces/$WORKSPACE_ID/agents/$AGENT_ID/webapp/rotate" \
--header "X-API-Key: $MOI_KEY" \
--header "X-Workspace-ID: $WORKSPACE_ID"
Parameter |
Location |
Type |
Required |
Description |
|---|---|---|---|---|
|
Path |
string |
Yes |
Publication Workspace ID in the same environment. |
|
Path |
string |
Yes |
Target agent ID. |
Rotation retains enabled, updates last_rotated_at, and makes the old token/short code no longer match the new record. Every rotation generates a new token. Retrying does not guarantee the same link; read again if the result is unknown. Verify visitor-session invalidation scope under the public session contract separately.
Successful response¶
{
"code": 0,
"data": {
"agent_id": "agent-example",
"enabled": true,
"url": "https://app.example.invalid/webapp?k=example-new-short-code",
"token": "example-new-publication-token",
"created_at": "2026-11-12T01:00:00Z",
"updated_at": "2026-11-12T01:00:00Z",
"last_rotated_at": "2026-11-12T01:00:00Z"
}
}
Field |
Type |
Description |
|---|---|---|
|
integer |
Success code. |
|
object |
Error response¶
Errors and read-back distinguishes parameters, permissions, and write results for this entry point.