> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/integrations/catalog/appwrite.md).

# Appwrite

Connect to Appwrite to manage TablesDB rows, Auth users, storage files, and serverless function executions.

### Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

| Connector | Authentication |
| --------- | -------------- |
| Appwrite  | API Key        |

#### Appwrite

Connect an Appwrite project with a server API key.

**Set up in Appwrite**

1. Prepare the Appwrite account or service that the workflow will access. Grant access to the required resources and operations.
2. **Project ID:** Found in Appwrite Console > Overview > Project settings.
3. **API Key:** A server API key from Appwrite Console > Overview > Integrations > API keys. Grant health.read plus the scopes of every action or trigger you use; a server key bypasses per-resource permissions and is limited only by its scopes.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **Appwrite**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field | Required                 | What to enter                                                                                                                                                                                                                        |
| ------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| API Endpoint  | Optional / as applicable | Your Appwrite Cloud regional endpoint or self-hosted URL, ending in /v1.                                                                                                                                                             |
| Project ID    | Yes                      | Found in Appwrite Console > Overview > Project settings.                                                                                                                                                                             |
| API Key       | Yes                      | A server API key from Appwrite Console > Overview > Integrations > API keys. Grant health.read plus the scopes of every action or trigger you use; a server key bypasses per-resource permissions and is limited only by its scopes. |

#### Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

### Use an action

1. Add the required **Appwrite** action to the workflow.
2. Select a connection when the action requests one.
3. Complete the required fields. Use the reference picker when a value comes from another workflow step.
4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

### Actions

#### Create Row

Add a new row (document) to a table in one of your Appwrite databases.

**Required permissions:** `rows.write`, `databases.read`, `tables.read`.

**Inputs**

| Field           | Type            | Required | Description                                                                                                                                     |
| --------------- | --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Database        | select (string) | Yes      | The Appwrite database that holds the table. Options load from the selected connection.                                                          |
| Table           | select (string) | Yes      | The table (collection) to add the row to. Options load from the selected connection.                                                            |
| Row data (JSON) | textarea        | Yes      | The row's fields as a JSON object. Keys must match the table's column names.                                                                    |
| Row ID          | string          | No       | Leave as unique() to let Appwrite generate an id, or set your own (a-z, A-Z, 0-9, period, hyphen, underscore, max 36 chars). Default: unique(). |
| Permissions     | string          | No       | Optional comma-separated Appwrite permission strings for this row. Leave empty to inherit the table's permissions.                              |

**Outputs**

| Field       | Type          | Description                                  |
| ----------- | ------------- | -------------------------------------------- |
| Row ID      | string        | Id of the created row.                       |
| Database ID | string        | Database the row lives in.                   |
| Table ID    | string        | Table the row lives in.                      |
| Created at  | datetime      | Creation timestamp.                          |
| Row data    | dict          | The stored row fields (custom columns only). |
| Permissions | string\_array | Permission strings applied to the row.       |

#### List Rows

Fetch rows (documents) from a table, with an optional filter and sort.

**Required permissions:** `rows.read`, `databases.read`, `tables.read`.

**Inputs**

| Field              | Type            | Required | Description                                                                                                                                                                                                                       |
| ------------------ | --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Database           | select (string) | Yes      | The Appwrite database that holds the table. Options load from the selected connection.                                                                                                                                            |
| Table              | select (string) | Yes      | The table to read rows from. Options load from the selected connection.                                                                                                                                                           |
| Filter column      | string          | No       | Optional column to filter on.                                                                                                                                                                                                     |
| Filter operator    | select (string) | No       | How to compare the column with the value. Available values: Equal, Not equal, Greater than, Greater than or equal, Less than, Less than or equal, Contains, Starts with, Ends with, Search, Is null, Is not null. Default: equal. |
| Filter value       | string          | No       | Value to compare against.                                                                                                                                                                                                         |
| Sort by column     | string          | No       | Column to order results by. Default: $createdAt.                                                                                                                                                                                  |
| Sort direction     | select (string) | No       | Ascending or descending. Available values: Ascending, Descending. Default: desc.                                                                                                                                                  |
| Max rows           | integer         | No       | How many rows to return (1-100). Default: 25.                                                                                                                                                                                     |
| Cursor             | string          | No       | Paste next\_cursor from a previous run to continue.                                                                                                                                                                               |
| Raw queries (JSON) | textarea        | No       | Advanced: a JSON array of Appwrite query strings that replaces the simple filter/sort fields.                                                                                                                                     |

**Outputs**

| Field         | Type          | Description                                             |
| ------------- | ------------- | ------------------------------------------------------- |
| Rows          | object\_array | The matching rows.                                      |
| Total matches | integer       | Total rows matching the filter.                         |
| Next cursor   | string        | Pass as Cursor to fetch the next page; empty when done. |

#### Get Row

Read a single row (document) by its id.

**Required permissions:** `rows.read`, `databases.read`, `tables.read`.

**Inputs**

| Field    | Type            | Required | Description                                                                            |
| -------- | --------------- | -------- | -------------------------------------------------------------------------------------- |
| Database | select (string) | Yes      | The Appwrite database that holds the table. Options load from the selected connection. |
| Table    | select (string) | Yes      | The table that holds the row. Options load from the selected connection.               |
| Row ID   | string          | Yes      | The row's id.                                                                          |

**Outputs**

| Field       | Type          | Description               |
| ----------- | ------------- | ------------------------- |
| Row ID      | string        | Row id.                   |
| Created at  | datetime      | Creation timestamp.       |
| Updated at  | datetime      | Last update timestamp.    |
| Row data    | dict          | The row's custom columns. |
| Permissions | string\_array | Row permission strings.   |

#### Create User

Create an end-user account in your Appwrite project.

**Required permissions:** `users.write`.

**Inputs**

| Field    | Type   | Required | Description                                                                |
| -------- | ------ | -------- | -------------------------------------------------------------------------- |
| Email    | string | No       | The user's email address.                                                  |
| Password | secret | No       | Initial password (min 8 characters). Leave empty for passwordless users.   |
| Name     | string | No       | Display name (max 128 characters).                                         |
| Phone    | string | No       | Phone number in international format.                                      |
| User ID  | string | No       | Leave as unique() to auto-generate, or set a custom id. Default: unique(). |

**Outputs**

| Field      | Type     | Description                                  |
| ---------- | -------- | -------------------------------------------- |
| User ID    | string   | Id of the new user.                          |
| Email      | string   | Email.                                       |
| Name       | string   | Name.                                        |
| Phone      | string   | Phone.                                       |
| Active     | boolean  | Whether the account is active (not blocked). |
| Created at | datetime | Creation timestamp.                          |

#### List Users

Search or list the users of your Appwrite project.

**Required permissions:** `users.read`.

**Inputs**

| Field     | Type    | Required | Description                                                                  |
| --------- | ------- | -------- | ---------------------------------------------------------------------------- |
| Search    | string  | No       | Optional text to search by name, email, phone or id (at least 3 characters). |
| Max users | integer | No       | How many users to return (1-100). Default: 25.                               |
| Cursor    | string  | No       | Paste next\_cursor from a previous run to continue.                          |

**Outputs**

| Field         | Type          | Description                       |
| ------------- | ------------- | --------------------------------- |
| Users         | object\_array | Matching users.                   |
| Total matches | integer       | Total users matching.             |
| Next cursor   | string        | Pass as Cursor for the next page. |

#### Upload File

Upload a file from a URL into an Appwrite storage bucket.

**Required permissions:** `files.write`, `buckets.read`.

**Inputs**

| Field       | Type            | Required | Description                                                                            |
| ----------- | --------------- | -------- | -------------------------------------------------------------------------------------- |
| Bucket      | select (string) | Yes      | The storage bucket to upload into. Options load from the selected connection.          |
| File URL    | string          | Yes      | Public HTTPS URL of the file to upload (up to 100 MB).                                 |
| File name   | string          | No       | Name to store the file under, with extension. Defaults to the name in the URL.         |
| Permissions | string          | No       | Optional comma-separated permission strings, e.g. read("any") to make the file public. |
| File ID     | string          | No       | Leave as unique() to auto-generate, or set a custom id. Default: unique().             |

**Outputs**

| Field        | Type     | Description                                                                      |
| ------------ | -------- | -------------------------------------------------------------------------------- |
| File ID      | string   | Id of the uploaded file.                                                         |
| Bucket ID    | string   | Bucket the file is in.                                                           |
| File name    | string   | Stored file name.                                                                |
| MIME type    | string   | Detected content type.                                                           |
| Size (bytes) | integer  | Original size in bytes.                                                          |
| View URL     | string   | URL to view the file inline; works publicly only if the file grants read("any"). |
| Download URL | string   | URL to download the file; same visibility rule as View URL.                      |
| Created at   | datetime | Upload timestamp.                                                                |

#### Execute Function

Run one of your Appwrite serverless functions and get its response.

**Required permissions:** `execution.write`, `functions.read`.

**Inputs**

| Field           | Type            | Required | Description                                                                                                   |
| --------------- | --------------- | -------- | ------------------------------------------------------------------------------------------------------------- |
| Function        | select (string) | Yes      | The function to run. Options load from the selected connection.                                               |
| Request body    | textarea        | No       | Text or JSON sent as the request body.                                                                        |
| Wait for result | boolean         | No       | Wait for the function to finish and return its response (on) or just start it (off). Default: true.           |
| Path            | string          | No       | Request path, may include a query string. Default: /.                                                         |
| HTTP method     | select (string) | No       | HTTP method the function sees. Available values: GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD. Default: POST. |
| Headers (JSON)  | textarea        | No       | Optional request headers as a JSON object.                                                                    |

**Outputs**

| Field                | Type     | Description                                          |
| -------------------- | -------- | ---------------------------------------------------- |
| Execution ID         | string   | Id of the execution.                                 |
| Status               | string   | waiting, processing, completed, failed or scheduled. |
| Response status code | integer  | HTTP status returned by the function (sync only).    |
| Response body        | textarea | Body returned by the function (sync only).           |
| Logs                 | textarea | Function stdout logs.                                |
| Errors               | textarea | Function stderr / errors.                            |
| Duration (s)         | number   | Execution time in seconds.                           |

#### Get Execution

Check the status and result of a function execution.

**Required permissions:** `execution.read`, `functions.read`.

**Inputs**

| Field        | Type            | Required | Description                                                                       |
| ------------ | --------------- | -------- | --------------------------------------------------------------------------------- |
| Function     | select (string) | Yes      | The function the execution belongs to. Options load from the selected connection. |
| Execution ID | string          | Yes      | The execution id returned by Execute Function.                                    |

**Outputs**

| Field                | Type     | Description                                                                |
| -------------------- | -------- | -------------------------------------------------------------------------- |
| Execution ID         | string   | Execution id.                                                              |
| Status               | string   | waiting, processing, completed, failed or scheduled.                       |
| Response status code | integer  | HTTP status returned by the function.                                      |
| Response body        | textarea | Body returned by the function (only for executions created synchronously). |
| Logs                 | textarea | Function logs.                                                             |
| Errors               | textarea | Function errors.                                                           |
| Duration (s)         | float    | Execution time in seconds.                                                 |
| Created at           | datetime | When the execution started.                                                |

### Triggers

A trigger starts a workflow when its configured event occurs. Configure the event and filters before enabling the trigger.

#### New Row

Starts the workflow the moment a new row (document) is added to a table.

Choose the database and table to watch. StackAI registers and secures the Appwrite webhook automatically when you enable the trigger; grant the API key webhooks.read, webhooks.write, databases.read and tables.read. Appwrite disables a webhook after 10 failed deliveries in a row, so republish the workflow to re-enable it if it stops firing.

**Required permissions:** `webhooks.read`, `webhooks.write`, `databases.read`, `tables.read`.

**Configuration**

| Field    | Type            | Required | Description                                                             |
| -------- | --------------- | -------- | ----------------------------------------------------------------------- |
| Database | select (string) | Yes      | Database to watch. Options load from the selected connection.           |
| Table    | select (string) | Yes      | Table to watch for new rows. Options load from the selected connection. |

**Event inputs**

| Field       | Type     | Required | Description               |
| ----------- | -------- | -------- | ------------------------- |
| Row ID      | string   | Yes      | Id of the new row.        |
| Database ID | string   | Yes      | Database.                 |
| Table ID    | string   | Yes      | Table.                    |
| Created at  | datetime | Yes      | Creation timestamp.       |
| Row data    | object   | Yes      | The row's custom columns. |

**Outputs**

| Field       | Type     | Description               |
| ----------- | -------- | ------------------------- |
| Row ID      | string   | Id of the new row.        |
| Database ID | string   | Database.                 |
| Table ID    | string   | Table.                    |
| Created at  | datetime | Creation timestamp.       |
| Row data    | dict     | The row's custom columns. |

#### New User

Starts the workflow the moment a user signs up or is created in your project.

StackAI registers and secures the Appwrite webhook automatically when you enable the trigger; grant the API key webhooks.read and webhooks.write. Appwrite disables a webhook after 10 failed deliveries in a row, so republish the workflow to re-enable it if it stops firing.

**Required permissions:** `webhooks.read`, `webhooks.write`.

**Event inputs**

| Field          | Type     | Required | Description                    |
| -------------- | -------- | -------- | ------------------------------ |
| User ID        | string   | Yes      | Id of the new user.            |
| Email          | string   | No       | Email.                         |
| Name           | string   | No       | Name.                          |
| Phone          | string   | No       | Phone.                         |
| Email verified | boolean  | Yes      | Whether the email is verified. |
| Labels         | array    | No       | User labels.                   |
| Created at     | datetime | Yes      | Creation timestamp.            |

**Outputs**

| Field          | Type          | Description                    |
| -------------- | ------------- | ------------------------------ |
| User ID        | string        | Id of the new user.            |
| Email          | string        | Email.                         |
| Name           | string        | Name.                          |
| Phone          | string        | Phone.                         |
| Email verified | boolean       | Whether the email is verified. |
| Labels         | string\_array | User labels.                   |
| Created at     | datetime      | Creation timestamp.            |

### Important behavior

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/integrations/catalog/appwrite.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
