Pre-alpha. No tagged release and no upgrade path between versions. Use for evaluation and development only, not production.
DevelopersPre-alpha

JSON-RPC API

Endpoint shape, authentication, common methods and error patterns.

Endpoints

Method / pathAuthPurpose
GET /api/healthNoneLiveness {"ok":true}
POST /api/rpcSession cookie or API keyModel RPC
Health check
health check
curl -s http://localhost:8080/api/health

Authentication

Use the sumeru_session cookie from /web/login, or send X-API-Key: sk_... (also Authorization: Bearer sk_...).

Request shape

Flat Sumeru JSON:

JSON
json
{  "model": "my.module",  "method": "search_read",  "args": [[], ["id", "name"]],  "kwargs": {"limit": 50, "offset": 0}}

A nested JSON-RPC params wrapper is also accepted. Responses use {ok, result, error}.

Methods

Methodargskwargsresult
search[domain?]limit, offsetList of records
search_read[domain, fields]limit, offsetProjected records
read[ids, fields?]-Records; missing ids -> NOT_FOUND
read_group[spec]-Grouped rows (sum/count)
call[id, method, vals?]-true or {redirect}
create[values]-New id
write[ids, values]-true
unlink[ids]-true
create_many[[values], ...]-List of ids
write_many[ids, values]-true
unlink_many[ids]-true

read_group spec includes domain, groupby, and fields with measure (sum or count). call invokes RegisterObjectAction handlers (same as form object buttons). See JSON-RPC reference.

call
text
curl -s http://localhost:8080/api/rpc \  -H 'Content-Type: application/json' \  -H 'X-API-Key: sk_YOUR_KEY' \  -d '{    "model": "core.user",    "method": "call",    "args": [42, "action_reset_password", {}]  }'
search_read
text
curl -s http://localhost:8080/api/rpc \  -H 'Content-Type: application/json' \  -H 'X-API-Key: sk_YOUR_KEY' \  -d '{    "model": "my.module",    "method": "search_read",    "args": [[], ["id", "name", "active"]],    "kwargs": {"limit": 50, "offset": 0}  }
create
text
curl -s http://localhost:8080/api/rpc \  -H 'Content-Type: application/json' \  -H 'X-API-Key: sk_YOUR_KEY' \  -d '{    "model": "my.module",    "method": "create",    "args": [{"name": "From API", "active": true}],    "kwargs": {}  }

Limits. Default kwargs.limit is 500 (hard cap). Deep offsets are clamped.

Compile and run

Terminal
shell
make runcurl -s http://localhost:8080/api/health

What not to do

  • Do not put API keys in query strings or non-HttpOnly storage.
  • Do not call mutating methods without understanding group ACLs for the key's user.
  • Do not treat pre-alpha error codes as a frozen public contract.

Next step

Verify behaviour in Testing, or create keys via API keys.