Invoke a function
Body
- Omit the body when the function declares no params (e.g.
device.health). - Field names must match the function’s
paramsschema from list functions. - Values are typically strings (ids as
"1,2,3", limits as"50"). JSON document fields accept objects or JSON strings. - Top-level
sql,operation, orparamsare forbidden — useinputfields from the registry. - Unexpected keys in
input→400.
Response
result is the Gateway/agent payload (rows, health body, or error), nested under data.
Auth
Use an API key with scopefunctions.invoke (and access to the device):
Write preflight
ForsqlPolicy: write (all *.create registry functions), Cloud first runs a read-only validation query on the device. If FKs / uniqueness / stock checks fail → HTTP 400 and the mutating SQL is not sent.

