API Endpoints

Copy any curl request below and paste directly into Postman or your terminal. Or try it out in our interactive demo.

Core APIs

GEThttps://leafapi.com/api/project1/module1

Retrieve all data records from a module

CURL REQUEST:

curl -X GET "https://leafapi.com/api/project1/module1" \ -H "LEAF_API_KEY: LEAF_API_KEY_HERE"
POSThttps://leafapi.com/api/project1/module1

Create a new record in a module

CURL REQUEST:

curl -X POST "https://leafapi.com/api/project1/module1" \ -H "LEAF_API_KEY: LEAF_API_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{"name":"New Record","data":"value"}'
GEThttps://leafapi.com/api/project1/module1/:id

Retrieve details of a specific record

CURL REQUEST:

curl -X GET "https://leafapi.com/api/project1/module1/123" \ -H "LEAF_API_KEY: LEAF_API_KEY_HERE"
PATCHhttps://leafapi.com/api/project1/module1/:id

Partially update a specific record

CURL REQUEST:

curl -X PATCH "https://leafapi.com/api/project1/module1/123" \ -H "LEAF_API_KEY: LEAF_API_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{"status":"active"}'
PUThttps://leafapi.com/api/project1/module1/:id

Completely replace a record

CURL REQUEST:

curl -X PUT "https://leafapi.com/api/project1/module1/123" \ -H "LEAF_API_KEY: LEAF_API_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{"name":"Updated Name","data":"new value"}'
DELETEhttps://leafapi.com/api/project1/module1/:id

Delete a specific record from a module

CURL REQUEST:

curl -X DELETE "https://leafapi.com/api/project1/module1/123" \ -H "LEAF_API_KEY: LEAF_API_KEY_HERE"

Additional Operations

Use the following API to delete an entire module and all its records at once.

DELETEhttps://leafapi.com/api/project1/module2

Delete entire module and all its records - use with caution

CURL REQUEST:

curl -X DELETE "https://leafapi.com/api/project1/module2" \ -H "LEAF_API_KEY: LEAF_API_KEY_HERE"