How to create REST API

I want to create one rest API for adding leads in the CRM module

There are different ways to do this:

  1. Use the Frappe standard REST API. You can refer the documentation: REST API.
  2. Make your own API using server scripts. You can find out more about this here: Server Script.
  3. Create your own app and add a whitelist function for the API that you want to allow.