Run a function
SDK platic.tools.functions.run()
Run the published version with input, as an agent would. The result is recorded as a manual execution.
Example
curl -X POST "https://api.platic.ai/v1/tools/functions/$FUNCTION_ID/run" \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": { "taxId": "XAXX010101000" }
}' await platic.tools.functions.run("fn_123", { input: { rfc: "XAXX010101000" } }); Important
The execution makes real HTTP calls. Use it to check a function. It does not provide general-purpose compute, background runs, scheduled runs, or webhook-triggered runs.
Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
functionId | string | Function ID | ✓ |
Request body
{
"input": { "taxId": "XAXX010101000" }
} | Field | Type | Description | Required |
|---|---|---|---|
input | object | Input that meets the published version's input schema. Up to 256 KB | — |
Do not send secrets: the execution uses the secrets bound to the function and answers 400 if the body has them.
Response
It has the same fields as Test a function. version is the published version's number. An execution that fails inside the code is also a 200, with ok: false and error.
{
"status": "success",
"data": {
"ok": true,
"output": { "found": true, "name": "EXAMPLE COMPANY INC" },
"durationMs": 412,
"logs": ["info response {\"status\":200}"],
"httpCalls": [
{ "method": "POST", "host": "api.example.com", "status": 200, "durationMs": 380 }
],
"runId": "run_8d1f",
"version": 1,
"nextStep": "It ran. The run is in the function's runs."
}
} Errors
| Status | details.code | When |
|---|---|---|
400 | INVALID_REQUEST | The body fails validation or has secrets. details.issues has the list of problems |
403 | FORBIDDEN or INSUFFICIENT_SCOPE | The credential does not have write access to Integrations |
404 | NOT_FOUND | The function does not exist in this workspace |
409 | NOT_PUBLISHED | The function does not have a published version yet |
409 | PAUSED | The function is paused |
429 | LIMIT_REACHED | The call limit was exceeded: 60 per minute per function, 5,000 per day or 50,000 per month per workspace. details.resetAt says when it frees up |
Notes
- It counts against the same call quota agents use.
- The execution stays in the executions with
trigger: "manual". - An unbound secret answers
ok: falsewithSECRET_MISSING. Bind it with Bind a secret.