Skip to content
Main menu
  • Main page
  • Discover
  • Unexpected connections
  • Topics
  • Random article
  • Search
Your library
  • Saved articles
  • Recent discoveries
  • Rabbit-hole trails
Topic areas
  • Computer Science
  • Mathematics
  • Physics
  • Engineering
  • Biology
  • Economics
  • Curiosities
WikiholeDeeper into Wikipedia
EnglishEN
  • Saved
  • History

  • Article text and media come live from Wikipedia via the official MediaWiki API and are available under the Creative Commons Attribution-ShareAlike 4.0 License; additional terms may apply. Each article links to its source and revision.
  • WikiHole is an independent project and is not affiliated with the Wikimedia Foundation.
  • How ranking works
  • All topics
  • Reading history
  • Random article
  • MediaWiki API

JSON-RPC

  • Article
  • Rabbit hole
  • Read
  • View history
Tools
Actions
  • Read
  • View history
General
  • Recent changes
  • Related articles
  • Random discovery
This article
Reading time
4 min
Topic
Computer Science
Quality
C-class
Views
1.4k in 14 days
Last edited
26 Jun 2026
Print/export
  • Printable version
In other projects
  • Wikidata item
From Wikipedia, the free encyclopedia
Rabbit hole:
  1. JSON-RPC

JSON-RPC (JavaScript Object Notation-Remote Procedure Call) is a JSON-based wire protocol for remote procedure calls (RPC). It is similar to the XML-RPC protocol, defining only a few data types and commands. JSON-RPC allows for notifications (data sent to the server that does not require a response) and for multiple calls to be sent to the server which may be answered asynchronously.

The JSON-RPC protocol is transport-independent and can be carried over many different data transport protocols, including file descriptor I/O, HTTP and TCP. It does not directly provide any support for authentication or authorization.

Loading the rest of the article…

Recent changes

Rabbit hole

Where JSON-RPC leads. Every connection below has a source: a link in this article, a shared Wikipedia category, or CirrusSearch text similarity. Articles already on your trail are left out.

Contents
  • (Top)
  • History
  • Usage
  • Examples
  • See also
  • References
  • External links
  • Recent changes
  • Rabbit hole
Contents
Contents8 sections
  • (Top)
  • History
  • Usage
  • Request
  • Response
  • Examples
  • Version 2.0
  • Version 1.1 (Working Draft)
  • Version 1.0
  • See also
  • References
  • External links
  • Recent changes
  • Rabbit hole
Study aids for JSON-RPC

Terminology

JavaScript Object Notation-Remote Procedure Call
JSON-RPC (JavaScript Object Notation-Remote Procedure Call) is a JSON-based wire protocol for remote procedure calls (RPC).
response
Although <-- is often called a response in client–server computing, depending on the JSON-RPC version it does not necessarily imply an answer to a request.

Terms the article defines in bold, quoted in context.

Categories:
  • JSON
  • Web services
  • Remote procedure call

492 words · 7 references · revision 1361233880 · CC BY-SA 4.0

General
  • Recent changes
  • Related articles
  • Random discovery
This article
Reading time
4 min
Topic
Computer Science
Quality
C-class
Views
1.4k in 14 days
Last edited
26 Jun 2026

Key concepts

  • JSON1
  • Wire protocol1
  • Remote procedure call1
  • XML-RPC1
  • File descriptor1
  • HTTP1
  • Transmission Control Protocol1
  • Integer1
  • Client–server model1

The articles this one links to most, weighted towards the introduction.

Print/export
  • Printable version
In other projects
  • Wikidata item

History

VersionDescriptionDated
1.0Original version2005
1.1 WDWorking draft. Adds named parameters, adds specific error codes, and adds introspection functions.2006-08-07
1.1 AltSuggestion for a simple JSON-RPC 1.1. Alternative proposal to 1.1 WD.2007-05-06
1.1 Object SpecificationObject Specification. Alternative proposal to 1.1 WD/1.1ALT.2007-07-30
1.2Proposal. A later revision of this document was renamed to 2.0.2007-12-27
2.0Specification proposal2009-05-24
2.0 (Revised-)Specification2010-03-26

Usage

JSON-RPC works by sending a request to a server implementing this protocol. The client in that case is typically software intending to call a single method of a remote system. Multiple input parameters can be passed to the remote method as an array or object, whereas the method itself can return multiple output data as well. (This depends on the implemented version.)

All transfer types are single objects, serialized using JSON.1

Request

A request is a call to a specific method provided by a remote system. It can contain three members:

  • method - A string with the name of the method to be invoked. Method names that begin with "rpc." are reserved for rpc-internal methods.
  • params - An object or array of values to be passed as parameters to the defined method. This member may be omitted.
  • id - A string or non-fractional number used to match the response with the request that it is replying to.2 This member may be omitted if no response should be returned.3

Response

The receiver of the request must reply with a valid response to all received requests. A response can contain the members mentioned below.

  • result - The data returned by the invoked method. If an error occurred while invoking the method, this member must not exist.4
  • error - An error object if there was an error invoking the method, otherwise this member must not exist.5 The object must contain members code (integer) and message (string).6 An optional data member can contain further server-specific data. There are pre-defined error codes which follow those defined for XML-RPC.
  • id - The id of the request it is responding to.
Error CodeMessageDescription
−32700Parse errorInvalid JSON was received
−32600Invalid RequestThe JSON sent is not a valid Request object
−32601Method not foundThe method does not exist / is not available
−32602Invalid paramsInvalid method parameter(s)
−32603Internal errorInternal JSON-RPC error
−32000 to −32099Server errorReserved for implementation-defined server errors

Since there are situations where no response is needed or even desired, notifications were introduced. A notification is similar to a request except for the id, which is not needed because no response will be returned. In this case the id property should be omitted (Version 2.0) or be null (Version 1.0).

Examples

In these examples, --> denotes data sent to a service (request), while <-- denotes data coming from a service. Although <-- is often called a response in client–server computing, depending on the JSON-RPC version it does not necessarily imply an answer to a request.

Version 2.0

Request and response:

--> {"jsonrpc": "2.0", "method": "subtract", "params": {"minuend": 42, "subtrahend": 23}, "id": 3}
<-- {"jsonrpc": "2.0", "result": 19, "id": 3}

Notification (no response, and no id):

--> {"jsonrpc": "2.0", "method": "update", "params": [1,2,3,4,5]}

Parse error:

--> {"jsonrpc": "2.0", "method": "subtract", "params":
<-- {"jsonrpc": "2.0", "error": {"code": -32700, "message": "Parse error"}, "id": null}

Invalid Request:

--> {"jsonrpc": "2.0", "method": 1, "params": "bar"}
<-- {"jsonrpc": "2.0", "error": {"code": -32600, "message": "Invalid Request"}, "id": null}

Method not found:

--> {"jsonrpc": "2.0", "method": "foobar", "id": 1}
<-- {"jsonrpc": "2.0", "error": {"code": -32601, "message": "Method not found"}, "id": 1}

Invalid params:

--> {"jsonrpc": "2.0", "method": "subtract", "params": {"minuend": 42}, "id": 2}
<-- {"jsonrpc": "2.0", "error": {"code": -32602, "message": "Invalid params", "data": "Missing required parameter: subtrahend"}, "id": 2}

Internal error:

--> {"jsonrpc": "2.0", "method": "getData", "params": [], "id": 4}
<-- {"jsonrpc": "2.0", "error": {"code": -32603, "message": "Internal error"}, "id": 4}

Batch request with errors:

--> [
      {"jsonrpc": "2.0", "method": "subtract", "params": [42, 23], "id": 1},
      {"jsonrpc": "2.0", "method": "foobar", "id": 2},
      {"foo": "bar"}
    ]
<-- [
      {"jsonrpc": "2.0", "result": 19, "id": 1},
      {"jsonrpc": "2.0", "error": {"code": -32601, "message": "Method not found"}, "id": 2},
      {"jsonrpc": "2.0", "error": {"code": -32600, "message": "Invalid Request"}, "id": null}
    ]

Version 1.1 (Working Draft)

See also

  • gRPC - cross-platform binary RPC protocol
  • SOAP - a messaging protocol
  • JSON-WSP - a JSON-RPC inspired protocol with a service description specification
  • Model Context Protocol - uses JSON-RPC to integrate AI agents with external tools 7

References

  1. 1"specification - JSON-RPC - Trac". Archived from the original on 2008-05-17. Retrieved 2008-05-14.
  2. 2"JSON-RPC 2.0 Specification". “id: An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null and Numbers SHOULD NOT contain fractional parts”
  3. 3"JSON-RPC 2.0 Specification". “A Notification is a Request object without an "id" member. A Request object that is a Notification signifies the Client's lack of interest in the corresponding Response object, and as such no Response object needs to be returned to the client. The Server MUST NOT reply to a Notification, including those that are within a batch request. Notifications are not confirmable by definition, since they do not have a Response object to be returned. As such, the Client would not be aware of any errors (like e.g. "Invalid params", "Internal error").”
  4. 4"JSON-RPC 2.0 Specification". “result: This member is REQUIRED on success. This member MUST NOT exist if there was an error invoking the method. The value of this member is determined by the method invoked on the Server.”
  5. 5"JSON-RPC 2.0 Specification". “error: This member is REQUIRED on error. This member MUST NOT exist if there was no error triggered during invocation. The value for this member MUST be an Object as defined in section 5.1.”
  6. 6. “Error object: When a rpc call encounters an error, the Response Object MUST contain the error member with a value that is an Object with the following members: (code) - A Number that indicates the error type that occurred. This MUST be an integer. (message) - A String providing a short description of the error. The message SHOULD be limited to a concise single sentence. (data) - A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).”

External links

  • Official website
  • JSON-RPC Google Group discussing topics of and around the protocol
  • JSON-RPC specifications, MNlinks etc.
  • HTTP transport description for JSON-RPC-2
  • OpenRPC Specification Service description format for JSON-RPC. (open-api, but for json rpc)
  • JSend - a similar specification which defines only format of response

Request and response:

--> {"version": "1.1", "method": "confirmFruitPurchase", "params": [["apple", "orange", "mangoes"], 1.123], "id": "194521489"}
<-- {"version": "1.1", "result": "done", "error": null, "id": "194521489"}

Version 1.0

Request and response:

--> {"method": "echo", "params": ["Hello JSON-RPC"], "id": 1}
<-- {"result": "Hello JSON-RPC", "error": null, "id": 1}
"JSON-RPC 2.0 Specification"
  • 7https://modelcontextprotocol.io/docs/learn/architecture
  • Created
    11 Jul 2005
    History
    399 edits
    283 contributors
    No edits in the last 30 days
    Last edited
    26 Jun 2026

    399 revisions in total · 283 contributors

    1. 26 Jun 2026, 15:52 UTCTemporary accountUndid revision 1360729096 by ~2026-36308-64 (talk)−3,830diff
    2. 23 Jun 2026, 06:33 UTCTemporary accountrevertedNo edit summary+3,830diff
    3. 17 Jun 2026, 22:37 UTCTemporary accountUndid revision 1359874913 by ~2026-35551-76 (talk)+2,250diff
    4. 17 Jun 2026, 19:45 UTCTemporary accountreverted§ Examples−2,250diff
    5. 15 May 2026, 12:36 UTCTemporary account§ Usage Clarity. Took several reads to grok that the table (where-was) did not involve notifications.+39diff
    6. 11 May 2026, 18:44 UTCTruegamer23§ See also I added MCP to a related article since MCP implements JSON-RPC+155diff
    7. 10 Mar 2026, 19:30 UTCCosmia Nebula§ Version 2.0 errors+2,158diff
    8. 22 Oct 2025, 17:18 UTCYourLocalZakkFromSomewhere§ growthexperiments-addlink-summary-summary:2|0|0+30diff

    View full revision history

    Created
    11 Jul 2005
    History
    399 edits
    283 contributors
    No edits in the last 30 days
    Last edited
    26 Jun 2026

    Related articles are unavailable right now.

    Wikipedia is rate limiting us right now. Try again in a minute.