Odoo Rest API Format: A Simple Guide for Beginners

Afghanistan Åland Islands Albania Algeria American Samoa Andorra Angola Anguilla Antarctica Antigua and Barbuda Argentina Armenia Aruba Australia Austria Azerbaijan Bahamas Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bermuda Bhutan Bolivia Bosnia and Herzegovina Botswana Bouvet Island Brazil British Indian Ocean Territory British Virgin Islands Brunei Bulgaria Burkina Faso Burundi Cambodia Cameroon Canada Cape Verde Caribbean Netherlands Cayman Islands Central African Republic Chad Chile China Christmas Island Cocos (Keeling) Islands Colombia Comoros Congo Cook Islands Costa Rica Croatia Cuba Curaçao Cyprus Czechia Denmark Djibouti Dominica Dominican Republic DR Congo Ecuador Egypt El Salvador Equatorial Guinea Eritrea Estonia Eswatini Ethiopia Falkland Islands Faroe Islands Fiji Finland France French Guiana French Polynesia French Southern and Antarctic Lands Gabon Gambia Georgia Germany Ghana Gibraltar Greece Greenland Grenada Guadeloupe Guam Guatemala Guernsey Guinea Guinea-Bissau Guyana Haiti Heard Island and McDonald Islands Honduras Hong Kong Hungary Iceland India Indonesia Iran Iraq Ireland Isle of Man Israel Italy Ivory Coast Jamaica Japan Jersey Jordan Kazakhstan Kenya Kiribati Kosovo Kuwait Kyrgyzstan Laos Latvia Lebanon Lesotho Liberia Libya Liechtenstein Lithuania Luxembourg Macau Madagascar Malawi Malaysia Maldives Mali Malta Marshall Islands Martinique Mauritania Mauritius Mayotte Mexico Micronesia Moldova Monaco Mongolia Montenegro Montserrat Morocco Mozambique Myanmar Namibia Nauru Nepal Netherlands New Caledonia New Zealand Nicaragua Niger Nigeria Niue Norfolk Island Northern Mariana Islands North Korea North Macedonia Norway Oman Pakistan Palau Palestine Panama Papua New Guinea Paraguay Peru Philippines Pitcairn Islands Poland Portugal Puerto Rico Qatar Réunion Romania Russia Rwanda Saint Barthélemy Saint Helena, Ascension and Tristan da Cunha Saint Kitts and Nevis Saint Lucia Saint Martin Saint Pierre and Miquelon Saint Vincent and the Grenadines Samoa San Marino São Tomé and Príncipe Saudi Arabia Senegal Serbia Seychelles Sierra Leone Singapore Sint Maarten Slovakia Slovenia Solomon Islands Somalia South Africa South Georgia South Korea South Sudan Spain Sri Lanka Sudan Suriname Svalbard and Jan Mayen Sweden Switzerland Syria Taiwan Tajikistan Tanzania Thailand Timor-Leste Togo Tokelau Tonga Trinidad and Tobago Tunisia Türkiye Turkmenistan Turks and Caicos Islands Tuvalu Uganda Ukraine United Arab Emirates United Kingdom United States United States Minor Outlying Islands United States Virgin Islands Uruguay Uzbekistan Vanuatu Vatican City Venezuela Vietnam Wallis and Futuna Western Sahara Yemen Zambia Zimbabwe Odoo
Published in Blog on April 14, 2026 3 min read
Odoo Rest API Format Banner Image

Have you ever tried connecting Odoo with a mobile app or another system and felt confused about the API structure? Many developers struggle to understand how the Odoo Rest API works, especially when it comes to request format, authentication, and response structure. This guide explains everything in plain language so you can start building integrations confidently.

 


What Is Odoo Rest API?

An Odoo Rest API allows external applications to communicate with your Odoo database using HTTP requests. It helps mobile apps fetch Odoo data, websites create sales orders, third-party tools update records, and external systems sync customer details.

 


Understanding Odoo Rest API Format

To work with Odoo REST endpoints, you need to understand the basic request and response structure.

Basic Request Structure

POST /api/endpoint

Content-Type: application/json

Authorization: Bearer your_token

Example JSON Request Body

 

{ "name": "John Doe", "email": "john@example.com", "phone": "9876543210" }



Typical JSON Response Format

 

{ "status": "success", "data": { "id": 45, "name": "John Doe", "email": "john@example.com" } }

 

{ "status": "error", "message": "Invalid API Key" }

 




Creating a Simple Odoo Rest API Endpoint

Below is an example of a basic controller in Odoo to create a customer record.

 from odoo import http

 from odoo.http import request



 class CustomerAPI(http.Controller):



    @http.route('/api/customer/create', type='json', auth='public',     methods=['POST'], csrf=False)

    def create_customer(self, **post):



        name = post.get('name')

        email = post.get('email')



        if not name:

            return {'status': 'error', 'message': 'Name is required'}



        partner = request.env['res.partner'].sudo().create({

            'name': name,

            'email': email

        })



        return {

            'status': 'success',

            'data': {'id': partner.id, 'name': partner.name}

        }

 

 


Common HTTP Methods

GET – Fetch records

POST – Create records

PUT – Update records

DELETE – Remove records

 


Authentication in Odoo Rest API

Common methods include public access (for testing), user authentication, and token-based authentication for production use.

Best Practices

  • Always return JSON
  • Use consistent response structure
  • Validate input data
  • Avoid exposing internal fields
  • Handle exceptions properly

 


Conclusion

Understanding Odoo Rest API format does not have to be complicated. Use JSON consistently, validate inputs, implement authentication, and follow REST conventions. Once you understand the structure, building integrations becomes much easier.

 


Frequently Asked Questions (FAQs)

  1. Does Odoo support REST API by default?

Odoo mainly uses XML-RPC and JSON-RPC by default. REST APIs are usually created using custom controllers.

  1. How do I secure my Odoo Rest API?

Use token-based authentication, validate headers, restrict access, and avoid exposing sensitive data.

  1. Can I use Odoo Rest API for mobile apps?

Yes. REST APIs are ideal for mobile applications because they use standard HTTP methods and JSON responses.

 

Hi...

Got ideas? We’ve got
the skills. Let’s team up.

Have a question or ready to discuss your project? Our team is here to help you scope, design, and deliver.

Trusted by Leading Businesses
Metro
Zabeel Equstrian
GEMS Logo
APSG Logo
Anisia Logo
Foodlinx Logo
🌐 +1
Select Subject?
send mail graphic