Contents
Odoo 20 has no read-only API key. A key can do everything its user can do, through any public method. Here is what that means when you hand a key to ChatGPT, Claude, an MCP server or an n8n flow, based on tests on a local Odoo 20 Community database on 2026-10-09.
- A key has no permissions of its own. In Odoo 20 Community the only scope offered for a new key is
RPC. The scope decides where the key may sign in, not what it may do. - The JSON-2 API calls any public method.
/json/2/<model>/<method>runsunlink,action_confirmoraction_cancelas readily assearch_read, within the rights of the key's user. - The free way to limit a key is a dedicated user with minimal access rights, as Odoo's documentation recommends. Access rights work per model and per operation: they cannot say "may confirm but not cancel" or "at most 10 records per call".
- An ordinary update can delete. When an agent edits a sales order, some of the values it may send for the order lines remove lines, with no delete call at all.
- A truly read-only key must also stop the writes that buttons such as Confirm make behind the scenes.
What a key can do by default
A user creates a key in My Preferences > Security. The key signs in as that user, with all of that user's access rights. In Odoo 20 Community, the scope field of a new key offers a single choice, RPC. Odoo's documentation describes an MCP scope for Odoo's own MCP server, which is not part of Community; we did not test it.
The JSON-2 endpoint looks the method up by name and calls it. On 2026-10-09 one admin key read sales orders with search_read, then confirmed one with:
POST /json/2/sale.order/action_confirm
Authorization: bearer <key>
{"ids": [3]}
The answer was true and the order moved to Sales Order. Nothing in the key said it was meant for reading.
Two smaller facts about keys in Odoo 20: a user who is not an administrator must give a key an expiry date ("The API key must have an expiration date"), and every call to /xmlrpc, /xmlrpc/2 or /jsonrpc logs that these endpoints are "deprecated in Odoo 19 and scheduled for removal in Odoo 22". They still accept keys.
The free way: a dedicated user
Odoo's documentation on the JSON-2 API recommends dedicated bot users for integrations, with the minimum permissions they need. For an AI assistant that only answers questions:
- Create a user for the assistant and give it only read access to the models it needs (a group of your own with read rights works).
- Create the API key while signed in as that user.
- Give the assistant that key, never a password.
Where this stops:
- Each integration needs its own user; check what an extra user costs on your plan.
- Groups add up. If one group of the user grants delete on a model, no other group takes it away.
- A user who may write to orders may also call every button on them. Access rights have no list of allowed methods.
- Access rights have no limit on how many records one call may change.
Why a read-only key has to check every write
AI agents write JSON, and an ordinary update to a sales order can remove its lines. Buttons such as Confirm also write other records behind the scenes. So a key that should only read has to refuse every write made during its calls, not only the calls whose names sound like writes.
In our tests on 2026-10-09, a read-only key could still search and read records, and all five kinds of writes we tried were refused, including confirming an order.
Per-key rules as a module
We packaged these checks as a module for Odoo 19 and 20, AI API Key Permissions (paid, by GRAMSHIFT, which publishes this site). It adds a rule to each API key: read-only, no deletes, only the methods you list, and a limit on records per call. Its page lists exactly what each rule covers. A dedicated user for each tool, as above, works well together with it. It is listed for Odoo 20, Odoo 19.
How this was tested: on a local Odoo 20 Community database (Odoo source as of 2026-10-06) with test sales orders, over JSON-2, XML-RPC and JSON-RPC, on 2026-10-09. The order-line results were read back from the database after each call. Statements about Odoo's MCP server and about dedicated bot users come from Odoo's documentation; the MCP server was not tested. This page is not affiliated with Odoo S.A. On the use of AI: the test scripts, the module and this article were written by Claude, an AI model, working for GRAMSHIFT; the results quoted here were compared against the saved outputs of those scripts.
Frequently asked questions
Can I make an Odoo API key read-only?
Not with standard Odoo 20: every key carries all the rights of its user, and the only scope offered in Community is RPC, which says where the key may sign in, not what it may do. The free way is to create the key for a dedicated user that only has read access rights. To make the key itself read-only, a per-key rule is needed: AI API Key Permissions does this, and in our tests on 2026-10-09 reads such as search_read and web_search_read worked with a read-only key while every write we tried, including action_confirm, was refused.
How do I stop an AI agent from deleting records in Odoo?
Give the agent a key whose user has no delete right on the models it uses. If the user may delete order lines, as most sales users may in order to edit quotations, an ordinary update from the agent can still remove lines. A no-delete rule on the key, such as the one in AI API Key Permissions, refuses every delete made during the agent's calls, including deletes inside an update or a button.
Does an MCP server limit what an Odoo API key can do?
An MCP server that connects with a standard Odoo API key can do whatever the key's user can do, unless the server itself restricts its tools. According to Odoo's documentation, Odoo's own MCP server uses a key with the MCP scope and the permissions of its user, and the tools it offers are set per database; we did not test it. Check what your MCP server exposes, and give it a key of a user with minimal rights.
Is AI API Key Permissions available for Odoo 19?
Yes. AI API Key Permissions is listed separately for Odoo 20 and Odoo 19 on the Odoo Apps Store, with the same per-key rules: read-only, no deletes, allowed methods and a limit on records per call.