Overview
useCreateReputationGrant returns a callable that transfers reputation from the logged-in user to another user. The amount leaves the sender’s bucket and lands in the recipient’s bucket for the same space — nothing is created, and reputation never crosses between the project-general bucket and a space bucket.
There is no actor argument: the sender is always the user the token belongs to. Naming a different sender requires a service key, which the React SDK never holds — see @sublay/node.
Requires the reputation bundle.
Usage Example
Parameters
Whole number from
1 to 2147483647 (the signed 32-bit maximum, which is also the width of a reputation balance). A transfer can never be zero, negative, or fractional, and it can never exceed what the sender holds in the source bucket.The bucket both legs move in. Omitted or
null = the project-general bucket. The space is validated before anything moves: an ID naming no space, or a space whose content the sender can’t read (a private or members-only space they aren’t an active member of, or a space under one), rejects with 404 reputation-grant/space-not-found, and naming one at all on a project without the spaces bundle rejects with 403 database/tables-not-available.What the grant is for. Must be supplied together with
targetId. It need not be authored by the recipient. A grant with a spaceId must use the target’s space (an entity’s space, a comment’s entity’s space, a message’s space chat’s space; none for a target in no space), or it is rejected with 400 reputation-grant/space-mismatch — see The target is an annotation.Returns
Returns aPromise<ReputationGrant> — the created ReputationGrant, with sourceType: "user".
Failure Modes
The hook validates locally before the round trip and throws for a missingprojectId, a missing recipientId or amount, or a half-filled target (targetType without targetId, or vice versa).
Server rejections surface as a SublayError carrying the status and code, most usefully:

