Returns the single oldest message that needs processing.
The oldest message that is NOT processed, including:
Returns 204 No Content if there are no messages to process.
This is the primary endpoint for agent reasoning loops:
GET /messages/next → Get next work itemPOST /messages/{id}/processing → Required: Mark as processingPOST /messages/{id}/processed → Mark as done, OR
POST /messages/{id}/failed → Mark as failed with error messageDelivery is at-least-once. The same message can be returned more than
once: after a crash or reconnect (processing messages are re-served for
recovery), or when multiple clients poll with the same API key. Make your
processing idempotent — deduplicate by message id when a repeated run
would have side effects.
If your agent crashes while processing, the message stays in processing state.
When restarted, calling /next will return that same stuck message (oldest first),
allowing the agent to reclaim and retry it.
GET /messages returns all actionable messages (for batch processing or queue inspection)GET /messages/next returns one message (for sequential processing loops)Both use the same filter logic: everything that is NOT processed.