Skip to main content
Fetch Many Reputation Grants
Returns a paginated list of reputation grants, newest first. Requires authentication (user token or service key) and the reputation bundle. A service key may name a viewer in actingUserId and then gets exactly that user’s list; naming nobody, it gets what a signed-in user in no conversation gets.
Only positive grants are ever returned — for every caller. The amount > 0 filter is baked into the query, so negative grants (your app’s private moderation deductions) are unreachable here for a service key exactly as they are for a user token. Read them from Fetch User Grant History instead.

One filter shape per request

Exactly one filter is required, and the three shapes are mutually exclusive — they are not AND-ed: Grants pointing at a chat message are private to that conversation, which is what makes the choice of shape matter — see Chat message targets below. Supplying none, more than one, or only half of the target pair returns 400 reputation-grant/invalid-query, with param naming the field to fix. Combining shapes is rejected rather than intersected, because a target list narrowed by sender would render rows that no longer reconcile with the summary printed above them.

Query Parameters

string
Service key only: the user to list as. The page and summary are exactly what that user’s own access token would get: grants on chat messages only where they can read the message, and viewerTotal is their own. Leave it out to list as a signed-in user in no conversation: no grants on chat messages, and viewerTotal is 0. A user token always acts as its own user and must not send it, and neither may a request with no credentials (400 reputation-grant/acting-user-not-allowed).
number
Page number (1-indexed): a whole number, 1 or more. Defaults to 1. Any other value returns 400 reputation-grant/invalid-query with param: "page".
number
Results per page: a whole number from 1 to 100. Defaults to 20. A larger value returns 400 reputation-grant/invalid-query with param: "limit" (it is never lowered to 100), as does 0, a negative number or a value that isn’t a whole number. See Pagination.
string
UUID. Grants credited to this user.
string
UUID. Grants sent by this user.
string
"entity", "comment", or "message" (a chat message). Values match exactly. Supplied together with targetId.
string
UUID of the rewarded record. Supplied together with targetType.
string
Associations to expand, as a comma-separated value or repeated params. The only value is:
  • user — hydrates both the sender and the recipient on every row
Matching ignores case. An unknown value returns 400 reputation-grant/invalid-query.

Chat message targets are private

A grant row carries targetType, targetId and the granter’s free-text note, and include=user hydrates both parties. On a message target those facts describe a private conversation — who is talking to whom, and what one of them said about it — so the grant is exactly as private as the message it points at. Both filter shapes ask the same question — can this caller see the underlying message? — and answer it the same way:
  • The target shape is gated on conversation membership. targetType=message returns rows only to a caller who is a member of the message’s conversation. The membership test is the one Fetch Message applies: an active member sees the grants on any message, and a user who has left the conversation sees them only on messages sent before they left, the ones chat itself still returns to them. In a space chat, the caller must also be an active member of the chat’s space and able to see it (visibility), as on every chat route; anyone else is answered like a non-member, here and on the user-keyed shapes. Everyone else gets 200 with an empty data array, totalItems: 0, and the zero summary { "total": 0, "count": 0, "viewerTotal": 0 } — never a 403, because an error would itself confirm the message exists. That covers a user who was never a member, and every user token on a project without the chat bundle, where there is no membership to have. The answer is byte-identical to the one a completely made-up message ID returns.
  • The recipientId and senderId shapes carry the same test into the query. A grant on a chat message stays in these feeds for a caller who can see the message, and is excluded from both the page and totalItems for one who cannot. The predicate rides the same where clause the COUNT uses, so a filtered page and a filtered total always move together and hasMore never asserts rows the caller may not read. A user’s own “reputation I received / sent” feed therefore includes the grants made on messages in their own conversations, and reconciles with the reputation shown on their profile.
  • A message removed by moderation takes its grants with it. Chat shows a removed message as a placeholder to everyone but its author, with a zero grants summary for everyone, so both shapes hide its grants: the target shape answers the same empty page, and the user-keyed shapes drop the rows from the page and totalItems. That holds for a member of the conversation as much as for a stranger.
A service key gets no exemption: it is tested as the user it names in actingUserId, exactly as that user’s token. Naming nobody, it is tested as a signed-in user in no conversation, so it gets no grants on chat messages on either shape. An entity removed by moderation takes its grants with it too, for everyone: the entity is a placeholder to everyone but its author and its grants summary is zero, so the target shape answers the empty page with the zero summary and the user-keyed shapes drop its grants from the page and totalItems. See A removed entity takes its grants with it. Grants with no target at all are returned by every shape, subject only to space reading.
The inline grants summary on the chat surfaces needs none of this. List Messages and Fetch Message already refuse a non-member with 403 chat/not-a-member before they read a message, so include=grants there is behind the conversation gate already.

Grants follow space reading

Every shape also leaves out grants that would reveal content of a space the viewer can’t read (see Who can read content):
  • a grant whose own spaceId is in a space the viewer can’t read;
  • a grant on an entity or comment that sits in a space the viewer can’t read (a comment goes by its entity’s space).
The filter rides the same query as totalItems, so the page and the total always agree. A grant whose spaceId names a space that no longer exists — the space was deleted, or the spaces bundle uninstalled — is left out for everyone. The reputation it moved went with the space’s buckets when the space was deleted; after a spaces uninstall, totals don’t change. Grants on deleted entities and comments, and on entities and comments in no space, are still listed. On the target shape, an entity or comment in a space the viewer can’t read answers 200 with an empty data array, totalItems: 0 and the zero summary, the same as a hidden chat message. On a target the viewer can read, the summary counts exactly the grants the list shows.

Space-scoped reputation

Grants carry their own spaceId, so this is a context endpoint: spaceReputationId=context scores each hydrated user against that grant’s own space. The same granter appearing on two grants in different spaces therefore gets two correct numbers rather than one overwriting the other. Only spaces the viewer can read count; others read 0 (see Who sees space reputation). Requires the reputation bundle — which this endpoint already does.

Response

Returns 200 with the standard paginated envelope:
On the target shape only, a summary block rides alongside the envelope, so a standalone “who rewarded this” view doesn’t have to fetch the parent item just to learn the totals:
viewerTotal is the viewer’s own summed grants on the target: the signed-in user, or the user a service key names in actingUserId. It is 0 for a service key naming nobody. The other two shapes return no summary key at all. See ReputationGrant for the row shape and GrantSummary for the summary.
Grant reads are never block-filtered. Unlike entity and comment feeds, this endpoint has no blockedFilter and applies no block exclusion. Hiding a blocked granter’s row while still counting their amount in the total would produce a “120 total, 70 shown” discrepancy no app can explain — so nothing is hidden, and the amounts you display always reconcile with the totals you display.

Error Responses

No filter was supplied; param is recipientId:
More than one was supplied; param names the second (senderId, or targetType for the target pair):
Only one half of the target pair was supplied; param names the missing half:
Shape failures from the query schema: a page or limit that breaks the pagination rule (param names it), a malformed UUID ("recipientId: Invalid UUID format"), a targetType outside the three accepted values, or an unknown include value ("include: Unknown include `sender`. Allowed: user."). The field path prefixes the message, so error reads "<path>: <message>".
The route names both of the reputation bundle’s tables, so a project without the bundle is told about both.
A user token, or a request with no credentials, sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
Returned when a service key names an actingUserId that isn’t a user in this project.
targetType was "chat-message" in the query. A chat message is message.
Rate limit: 100 requests per 5 minutes per IP. Exceeding it returns 429 request/rate-limited. See also: useFetchManyReputationGrants · useFetchManyReputationGrantsWrapper · node-sdk · js-sdk