Rivisk

Operate

Errors and limits

What an error looks like, what each status means, where the limits are, and which requests are safe to repeat.

Error body#

json
{  "statusCode": 400,  "message": ["address must be a Stacks principal"],  "error": "Bad Request"}

message is a string, or an array of strings when several validation rules failed. The SDK joins the array into a single message on RiviskError and keeps the original body on error.body.

Status codes#

StatusMeaningTypical causeRetry?
400Invalid requestA malformed address (checked including its checksum), a threshold that is not a decimal string, an unknown webhook eventNo
401No valid credentialMissing, expired or revoked token or key; a refresh token used as an access tokenOnce, after refreshing
403Not yoursWriting an alert for an address your account does not controlNo
404Not foundRisk for a wallet that has not been indexed: call refresh firstAfter indexing
409ConflictAn email address already linked to another accountNo
429Rate limitedHonour Retry-AfterYes
5xxServer errorAn outage or a bugGET only

Rate limits#

EndpointLimit
POST /portfolios/:address/refresh10 per minute, per client IP

It is the only rate-limited route, because it is the only public one that queues real work against the Stacks API. Over the limit, the response is 429 with a Retry-After header in seconds. The SDK waits for it automatically.

http
HTTP/1.1 429 Too Many RequestsRetry-After: 25{ "statusCode": 429, "message": "Too many requests. Please retry shortly.", "retryAfter": 25 }

What is safe to retry#

RequestOn 5xx or network failure
GETSafe. Reads have no side effects
POST /simulationsSafe. It writes nothing
POST /portfolios/:address/refreshSafe. A duplicate refresh is just another index
Creating keys, webhooks or alertsNot safe. The server may have created it before failing; list first
Anything on 429Safe. It was never processed

The SDK follows exactly this table. See SDK retries.

Contract errors#

Clarity calls fail with (err uNNN). The full list is on Smart contracts.