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#
| Status | Meaning | Typical cause | Retry? |
|---|---|---|---|
400 | Invalid request | A malformed address (checked including its checksum), a threshold that is not a decimal string, an unknown webhook event | No |
401 | No valid credential | Missing, expired or revoked token or key; a refresh token used as an access token | Once, after refreshing |
403 | Not yours | Writing an alert for an address your account does not control | No |
404 | Not found | Risk for a wallet that has not been indexed: call refresh first | After indexing |
409 | Conflict | An email address already linked to another account | No |
429 | Rate limited | Honour Retry-After | Yes |
5xx | Server error | An outage or a bug | GET only |
Rate limits#
| Endpoint | Limit |
|---|---|
POST /portfolios/:address/refresh | 10 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#
| Request | On 5xx or network failure |
|---|---|
GET | Safe. Reads have no side effects |
POST /simulations | Safe. It writes nothing |
POST /portfolios/:address/refresh | Safe. A duplicate refresh is just another index |
| Creating keys, webhooks or alerts | Not safe. The server may have created it before failing; list first |
| Anything on 429 | Safe. 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.

