Every operation you need
Get all, get by id, save one or many, master save, update by id, update many, remove by id or by query, query, count and distinct. On MongoDB also replace by id, array operations and aggregate.
API Maker
The framework for AI era
Database APIs
Connect a database. Every table and collection gets its REST APIs at once.
API Maker reads your databases and serves APIs for every table: list, read, save, update, delete, query, count, distinct values and streams. Use them straight on the table, or as schema APIs that check every write. No code to write for any of it.
Step through it, slow it down, or open the full canvas.
Connect any of 8 databases. Pick the connection string from your Secret. API Maker connects and lists every database, table and collection.
Pick the connection string from your Secret. API Maker connects and lists every database, table and collection.
A MongoDB collection gets 17 generated APIs, from get all and streams to aggregate. A SQL table gets 14. No code.
The schema is detected from the data (the first 100 documents, or the table columns). Its 17 schema APIs validate every write.
find, sort, limit and select shape the answer on the server. skip, deep and getTotalCount are there too.
A schema API answers 400 with a clear message for every field, and saves valid data with 201.
The stream APIs read and send 1000 rows at a time and wait for the client, so memory stays flat whatever the size.
Get all, get by id, save one or many, master save, update by id, update many, remove by id or by query, query, count and distinct. On MongoDB also replace by id, array operations and aggregate.
Generated APIs work straight on the table. Schema APIs use the schema of the table to convert and validate every write, and to follow relations. The schema is detected for you and stays editable.
find, sort, skip, limit and select work the same on every database, with operators like $gt, $in, $and and $or. getTotalCount adds the total for paging.
The stream APIs read 1000 rows at a time and wait for the client, so exporting millions of rows keeps memory flat.
Populate related rows with deep, or filter on fields of related tables with find, even when they live in another database.
Every API needs a token unless you make it public, and groups decide which APIs and fields each user can use.
Every table gets these APIs under /api/gen. Tables with a schema get them again under /api/schema, where each request goes through the schema first. The examples use the products table of the main database of an instance named shop, and admin as the API path of the account.
Base path/api/gen/<api path>/<instance>/<database>
| API | Method and path | What it does | Example |
|---|---|---|---|
| Get all | GET/:table | Rows of the table, filtered, sorted, paged and trimmed to some fields by the query string. | |
| Get all by stream | GET/:table/stream | The same filters as get all. The rows are sent as a stream, for exports of any size. | |
| Get by id | GET/:table/get-by-id/:id | One row by its id. Add a column name after the id to find the row by that column instead. | |
| Save single or multiple | POST/:table/save-single-or-multiple | Insert one row, or an array of rows in one call. | |
| Master save | POST/:table/master-save | A row with its related rows, following the relations of the schema: rows with an id are updated, the others inserted. | |
| Array operationsMongoDB only | PUT/:table/array-operations | Push, add to set, pull, pop or set items of an array field, in the documents that match find. | |
| Update many | PUT/:table/update-many | Set the same fields on every row that matches find. | |
| Update by id | PUT/:table/update-by-id/:id | Change some fields of one row. upsert and returnDocument go in the query string. | |
| Replace by idMongoDB only | PUT/:table/replace-by-id/:id | Replace a whole document with the body. | |
| Remove by id | DELETE/:table/:id | Remove one row by its id. | |
| Query | POST/:table/query | find, sort, skip, limit, select and deep in a JSON body, for filters too long for a URL. | |
| Query by stream | POST/:table/query-stream | The query API, with the rows sent as a stream. | |
| Remove by query | POST/:table/query/delete | Remove every row that matches find. A missing or empty find is refused. | |
| AggregateMongoDB only | POST/:table/aggregate | Run a MongoDB aggregation pipeline on the collection. | |
| Count | POST/:table/count | How many rows match find. | |
| Distinct | GET/:table/distinct/:field | Unique values of one or more fields. Add /asc or /desc after the fields to choose the order. | |
| Distinct with query | POST/:table/distinct/:field | Unique values of the fields, among the rows that match find. | |
GET /api/gen/admin/shop/main/products?find={"stock":{"$gt":0}}&sort=price&limit=10&select=name,price&getTotalCount=truex-am-authorization: <API user token>admin is the API path of your account, shop the instance, main the database and products the table.
POST /api/schema/admin/shop/main/products/queryx-am-authorization: <API user token>{ "find": { "stock": { "$gt": 0 }, "category": { "$in": ["mouse", "keyboard"] } }, "sort": { "price": 1 }, "limit": 10}{ "success": true, "statusCode": 200, "data": [ { "_id": "66f1c2…", "name": "Mouse", "price": 19 }, { "_id": "66f1c3…", "name": "Keyboard", "price": 49 } ], "totalCount": 42}Generated APIs (/api/gen) run your request on the table as it is. Schema APIs (/api/schema) first apply the schema of the table: type conversions, default values, validations, encryption and relations. Both exist for every table that has a schema.
API Maker detects it: from the columns of a SQL table, or from the first 100 documents of a MongoDB collection. You can edit it afterwards to add validations and relations.
No. The generated APIs are generic routes, so a new table is served by the same handlers.
Yes. Pre and post hooks run your TypeScript before and after any generated API, and custom APIs cover everything else.