Message received
SSE event emitted when a non-chunked message arrives in the feed of one of the application's endpoints
event: MESSAGE_RECEIVEDEmitted when a non-chunked message arrives in the feed of one of the application's endpoints. The frame arrives on the GET /events SSE stream.
Data fields
| Field | Type | Required | Description |
|---|---|---|---|
event_type | string (MESSAGE_RECEIVED) | yes | Discriminator; matches the event: line. |
id | UUID | yes | agrirouter-generated message ID. This is the field to send as message_id when confirming via POST /confirmations — see Confirming the message. |
app_message_id | string | yes | The application-supplied message ID from the sender's x-agrirouter-context-id header. |
message_type | string | yes | Technical message type, for example iso:11783:-10:taskdata:zip. |
sent_at | RFC 3339 date-time | yes | When the sending application called POST /messages. |
receiving_endpoint_id | UUID | yes | agrirouter-internal ID of the receiving endpoint. Pair it with id when confirming. |
received_at | RFC 3339 date-time | no | When agrirouter accepted the message. |
payload | string (base64) | no | Inline payload for small messages. Mutually exclusive with payload_uri. |
payload_uri | URI | no | Pre-signed URL to download the payload. Mutually exclusive with payload. Expires after at most 15 minutes. |
filename | string | no | Optional filename metadata supplied by the sender. |
tenant_id | string | no | Tenant that owns the receiving endpoint. Useful when confirming back on behalf of a user. |
teamset_context_id | string | no | Teamset context ID the sender attached via the x-agrirouter-teamset-context-id header, if any. |
Exactly one of payload and payload_uri is present per event.
Confirming the message
Once your application has successfully processed the payload, confirm the message via POST /confirmations so agrirouter marks it as handled for the receiving endpoint and removes it from the feed. The confirmation body uses two fields from this event:
- Pass the event's
id(the agrirouter-generated message ID) as themessage_idof the confirmation. This is the only identifier agrirouter recognises here — do not useapp_message_id, which is supplied by the sender and is not unique on the receiving side. - Pass the event's
receiving_endpoint_idas theendpoint_idof the confirmation. The same message can be delivered to multiple endpoints in the tenant; each receiving endpoint must confirm independently.
Sample frame
event: MESSAGE_RECEIVED
data: {"event_type":"MESSAGE_RECEIVED","id":"e4f5a6b7-c8d9-0123-4567-89abcdef0123","app_message_id":"my-first-message-001","message_type":"iso:11783:-10:taskdata:zip","sent_at":"2026-03-20T10:30:00Z","received_at":"2026-03-20T10:30:01Z","receiving_endpoint_id":"9f8e7d6c-5b4a-3210-fedc-ba0987654321","payload_uri":"https://api.agrirouter.com/payloads/e4f5a6b7-c8d9-0123-4567-89abcdef0123/2026-03-20T10:30:01Z"}