API Maker

The backend engine for the AI era

API reference

The URLs of every API

One server. One token header. Your tables, your own code and the ready-made tools each get a path of their own.

Try it

Build the URL of a table API

Type the names of your own server and table. Pick an operation. The URL and its curl command follow.

Family
POSTCount
https://api.example.comserver/apiprefix/schemafamily/adminuser path/shopinstance/maindatabase/productstable/countoperation

How many rows match a find. Read the docs

curl
curl -X POST 'https://api.example.com/api/schema/admin/shop/main/products/count' \
  -H 'x-am-authorization: <token>' \
  -H 'content-type: application/json' \
  -d '{ "find": { "status": "ACTIVE" } }'
/api Prefix
Always there.
/schema or /gen Family
Schema APIs check writes. Gen APIs do not.
/admin User path
The API path of the account that owns the instance. It is admin for the first admin.
/shop Instance
A database server you connected. For a tenant : name::tenant.
/main Database
A database on that server.
/products Table
A table, or a MongoDB collection.
/count Operation
What to do. Nothing after the table means get all.

Two families

Schema or gen ?

Each table gets its APIs twice. The paths and operations are the same. Only the handling of your data differs.

/api/schemaRecommended for writes

  • Reads the schema of the table.
  • Converts values to their types, validates them, encrypts and fills defaults.
  • Needs a schema. Without one, it answers 400.

Use it for the tables your app writes to.

/api/genNo schema needed

  • Works on every table, with or without a schema.
  • Passes your data as it is. A number sent as "22" stays a string.
  • Same paths, same query params, same answers.

Use it for quick reads, and tables without a schema.

Table APIs

17 operations on every table

Each path comes after /api/schema/<user-path>/<instance>/<database>/<table>, or the same under /api/gen. A dimmed part is optional.

OperationMethod and pathWhat it doesTry it
Read Get rows, count them, or find unique values.
Get allGET/Rows of the table. Filter, sort and page them with query params.
Get all by streamGET/streamSame as get all, sent as rows are read. For exports and big tables.
Get by idGET/get-by-id/:id/:primaryKeyOne row by its primary key, or by another column.
QueryPOST/queryFind rows with a JSON body : find, select, sort, skip, limit, deep.
Query by streamPOST/query-streamSame as query, sent as rows are read.
CountPOST/countHow many rows match a find.
DistinctGET/distinct/:field/:orderThe unique values of a column.
Distinct with queryPOST/distinct/:field/:orderThe unique values of a column, among the rows that match a find.
AggregateMongoDBPOST/aggregateRun a MongoDB aggregation pipeline.
Write Insert and change rows.
Save single or multiplePOST/save-single-or-multipleInsert one row, or a list of rows.
Master savePOST/master-saveSave a row with its related rows in other tables, in one call.
Update by idPUT/update-by-id/:id/:primaryKeyChange some fields of one row.
Update manyPUT/update-manyChange every row that matches a find.
Replace by idMongoDBPUT/replace-by-id/:id/:primaryKeyPut a whole new document in place of one.
Array operationsMongoDBPUT/array-operationsPush, pull, pop or set items of array fields.
Remove Delete rows.
Remove by idDELETE/:id/:primaryKeyDelete one row, and get it back.
Remove by queryPOST/query/deleteDelete every row that matches a find.

Every read takes the same query params : find, select, sort, skip, limit, deep, getTotalCount. The query APIs take them in the body. How the table APIs work

Your code

Your own APIs, and live messages

Custom APIs

/api/custom-api/<user-path>/<your path>

GETPOSTPUTDELETE

A function in TypeScript, Python, PHP, C#, Go, Rust, Java or Kotlin. You choose its path and method. It answers as soon as you save it.

Custom APIs

WebSockets

wss://<your host>/?x-am-authorization=<token>

Same host and port as the APIs, with ws:// on plain HTTP. Apps listen for the calls of a table, a custom API, a system API or an event of yours.

WebSockets

Code without a URL

Some of your code runs on its own, with no path to call.

Ready-made tools

23 system APIs

All are POST under /api/system-api/<user-path>. They are closed to outside callers until their settings open them. Only /token is open. Your code calls each of them through g.sys.

About the system APIs