Build a CRUD API Without Code
Build a complete REST API with database operations using Tensorify's visual editor. No Express, no Django, no boilerplate — just drag nodes, connect them, and deploy.
Uses: API Trigger, Switch, DB Find, DB Insert, DB Update, DB Delete, Return Time: ~15 minutes Template: CRUD API
A REST API with four endpoints on a single path:
| Method | Action | Description |
|---|---|---|
| GET /items | Read | Fetch all items from the database |
| POST /items | Create | Insert a new item |
| PUT /items?id=123 | Update | Update an existing item by ID |
| DELETE /items?id=123 | Delete | Remove an item by ID |
- A Tensorify workspace
- A PostgreSQL database (or any supported database)
DATABASE_URLenvironment variable configured
The fastest way is to use the CRUD API template:
- Go to Templates → APIs → CRUD API
- Click Use template
Or build from scratch following the steps below.
- Drag an API Trigger onto the canvas
- Configure:
- Protocol:
rest - Path:
/items - Allowed Methods:
GET,POST,PUT,DELETE - Auth Type:
bearer-token(recommended for production) - Response Mode:
use-workflow-response
- Protocol:
- Add a Switch node
- Set Condition to:
{{ api_request.method }} - Add cases:
GET,POST,PUT,DELETE - Set Match Mode to
exact
Connect the API Trigger outputs to the Switch input.
- Add a DB Find node
- Configure:
- Table:
items - Columns:
* - Limit:
50
- Table:
- Connect Switch
GEToutput → DB Find input
- Add a DB Insert node
- Configure:
- Table:
items - Data:
{{ api_request.body }}
- Table:
- Connect Switch
POSToutput → DB Insert input
- Add a DB Update node
- Configure:
- Table:
items - Data:
{{ api_request.body }} - Where:
id = '{{ api_request.query.id }}'
- Table:
- Connect Switch
PUToutput → DB Update input
- Add a DB Delete node
- Configure:
- Table:
items - Where:
id = '{{ api_request.query.id }}'
- Table:
- Connect Switch
DELETEoutput → DB Delete input
Add a Return node after each database operation. Connect each DB node's result output to a Return node's input.
For the POST return, you can set the status code to 201 (Created).
Go to Settings → Environment Variables and add:
DATABASE_URL— your PostgreSQL connection string (e.g.,postgresql://user:pass@host:5432/db)
- Click Deploy and choose cloud or CLI execution
- Open the Playground to test each endpoint:
# Create an item
curl -X POST https://triggers.tensorify.io/h/YOUR_PATH/items \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Widget", "price": 9.99}'
# List items
curl https://triggers.tensorify.io/h/YOUR_PATH/items \
-H "Authorization: Bearer YOUR_TOKEN"
# Update an item
curl -X PUT "https://triggers.tensorify.io/h/YOUR_PATH/items?id=1" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Updated Widget", "price": 14.99}'
# Delete an item
curl -X DELETE "https://triggers.tensorify.io/h/YOUR_PATH/items?id=1" \
-H "Authorization: Bearer YOUR_TOKEN"
To validate incoming data before database operations, add a Code node between the Switch and the DB Insert/Update:
import json
body = json.loads(data)
if not body.get("name"):
raise ValueError("name is required")
if not isinstance(body.get("price"), (int, float)):
raise ValueError("price must be a number")
result = body
The AI Agent's error branch catches exceptions and can return appropriate error responses.
- Build an API — Simpler API guide for beginners
- Expressions and Conditions — Master
{{ }}bindings - Webhook Automation — Handle incoming webhooks
- Deploy as an OpenAI Endpoint — Add AI capabilities to your API
