Skip to main content

Invoke a function

Body

  • Omit the body when the function declares no params (e.g. device.health).
  • Field names must match the function’s params schema 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, or params are forbidden — use input fields 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 scope functions.invoke (and access to the device):

Write preflight

For sqlPolicy: 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.

Rate limits

Plan-based limits apply per API key (same ceiling as your account plan). See Rate limits.