arrow_back Back to Blog

How to Create an API Key in Odoo (All Versions)

API keys allow external tools — like our Gmail extension — to connect securely to your Odoo instance without using your password. The process to create one varies slightly depending on your Odoo version. This guide covers every version from Odoo 14 to 19 with step-by-step instructions.

1 Before You Begin

Before creating an API key, make sure you meet these requirements:

  • You must be logged in to your Odoo instance
  • You need an internal user account (not a portal user)
  • You should know which Odoo version you are using

To check your Odoo version, look at the bottom of the Settings page or ask your system administrator.

Odoo profile menu showing My Profile option
Odoo profile menu showing My Profile option

2 Odoo 14-15

In Odoo 14 and 15, API keys are found under the "Developer API Keys" section in your user preferences.

Navigate to: Profile icon (top right) → My Profile → Account Security tab

warning Odoo 15 only: If you don't see the "Developer API Keys" section, you need to activate Developer Mode first. Go to Settings → Developer Tools → Activate the developer mode, then return to your profile.
  1. Click "New API Key"
  2. Enter a name for your key (e.g., "Gmail Extension")
  3. Click the confirmation button
  4. Copy the generated key immediately — it cannot be retrieved later

In these versions, API keys are permanent — they never expire.

3 Odoo 16-17

Starting from Odoo 16, the API Keys section was renamed and no longer requires Developer Mode.

Navigate to: Profile icon (top right) → My Profile → Account Security tab

  1. Click "New API Key"
  2. Enter a name for your key (e.g., "Gmail Extension")
  3. Click the confirmation button
  4. Copy the generated key immediately — it cannot be retrieved later

API keys in Odoo 16-17 are permanent — they never expire.

Odoo 16

Account Security tab showing API Keys section in Odoo 16
Account Security tab showing API Keys section in Odoo 16
API Key creation wizard in Odoo 16
API Key creation wizard in Odoo 16
Generated API key in Odoo 16
Generated API key in Odoo 16

Odoo 17

Account Security tab showing API Keys section in Odoo 17
Account Security tab showing API Keys section in Odoo 17
API Key creation wizard in Odoo 17
API Key creation wizard in Odoo 17
Generated API key in Odoo 17
Generated API key in Odoo 17

4 Odoo 18

Odoo 18 introduces key expiration. When creating an API key, you must choose how long it will be valid.

Navigate to: Profile icon (top right) → My Profile → Account Security tab

  1. Click "New API Key"
  2. Enter a name for your key (e.g., "Gmail Extension")
  3. In the duration selector, choose "Persistent Key"
  4. Click "Generate key"
  5. Copy the generated key immediately — it cannot be retrieved later
warning If you don't select "Persistent Key", your API key will expire after the chosen duration, and the extension will stop working. You would need to create a new key and reconfigure the extension.
Account Security tab showing API Keys with expiration date column in Odoo 18
Account Security tab showing API Keys with expiration date column in Odoo 18
API Key creation wizard with duration selector in Odoo 18
API Key creation wizard with duration selector in Odoo 18
Generated API key in Odoo 18
Generated API key in Odoo 18

5 Odoo 19+

Odoo 19 redesigned the user preferences interface. The path and button names have changed, but the process is similar to Odoo 18.

Navigate to: Profile icon (top right) → My Preferences → Security tab

  1. Click "Add API Key"
  2. Enter a name for your key (e.g., "Gmail Extension")
  3. In the duration selector, choose "Persistent Key"
  4. Click "Generate key"
  5. Copy the generated key immediately — it cannot be retrieved later
warning Same as Odoo 18: always select "Persistent Key" to avoid expiration.

In Odoo 19, existing API keys are displayed as cards (kanban view) instead of a list.

Security tab showing API Keys in kanban view in Odoo 19
Security tab showing API Keys in kanban view in Odoo 19
API Key creation wizard with duration selector in Odoo 19
API Key creation wizard with duration selector in Odoo 19
Generated API key in Odoo 19
Generated API key in Odoo 19

6 Quick Reference

Version Path Button Dev Mode Expiration
Odoo 14 My Profile → Account Security New API Key No Permanent
Odoo 15 My Profile → Account Security New API Key Yes Permanent
Odoo 16-17 My Profile → Account Security New API Key No Permanent
Odoo 18 My Profile → Account Security New API Key No Must select "Persistent"
Odoo 19+ My Preferences → Security Add API Key No Must select "Persistent"

7 Troubleshooting

"Invalid API Key" error

Double-check that you copied the entire key without extra spaces. If using Odoo 18+, make sure the key hasn't expired — create a new one with "Persistent Key" selected.

"API Key expired"

This happens in Odoo 18+ when the key was created without selecting "Persistent Key". Create a new key and select "Persistent Key" as the duration.

Can't find the API Key button

In Odoo 15, you need to activate Developer Mode first (Settings → Developer Tools → Activate). In Odoo 19+, the section moved to My Preferences → Security (not Account Security).

"Connection timeout" error

Verify that your Odoo URL is correct and accessible. Make sure to include https:// and remove any trailing slash.

Ready to connect?

Now that you have your API key, install the extension and connect your Odoo instance to Gmail in seconds.

Get the Extension