Publish a function version
Publish source code as the function’s new current version. A version never changes: publishing again appends one. allowedActions lists the actions the function may call, by name; each must exist in this environment and be enabled (400 ALLOWED_ACTION_UNAVAILABLE). A call to any other action is refused in the runner and again by the API. Budgets default to 50 action calls, 1,000 ms of CPU, 100 binding calls and 30,000 ms per run. straightThrough lets a run skip the plan for writes to some of those actions, up to a number of writes per run; without it a straight-through run reads and does not write.
JavaScript: an ES module whose default export is async function run(input, anlyon). Python: a module that defines run(input, anlyon). anlyon.invoke(action, input) and anlyon.read(action, input) call actions; anlyon.log(message) adds a line to the run. The function has no network, no environment variables and no secrets. A call answers { ok: true, result } or { ok: false, error }. result is the action invocation: the provider’s reply as text in result.body, and parsed in result.json (null when it is not JSON).
/api/v2/functions/{name}/versionsAuthorizationBearer token (Anlyon API key) · headerrequiredWorkspace API key sent as Authorization: Bearer <key>.
better-auth.session_tokenAPI key · cookierequiredBrowser session used by dashboard-only operations.
namestringrequiredThe function's name or id (fn_...).
X-Request-IdstringOptional caller correlation ID. Unsafe or oversized values are replaced.
application/jsonlanguagestringrequiredjavascriptpythonsourcestringrequiredOne module. At most 256 KB.
allowedActionsstring[]Action names the function may call. Each must exist and be enabled. Omitted, the list is read from the source's literal anlyon.invoke("…") and anlyon.read("…") calls; a source that computes an action name, or does not parse, needs it listed (400 ALLOWED_ACTIONS_REQUIRED).
inputSchemaobjectA JSON Schema the run's input must match.
budgetsFunctionBudgetsPer-run budgets. When one runs out the run ends budget_exceeded.
Show propertiesHide properties
maxActionCallsintegerAction calls dispatched in one run. Default 50.
maxCpuMsintegerCPU time in one run. Default 1000.
maxSubrequestsintegerCalls through the anlyon binding in one run
timeoutMsintegerWall time of one run. Default 30000.
straightThroughFunctionStraightThroughPolicy | nullWhen a run may skip the plan. Omitted or null
Show propertiesHide properties
actionsstring[]requiredAllowed actions a straight-through run may write to. Each must be in allowedActions.
maxWritesintegerrequiredWrites in one straight-through run.
nullThe function and its new current version.
successbooleanrequiredtruedataobjectrequiredShow propertiesHide properties
functionFunctionrequiredShow propertiesHide properties
idstringrequirednamestringrequireddescriptionstring | nullrequiredenvironmentIdstring<uuid>requiredcurrentVersionFunctionVersion | nullrequiredNull until the first publish.
Show propertiesHide properties
idstringrequiredThe version id.
versionintegerrequiredlanguagestringrequiredjavascriptpythondigeststringrequiredSHA-256 of the source.
allowedActionsstring[]requiredinputSchemaobjectrequiredbudgetsobjectrequiredShow propertiesHide properties
maxActionCallsintegerrequiredmaxCpuMsintegerrequiredmaxSubrequestsintegerrequiredtimeoutMsintegerrequiredstraightThroughFunctionStraightThroughPolicy | nullrequiredShow propertiesHide properties
FunctionStraightThroughPolicynullreviewFunctionVersionReview | nullrequiredShow propertiesHide properties
FunctionVersionReviewnullcreatedAtstring<date-time>requirednullcreatedAtstring<date-time>requiredupdatedAtstring<date-time>requiredversionFunctionVersionrequiredShow propertiesHide properties
idstringrequiredThe version id.
versionintegerrequiredlanguagestringrequiredjavascriptpythondigeststringrequiredSHA-256 of the source.
allowedActionsstring[]requiredinputSchemaobjectrequiredbudgetsobjectrequiredShow propertiesHide properties
maxActionCallsintegerrequiredmaxCpuMsintegerrequiredmaxSubrequestsintegerrequiredtimeoutMsintegerrequiredstraightThroughFunctionStraightThroughPolicy | nullrequiredShow propertiesHide properties
actionsstring[]requiredAllowed actions a straight-through run may write to. Each must be in allowedActions.
maxWritesintegerrequiredWrites in one straight-through run.
nullreviewFunctionVersionReview | nullrequiredShow propertiesHide properties
astFunctionSourceFindingsrequiredWhat the source says it calls and uses, read from its syntax tree. Advice for people; what a run may call is the version's allowedActions.
Show propertiesHide properties
languagestringrequiredjavascriptpythonparsedbooleanrequiredparseErrorstring | nullrequiredcallsobject[]requiredShow propertiesHide properties
objectkindstringrequiredinvokereadactionstringrequiredlineintegerrequiredproposedAllowedActionsstring[]requiredcomputedActionNamesobject[]requiredShow propertiesHide properties
objectkindstringrequiredinvokereadlineintegerrequiredriskyobject[]requiredNetwork, file, process, environment and eval APIs. They fail inside a function anyway.
Show propertiesHide properties
objectapistringrequiredcategorystringrequirednetworkfileprocessenvironmentevallineintegerrequiredwritesInLoopobject[]requiredShow propertiesHide properties
objectactionstring | nullrequiredlineintegerrequiredaiobject | nullrequiredThe AI review, for a workspace with Anlyon Vigil on. Null until it is done.
Show propertiesHide properties
statusstringrequiredreviewedskippedfailedreasonstring | nullrequiredmodelstring | nullrequiredsummarystring | nullrequiredpurposestring | nullrequiredrefundspaymentsmessagesrecordsaccountslookupsotherriskyPatternsobject[]requiredShow propertiesHide properties
objectpatternstringrequiredwrites_in_loopmoney_per_itemamount_from_inputunchecked_writedescriptionstringrequiredprobabilitynumberrequiredsuggestedRiskTierstring | nullrequiredroutinelowmoderatehighcriticalconfidencenumber | nullrequiredtruncatedbooleanrequiredreviewedAtstring<date-time>requirednullcreatedAtstring<date-time>requiredBad Request - Invalid input data
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectfixErrorFixHow to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.
Show propertiesHide properties
summarystringrequiredOne sentence that says what to do.
commandstringAn exact anlyon CLI command that fixes it. Absent when no command does.
urlstring<uri>An absolute console link where a person fixes it.
docsstring<uri>A docs page that explains it.
Unauthorized - Invalid or missing API key
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectfixErrorFixHow to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.
Show propertiesHide properties
summarystringrequiredOne sentence that says what to do.
commandstringAn exact anlyon CLI command that fixes it. Absent when no command does.
urlstring<uri>An absolute console link where a person fixes it.
docsstring<uri>A docs page that explains it.
Authenticated credential lacks the required scope or workspace access.
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectfixErrorFixHow to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.
Show propertiesHide properties
summarystringrequiredOne sentence that says what to do.
commandstringAn exact anlyon CLI command that fixes it. Absent when no command does.
urlstring<uri>An absolute console link where a person fixes it.
docsstring<uri>A docs page that explains it.
Not Found - Resource does not exist
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectfixErrorFixHow to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.
Show propertiesHide properties
summarystringrequiredOne sentence that says what to do.
commandstringAn exact anlyon CLI command that fixes it. Absent when no command does.
urlstring<uri>An absolute console link where a person fixes it.
docsstring<uri>A docs page that explains it.
Too Many Requests - Rate limit exceeded. A workspace's API requests are limited per minute and per UTC clock hour by plan; Retry-After says when to try again, and an hourly refusal names the limit and when the count resets. Successful responses carry the same limits in X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (the minute) and X-RateLimit-Limit-Hour, X-RateLimit-Remaining-Hour, X-RateLimit-Reset-Hour (the hour).
successbooleanrequiredrequestIdstringrequiredCorrelation ID matching the X-Request-Id response header.
errorobjectrequiredShow propertiesHide properties
codestringmessagestringdetailsobjectfixErrorFixHow to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.
Show propertiesHide properties
summarystringrequiredOne sentence that says what to do.
commandstringAn exact anlyon CLI command that fixes it. Absent when no command does.
urlstring<uri>An absolute console link where a person fixes it.
docsstring<uri>A docs page that explains it.

