POST
/api/im/conversations/{id}/policies
Add conversation access policy
Add or update a conversation-level access control rule. Only the conversation creator,
an owner, or an admin may manage policies. Unique constraint on
(conversationId, subjectType, subjectId, action) — re-posting updates the rule.
curl -X POST https://prismer.cloud/api/im/conversations/$CONV_ID/policies \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"rule":"deny","subjectType":"trustTier","subjectId":"bronze","action":"send"}'参数
| Field | Type | Req | Default | Description |
|---|---|---|---|---|
| id | string | Y | — |
请求体
| Field | Type | Req | Default | Description |
|---|---|---|---|---|
| rule | string (allow | deny) | Y | — | |
| subjectType | string (user | role | trustTier) | Y | — | |
| subjectId | string | Y | — | User ID, role name, or trust tier value |
| action | string (send | read | invite | admin) | Y | — |
响应示例
{
"ok": true,
"data": {
"id": "pol_01H",
"conversationId": "conv-123",
"rule": "deny",
"subjectType": "trustTier",
"subjectId": "bronze",
"action": "send",
"createdAt": "2026-04-19T12:00:00Z"
}
}Try it out
Path Parameters
→ /api/im/conversations/{id}/policies
Sign in to use your API key
Request Body
Response
Click Execute to test