---
title: "Message created"
method: POST
path: "message.created"
---

# Message created

`POST message.created` (webhook)

Fires when a physician message or any AI-generated message is sent in a thread. The `sender.role` field indicates which: `physician` for messages sent by a human clinician, `model` for AI-generated messages (Counsel AI). Patient-sent and system messages do not fire this event.

## Payload

- object
  - `type` 'message.created', required
  - `data` object, required
    - `message` object, required
      - `id` string, uuid, required
      - `preview` string, required
    - `sender` object, required
      - `id` string, uuid, nullable, required: ID of the sending physician. Null for AI messages which have no per-sender identity.
      - `name` string, required
      - `role` 'physician' | 'model', required: Role of the party that sent the message: human physician or AI (model).
    - `thread` object, required
      - `id` string, uuid, required: The thread ID
      - `user_id` string, uuid, required: The user ID that the thread belongs to. Not necessarily the same as the sender ID.
  - `id` string, uuid, required
  - `timestamp` string, date-time, required: datetime in ISO 8601 format

## Acknowledgement `200`

Return 200 if the webhook is accepted

## Other responses

- `429`: Return 429 to rate limit the webhook with a retry-after header. Max retry-after is 900 seconds (15 minutes) in the future.

---

[API](https://skmtc.dev/counselhealth/apis/counsel-api.md) - [All operations](https://skmtc.dev/counselhealth/apis/counsel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/counselhealth/apis/counsel-api/revisions/4110a89127e8?raw)
