Create function
Endpoint
posthttps://<REGION>.cloud.appwrite.io/v1/functions
Description
Create a new function. You can pass a list of permissions to allow different project users or team with access to execute the function using the client API.
Required scopes
Authentication
setProject() and a server API key (setKey()). For direct REST calls, send X-Appwrite-Project and X-Appwrite-Key.Parameters
Function ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
Function name. Max length: 128 chars.
Execution runtime.
An array of role strings with execution permissions. By default no user is granted with any execute permissions. learn more about roles. Maximum of 100 roles are allowed, each 64 characters long.
Events list. Maximum of 100 events are allowed.
Schedule CRON syntax.
Function maximum execution time in seconds.
Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.
Entrypoint File. This path is relative to the "providerRootDirectory".
Build Commands.
List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.
Appwrite Installation ID for VCS (Version Control System) deployment.
Repository ID of the repo linked to the function.
Production branch for the repo linked to the function.
Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
Path to function code in the linked repo.
Repository name of the template.
The name of the owner of the template.
Path to function code in the template repo.
Version (tag) for the repo linked to the function template.
Runtime specification for the function and builds.
Function
Function ID.
Function creation date in ISO 8601 format.
Function update date in ISO 8601 format.
Execution permissions.
Function name.
Function enabled.
Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration.
Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.
Function execution runtime.
Function's active deployment ID.
Allowed permission scopes.
Function variables.
Object type
Function trigger events.
Function execution schedule in CRON format.
Function execution timeout in seconds.
The entrypoint file used to execute the deployment.
The build command used to build the deployment.
Version of Open Runtimes used for the function.
Function VCS (Version Control System) installation id.
VCS (Version Control System) Repository ID
VCS (Version Control System) branch name
Path to function in VCS (Version Control System) repository
Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests
Machine specification for builds and executions.
POST /v1/functions HTTP/1.1Host: cloud.appwrite.ioContent-Type: application/jsonX-Appwrite-Response-Format: 1.6.0X-Appwrite-Project: <YOUR_PROJECT_ID>X-Appwrite-Key: <YOUR_API_KEY>
{ "functionId": "<FUNCTION_ID>", "name": "<NAME>", "runtime": "node-14.5", "execute": ["any"], "events": [], "schedule": , "timeout": 1, "enabled": false, "logging": false, "entrypoint": "<ENTRYPOINT>", "commands": "<COMMANDS>", "scopes": [], "installationId": "<INSTALLATION_ID>", "providerRepositoryId": "<PROVIDER_REPOSITORY_ID>", "providerBranch": "<PROVIDER_BRANCH>", "providerSilentMode": false, "providerRootDirectory": "<PROVIDER_ROOT_DIRECTORY>", "templateRepository": "<TEMPLATE_REPOSITORY>", "templateOwner": "<TEMPLATE_OWNER>", "templateRootDirectory": "<TEMPLATE_ROOT_DIRECTORY>", "templateVersion": "<TEMPLATE_VERSION>", "specification": }Functions
functions
runtimes
deployments
executions
variables
Create function
Endpoint
posthttps://<REGION>.cloud.appwrite.io/v1/functions
Description
Create a new function. You can pass a list of permissions to allow different project users or team with access to execute the function using the client API.
Required scopes
Authentication
setProject() and a server API key (setKey()). For direct REST calls, send X-Appwrite-Project and X-Appwrite-Key.Parameters
Function ID. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
Function name. Max length: 128 chars.
Execution runtime.
An array of role strings with execution permissions. By default no user is granted with any execute permissions. learn more about roles. Maximum of 100 roles are allowed, each 64 characters long.
Events list. Maximum of 100 events are allowed.
Schedule CRON syntax.
Function maximum execution time in seconds.
Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.
Entrypoint File. This path is relative to the "providerRootDirectory".
Build Commands.
List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.
Appwrite Installation ID for VCS (Version Control System) deployment.
Repository ID of the repo linked to the function.
Production branch for the repo linked to the function.
Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
Path to function code in the linked repo.
Repository name of the template.
The name of the owner of the template.
Path to function code in the template repo.
Version (tag) for the repo linked to the function template.
Runtime specification for the function and builds.
Function
Function ID.
Function creation date in ISO 8601 format.
Function update date in ISO 8601 format.
Execution permissions.
Function name.
Function enabled.
Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration.
Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.
Function execution runtime.
Function's active deployment ID.
Allowed permission scopes.
Function variables.
Object type
Function trigger events.
Function execution schedule in CRON format.
Function execution timeout in seconds.
The entrypoint file used to execute the deployment.
The build command used to build the deployment.
Version of Open Runtimes used for the function.
Function VCS (Version Control System) installation id.
VCS (Version Control System) Repository ID
VCS (Version Control System) branch name
Path to function in VCS (Version Control System) repository
Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests
Machine specification for builds and executions.
POST /v1/functions HTTP/1.1Host: cloud.appwrite.ioContent-Type: application/jsonX-Appwrite-Response-Format: 1.6.0X-Appwrite-Project: <YOUR_PROJECT_ID>X-Appwrite-Key: <YOUR_API_KEY>
{ "functionId": "<FUNCTION_ID>", "name": "<NAME>", "runtime": "node-14.5", "execute": ["any"], "events": [], "schedule": , "timeout": 1, "enabled": false, "logging": false, "entrypoint": "<ENTRYPOINT>", "commands": "<COMMANDS>", "scopes": [], "installationId": "<INSTALLATION_ID>", "providerRepositoryId": "<PROVIDER_REPOSITORY_ID>", "providerBranch": "<PROVIDER_BRANCH>", "providerSilentMode": false, "providerRootDirectory": "<PROVIDER_ROOT_DIRECTORY>", "templateRepository": "<TEMPLATE_REPOSITORY>", "templateOwner": "<TEMPLATE_OWNER>", "templateRootDirectory": "<TEMPLATE_ROOT_DIRECTORY>", "templateVersion": "<TEMPLATE_VERSION>", "specification": }