Functions

Poly has three callable function kinds. After you generate an SDK they all show up as poly.<context>.<name>. They run in different places.

Need an endpoint, job, trigger, snippet, or AI Function as well? Start at Choosing a Poly resource.

Kind

Runs

Use when

API Function

Poly gateway, as a trained HTTP call to a third-party API

You already have an HTTP API and want auth, URL, and body templating in the catalog

Server Function

Poly’s Knative FaaS

You need hosted logic, a webhook/job/GraphQL target, logs, or a callable from any SDK language

Client Function

The caller’s process (your laptop, or inside a server function)

You want a same-language helper that is fast and is not billed as a server execution

Older training copy called these custom functions. The name to use is server function.

How names work

Each function has a context (namespace, may contain periods) and a name.

The SDK path is poly.<context>.<name>. Nested context becomes nested objects: context some.custom.context plus name fn is poly.some.custom.context.fn.

The fully-qualified token is context.name, or just context if there is no name, or just name if there is no context. Context is case-sensitive.

Within one environment, context + name is unique. If a tenant-level or public function uses the same pair, the environment-level function wins at generate and execute.

Create vs execute

  • Train creates API functions (Postman or OpenAPI).

  • Deploy (function add --server / --client, or Project Glide) creates server and client functions.

  • Execute applies to API and server functions (POST /functions/api/:id/execute and POST /functions/server/:id/execute). Client functions have no execute route; their code runs in-process.

Permissions (v1 API key flags):

  • Create/update/delete API functions: Manage API Functions

  • Create/update/delete server or client functions: CustomDev

  • Execute API or server functions: Execute

See API Key Permissions.

Onward