Skip to main content

Create a Function

Creates a new function with provided configurations and uploads the code file.

POST/faas/functions/

Query parameters

Request body

multipart/form-data

object
function_namestringrequired

Unique name for the function

examplee2e-function-55619
runtimestringrequiredpython-3.11-fastapi | python-3.11-flask | node-20-express

Runtime environment

examplepython-3.11-fastapi
memorystringrequired128 | 256 | 512

Memory allocated to the function (in MB)

example128
timeoutstringrequired

Timeout for the function (in seconds)

example15
environment_variablesstringrequired

JSON string of environment variables

example{"env_name":"env_value"}
code_filestring·binaryrequired

Zipped function source code (.zip file)

Responses

200Function created successfully
object
codeinteger
example200
dataobject
errorsobject
messagestring
exampleSuccess