Update a function
SDK platic.tools.functions.update()
Update the draft fields you send. Agents keep using the published version until you publish again.
Example
curl -X PATCH "https://api.platic.ai/v1/tools/functions/$FUNCTION_ID" \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"timeoutSeconds": 30
}' await platic.tools.functions.update("fn_123", { timeoutSeconds: 30 }); Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
functionId | string | Function ID | ✓ |
Request body
{
"timeoutSeconds": 30,
"allowedDomains": ["api.example.com", "auth.example.com"]
} Send at least one. Lists are replaced whole.
| Field | Type | Description | Required |
|---|---|---|---|
displayName | string | Name for people, up to 80 characters | — |
description | string | 10 to 1,000 characters | — |
source | string | The complete TypeScript code, up to 100 KB | — |
allowedDomains | string[] | Exact hosts, HTTPS only. Up to 10 | — |
timeoutSeconds | integer | From 1 to 60 | — |
secretSlots | array | { slot, origin } slots, up to 10. See secretSlots | — |
name cannot be changed.
Response
data has the complete function, with the fields of Get a function.
{
"status": "success",
"message": "Function updated",
"data": {
"id": "Hk2s9QmXc1",
"name": "tax_id_lookup",
"status": "enabled",
"allowedDomains": ["api.example.com", "auth.example.com"],
"timeoutSeconds": 30,
"liveVersion": 1,
"toolName": "fn_tax_id_lookup",
"toolId": "Hk2s9QmXc1",
"secrets": [
{
"slot": "API_KEY",
"origin": "https://api.example.com",
"state": "bound",
"secretId": "5d0c7a1e9b3f4a6c8e2d1f0b7a9c3e5d6f8a0b2c4d6e8f1a3b5c7d9e0f2a4b6c"
}
],
"nextStep": "Draft changed. Verify it with POST /v1/tools/functions/Hk2s9QmXc1/verify and publish it to make it live; agents keep using version 1."
}
} Some fields are left out of the example.
Errors
| Status | details.code | When |
|---|---|---|
400 | INVALID_REQUEST | The body is empty or fails validation. 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 |
Notes
- Changing
allowedDomainsorsecretSlotsrequires binding the secrets again: a secret is authorized for a destination. - After changing
source, verify the code. - For agents to use the change, publish a new version.