JSON-RPC Error Codes

Standard JSON-RPC 2.0 error codes with meaning and custom-range guidance.

Reference for JSON-RPC 2.0 error object codes: the predefined -32700 to -32600 codes (parse error, invalid request, method not found, invalid params, internal error), the reserved server-error range, and where application codes belong.

What does JSON-RPC error -32601 mean?

-32601 is Method not found. The server returns it when the request's "method" names a procedure that does not exist or is not exposed. The request itself is valid JSON and a valid Request object.

JSON-RPC 2.0 error code reference

JSON-RPC 2.0 is a lightweight remote-procedure-call protocol that encodes calls and responses as JSON. When a call fails, the response carries an error object with an integer code, a human message, and optional data. The spec predefines a small set of codes and reserves a range for transport-level failures, leaving everything else to your application. This reference lists each predefined code and exactly when it applies.

How it works

A response is either a success or an error, never both:

{ "jsonrpc": "2.0", "id": 1, "result": 42 }
{ "jsonrpc": "2.0", "id": 1, "error": { "code": -32601, "message": "Method not found" } }

The predefined codes form a pipeline that mirrors how a server processes a request:

  1. -32700 Parse error — the bytes are not valid JSON, so nothing else can happen.
  2. -32600 Invalid Request — the JSON parsed but is not a conforming Request object.
  3. -32601 Method not found — the named method does not exist.
  4. -32602 Invalid params — the method exists but its arguments are wrong.
  5. -32603 Internal error — a generic server-side failure during handling.

The range -32000 to -32099 is reserved for implementation-defined server errors (transport, auth, rate limiting). The whole band -32768 to -32000 is off-limits to applications; any code outside that band is yours to use freely.

Tips and notes

  • Match the code to the failure stage: bad JSON is -32700, a missing method member is -32600, an unknown method is -32601 — they are not interchangeable.
  • Put machine-readable detail in data (for example validation paths), and keep message short and stable.
  • For your own domain errors, pick codes well outside -32768..-32000 so they can never collide with protocol codes.
  • Notifications (requests without an id) must not receive a response, including error responses — drop them silently per the spec.