JSON-2

Odoo JSON-2 API explained.

JSON-2 is Odoo 19's external API. HTTP to /json/2, bearer API keys, named arguments — and the layer an MCP server should call instead of deprecated XML-RPC.

Odoo MCP connecting ChatGPT, Claude, Gemini and MCP-compatible AI agents

JSON-2 is Odoo’s new external API, introduced in version 19 — see the Odoo 19 External API. It gives HTTP access to models and methods through /json/2. If you are building automation, integrations or AI agents in 2026, this is the API to learn.

JSON-2 example

A typical call:

POST https://your-odoo.example/json/2/res.partner/read
Authorization: bearer YOUR_API_KEY
Content-Type: application/json

{
  "ids": [1, 2, 3],
  "fields": ["name"]
}

The model and method live in the URL. Arguments are named JSON fields — there are no positional RPC args. On multi-database hosts you may also send X-Odoo-Database.

Why it exists

Why JSON-2 matters

Odoo 19 deprecated the traditional XML-RPC and JSON-RPC external endpoints (/xmlrpc, /xmlrpc/2, /jsonrpc). Current docs schedule those services for removal in Odoo 22 (fall 2028).

New work should be designed around JSON-2. That includes MCP servers that sit outside Odoo and need a stable HTTP API.

Full comparison: JSON-2 vs XML-RPC vs JSON-RPC. Official XML-RPC/JSON-RPC URLs by version: external API documentation map. Keys and bot users: JSON-2 authentication.

AI

Why JSON-2 is important for AI

AI agents need predictable tools. MCP can expose search_customers. The server then talks to Odoo over JSON-2:

AI → MCP → JSON-2 → Odoo

That split is the point. MCP is the AI-facing protocol. JSON-2 is the ERP API. They are not competitors — MCP vs JSON-2.

On Odoo Online the external API is Custom-plan only. An in-Odoo module can skip that gate. JSON-2 on Odoo Online · Odoo 19.4 MCP.

The contract

What JSON-2 actually is in Odoo 19

JSON-2 is Odoo’s External API for 19.0: HTTP POST to /json/2/<model>/<method>, JSON body with named arguments, Authorization: bearer <key>. It is easier to call from modern runtimes than XML-RPC’s execute_kw, and it is the API new MCP sidecars should use.

It is still the external API. Access rights apply. On Odoo Online, Odoo documents it as Custom-plan only — same commercial gate as XML-RPC, friendlier wire format. Community self-hosted does not use that Online plan gate.

It is not MCP. Assistants do not “speak JSON-2” unless you wrap methods as tools. MCP vs JSON-2.

Deprecation

Why you should not start XML-RPC in 2026

Odoo 19 deprecates the external XML-RPC and JSON-RPC services (/xmlrpc, /xmlrpc/2, /jsonrpc) and documents removal in Odoo 22, fall 2028. That is a migration clock, not a style preference.

Existing XML-RPC integrations should be scheduled. New ones should not be created unless you are on a version that has no JSON-2. MCP servers copied from 2024 gists are the usual source of new XML-RPC.

Comparison table and migration notes: JSON-2 vs XML-RPC vs JSON-RPC. Auth: JSON-2 authentication.

AI

Why JSON-2 keeps showing up in MCP articles

Every external MCP server needs an ERP API. On Odoo 19 that API is JSON-2. The interesting design is which methods you wrap, not whether you can POST.

In-Odoo MCP modules can ignore JSON-2 and use the ORM. That is why “do I need JSON-2 for MCP?” has two answers. External server: yes. Module: no.

19.4’s MCP connectivity sits beside this API, not on top of it as a replacement. Odoo 19.4 MCP.

Questions

FAQ

What is the Odoo JSON-2 API?

The External JSON-2 API, new in Odoo 19.0. You POST JSON to /json/2/<model>/<method> with Authorization: bearer and an API key. Odoo documentation.

Why did Odoo introduce JSON-2?

To replace the older XML-RPC and JSON-RPC external services. Those endpoints are deprecated in 19 and scheduled for removal in Odoo 22 (fall 2028). External API · JSON-2 vs XML-RPC.

Does JSON-2 bypass Odoo permissions?

No. Operations are checked against the authenticated user's access rights, record rules and field access.

Is JSON-2 the same as MCP?

No. JSON-2 is how software talks to Odoo. MCP is how compatible AI clients discover tools. An MCP server often calls JSON-2. MCP vs JSON-2.

Start read-only. Ask a real question.

Sandbox on sample data, or we put MCP on your instance.