Everstack
API ReferenceFunctionsUpdate Function

Update Function

PATCH/v1/functions/{id}
PATCH/v1/functions/{id}

Your instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Request Body

PropertyTypeRequiredDescription
tenantIdstringNo
namestringNo
descriptionstringNo
mode"EXECUTION_MODE_UNSPECIFIED" | "EXECUTION_MODE_WEBHOOK" | "EXECUTION_MODE_PROXY" | "EXECUTION_MODE_ISOLATED"No
parametersobjectNo
webhookobjectNo
proxyobjectNo
isolatedobjectNo
timeoutMsintegerNo
memoryMbintegerNo
maxRetriesintegerNo
enabledbooleanNo

Responses

200 Update function

PropertyTypeDescription
functionobject

default An unexpected error response.

PropertyTypeDescription
codeinteger
messagestring
detailsobject[]

Request

curl -X PATCH "http://localhost:8089/v1/functions/{id}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tenantId":"string","name":"string","description":"string","mode":"EXECUTION_MODE_UNSPECIFIED","webhook":{"url":"string","method":"string","timeoutMs":0},"proxy":{"baseUrl":"string","path":"string","method":"string"},"isolated":{"runtime":"string","code":"string","packages":["string"],"dockerHost":"string"},"timeoutMs":0,"memoryMb":0,"maxRetries":0,"enabled":true}'
const response = await fetch("http://localhost:8089/v1/functions/{id}", {
  method: "PATCH",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "tenantId": "string",
  "name": "string",
  "description": "string",
  "mode": "EXECUTION_MODE_UNSPECIFIED",
  "webhook": {
    "url": "string",
    "method": "string",
    "timeoutMs": 0
  },
  "proxy": {
    "baseUrl": "string",
    "path": "string",
    "method": "string"
  },
  "isolated": {
    "runtime": "string",
    "code": "string",
    "packages": [
      "string"
    ],
    "dockerHost": "string"
  },
  "timeoutMs": 0,
  "memoryMb": 0,
  "maxRetries": 0,
  "enabled": true
}),
});
const data = await response.json();
import requests

response = requests.patch(
    "http://localhost:8089/v1/functions/{id}",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
  "tenantId": "string",
  "name": "string",
  "description": "string",
  "mode": "EXECUTION_MODE_UNSPECIFIED",
  "webhook": {
    "url": "string",
    "method": "string",
    "timeoutMs": 0
  },
  "proxy": {
    "baseUrl": "string",
    "path": "string",
    "method": "string"
  },
  "isolated": {
    "runtime": "string",
    "code": "string",
    "packages": [
      "string"
    ],
    "dockerHost": "string"
  },
  "timeoutMs": 0,
  "memoryMb": 0,
  "maxRetries": 0,
  "enabled": true
},
)
data = response.json()

Response

{
  "function": {
    "id": "string",
    "tenantId": "string",
    "name": "string",
    "description": "string",
    "mode": "EXECUTION_MODE_UNSPECIFIED",
    "webhook": {
      "url": "string",
      "method": "string",
      "timeoutMs": 0
    },
    "proxy": {
      "baseUrl": "string",
      "path": "string",
      "method": "string"
    },
    "isolated": {
      "runtime": "string",
      "code": "string",
      "packages": [
        "string"
      ],
      "dockerHost": "string"
    },
    "timeoutMs": 0,
    "memoryMb": 0,
    "maxRetries": 0,
    "enabled": true,
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-01T00:00:00Z"
  }
}
{
  "code": 0,
  "message": "string",
  "details": [
    {
      "@type": "string"
    }
  ]
}