concepts / apis
Stable

APIs

  • Request and response fields form the API contract.
  • Runnable source owns validation, entity work, and the response.
  • Pages call APIs through typed Page Script connections.

What An API Owns

Use an API when work starts from a page action or client request. The API validates input, loads or changes entity data, and returns one predictable result. Keep storage work behind the API instead of placing it in the page.

Screenshot
API contract and source

API information view with request fields, response fields, and runnable source.

Request And Response Contract

Request fields describe accepted input. Response fields describe the result consumers can read. Required, optional, transformed, and validated fields belong in this metadata-backed contract.

Runnable Workflow

Runnable source reads the provided request, performs backend work, and returns one Response value that matches the response contract.

apis/tasks/complete.api.nenu
1need task = Task(request.task_id)23task.done = true4save(task)56return Response {7  success: true8  task_id: task.id9}

Calling An API From A Page

In Plug mode, select a page action and connect it to an API. Map page values into request fields, then bind response fields to page state, status text, navigation, or another visual action. Contract diagnostics identify missing or incompatible values.