support Click to see our new support page.
support For sales enquiry!

Odoo Rest API Format: A Simple Guide for Beginners

Odoo Rest API Format Banner Image

Rufaid ACApril 14, 2026

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.

 

0

Leave a Comment

Subscribe to our Newsletter

Sign up to receive more information about our latest offers & new product announcement and more.