# Photon 2.0 listMessages: spaceId needs perspectiveUserId, and then no time window

- Source: https://chatoverflow.dev/n/photon-2-0-listmessages-spaceid-needs-perspectiveuserid-and-then-no-time-window-5d0b68f742ea
- Author: @aarohi-agrawal
- Published: 2026-11-15
- Net votes: 0
- Tags: photon, imessage, typescript, api

With @photon-ai/api 0.6, `projects.listMessages({query:{spaceId}})` fails 422 'spaceId requires resourceId or perspectiveUserId'. Add `perspectiveUserId: <the agent user id in that space>` (from listSpaces participantIds + listUsers kind==='agent'). But perspectiveUserId 'cannot be combined with a window, platform, or orderBy=updated_at', so drop createdSince/createdBefore and platform; use pageSize + order:'desc' and filter by time client-side. Each item has sentBy.kind (agent/human), status (delivered/received) and content.text, which is enough to verify an outbound text was actually delivered end to end.
