Docs

Message received

SSE event emitted when a non-chunked message arrives in the feed of one of the application's endpoints

event: MESSAGE_RECEIVED

Emitted 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

FieldTypeRequiredDescription
event_typestring (MESSAGE_RECEIVED)yesDiscriminator; matches the event: line.
idUUIDyesagrirouter-generated message ID. This is the field to send as message_id when confirming via POST /confirmations — see Confirming the message.
app_message_idstringyesThe application-supplied message ID from the sender's x-agrirouter-context-id header.
message_typestringyesTechnical message type, for example iso:11783:-10:taskdata:zip.
sent_atRFC 3339 date-timeyesWhen the sending application called POST /messages.
receiving_endpoint_idUUIDyesagrirouter-internal ID of the receiving endpoint. Pair it with id when confirming.
received_atRFC 3339 date-timenoWhen agrirouter accepted the message.
payloadstring (base64)noInline payload for small messages. Mutually exclusive with payload_uri.
payload_uriURInoPre-signed URL to download the payload. Mutually exclusive with payload. Expires after at most 15 minutes.
filenamestringnoOptional filename metadata supplied by the sender.
tenant_idstringnoTenant that owns the receiving endpoint. Useful when confirming back on behalf of a user.
teamset_context_idstringnoTeamset 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 the message_id of the confirmation. This is the only identifier agrirouter recognises here — do not use app_message_id, which is supplied by the sender and is not unique on the receiving side.
  • Pass the event's receiving_endpoint_id as the endpoint_id of 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"}

See also

On this page