Functions API
Create, change, delete and run JavaScript functions, and read their result, logs and limits.
Functions are small JavaScript programs that run inside AxisIQ and can read and write your workspace data. This API manages them and runs them on demand. To write the code itself, see the Functions SDK. To call a function from the public internet, see Public endpoints.
Endpoints
| Method | Path | Permission | What it does |
|---|---|---|---|
GET |
/orgs/{orgId}/functions |
functions:read |
List functions |
POST |
/orgs/{orgId}/functions |
functions:create |
Create a function |
GET |
/orgs/{orgId}/functions/{fnId} |
functions:read |
Get a function, including its code |
PUT |
/orgs/{orgId}/functions/{fnId} |
functions:create |
Change a function |
DELETE |
/orgs/{orgId}/functions/{fnId} |
functions:create |
Delete a function |
POST |
/orgs/{orgId}/functions/{fnId}/invoke |
functions:invoke |
Run a function |
If the Functions app is switched off in Settings › Apps, these routes answer 404 NOT_FOUND.
The function object
{
"id": "0190f0ee-…",
"name": "Tag overdue invoices",
"description": "Marks open invoices past their due date",
"source": "async function handler(input) {\n …\n}",
"timeout_ms": 5000,
"enabled": true,
"http_enabled": false,
"created_at": "2026-10-01T08:00:00Z",
"updated_at": "2026-10-04T09:00:00Z"
}
POST /orgs/{orgId}/functions
| Field | Type | Required | Notes |
|---|---|---|---|
name |
string | Yes | Up to 120 characters |
description |
string | No | Up to 500 characters |
source |
string | Yes | JavaScript, up to 256 KB. It must define a global function named handler |
timeout_ms |
number | No | 100 to 30,000. Default 5,000. Values outside the range are brought into it |
http_enabled |
boolean | No | When true the function can be called from the public internet. See Public endpoints |
curl -s -X POST https://axisiq.co/api/v1/orgs/$ORG/functions \
-H "Authorization: Bearer $AXIS_KEY" -H "Content-Type: application/json" \
-d '{
"name": "Count open invoices",
"source": "function handler(input) {\n var r = axis.records.search(\"invoices\", { filters: [{ field: \"status\", op: \"eq\", value: \"open\" }], limit: 1 });\n return { open: r.total };\n}"
}'
Response 201 with the function object. New functions are enabled.
PUT /orgs/{orgId}/functions/{fnId}
Send any of name, description, source, timeout_ms, enabled, http_enabled. Fields you leave out are unchanged. Response 200 with the function object.
Important: Changing
sourcemakes you the function's author. When a flow, a queue button or a form runs the function later, it uses the fewer permissions of the trigger's owner and the author, so editing someone else's function cannot be used to borrow their access.
DELETE /orgs/{orgId}/functions/{fnId}
Returns 204 No Content.
POST /orgs/{orgId}/functions/{fnId}/invoke
Run a function now, with the caller's permissions. Permission: functions:invoke.
| Field | Type | Required | Notes |
|---|---|---|---|
input |
any JSON | No | Passed to handler as its argument. Absent means null |
curl -s -X POST https://axisiq.co/api/v1/orgs/$ORG/functions/$FN/invoke \
-H "Authorization: Bearer $AXIS_KEY" -H "Content-Type: application/json" \
-d '{"input": {"since": "2026-10-01"}}'
Response 200
{
"data": {
"result": { "open": 17 },
"logs": [ { "level": "log", "msg": "checked 17 invoices" } ],
"steps": [ { "method": "records.search", "is_error": false } ],
"duration_ms": 38,
"timed_out": false
}
}
| Field | Meaning |
|---|---|
result |
What handler returned, as JSON. null when it returned nothing |
logs |
Output from console.log, info, warn and error |
steps |
Each SDK call the function made, and whether it failed |
duration_ms |
Run time |
timed_out |
True when the function hit its timeout |
error |
Present only when the function threw or did not finish. The text is the error message |
Note: A function that throws or times out still answers HTTP 200, with
errorset. Checkerrorandtimed_outin the body, not just the status.
Errors
| Status | Code | When |
|---|---|---|
| 400 | VALIDATION_ERROR |
The function is disabled |
| 403 | FORBIDDEN |
The key lacks functions:invoke |
| 404 | NOT_FOUND |
No such function |
Limits
| Limit | Value |
|---|---|
| Run time | The function's timeout_ms, at most 30 seconds |
| Memory | 128 MB per run |
| Console output | 1,000 lines or 256 KB per run |
| SDK calls | 10,000 per run |
| Concurrent runs | 4 at a time per workspace, the rest wait |
| Source size | 256 KB |
Related
- Functions SDK
- Public endpoints
- In the product: Functions