Skip to content
SecureKeys

Learn

Securing Odoo API keys and integrations

How Odoo API keys work, the three-month lifetime limit, the JSON-2 API that replaces XML-RPC, and a practical policy for integration accounts.

SecureKeys Engineering ·

Integrations (webshops, payment gateways, BI tools, scripts) often have broader access to Odoo than any person. Their credentials deserve the same care as an administrator’s.

How Odoo API keys work

Users create keys under Preferences → Account Security → New API Key. Odoo requires a description and a duration, generates a strong random key, and shows it only once. Odoo’s documentation states that keys cannot be created for more than three months, so long-running integrations must rotate keys at least quarterly. The key is sent as a bearer token and acts with the rights of the user who owns it.

On Odoo Online, external API access is limited to certain pricing plans; check yours before designing an integration.

Move to the JSON-2 API

Odoo 19 introduced the JSON-2 API (/json/2/<model>/<method>), and the older XML-RPC and JSON-RPC endpoints are deprecated with removal scheduled in a future version. New integrations should use JSON-2; existing ones need a migration plan.

A practical policy

  1. One integration, one user. Never use an administrator’s or a person’s account for an integration.
  2. Least privilege. Give that user only the groups the integration needs. A lead-capture form needs to create leads, not read invoices.
  3. Describe and date every key. Name keys after the system and owner, e.g. “Website lead form — IT”.
  4. Rotate before expiry. Create the new key, deploy it, verify, then delete the old one. Put the date in a calendar.
  5. Store keys as secrets. Use your platform’s secret store, never source code or shared documents.
  6. Delete on suspicion. If a key may be exposed, delete it immediately and issue a new one.
  7. Close password-based API access for people. With SecureKey 2FA, password-based XML-RPC/JSON-RPC is refused for users who have a security key, while API keys keep working.

Review quarterly

List every API key, its owner and last use; remove what nobody can explain. A planned feature of our free Odoo security assessment is to produce this list automatically.

References

  1. Odoo 20.0 documentation — External JSON-2 API
  2. Odoo 20.0 documentation — External RPC API (deprecated)

Odoo is a trademark of Odoo S.A. SecureKeys, SecureKey 2FA and Action Approvals are independent products by Novator Technologies. They are not official Odoo products and are not endorsed or supported by Odoo S.A. Trademark notice.

Plan your move beyond passwords

Talk to our engineers about phishing-resistant authentication for your organisation. We reply within one business day.