⚠️Error Handling
The Fuul API uses standard HTTP status codes to indicate success or failure. The SDK catches API errors and throws typed error classes for common failure modes.
HTTP status codes
200
Success
400
Bad Request — invalid parameters or validation error
401
Unauthorized — missing or invalid API key
403
Forbidden — API key lacks required permissions
404
Not Found
409
Conflict — duplicate resource
422
Unprocessable Entity — the request is well-formed but a guard rejected it. For example, DELETE /v1/user-referrers returns 422 when the user still has matching referral code associations; add ?force=true to remove them in the same call
429
Too Many Requests — rate limit exceeded
500
Server Error
SDK error types
The SDK throws these typed errors for createAffiliateCode, updateAffiliateCode, and updateRebateRate. Each extends Error and sets a .name property. Note: updateRebateRate can throw InvalidSignatureError and ValidationError but not AddressInUseError or CodeInUseError.
Error class
.name
When thrown
ValidationError
'ValidationError'
Invalid characters in the code. Has an errors: string[] property with details.
InvalidSignatureError
'InvalidSignatureError'
Signature doesn't match the address and message
AddressInUseError
'AddressInUseError'
Address already has a code registered. Has an address property.
CodeInUseError
'CodeInUseError'
Code is already taken. Has a code property.
These are exported from @fuul/sdk and can be used with instanceof:
API key permissions reference
Read data (leaderboards, rewards, conversions)
Any key type
Send tracking events (pageview, connect_wallet)
send:tracking_event or higher
Send trigger events (custom offchain events)
send:trigger_event
Record a terms acceptance
terms_conditions:write
Read terms acceptance status
terms_conditions:write or service_role
Manage audiences, webhooks, set referrers
service_role
For full details on key types, see API Key Management.
Last updated