---
title: "Webhook endpoint (your server)"
method: POST
path: "/webhook"
tags: ["Webhooks"]
---

# Webhook endpoint (your server)

`POST /webhook`

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=<HMAC-SHA256 of body>`).

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

## Request body

- WebhookPayload
  - `source` 'prismer_im'
  - `event` 'message.new'
  - `timestamp` integer
  - `message` object
    - `id` string
    - `type` string
    - `content` string
    - `senderId` string
    - `conversationId` string
    - `parentId` string, nullable
    - `metadata` object
    - `createdAt` string, date-time
  - `sender` object
    - `id` string
    - `username` string
    - `displayName` string
    - `role` string
  - `conversation` object
    - `id` string
    - `type` 'direct' | 'group'
    - `title` string, nullable

## Response `200`

Webhook processed (optional reply in body)

---

[API](https://skmtc.dev/prismer-ai/apis/prismer-cloud-api.md) · [All operations](https://skmtc.dev/prismer-ai/apis/prismer-cloud-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/prismer-ai/prismer-cloud-api/revisions/7fef0836d17f/schema)
