---
title: "message.received"
url: "https://docs.yoagent.dev/reference/webhook-events/webhooks/message-received"
---

# message.received

POST

A message arrived in an inbox the webhook covers. A webhook of scope `project`, `inboxes` or `catch_all` gets it. Answer 2xx within 10 s; anything else is retried after 30 s, 120 s, 600 s, 3600 s, 21600 s, unless the URL now resolves to an address webhooks may not reach (then it is dropped), and 3 failures in a row pause the webhook (`disabled_reason: failing`). Each attempt counts toward the organization’s webhook deliveries per minute; one over it is skipped, never sent later. Before each attempt the webhook is checked again: one paused, deleted or no longer wanting the event gets nothing more of it. Every attempt is in the webhook’s log (`GET /v0/webhooks/{webhook_id}/attempts`). Verify `webhook-signature` with the webhook’s `secret`; `webhook-id` is the same on every retry. An event goes to the webhooks that want it when it is queued for them, so one made right after an event may still receive it if that queuing was retried.

## Request Body required

application/json

_MessageReceivedBody_

The body POSTed for `message.received`: the message as it arrived, the same on every retry; signed per Standard Webhooks (`webhook-id` = `event_id`).

object

**event_id**

required

_Event Id_

The same on every retry of this event: deduplicate on it.

string

/^evt\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**event_type**

required

_Event Type_

string

Allowed value: message.received

**occurred_at**

required

_Occurred At_

string format: date-time

**message**

required

_WebhookMessage_

The message in a webhook body: the list shape plus what a test needs right away (no HTML, no headers).

object

**version**

required

_Version_

Goes up by one on every change: of two copies, the one with the higher version is the newer.

integer

**message_id**

required

_Message Id_

string

/^msg\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**project_id**

required

_Project Id_

string

/^prj\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**inbox_id**

required

_Inbox Id_

string

/^inb\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**thread_id**

required

_Thread Id_

string

/^thr\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**envelope_to**

required

_Envelope To_

The address the message came to; null for a message the inbox sent (`sent`).

Any of:

**string**

string

**null**

null

**envelope_from**

required

_Envelope From_

string

**plus_tag**

required

_Plus Tag_

Any of:

**string**

string

**null**

null

**from**

required

_From_

Array\<object>

_Party_

A name and address from a header.

object

**name**

required

_Name_

string

**address**

required

_Address_

string

**to**

required

_To_

Array\<object>

_Party_

A name and address from a header.

object

**name**

required

_Name_

string

**address**

required

_Address_

string

**subject**

required

_Subject_

Any of:

**string**

string

**null**

null

**preview**

required

_Preview_

Any of:

**string**

string

**null**

null

**labels**

required

_Labels_

Array\<string>

**size**

required

_Size_

integer

**received_at**

required

_Received At_

string format: date-time

**extracted_text**

required

_Extracted Text_

Dropped (null) when the body would exceed 256 KB.

Any of:

**string**

string

**null**

null

**links**

required

_Links_

Array\<object>

_Link_

A link found in a message when it arrived: its URL, its text and what it is for.

object

**url**

required

_Url_

string

**text**

required

_Text_

string

**kind**

required

_LinkKind_

What a link is for, guessed from its text and URL.

string

Allowed values: verify reset unsubscribe other

**codes**

required

_Codes_

Array\<object>

_Code_

A one-time code found in a message when it arrived, with the text around it.

object

**code**

required

_Code_

string

**context**

required

_Context_

string

**truncated**

required

_Truncated_

The fields this body cut or emptied to stay under 256 KB (empty: nothing was cut; the API has them whole): first extracted_text (null), then links and codes (empty), then subject, from and to (shortened). HTML and headers are never in a webhook body and are not listed.

Array\<string>

Allowed values: text extracted_text html extracted_html links codes subject from to

### Example

```json
{
  "event_id": "evt_01je56wqswfmn9pgbc1wq8tjgq",
  "event_type": "message.received",
  "occurred_at": "2026-12-01T12:00:00Z",
  "message": {
    "version": 1,
    "message_id": "msg_01je56wqswfmn9pgbc1wq8tjgq",
    "project_id": "prj_01je56wqswfmn9pgbc1wq8tjgq",
    "inbox_id": "inb_01je56wqswfmn9pgbc1wq8tjgq",
    "thread_id": "thr_01je56wqswfmn9pgbc1wq8tjgq",
    "envelope_to": "test@k7m2xq4p.yoagent.email",
    "envelope_from": "bounce@example.com",
    "plus_tag": null,
    "from": [
      {
        "name": "Example App",
        "address": "noreply@example.com"
      }
    ],
    "to": [
      {
        "name": "",
        "address": "test@k7m2xq4p.yoagent.email"
      }
    ],
    "subject": "Your sign-in code",
    "preview": "Your sign-in code is 482913.",
    "labels": [
      "received",
      "unread"
    ],
    "size": 66000,
    "received_at": "2026-12-01T12:00:00Z",
    "extracted_text": "Your sign-in code is 482913.",
    "links": [
      {
        "url": "https://example.com/sign-in?code=482913",
        "text": "Sign in",
        "kind": "verify"
      }
    ],
    "codes": [
      {
        "code": "482913",
        "context": "Your sign-in code is 482913."
      }
    ],
    "truncated": []
  }
}
```

## Responses

### 200

Delivered: any 2xx within 10 s (its body is not read).
