Skip to content

Functions API

Choose your fighter:

Follow the steps in the web app.

Functions belong to an organization. Choose the organization whose permissions, API keys, and spending should apply. The examples use acme; replace it with your organization slug. See authentication to sign in first.

Open Functions in your organization. Enter a name in Create a function and submit the form. Your function appears in the list; open it to edit its draft.

A draft is your editable function source. Saving a draft leaves published versions unchanged. function.json declares schemas and configuration; prompt functions use prompt.hbs, and TypeScript scripts use main.ts.

Open the function from the Functions list. Select a source file to edit it, then save the draft. If another edit conflicts with yours, review the latest saved draft and reconcile your changes before saving again.

Saving does not execute the function. The API specification describes accepted source files and the script-check endpoint.

Published versions are immutable. Publish a saved draft commit under a new version to make a change. A publish preview compares your schemas and suggests versions.

Use curl or str api to publish a saved draft. Select either option above for the preview and publish requests.

Publishing leaves the default unchanged. Select a published version explicitly, or clear the default when you no longer want one.

Use curl or str api to select or clear the default version.

Publishing and selecting a default do not execute the function.