folkwaysDocs
Realtime API

Error codes

Every Realtime API error code, its HTTP status, whether it closes the connection, and what to do about it.

Every transport uses the same codes. A code that closes the connection arrives as a Close frame; the others as an OpError for one request, and the connection stays open. Over HTTP, packet-level failures also set the status, and the JSON endpoints answer { "code", "error", "message" }. Codes are grouped by hundreds.

Request

CodeNameHTTPClosesRetryMeans
100BadFrame400yesneverNot a valid packet: wrong identifier, failed verification, a text message
101InvalidArgument400noneverA field is missing or wrong
102UnsupportedVersion400yesneverThe protocol version isn't supported
103UnsupportedFrame400noneverA frame not accepted here, e.g. Subscribe on /v1/publish. Ten close the connection
104UnsupportedFeature400noneverA feature this server doesn't offer
105FrameTooLarge413yesneverA packet over max_frame_bytes
106HelloRequired400yesneverAnother frame came before Hello

Authentication and access

CodeNameHTTPClosesRetryMeans
200AuthRequired401yeswith a tokenNo token, or no Hello within 5 s
201AuthInvalid401yesneverBad signature, unknown key, wrong segment, bad claims; a revoked or expired publishable key
202AuthExpired401yeswith a new tokenThe token has expired
203Forbidden403noneverNo rule matches, or the token, rule or member entry doesn't allow it. The same answer for both, so topics can't be probed
204Suspended403yesneverThe segment is off, the workspace's package isn't active, or the publishable key is paused
205ResumeRejected409noneverReserved for session resume, which isn't offered
206Replaced409yesdon't reconnect automaticallyA newer connection of the same identity took this one's place
207AuthRevoked401yesdon't reconnect automaticallyYour backend kicked this identity or revoked this token

Limits

CodeNameHTTPClosesRetryMeans
300RateLimited429no*after retry_after_msA rate limit: publishes, bytes, subscribes, topic creations, new connections, failed authentications
301QuotaExceeded429no*after retry_after_msA connection, topic, subscription, member or monthly limit
302PayloadTooLarge413noneverThe payload is over the limit
303Backpressure503yesreconnect and resumeThe connection couldn't keep up with deliveries

* RateLimited and QuotaExceeded close the connection only when they answer Hello. A publish refused for a monthly allowance gets a retry_after_ms that ends at the next period: retrying sooner fails again unless you upgrade or raise the cap. Subscriptions and deliveries are never cut for quotas.

Topics

CodeNameHTTPClosesRetryMeans
400InvalidTopic400noneverNot a valid topic name. A reserved $ name other than a system topic gets Forbidden
401ClassMismatch409noneverThe event type isn't allowed for this event name or topic
402InvalidCursor400noneverThe cursor is ahead of the topic
403IdempotencyConflict409noneverThe idempotency key was used with different content
404IdempotencyKeyRequired400noneverA stream publish without an idempotency key

Server

CodeNameHTTPClosesRetryMeans
500Internal500nowith backoffAn unexpected server error
501Unavailable503yeswith backoffA dependency is unavailable
502Draining503yesreconnect after retry_after_msThe server is restarting; you'll reach another
503Overloaded503nowith backoffThe server is busy
504Timeout504yesreconnect90 seconds with nothing received

Handling errors

  • Retry with backoff and jitter only where the table says so, and never sooner than retry_after_ms.
  • Never retry Forbidden, InvalidArgument or PayloadTooLarge unchanged. Fix the request, the token or the rule.
  • After Replaced or AuthRevoked, stop: show "signed in elsewhere" or sign the user out.
  • After Draining or Backpressure, reconnect and resume from your saved cursors.

The JavaScript SDK adds its own local codes (1000–1006) for things that happen in the client, such as a full queue: see JavaScript errors.

On this page