We're having lots of fun on GitHub! Come and star us! ⭐️
Docs

Functions API


Server integration with  

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 enviornment.

You can learn more by following our Cloud Functions tutorial.

Create Function

POST/v1/functions

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.

Request

Name Type Description
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.

runtime required string

Execution runtime.

vars optional object

Key-value JSON object.

events optional array

Events list.

schedule optional string

Schedule CRON syntax.

timeout optional integer

Function maximum execution time in seconds.

Response

Status Code Content Type Payload
201  Created application/json Function Object
Example Request
  • 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('[NAME]', [], 'dotnet-5.0');
    
    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('[NAME]', [], 'dotnet-5.0');
    
    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('[NAME]', [], 'dotnet-5.0');
  • 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('[NAME]', [], 'dotnet-5.0')
    
  • 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(name: '[NAME]', execute: [], runtime: 'dotnet-5.0');
    
    puts response
  • using Appwrite;
    
    Client 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 functions = new Functions(client);
    
    HttpResponseMessage result = await functions.Create("[NAME]", [List<object>], "dotnet-5.0");
    
  • 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(
        name: '[NAME]',
        execute: [],
        runtime: 'dotnet-5.0',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • appwrite functions create \
            --name="[NAME]" \
            --execute="" \
            --runtime="dotnet-5.0" \
            --vars="{}" \
            --events="" \
            --schedule="" \
            --timeout="1"
    
  • 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(
            name = "[NAME]",
            execute = listOf(),
            runtime = "dotnet-5.0",
        )
        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(
            name = "[NAME]",
            execute = listOf(),
            runtime = "dotnet-5.0",
            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());
                    }
                }
            }
        );
    }

List Functions

GET/v1/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.

Request

Name Type Description
search optional string

Search term to filter your list results. Max length: 256 chars.

limit optional integer

Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.

offset optional integer

Results offset. The default value is 0. Use this param to manage pagination.

orderType optional string

Order result by ASC or DESC order.

Response

Status Code Content Type Payload
200  OK application/json Functions List Object
Example Request
  • 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
  • using Appwrite;
    
    Client 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 functions = new Functions(client);
    
    HttpResponseMessage result = await functions.List();
    
  • 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);
      });
    }
  • appwrite functions list \
            --search="[SEARCH]" \
            --limit="0" \
            --offset="0" \
            --orderType="ASC"
    
  • 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());
                    }
                }
            }
        );
    }

Get Function

GET/v1/functions/{functionId}

Get a function 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.

Request

Name Type Description
functionId required string

Function unique ID.

Response

Status Code Content Type Payload
200  OK application/json Function Object
Example Request
  • 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
  • using Appwrite;
    
    Client 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 functions = new Functions(client);
    
    HttpResponseMessage result = await functions.Get("[FUNCTION_ID]");
    
  • 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);
      });
    }
  • appwrite functions get \
            --functionId="[FUNCTION_ID]"
    
  • 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());
                    }
                }
            }
        );
    }

Update Function

PUT/v1/functions/{functionId}

Update function 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.

Request

Name Type Description
functionId required string

Function unique 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.

vars optional object

Key-value JSON object.

events optional array

Events list.

schedule optional string

Schedule CRON syntax.

timeout optional integer

Function maximum execution time in seconds.

Response

Status Code Content Type Payload
200  OK application/json Function Object
Example Request
  • 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
  • using Appwrite;
    
    Client 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 functions = new Functions(client);
    
    HttpResponseMessage result = await functions.Update("[FUNCTION_ID]", "[NAME]", [List<object>]);
    
  • 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);
      });
    }
  • appwrite functions update \
            --functionId="[FUNCTION_ID]" \
            --name="[NAME]" \
            --execute="" \
            --vars="{}" \
            --events="" \
            --schedule="" \
            --timeout="1"
    
  • 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());
                    }
                }
            }
        );
    }

Update Function Tag

PATCH/v1/functions/{functionId}/tag

Update the function code tag ID using the unique function ID. Use this endpoint to switch the code tag 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.

Request

Name Type Description
functionId required string

Function unique ID.

tag required string

Tag unique ID.

Response

Status Code Content Type Payload
200  OK application/json Function Object
Example Request
  • 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.updateTag('[FUNCTION_ID]', '[TAG]');
    
    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.updateTag('[FUNCTION_ID]', '[TAG]');
    
    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->updateTag('[FUNCTION_ID]', '[TAG]');
  • 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_tag('[FUNCTION_ID]', '[TAG]')
    
  • 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_tag(function_id: '[FUNCTION_ID]', tag: '[TAG]');
    
    puts response
  • using Appwrite;
    
    Client 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 functions = new Functions(client);
    
    HttpResponseMessage result = await functions.UpdateTag("[FUNCTION_ID]", "[TAG]");
    
  • 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.updateTag(
        functionId: '[FUNCTION_ID]',
        tag: '[TAG]',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • appwrite functions updateTag \
            --functionId="[FUNCTION_ID]" \
            --tag="[TAG]"
    
  • 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.updateTag(
            functionId = "[FUNCTION_ID]",
            tag = "[TAG]"
        )
        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.updateTag(
            functionId = "[FUNCTION_ID]",
            tag = "[TAG]"
            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());
                    }
                }
            }
        );
    }

Delete Function

DELETE/v1/functions/{functionId}

Delete a function 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.

Request

Name Type Description
functionId required string

Function unique ID.

Response

Status Code Content Type Payload
204  No Content - -
Example Request
  • 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
  • using Appwrite;
    
    Client 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 functions = new Functions(client);
    
    HttpResponseMessage result = await functions.Delete("[FUNCTION_ID]");
    
  • 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);
      });
    }
  • appwrite functions delete \
            --functionId="[FUNCTION_ID]"
    
  • 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());
                    }
                }
            }
        );
    }

Create Tag

POST/v1/functions/{functionId}/tags

Create a new function code tag. 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 tag to use your new tag 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.

Request

Name Type Description
functionId required string

Function unique ID.

command required string

Code execution command.

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.

Response

Status Code Content Type Payload
201  Created application/json Tag Object
Example Request
  • 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.createTag('[FUNCTION_ID]', '[COMMAND]', fs.createReadStream(__dirname + '/file.png')));
    
    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.createTag('[FUNCTION_ID]', '[COMMAND]', new File([fileBlob], 'file.png'));
    
    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->createTag('[FUNCTION_ID]', '[COMMAND]', new \CURLFile('/path/to/file.png', 'image/png', 'file.png'));
  • 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_tag('[FUNCTION_ID]', '[COMMAND]', open('/path/to/file.png', 'rb'))
    
  • 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_tag(function_id: '[FUNCTION_ID]', command: '[COMMAND]', code: Appwrite::File.new());
    
    puts response
  • using Appwrite;
    
    Client 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 functions = new Functions(client);
    
    HttpResponseMessage result = await functions.CreateTag("[FUNCTION_ID]", "[COMMAND]", new File("./path-to-files/image.jpg"));
    
  • 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.createTag(
        functionId: '[FUNCTION_ID]',
        command: '[COMMAND]',
        code: await MultipartFile.fromPath('code', './path-to-files/image.jpg', 'image.jpg'),
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • appwrite functions createTag \
            --functionId="[FUNCTION_ID]" \
            --command="[COMMAND]" \
            --code=""
    
  • 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.createTag(
            functionId = "[FUNCTION_ID]",
            command = "[COMMAND]",
            code = File("./path-to-files/image.jpg")
        )
        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.createTag(
            functionId = "[FUNCTION_ID]",
            command = "[COMMAND]",
            code = File("./path-to-files/image.jpg")
            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());
                    }
                }
            }
        );
    }

List Tags

GET/v1/functions/{functionId}/tags

Get a list of all the project's code tags. 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.

Request

Name Type Description
functionId required string

Function unique ID.

search optional string

Search term to filter your list results. Max length: 256 chars.

limit optional integer

Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.

offset optional integer

Results offset. The default value is 0. Use this param to manage pagination.

orderType optional string

Order result by ASC or DESC order.

Response

Status Code Content Type Payload
200  OK application/json Tags List Object
Example Request
  • 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.listTags('[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.listTags('[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->listTags('[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_tags('[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_tags(function_id: '[FUNCTION_ID]');
    
    puts response
  • using Appwrite;
    
    Client 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 functions = new Functions(client);
    
    HttpResponseMessage result = await functions.ListTags("[FUNCTION_ID]");
    
  • 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.listTags(
        functionId: '[FUNCTION_ID]',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • appwrite functions listTags \
            --functionId="[FUNCTION_ID]" \
            --search="[SEARCH]" \
            --limit="0" \
            --offset="0" \
            --orderType="ASC"
    
  • 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.listTags(
            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.listTags(
            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());
                    }
                }
            }
        );
    }

Get Tag

GET/v1/functions/{functionId}/tags/{tagId}

Get a code tag 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.

Request

Name Type Description
functionId required string

Function unique ID.

tagId required string

Tag unique ID.

Response

Status Code Content Type Payload
200  OK application/json Tag Object
Example Request
  • 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.getTag('[FUNCTION_ID]', '[TAG_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.getTag('[FUNCTION_ID]', '[TAG_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->getTag('[FUNCTION_ID]', '[TAG_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_tag('[FUNCTION_ID]', '[TAG_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_tag(function_id: '[FUNCTION_ID]', tag_id: '[TAG_ID]');
    
    puts response
  • using Appwrite;
    
    Client 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 functions = new Functions(client);
    
    HttpResponseMessage result = await functions.GetTag("[FUNCTION_ID]", "[TAG_ID]");
    
  • 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.getTag(
        functionId: '[FUNCTION_ID]',
        tagId: '[TAG_ID]',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • appwrite functions getTag \
            --functionId="[FUNCTION_ID]" \
            --tagId="[TAG_ID]"
    
  • 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.getTag(
            functionId = "[FUNCTION_ID]",
            tagId = "[TAG_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.getTag(
            functionId = "[FUNCTION_ID]",
            tagId = "[TAG_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());
                    }
                }
            }
        );
    }

Delete Tag

DELETE/v1/functions/{functionId}/tags/{tagId}

Delete a code tag 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.

Request

Name Type Description
functionId required string

Function unique ID.

tagId required string

Tag unique ID.

Response

Status Code Content Type Payload
204  No Content - -
Example Request
  • 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.deleteTag('[FUNCTION_ID]', '[TAG_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.deleteTag('[FUNCTION_ID]', '[TAG_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->deleteTag('[FUNCTION_ID]', '[TAG_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_tag('[FUNCTION_ID]', '[TAG_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_tag(function_id: '[FUNCTION_ID]', tag_id: '[TAG_ID]');
    
    puts response
  • using Appwrite;
    
    Client 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 functions = new Functions(client);
    
    HttpResponseMessage result = await functions.DeleteTag("[FUNCTION_ID]", "[TAG_ID]");
    
  • 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.deleteTag(
        functionId: '[FUNCTION_ID]',
        tagId: '[TAG_ID]',
      );
    
      result
        .then((response) {
          print(response);
        }).catchError((error) {
          print(error.response);
      });
    }
  • appwrite functions deleteTag \
            --functionId="[FUNCTION_ID]" \
            --tagId="[TAG_ID]"
    
  • 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.deleteTag(
            functionId = "[FUNCTION_ID]",
            tagId = "[TAG_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.deleteTag(
            functionId = "[FUNCTION_ID]",
            tagId = "[TAG_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());
                    }
                }
            }
        );
    }

Create Execution

POST/v1/functions/{functionId}/executions

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.

Request

Name Type Description
functionId required string

Function unique ID.

data optional string

String of custom data to send to function.

Response

Status Code Content Type Payload
201  Created application/json Execution Object
Example Request
  • 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
  • using Appwrite;
    
    Client 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 functions = new Functions(client);
    
    HttpResponseMessage result = await functions.CreateExecution("[FUNCTION_ID]");
    
  • 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);
      });
    }
  • appwrite functions createExecution \
            --functionId="[FUNCTION_ID]" \
            --data="[DATA]"
    
  • 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());
                    }
                }
            }
        );
    }

List Executions

GET/v1/functions/{functionId}/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.

Request

Name Type Description
functionId required string

Function unique ID.

search optional string

Search term to filter your list results. Max length: 256 chars.

limit optional integer

Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.

offset optional integer

Results offset. The default value is 0. Use this param to manage pagination.

orderType optional string

Order result by ASC or DESC order.

Response

Status Code Content Type Payload
200  OK application/json Executions List Object
Example Request
  • 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
  • using Appwrite;
    
    Client 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 functions = new Functions(client);
    
    HttpResponseMessage result = await functions.ListExecutions("[FUNCTION_ID]");
    
  • 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);
      });
    }
  • appwrite functions listExecutions \
            --functionId="[FUNCTION_ID]" \
            --search="[SEARCH]" \
            --limit="0" \
            --offset="0" \
            --orderType="ASC"
    
  • 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());
                    }
                }
            }
        );
    }

Get Execution

GET/v1/functions/{functionId}/executions/{executionId}

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.

Request

Name Type Description
functionId required string

Function unique ID.

executionId required string

Execution unique ID.

Response

Status Code Content Type Payload
200  OK application/json Execution Object
Example Request
  • 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
  • using Appwrite;
    
    Client 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 functions = new Functions(client);
    
    HttpResponseMessage result = await functions.GetExecution("[FUNCTION_ID]", "[EXECUTION_ID]");
    
  • 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);
      });
    }
  • appwrite functions getExecution \
            --functionId="[FUNCTION_ID]" \
            --executionId="[EXECUTION_ID]"
    
  • 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());
                    }
                }
            }
        );
    }