Instant API
Instant API is the data API layer that every Lovrabet dataset gets out of the box. As soon as a dataset exists, the platform can serve 9+ common APIs around it — list queries, record details, writes, batch writes, aggregations, option data, and exports.
Its key value isn't "fewer CRUD endpoints to write" — it's that pages, server-side jobs, third-party systems, and Agents all work against the same business model. DBAgent first reconstructs the business objects and their relationships; Instant APIs, SDKs, pages, and Backend Function Hooks then share that same business semantics.
1. What Problems Does Instant API Solve?
| Problem | Without Instant API | With Instant API |
|---|---|---|
| List pages | Hand-write a list endpoint for every table | Just call filter |
| Detail pages | Hand-write a query-by-ID endpoint | Just call getOne |
| Form submissions | Hand-write create, update, and delete endpoints | Just call create / update / delete |
| Bulk imports | Loop create from the frontend or build a custom bulk endpoint | Just call batchCreate |
| Analytics dashboards | Write SQL or a BFF from day one | Start with aggregate for common statistics |
| Dropdowns | Write an options endpoint for every selector | Just call getSelectOptions |
| Exports | Filtering and export logic drift apart | excelExport reuses the query conditions |
2. Standard Execution Chain
页面 / 服务端 / Agent / 第三方系统
|
v
SDK / OpenAPI / Runtime CLI
|
v
Before Hook
|
v
Instant API
|
v
After Hook
|
v
JSON / 文件 URL / 业务结果You don't have to write Before Hooks or After Hooks every time. By default, Instant API works as-is; add Hooks only when your business needs shared validation, authorization, data masking, or field enrichment.
3. Common Ways to Call Instant API
| Calling method | Best for | Typical entry |
|---|---|---|
| TypeScript SDK | Web, Node.js, SSR, mini programs, Agent runtimes | client.models.orders.filter(...) |
| Java OpenSDK | Spring Boot, Java services, batch jobs, enterprise system integration | LovrabetSDKClient |
| Runtime CLI | Debugging, automation scripts, Agent tool execution | lovrabet data filter --code ... |
| OpenAPI | Third-party systems, languages without an SDK, external services | AccessKey + HTTP |
4. Boundary with Backend Function
Instant API targets standard actions on a single dataset. Whenever the business goal can be expressed as "query, modify, aggregate, or export a dataset," prefer Instant API.
Reach for a Backend Function Endpoint when a business action spans multiple datasets, calls external services, or requires transaction orchestration, compensation, or async processing. An Endpoint can call Instant APIs internally, but it is itself a higher-level business orchestration entry point.
5. Naming Conventions
Always use Instant API. Don't call this set of capabilities "standard APIs," "instant OpenAPI," or "auto-generated CRUD APIs." When maintaining legacy docs, you may map old names to the new one, but new documentation and product pages must use Instant API.