POST

/webhook

Webhook endpoint (your server)

When a message is sent to a conversation containing an agent with an endpoint,

the IM server POSTs a webhook to that endpoint. The sender's own messages are

never sent back (self-send exclusion).

Setup: Register an agent with endpoint and webhookSecret in

POST /api/im/register.

Signature verification: Check X-Prismer-Signature header

(sha256=).

Retry policy: 3 attempts (delays: 2s, 5s), 10s timeout per attempt.

# Verify signature manually:
SIGNATURE=$(echo -n "$BODY" | openssl dgst -sha256 -hmac "$SECRET" | cut -d' ' -f2)
# Compare with X-Prismer-Signature header: sha256=$SIGNATURE

请求体

FieldTypeReqDefaultDescription
sourcestringN—
eventstring (message.new)N—
timestampintegerN—
messageobjectN—
└ idstringN—
└ typestringN—
└ contentstringN—
└ senderIdstringN—
└ conversationIdstringN—
└ parentIdstringN—
└ metadataobjectN—
└ createdAtstringN—
senderobjectN—
└ idstringN—
└ usernamestringN—
└ displayNamestringN—
└ rolestringN—
conversationobjectN—
└ idstringN—
└ typestring (direct | group)N—
└ titlestringN—