Functions API
The Functions service allows you to create custom behaviour that can be triggered by any supported Appwrite system events or by a predefined schedule.
Appwrite Cloud Functions lets you automatically run backend code in response to events triggered by Appwrite or by setting it to be executed in a predefined schedule. Your code is stored in a secure way on your Appwrite instance and is executed in an isolated environment.
You can learn more by following our Cloud Functions tutorial.
Create Function
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.
Authentication
To access this route, init your SDK with your project unique ID and API Key secret token. Make sure your API Key is granted with access to the "functions.write" permission scope.
HTTP Request
Name | Type | Description | |
functionId | required | string | Function ID. Choose your own unique ID or pass the string "unique()" to auto generate it. 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. |
name | required | string | Function name. Max length: 128 chars. |
execute | required | array | An array of strings with execution permissions. By default no user is granted with any execute permissions. learn more about permissions and get a full list of available permissions. Maximum of 100 scopes are allowed, each 64 characters long. |
runtime | required | string | Execution runtime. |
vars | optional | object | Key-value JSON object that will be passed to the function as environment variables. |
events | optional | array | Events list. Maximum of 100 events are allowed. |
schedule | optional | string | Schedule CRON syntax. |
timeout | optional | integer | Function maximum execution time in seconds. |
HTTP Response
Status Code | Content Type | Payload |
201 Created | application/json | Function Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.create('[FUNCTION_ID]', '[NAME]', [], 'node-14.5'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.create('[FUNCTION_ID]', '[NAME]', [], 'node-14.5'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Functions; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); $result = $functions->create('[FUNCTION_ID]', '[NAME]', [], 'node-14.5');
-
from appwrite.client import Client from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) result = functions.create('[FUNCTION_ID]', '[NAME]', [], 'node-14.5')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Appwrite::Functions.new(client) response = functions.create(function_id: '[FUNCTION_ID]', name: '[NAME]', execute: [], runtime: 'node-14.5') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Functions functions = Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = functions.create( functionId: '[FUNCTION_ID]', name: '[NAME]', execute: [], runtime: 'node-14.5', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Functions suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val functions = Functions(client) val response = functions.create( functionId = "[FUNCTION_ID]", name = "[NAME]", execute = listOf(), runtime = "node-14.5", ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Functions public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Functions functions = new Functions(client); functions.create( functionId = "[FUNCTION_ID]", name = "[NAME]", execute = listOf(), runtime = "node-14.5", new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let functions = Functions(client) let function = try await functions.create( functionId: "[FUNCTION_ID]", name: "[NAME]", execute: [], runtime: "node-14.5" ) print(String(describing: function) }
List Functions
Get a list of all the project's functions. You can use the query params to filter your results.
Authentication
To access this route, init your SDK with your project unique ID and API Key secret token. Make sure your API Key is granted with access to the "functions.read" permission scope.
HTTP Request
Name | Type | Description | |
search | optional | string | Search term to filter your list results. Max length: 256 chars. |
limit | optional | integer | Maximum number of functions to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request. |
offset | optional | integer | Offset value. The default value is 0. Use this value to manage pagination. learn more about pagination |
cursor | optional | string | ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. learn more about pagination |
cursorDirection | optional | string | Direction of the cursor. |
orderType | optional | string | Order result by ASC or DESC order. |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Functions List Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.list(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.list(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Functions; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); $result = $functions->list();
-
from appwrite.client import Client from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) result = functions.list()
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Appwrite::Functions.new(client) response = functions.list() puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Functions functions = Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = functions.list( ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Functions suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val functions = Functions(client) val response = functions.list( ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Functions public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Functions functions = new Functions(client); functions.list( new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let functions = Functions(client) let functionList = try await functions.list() print(String(describing: functionList) }
List runtimes
Get a list of all runtimes that are currently active on your instance.
Authentication
To access this route, init your SDK with your project unique ID and API Key secret token. Make sure your API Key is granted with access to the "functions.read" permission scope.
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Runtimes List Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.listRuntimes(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.listRuntimes(); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Functions; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); $result = $functions->listRuntimes();
-
from appwrite.client import Client from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) result = functions.list_runtimes()
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Appwrite::Functions.new(client) response = functions.list_runtimes() puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Functions functions = Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = functions.listRuntimes(); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Functions suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val functions = Functions(client) val response = functions.listRuntimes() val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Functions public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Functions functions = new Functions(client); functions.listRuntimes(new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } }); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let functions = Functions(client) let runtimeList = try await functions.listRuntimes() print(String(describing: runtimeList) }
Get Function
Authentication
To access this route, init your SDK with your project unique ID and API Key secret token. Make sure your API Key is granted with access to the "functions.read" permission scope.
HTTP Request
Name | Type | Description | |
functionId | required | string | Function ID. |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Function Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.get('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.get('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Functions; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); $result = $functions->get('[FUNCTION_ID]');
-
from appwrite.client import Client from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) result = functions.get('[FUNCTION_ID]')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Appwrite::Functions.new(client) response = functions.get(function_id: '[FUNCTION_ID]') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Functions functions = Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = functions.get( functionId: '[FUNCTION_ID]', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Functions suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val functions = Functions(client) val response = functions.get( functionId = "[FUNCTION_ID]" ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Functions public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Functions functions = new Functions(client); functions.get( functionId = "[FUNCTION_ID]" new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let functions = Functions(client) let function = try await functions.get( functionId: "[FUNCTION_ID]" ) print(String(describing: function) }
Update Function
Authentication
To access this route, init your SDK with your project unique ID and API Key secret token. Make sure your API Key is granted with access to the "functions.write" permission scope.
HTTP Request
Name | Type | Description | |
functionId | required | string | Function ID. |
name | required | string | Function name. Max length: 128 chars. |
execute | required | array | An array of strings with execution permissions. By default no user is granted with any execute permissions. learn more about permissions and get a full list of available permissions. Maximum of 100 scopes are allowed, each 64 characters long. |
vars | optional | object | Key-value JSON object that will be passed to the function as environment variables. |
events | optional | array | Events list. Maximum of 100 events are allowed. |
schedule | optional | string | Schedule CRON syntax. |
timeout | optional | integer | Maximum execution time in seconds. |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Function Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.update('[FUNCTION_ID]', '[NAME]', []); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.update('[FUNCTION_ID]', '[NAME]', []); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Functions; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); $result = $functions->update('[FUNCTION_ID]', '[NAME]', []);
-
from appwrite.client import Client from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) result = functions.update('[FUNCTION_ID]', '[NAME]', [])
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Appwrite::Functions.new(client) response = functions.update(function_id: '[FUNCTION_ID]', name: '[NAME]', execute: []) puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Functions functions = Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = functions.update( functionId: '[FUNCTION_ID]', name: '[NAME]', execute: [], ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Functions suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val functions = Functions(client) val response = functions.update( functionId = "[FUNCTION_ID]", name = "[NAME]", execute = listOf(), ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Functions public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Functions functions = new Functions(client); functions.update( functionId = "[FUNCTION_ID]", name = "[NAME]", execute = listOf(), new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let functions = Functions(client) let function = try await functions.update( functionId: "[FUNCTION_ID]", name: "[NAME]", execute: [] ) print(String(describing: function) }
Update Function Deployment
Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.
Authentication
To access this route, init your SDK with your project unique ID and API Key secret token. Make sure your API Key is granted with access to the "functions.write" permission scope.
HTTP Request
Name | Type | Description | |
functionId | required | string | Function ID. |
deploymentId | required | string | Deployment ID. |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Function Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.updateDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.updateDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Functions; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); $result = $functions->updateDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]');
-
from appwrite.client import Client from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) result = functions.update_deployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Appwrite::Functions.new(client) response = functions.update_deployment(function_id: '[FUNCTION_ID]', deployment_id: '[DEPLOYMENT_ID]') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Functions functions = Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = functions.updateDeployment( functionId: '[FUNCTION_ID]', deploymentId: '[DEPLOYMENT_ID]', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Functions suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val functions = Functions(client) val response = functions.updateDeployment( functionId = "[FUNCTION_ID]", deploymentId = "[DEPLOYMENT_ID]" ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Functions public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Functions functions = new Functions(client); functions.updateDeployment( functionId = "[FUNCTION_ID]", deploymentId = "[DEPLOYMENT_ID]" new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let functions = Functions(client) let function = try await functions.updateDeployment( functionId: "[FUNCTION_ID]", deploymentId: "[DEPLOYMENT_ID]" ) print(String(describing: function) }
Delete Function
Authentication
To access this route, init your SDK with your project unique ID and API Key secret token. Make sure your API Key is granted with access to the "functions.write" permission scope.
HTTP Request
Name | Type | Description | |
functionId | required | string | Function ID. |
HTTP Response
Status Code | Content Type | Payload |
204 No Content | - | - |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.delete('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.delete('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Functions; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); $result = $functions->delete('[FUNCTION_ID]');
-
from appwrite.client import Client from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) result = functions.delete('[FUNCTION_ID]')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Appwrite::Functions.new(client) response = functions.delete(function_id: '[FUNCTION_ID]') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Functions functions = Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = functions.delete( functionId: '[FUNCTION_ID]', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Functions suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val functions = Functions(client) val response = functions.delete( functionId = "[FUNCTION_ID]" ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Functions public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Functions functions = new Functions(client); functions.delete( functionId = "[FUNCTION_ID]" new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let functions = Functions(client) let result = try await functions.delete( functionId: "[FUNCTION_ID]" ) print(String(describing: result) }
Create Deployment
Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.
This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the Appwrite Cloud Functions tutorial.
Use the "command" param to set the entry point used to execute your code.
Authentication
To access this route, init your SDK with your project unique ID and API Key secret token. Make sure your API Key is granted with access to the "functions.write" permission scope.
HTTP Request
Name | Type | Description | |
functionId | required | string | Function ID. |
entrypoint | required | string | Entrypoint File. |
code | required | file | Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. |
activate | required | boolean | Automatically activate the deployment when it is finished building. |
HTTP Response
Status Code | Content Type | Payload |
201 Created | application/json | Deployment Object |
-
const sdk = require('node-appwrite'); const fs = require('fs'); // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', 'file.png', false); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', 'file.png', false); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Functions; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); $result = $functions->createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', 'file.png', false);
-
from appwrite.client import Client from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) result = functions.create_deployment('[FUNCTION_ID]', '[ENTRYPOINT]', 'file.png', False)
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Appwrite::Functions.new(client) response = functions.create_deployment(function_id: '[FUNCTION_ID]', entrypoint: '[ENTRYPOINT]', code: 'dir/file.png', activate: false) puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Functions functions = Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = functions.createDeployment( functionId: '[FUNCTION_ID]', entrypoint: '[ENTRYPOINT]', code: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'), activate: false, ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Functions suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val functions = Functions(client) val response = functions.createDeployment( functionId = "[FUNCTION_ID]", entrypoint = "[ENTRYPOINT]", code = File("file.png"), activate = false ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Functions public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Functions functions = new Functions(client); functions.createDeployment( functionId = "[FUNCTION_ID]", entrypoint = "[ENTRYPOINT]", code = File("file.png"), activate = false new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let functions = Functions(client) let deployment = try await functions.createDeployment( functionId: "[FUNCTION_ID]", entrypoint: "[ENTRYPOINT]", code: File(name: "image.jpg", buffer: yourByteBuffer), activate: xfalse ) print(String(describing: deployment) }
List Deployments
Get a list of all the project's code deployments. You can use the query params to filter your results.
Authentication
To access this route, init your SDK with your project unique ID and API Key secret token. Make sure your API Key is granted with access to the "functions.read" permission scope.
HTTP Request
Name | Type | Description | |
functionId | required | string | Function ID. |
search | optional | string | Search term to filter your list results. Max length: 256 chars. |
limit | optional | integer | Maximum number of deployments to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request. |
offset | optional | integer | Offset value. The default value is 0. Use this value to manage pagination. learn more about pagination |
cursor | optional | string | ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. learn more about pagination |
cursorDirection | optional | string | Direction of the cursor. |
orderType | optional | string | Order result by ASC or DESC order. |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Deployments List Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.listDeployments('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.listDeployments('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Functions; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); $result = $functions->listDeployments('[FUNCTION_ID]');
-
from appwrite.client import Client from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) result = functions.list_deployments('[FUNCTION_ID]')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Appwrite::Functions.new(client) response = functions.list_deployments(function_id: '[FUNCTION_ID]') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Functions functions = Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = functions.listDeployments( functionId: '[FUNCTION_ID]', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Functions suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val functions = Functions(client) val response = functions.listDeployments( functionId = "[FUNCTION_ID]", ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Functions public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Functions functions = new Functions(client); functions.listDeployments( functionId = "[FUNCTION_ID]", new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let functions = Functions(client) let deploymentList = try await functions.listDeployments( functionId: "[FUNCTION_ID]" ) print(String(describing: deploymentList) }
Get Deployment
Get a code deployment by its unique ID.
Authentication
To access this route, init your SDK with your project unique ID and API Key secret token. Make sure your API Key is granted with access to the "functions.read" permission scope.
HTTP Request
Name | Type | Description | |
functionId | required | string | Function ID. |
deploymentId | required | string | Deployment ID. |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Deployments List Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.getDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.getDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Functions; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); $result = $functions->getDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]');
-
from appwrite.client import Client from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) result = functions.get_deployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Appwrite::Functions.new(client) response = functions.get_deployment(function_id: '[FUNCTION_ID]', deployment_id: '[DEPLOYMENT_ID]') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Functions functions = Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = functions.getDeployment( functionId: '[FUNCTION_ID]', deploymentId: '[DEPLOYMENT_ID]', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Functions suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val functions = Functions(client) val response = functions.getDeployment( functionId = "[FUNCTION_ID]", deploymentId = "[DEPLOYMENT_ID]" ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Functions public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Functions functions = new Functions(client); functions.getDeployment( functionId = "[FUNCTION_ID]", deploymentId = "[DEPLOYMENT_ID]" new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let functions = Functions(client) let deploymentList = try await functions.getDeployment( functionId: "[FUNCTION_ID]", deploymentId: "[DEPLOYMENT_ID]" ) print(String(describing: deploymentList) }
Delete Deployment
Delete a code deployment by its unique ID.
Authentication
To access this route, init your SDK with your project unique ID and API Key secret token. Make sure your API Key is granted with access to the "functions.write" permission scope.
HTTP Request
Name | Type | Description | |
functionId | required | string | Function ID. |
deploymentId | required | string | Deployment ID. |
HTTP Response
Status Code | Content Type | Payload |
204 No Content | - | - |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.deleteDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.deleteDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Functions; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); $result = $functions->deleteDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]');
-
from appwrite.client import Client from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) result = functions.delete_deployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Appwrite::Functions.new(client) response = functions.delete_deployment(function_id: '[FUNCTION_ID]', deployment_id: '[DEPLOYMENT_ID]') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Functions functions = Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = functions.deleteDeployment( functionId: '[FUNCTION_ID]', deploymentId: '[DEPLOYMENT_ID]', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Functions suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val functions = Functions(client) val response = functions.deleteDeployment( functionId = "[FUNCTION_ID]", deploymentId = "[DEPLOYMENT_ID]" ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Functions public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Functions functions = new Functions(client); functions.deleteDeployment( functionId = "[FUNCTION_ID]", deploymentId = "[DEPLOYMENT_ID]" new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let functions = Functions(client) let result = try await functions.deleteDeployment( functionId: "[FUNCTION_ID]", deploymentId: "[DEPLOYMENT_ID]" ) print(String(describing: result) }
Create Execution
Trigger a function execution. The returned object will return you the current execution status. You can ping the Get Execution
endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
Authentication
To access this route, init your SDK with your project unique ID and API Key secret token. Make sure your API Key is granted with access to the "execution.write" permission scope. You can also authenticate using a valid JWT and perform actions on behalf of your user.
Rate Limits
This endpoint is limited to 60 requests in every 1 minutes per IP address. We use rate limits to avoid service abuse by users and as a security practice. Learn more about rate limiting.
HTTP Request
Name | Type | Description | |
functionId | required | string | Function ID. |
data | optional | string | String of custom data to send to function. |
async | optional | boolean | Execute code asynchronously. Default value is true. |
HTTP Response
Status Code | Content Type | Payload |
201 Created | application/json | Execution Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.createExecution('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.createExecution('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Functions; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); $result = $functions->createExecution('[FUNCTION_ID]');
-
from appwrite.client import Client from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) result = functions.create_execution('[FUNCTION_ID]')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Appwrite::Functions.new(client) response = functions.create_execution(function_id: '[FUNCTION_ID]') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Functions functions = Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = functions.createExecution( functionId: '[FUNCTION_ID]', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Functions suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val functions = Functions(client) val response = functions.createExecution( functionId = "[FUNCTION_ID]", ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Functions public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Functions functions = new Functions(client); functions.createExecution( functionId = "[FUNCTION_ID]", new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let functions = Functions(client) let execution = try await functions.createExecution( functionId: "[FUNCTION_ID]" ) print(String(describing: execution) }
List Executions
Get a list of all the current user function execution logs. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's executions. Learn more about different API modes.
Authentication
To access this route, init your SDK with your project unique ID and API Key secret token. Make sure your API Key is granted with access to the "execution.read" permission scope. You can also authenticate using a valid JWT and perform actions on behalf of your user.
HTTP Request
Name | Type | Description | |
functionId | required | string | Function ID. |
limit | optional | integer | Maximum number of executions to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request. |
offset | optional | integer | Offset value. The default value is 0. Use this value to manage pagination. learn more about pagination |
search | optional | string | Search term to filter your list results. Max length: 256 chars. |
cursor | optional | string | ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. learn more about pagination |
cursorDirection | optional | string | Direction of the cursor. |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Executions List Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.listExecutions('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.listExecutions('[FUNCTION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Functions; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); $result = $functions->listExecutions('[FUNCTION_ID]');
-
from appwrite.client import Client from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) result = functions.list_executions('[FUNCTION_ID]')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Appwrite::Functions.new(client) response = functions.list_executions(function_id: '[FUNCTION_ID]') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Functions functions = Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = functions.listExecutions( functionId: '[FUNCTION_ID]', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Functions suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val functions = Functions(client) val response = functions.listExecutions( functionId = "[FUNCTION_ID]", ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Functions public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Functions functions = new Functions(client); functions.listExecutions( functionId = "[FUNCTION_ID]", new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let functions = Functions(client) let executionList = try await functions.listExecutions( functionId: "[FUNCTION_ID]" ) print(String(describing: executionList) }
Get Execution
Get a function execution log by its unique ID.
Authentication
To access this route, init your SDK with your project unique ID and API Key secret token. Make sure your API Key is granted with access to the "execution.read" permission scope. You can also authenticate using a valid JWT and perform actions on behalf of your user.
HTTP Request
Name | Type | Description | |
functionId | required | string | Function ID. |
executionId | required | string | Execution ID. |
HTTP Response
Status Code | Content Type | Payload |
200 OK | application/json | Execution Object |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.getExecution('[FUNCTION_ID]', '[EXECUTION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.getExecution('[FUNCTION_ID]', '[EXECUTION_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Functions; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); $result = $functions->getExecution('[FUNCTION_ID]', '[EXECUTION_ID]');
-
from appwrite.client import Client from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) result = functions.get_execution('[FUNCTION_ID]', '[EXECUTION_ID]')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Appwrite::Functions.new(client) response = functions.get_execution(function_id: '[FUNCTION_ID]', execution_id: '[EXECUTION_ID]') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Functions functions = Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = functions.getExecution( functionId: '[FUNCTION_ID]', executionId: '[EXECUTION_ID]', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Functions suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val functions = Functions(client) val response = functions.getExecution( functionId = "[FUNCTION_ID]", executionId = "[EXECUTION_ID]" ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Functions public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Functions functions = new Functions(client); functions.getExecution( functionId = "[FUNCTION_ID]", executionId = "[EXECUTION_ID]" new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let functions = Functions(client) let execution = try await functions.getExecution( functionId: "[FUNCTION_ID]", executionId: "[EXECUTION_ID]" ) print(String(describing: execution) }
Retry Build
Authentication
To access this route, init your SDK with your project unique ID and API Key secret token. Make sure your API Key is granted with access to the "functions.write" permission scope. You can also authenticate using a valid JWT and perform actions on behalf of your user.
HTTP Request
Name | Type | Description | |
functionId | required | string | Function ID. |
deploymentId | required | string | Deployment ID. |
buildId | required | string | Build unique ID. |
HTTP Response
Status Code | Content Type | Payload |
204 No Content | - | - |
-
const sdk = require('node-appwrite'); // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.retryBuild('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
import * as sdk from "https://deno.land/x/appwrite/mod.ts"; // Init SDK let client = new sdk.Client(); let functions = new sdk.Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; let promise = functions.retryBuild('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]'); promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });
-
<?php use Appwrite\Client; use Appwrite\Services\Functions; $client = new Client(); $client ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $functions = new Functions($client); $result = $functions->retryBuild('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]');
-
from appwrite.client import Client from appwrite.services.functions import Functions client = Client() (client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) functions = Functions(client) result = functions.retry_build('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]')
-
require 'appwrite' client = Appwrite::Client.new client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key functions = Appwrite::Functions.new(client) response = functions.retry_build(function_id: '[FUNCTION_ID]', deployment_id: '[DEPLOYMENT_ID]', build_id: '[BUILD_ID]') puts response.inspect
-
import 'package:dart_appwrite/dart_appwrite.dart'; void main() { // Init SDK Client client = Client(); Functions functions = Functions(client); client .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = functions.retryBuild( functionId: '[FUNCTION_ID]', deploymentId: '[DEPLOYMENT_ID]', buildId: '[BUILD_ID]', ); result .then((response) { print(response); }).catchError((error) { print(error.response); }); }
-
import io.appwrite.Client import io.appwrite.services.Functions suspend fun main() { val client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key val functions = Functions(client) val response = functions.retryBuild( functionId = "[FUNCTION_ID]", deploymentId = "[DEPLOYMENT_ID]", buildId = "[BUILD_ID]" ) val json = response.body?.string() }
-
import io.appwrite.Client import io.appwrite.services.Functions public void main() { Client client = Client(context) .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Functions functions = new Functions(client); functions.retryBuild( functionId = "[FUNCTION_ID]", deploymentId = "[DEPLOYMENT_ID]", buildId = "[BUILD_ID]" new Continuation<Response>() { @NotNull @Override public CoroutineContext getContext() { return EmptyCoroutineContext.INSTANCE; } @Override public void resumeWith(@NotNull Object o) { String json = ""; try { if (o instanceof Result.Failure) { Result.Failure failure = (Result.Failure) o; throw failure.exception; } else { Response response = (Response) o; } } catch (Throwable th) { Log.e("ERROR", th.toString()); } } } ); }
-
import Appwrite func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let functions = Functions(client) let result = try await functions.retryBuild( functionId: "[FUNCTION_ID]", deploymentId: "[DEPLOYMENT_ID]", buildId: "[BUILD_ID]" ) print(String(describing: result) }