Guides
Grant Lifecycle
Understand grant statuses, transitions, and edge cases
Grant State Machine#
Every grant moves through a defined set of statuses. Understanding these transitions is critical for building a reliable integration.
Status Reference#
| Status | Meaning | Can Transition To |
|---|---|---|
PENDING | Grant created, waiting for recipient to accept | ACCEPTED, REJECTED |
ACCEPTED | Active and vesting | COMPLETED, TERMINATED, PAUSED, MARKED_FOR_FUTURE_TERMINATION |
REJECTED | Recipient declined the grant | Terminal state |
COMPLETED | All vesting periods finished | Terminal state |
TERMINATED | Terminated early; future vestings cancelled | ACCEPTED (via revert) |
PAUSED | Vesting temporarily suspended | ACCEPTED (via resume) |
MARKED_FOR_FUTURE_TERMINATION | Termination scheduled for a future date | TERMINATED, ACCEPTED (via revert) |
Pausing, resuming and scheduling a future termination are done in the Toku dashboard. The API covers creating, terminating and reverting.
Creating a Grant#
A grant created with addSingleGrant starts in ACCEPTED status, and its vestings are generated straight away (for any frequency other than CUSTOM, or when a grant template is given).
The examples use the tokuAPI helper from Build a Dashboard, which returns the data field of each response.
Vesting Calculation#
Vestings are calculated automatically from the schedule:
Standard 4-Year Schedule (48 months, 12-month cliff, 25% cliff)#
| Event | Month | Tokens | Cumulative |
|---|---|---|---|
| Grant starts | 0 | 0 | 0 |
| Cliff vests | 12 | 12,500 (25%) | 12,500 |
| Monthly vest | 13 | ~1,042 | 13,542 |
| Monthly vest | 14 | ~1,042 | 14,583 |
| ... | ... | ... | ... |
| Fully vested | 48 | ~1,042 | 50,000 |
Monitoring Vesting Progress#
percentageOfUnitsVested is calculated each time you call listGrants. Poll periodically to track progress.
Termination#
Terminating a Grant#
Sets the grant to TERMINATED and recalculates vestings — only tokens vested before the termination date are retained.
terminateGrant returns { grantID }. It sets TERMINATED straight away, even when terminationDate is in the future: vestings after that date are cancelled. To schedule a termination that only takes effect on a future date (MARKED_FOR_FUTURE_TERMINATION), use the Toku dashboard.
Bulk Termination (Employee Departure)#
Terminate all grants when an employee leaves:
Or terminate specific grants only:
Reverting a Termination#
Made a mistake? Revert a termination to restore the grant and regenerate future vestings.
Single Grant#
Only a TERMINATED grant can be reverted. For any other grant the call still returns 200 with { success: false, errorMessage: "Grant not terminated" }, so check success.
Bulk Revert#
Reverting a termination restores the vestings the termination cancelled. Any settlements or distributions that were already processed are not affected.
Edge Cases#
Grant with zero token amount#
Fiat-only grants have grantAmount: 0. The grantAmountInFiat field holds the fiat value.
Multiple grants per employee#
An employee can have multiple independent grants, each with its own vesting schedule. Call getEmployeeGrants?externalEmployeeID=... (or ?payrollEmployeeID=...), or filter listGrants by roleInOrgID, to find all grants for an employee.
Terminated then reverted#
When a grant is reverted, it returns to ACCEPTED with the original vesting schedule fully restored. The termination is as if it never happened.
Future termination then reverted#
A MARKED_FOR_FUTURE_TERMINATION grant is reverted in the Toku dashboard; the API revert calls only accept TERMINATED grants.
Polling Strategy#
The API has no webhooks, so poll for status changes:
| What to Check | Endpoint | Recommended Interval |
|---|---|---|
| Grant status changes | listGrants | Every 5 minutes |
| New vesting events | listGrants (check percentageOfUnitsVested) | Every 15 minutes |
| Wallet verification status | getPendingWalletRequests | Every 2 minutes |