> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudthinker.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Appwrite

> Connect Appwrite so agents can check service health, functions, databases, and buckets, and make small changes after you approve

Connect Appwrite and agents can check service health, failed jobs, functions and their deployments, databases, buckets, users, and teams. CloudThinker signs in with a **project API key**, on Appwrite Cloud or your own server.

## Prerequisites

* An Appwrite project, on Appwrite Cloud or a server you run.
* Permission to create API keys in the project.
* For a server with a private certificate, the issuing CA certificate in PEM form.

## Setup

**1. Copy the endpoint and project ID**

In the Appwrite console, find the API address of your project, such as `https://cloud.appwrite.io/v1`. Open **Settings** and copy the **Project ID**.

**2. Create an API key**

In the Appwrite console, create a project API key with the scopes in [Required permissions](#required-permissions). Copy it now.

**3. Add the connection in CloudThinker**

Go to **Settings → Workspace → Connections**. On the **Discover** tab, select **Appwrite**. Fill in the fields in [Connection details](#connection-details) and click **Connect**.

**Success state:** Appwrite shows **Connected** on the **Connected** tab.

## Connection details

| Field | Description | Example |
| - | - | - |
| **Appwrite endpoint** | The API address of your project | `https://cloud.appwrite.io/v1` |
| **Project ID** | Project ID from **Settings** in the Appwrite console | `<your-project-id>` |
| **API key** | A project API key with the scopes below | `<your-api-key>` |
| **CA certificate (optional)** | PEM of the private CA that issued your Appwrite certificate. Leave empty to use public trust | `-----BEGIN CERTIFICATE-----` |

The certificate and hostname are always checked.

## Required permissions

Read-only scopes:

`health.read`, `databases.read`, `functions.read`, `buckets.read`, `users.read`, `teams.read`, `execution.read`, `sites.read`

Add a write scope only for the changes you want agents to propose:

| Change | Scope |
| - | - |
| Block or unblock a user, set user labels | `users.write` |
| Enable or disable a database | `databases.write` |
| Activate a function deployment | `functions.write` |
| Run a function | `execution.write` |

## Agent capabilities

Changes run only after you approve them in [Approvals](https://docs.cloudthinker.io/guide/approvals/overview.md).

| Capability | What agents can do | Approval |
| - | - | - |
| **Overview** | Summarize functions, databases, buckets, sites, users, teams, and service health | No |
| **Health** | Check each service and the count of failed background jobs | No |
| **Functions** | List functions, show their recent deployments and executions, and spot failures | No |
| **Block or unblock user** | Set one user to active or blocked | Yes |
| **Set user labels** | Replace the labels on one user, up to 5, or clear them | Yes |
| **Enable or disable database** | Turn one database on or off | Yes |
| **Activate deployment** | Make one ready deployment of a function the active one | Yes |
| **Run function** | Run one function once, with an optional body up to 4000 characters | Yes |

Each change reads the target first and refuses an unknown ID. Running a function runs its code and cannot be undone.

### Verify the connection

```text theme={null}
Check Appwrite health and list any functions with failed deployments
```

Expect service status, failed job counts, and a list of functions. If a section is marked incomplete, the key lacks that read scope.

### Example prompts

```text theme={null}
Why did the latest deployment of the checkout function fail?
Which Appwrite services are unhealthy right now?
Block the user with ID <user-id>
```

## Troubleshooting

> [accordion] Requests return 401
>
> The API key is wrong or lacks a read scope. Create a key with the read scopes above, then edit the connection and paste it.

> [accordion] Certificate is not trusted
>
> Your server uses a private or self-signed certificate. Paste the issuing CA certificate into **CA certificate (optional)**.

> [accordion] A function returns 404
>
> No function has that ID. Ask the agent to list functions and use the ID it shows.

## Security

* **Least privilege** — grant only the permissions the agents need for your use case; start read-only and widen later.
* **Read-only by default** — use read-only credentials unless you want agents to make changes through this connection.
* **Rotate credentials** — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
* **Revoke on offboarding** — remove the credential at the provider when you delete a connection or a teammate leaves.

- **Scopes**: leave write scopes off the key if you only want to investigate.
- **Run function**: running a function can have side effects. Read the function name and body before you approve.

## Related

> [card] [Connections](https://docs.cloudthinker.io/guide/connections/overview.md)
>
> See how connections work and how to manage them.

> [card] [Approvals](https://docs.cloudthinker.io/guide/approvals/overview.md)
>
> Control which Appwrite changes wait for a person.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.