diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
new file mode 100644
index 0000000000..a0b044ecf2
--- /dev/null
+++ b/.github/workflows/codeql-analysis.yml
@@ -0,0 +1,62 @@
+name: "CodeQL"
+
+on:
+ push:
+ branches: [master]
+ pull_request:
+ # The branches below must be a subset of the branches above
+ branches: [master]
+ schedule:
+ - cron: '0 16 * * 0'
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-latest
+
+ strategy:
+ fail-fast: false
+ matrix:
+ # Override automatic language detection by changing the below list
+ # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
+ language: ['javascript']
+ # Learn more...
+ # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ with:
+ # We must fetch at least the immediate parents so that if this is
+ # a pull request then we can checkout the head.
+ fetch-depth: 2
+
+ # If this run was triggered by a pull request event, then checkout
+ # the head of the pull request instead of the merge commit.
+ - run: git checkout HEAD^2
+ if: ${{ github.event_name == 'pull_request' }}
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v1
+ with:
+ languages: ${{ matrix.language }}
+
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
+ # If this step fails, then you should remove it and run the build manually (see below)
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@v1
+
+ # ℹ️ Command-line programs to run using the OS shell.
+ # 📚 https://git.io/JvXDl
+
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
+ # and modify them (or add more) to build your code if your project
+ # uses a compiled language
+
+ #- run: |
+ # make bootstrap
+ # make release
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v1
diff --git a/CHANGES.md b/CHANGES.md
index e27b89b088..44fd40aec6 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -22,6 +22,14 @@
- Added pagination for projects list on the console home page.
- Updated storage calculation to match IEC standards
- Now using Alpine as base Docker image
+- User name max length is now 128 chars and not 100 for better API consistency
+- Team name max length is now 128 chars and not 100 for better API consistency
+- Collection name max length is now 128 chars and not 256 for better API consistency
+- Project name max length is now 128 chars and not 100 for better API consistency
+- Webhook name max length is now 128 chars and not 256 for better API consistency
+- API Key name max length is now 128 chars and not 256 for better API consistency
+- Task name max length is now 128 chars and not 256 for better API consistency
+- Platform name max length is now 128 chars and not 256 for better API consistency
- New and consistent response format for all API object + new response examples in the docs
- Removed user roles attribute from user object (can be fetched from /v1/teams/memberships) **
- Removed type attribute from session object response (used only internally)
@@ -59,6 +67,8 @@
- Access to Health API now requires authentication with an API Key with access to `health.read` scope allowed
- Added option to force HTTPS connection to the Appwrite server (_APP_OPTIONS_FORCE_HTTPS)
- Now using your `_APP_SYSTEM_EMAIL_ADDRESS` as the email address for issuing and renewing SSL certificates
+- Block iframe access to Appwrite console using the `X-Frame-Options` header.
+- Fixed `roles` param input validator
# Version 0.6.2 (PRE-RELEASE)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f007f9cf10..9f0f4ac428 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -6,38 +6,48 @@ We would ❤️ for you to contribute to Appwrite and help make it better! We wa
If you are worried or don’t know where to start, check out our next section explaining what kind of help we could use and where can you get involved. You can reach out with questions to [Eldad Fux (@eldadfux)](https://twitter.com/eldadfux) or [@appwrite_io](https://twitter.com/appwrite_io) on Twitter, and anyone from the [Appwrite team on Discord](https://discord.gg/GSeTUeA). You can also submit an issue, and a maintainer can guide you!
-## Where to Start?
-
-Pull requests are great, but there are many other areas where you can help Appwrite.
-
-### Blogging & Speaking
-
-Blogging, speaking about, or creating tutorials about one of Appwrite’s many features. Mention [@appwrite_io](https://twitter.com/appwrite_io) on Twitter and/or email team [at] appwrite [dot] io so we can give pointers and tips and help you spread the word by promoting your content on the different Appwrite communication channels. Please add your blog posts and videos of talks to our [Awesome Appwrite]() repo on GitHub.
-
-### Presenting at Meetups
-
-Presenting at meetups and conferences about your Appwrite projects. Your unique challenges and successes in building things with Appwrite can provide great speaking material. We’d love to review your talk abstract/CFP, so get in touch with us if you’d like some help!
-
-### Sending Feedbacks & Reporting Bugs
-
-Sending feedback is a great way for us to understand your different use cases of Appwrite better. If you had any issues, bugs, or want to share about your experience, feel free to do so on our GitHub issues page or at our [Discord channel](https://discord.gg/GSeTUeA).
-
-### Submitting New Ideas
-
-If you think Appwrite could use a new feature, please open an issue on our GitHub repository, stating as much information as you can think about your new idea and it's implications. We would also use this issue to gather more information, get more feedback from the community, and have a proper discussion about the new feature.
-
-### Improving Documentation
-
-Submitting documentation updates, enhancements, designs, or bug fixes. Spelling or grammar fixes will be very much appreciated.
-
-### Helping Someone
-
-Searching for Appwrite on Discord, GitHub or StackOverflow and helping someone else who needs help. You can also help by reaching others how to contribute to Appwrite's repo!
-
## Code of Conduct
Help us keep Appwrite open and inclusive. Please read and follow our [Code of Conduct](/CODE_OF_CONDUCT.md).
+## Setup From Source
+
+To set up a working **development environment**, just fork the project git repository and install the backend and frontend dependencies using the proper package manager and create run the docker-compose stack.
+
+> If you just want to install Appwrite for day-to-day usage and not as a code maintainer use this [installation guide](https://github.com/appwrite/appwrite#installation).
+
+Please note that these instructions are for setting a functional dev environment. If you want to set up an Appwrite instance to integrate into your app, you should probably try and install Appwrite by using the instructions in the [getting started guide](https://appwrite.io/docs/getting-started-for-web) or in the main [README](README.md) file.
+
+```bash
+git clone git@github.com:[YOUR_FORK_HERE]/appwrite.git
+
+cd appwrite
+
+docker-compose up -d
+```
+
+After finishing the installation process, you can start writing and editing code. To compile new CSS and JS distribution files, use 'less' and 'build' tasks using gulp as a task manager.
+
+## Architecture
+
+Appwrite's current structure is a combination of both [Monolithic](https://en.wikipedia.org/wiki/Monolithic_application) and [Microservice](https://en.wikipedia.org/wiki/Microservices) architectures, but our final goal, as we grow, is to be using only microservices.
+
+---
+
+---
+
+### The Monolithic Part
+
+Appwrite's main API container is designed as a monolithic app. This is a decision we made to allow us to develop the project faster while still being a very small team.
+
+Although the Appwrite API is a monolithic app, it has a very clear separation of concern as each internal service or worker is separated by its container, which will allow us as we grow to start breaking services for better maintenance and scalability.
+
+### The Microservice Part
+
+Each container in Appwrite is a microservice on its own. Each service is an independent process that can scale without regard to any of the other services.
+
+Currently, all of the Appwrite microservices are intended to communicate using the TCP protocol over a private network. You should be aware to not expose any of the services to the public-facing network, besides the public port 80 and 443, who, by default, are used to expose the Appwrite HTTP API.
+
## Technology Stack
To start helping us to improve the Appwrite server by submitting code, prior knowledge of Appwrite's technology stack can help you with getting started.
@@ -74,7 +84,7 @@ We use prettier for our JS coding standards and for auto-formatting our code.
Appwrite is built to scale. Please keep in mind that the Appwrite stack can run in different environments and different scales.
-We wish Appwrite will be as easy to set up and in a single, localhost, and easy to grow to a large environment with thousands and even hundreds of instances.
+We wish Appwrite will be as easy to set up and in a single, localhost, and easy to grow to a large environment with dozens and even hundreds of instances.
When contributing code, please take into account the following considerations:
@@ -87,22 +97,6 @@ When contributing code, please take into account the following considerations:
* Background Jobs
* Task Execution Time
-## Architecture
-
-Appwrite's current structure is a combination of both [Monolithic](https://en.wikipedia.org/wiki/Monolithic_application) and [Microservice](https://en.wikipedia.org/wiki/Microservices) architectures, but our final goal, as we grow, is to be using only microservices.
-
-### The Monolithic Part
-
-Appwrite's main API container is designed as a monolithic app. This is a decision we made to allow us to develop the project faster while still being a very small team.
-
-Although the Appwrite API is a monolithic app, it has a very clear separation of concern as each internal service or worker is separated by its container, which will allow us as we grow to start breaking services for better maintenance and scalability.
-
-### The Microservice Part
-
-Each container in Appwrite is a microservice on its own. Each service is an independent process that can scale without regard to any of the other services.
-
-Currently, all of the Appwrite microservices are intended to communicate using the TCP protocol over a private network. You should be aware to not expose any of the services to the public-facing network, besides the public port 80 and 443, who, by default, are used to expose the Appwrite HTTP API.
-
## Security & Privacy
Security and privacy are extremely important to Appwrite, developers, and users alike. Make sure to follow the best industry standards and practices.
@@ -123,24 +117,6 @@ This will allow the Appwrite community to have sufficient discussion about the n
This is also important for the Appwrite lead developers to be able to give technical input and different emphasize regarding the feature design and architecture.
-## Setup From Source
-
-To set up a working **development environment**, just fork the project git repository and install the backend and frontend dependencies using the proper package manager and create run the docker-compose stack.
-
-> If you just want to install Appwrite for day-to-day usage and not as a code maintainer use this [installation guide](https://github.com/appwrite/appwrite#installation).
-
-Please note that these instructions are for setting a functional dev environment. If you want to set up an Appwrite instance to integrate into your app, you should probably try and install Appwrite by using the instructions in the [getting started guide](https://appwrite.io/docs/getting-started-for-web) or in the main [README](README.md) file.
-
-```bash
-git clone git@github.com:[YOUR_FORK_HERE]/appwrite.git
-
-cd appwrite
-
-docker-compose up -d
-```
-
-After finishing the installation process, you can start writing and editing code. To compile new CSS and JS distribution files, use 'less' and 'build' tasks using gulp as a task manager.
-
## Build
To build a new version of the Appwrite server, all you need to do is run the build.sh file like this:
@@ -213,3 +189,33 @@ From time to time, our team will add tutorials that will help contributors find
* [Adding Support for a New OAuth2 Provider](./docs/tutorials/add-oauth2-provider.md)
* [Appwrite Environment Variables](./docs/tutorials/environment-variables.md)
* [Running in Production](./docs/tutorials/running-in-production.md)
+
+
+## Other Ways to Help
+
+Pull requests are great, but there are many other areas where you can help Appwrite.
+
+### Blogging & Speaking
+
+Blogging, speaking about, or creating tutorials about one of Appwrite’s many features. Mention [@appwrite_io](https://twitter.com/appwrite_io) on Twitter and/or email team [at] appwrite [dot] io so we can give pointers and tips and help you spread the word by promoting your content on the different Appwrite communication channels. Please add your blog posts and videos of talks to our [Awesome Appwrite]() repo on GitHub.
+
+### Presenting at Meetups
+
+Presenting at meetups and conferences about your Appwrite projects. Your unique challenges and successes in building things with Appwrite can provide great speaking material. We’d love to review your talk abstract/CFP, so get in touch with us if you’d like some help!
+
+### Sending Feedbacks & Reporting Bugs
+
+Sending feedback is a great way for us to understand your different use cases of Appwrite better. If you had any issues, bugs, or want to share about your experience, feel free to do so on our GitHub issues page or at our [Discord channel](https://discord.gg/GSeTUeA).
+
+### Submitting New Ideas
+
+If you think Appwrite could use a new feature, please open an issue on our GitHub repository, stating as much information as you can think about your new idea and it's implications. We would also use this issue to gather more information, get more feedback from the community, and have a proper discussion about the new feature.
+
+### Improving Documentation
+
+Submitting documentation updates, enhancements, designs, or bug fixes. Spelling or grammar fixes will be very much appreciated.
+
+### Helping Someone
+
+Searching for Appwrite on Discord, GitHub or StackOverflow and helping someone else who needs help. You can also help by reaching others how to contribute to Appwrite's repo!
+
diff --git a/Dockerfile b/Dockerfile
index 2eeb7f84f3..1a2798c450 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -16,7 +16,7 @@ FROM php:7.4-cli-alpine as step1
ENV TZ=Asia/Tel_Aviv \
PHP_REDIS_VERSION=5.3.0 \
- PHP_SWOOLE_VERSION=4.5.2 \
+ PHP_SWOOLE_VERSION=4.5.3 \
PHP_XDEBUG_VERSION=sdebug_2_9-beta
RUN \
diff --git a/Dockerfile.alpine b/Dockerfile.alpine
deleted file mode 100755
index e60b97585c..0000000000
--- a/Dockerfile.alpine
+++ /dev/null
@@ -1,178 +0,0 @@
-FROM composer:2.0 as step0
-
-ARG TESTING=false
-ENV TESTING=$TESTING
-
-WORKDIR /usr/local/src/
-
-COPY composer.lock /usr/local/src/
-COPY composer.json /usr/local/src/
-
-RUN composer update --ignore-platform-reqs --optimize-autoloader \
- --no-plugins --no-scripts --prefer-dist \
- `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
-
-FROM php:8.0.0alpha1-cli-alpine as step1
-
-ENV TZ=Asia/Tel_Aviv \
- DEBIAN_FRONTEND=noninteractive \
- PHP_REDIS_VERSION=5.3.0 \
- PHP_SWOOLE_VERSION=4.5.2 \
- PHP_XDEBUG_VERSION=sdebug_2_9-beta
-
-RUN \
- apk update && \
- apk add ca-certificates gcc make g++ autoconf wget git openssl make zip unzip brotli zlib
-
-RUN docker-php-ext-install sockets
-
-RUN \
- # Redis Extension
- wget -q https://github.com/phpredis/phpredis/archive/$PHP_REDIS_VERSION.tar.gz && \
- tar -xf $PHP_REDIS_VERSION.tar.gz && \
- cd phpredis-$PHP_REDIS_VERSION && \
- phpize && \
- ./configure && \
- make && make install && \
- cd .. && \
- ## Swoole Extension
- git clone https://github.com/swoole/swoole-src.git && \
- cd swoole-src && \
- #git checkout v$PHP_SWOOLE_VERSION && \
- phpize && \
- ./configure --enable-sockets --enable-http2 && \
- make && make install && \
- cd ..
- ## XDebug Extension
- # git clone https://github.com/swoole/sdebug.git && \
- # cd sdebug && \
- # git checkout $PHP_XDEBUG_VERSION && \
- # phpize && \
- # ./configure --enable-xdebug && \
- # make clean && make && make install
- # cd .. && \
- # Meminfo Extension
- # git clone https://github.com/BitOne/php-meminfo.git && \
- # cd php-meminfo && \
- # git checkout v1.0.5 && \
- # cd extension/php7 && \
- # phpize && \
- # ./configure --enable-meminfo && \
- # make && make install
-
-FROM php:8.0.0alpha1-cli-alpine as final
-
-LABEL maintainer="team@appwrite.io"
-
-ARG VERSION=dev
-
-ENV TZ=Asia/Tel_Aviv \
- DEBIAN_FRONTEND=noninteractive \
- _APP_SERVER=swoole \
- _APP_ENV=production \
- _APP_DOMAIN=localhost \
- _APP_DOMAIN_TARGET=localhost \
- _APP_HOME=https://appwrite.io \
- _APP_EDITION=community \
- _APP_OPTIONS_ABUSE=enabled \
- _APP_OPTIONS_FORCE_HTTPS=disabled \
- _APP_OPENSSL_KEY_V1=your-secret-key \
- _APP_STORAGE_LIMIT=100000000 \
- _APP_STORAGE_ANTIVIRUS=enabled \
- _APP_REDIS_HOST=redis \
- _APP_REDIS_PORT=6379 \
- _APP_DB_HOST=mariadb \
- _APP_DB_PORT=3306 \
- _APP_DB_USER=root \
- _APP_DB_PASS=password \
- _APP_DB_SCHEMA=appwrite \
- _APP_INFLUXDB_HOST=influxdb \
- _APP_INFLUXDB_PORT=8086 \
- _APP_STATSD_HOST=telegraf \
- _APP_STATSD_PORT=8125 \
- _APP_SMTP_HOST=smtp \
- _APP_SMTP_PORT=25 \
- _APP_SETUP=self-hosted \
- _APP_VERSION=$VERSION
-#ENV _APP_SMTP_SECURE ''
-#ENV _APP_SMTP_USERNAME ''
-#ENV _APP_SMTP_PASSWORD ''
-
-RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
-
-RUN \
- apk update && \
- apk add libwebp certbot htop procps \
- oniguruma libcurl imagemagick-libs yaml-dev brotli-libs zlib-dev
- # pecl install imagick yaml && \
- # docker-php-ext-enable imagick yaml
-
-RUN docker-php-ext-install sockets curl opcache pdo pdo_mysql
-
-WORKDIR /usr/src/code
-
-COPY --from=step0 /usr/local/src/vendor /usr/src/code/vendor
-COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190128/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20190128/
-COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190128/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20190128/
-# COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190128/xdebug.so /usr/local/lib/php/extensions/no-debug-non-zts-20190128/
-# COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190128/meminfo.so /usr/local/lib/php/extensions/no-debug-non-zts-20190128/
-
-# Add Source Code
-COPY ./app /usr/src/code/app
-COPY ./bin /usr/local/bin
-COPY ./docs /usr/src/code/docs
-COPY ./public /usr/src/code/public
-COPY ./src /usr/src/code/src
-
-# Set Volumes
-RUN mkdir -p /storage/uploads && \
- mkdir -p /storage/cache && \
- mkdir -p /storage/config && \
- mkdir -p /storage/certificates && \
- mkdir -p /storage/functions && \
- mkdir -p /storage/debug && \
- chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \
- chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache && \
- chown -Rf www-data.www-data /storage/config && chmod -Rf 0755 /storage/config && \
- chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \
- chown -Rf www-data.www-data /storage/functions && chmod -Rf 0755 /storage/functions && \
- chown -Rf www-data.www-data /storage/debug && chmod -Rf 0755 /storage/debug
-
-# Executables
-RUN chmod +x /usr/local/bin/doctor
-RUN chmod +x /usr/local/bin/migrate
-RUN chmod +x /usr/local/bin/schedule
-RUN chmod +x /usr/local/bin/test
-RUN chmod +x /usr/local/bin/worker-audits
-RUN chmod +x /usr/local/bin/worker-certificates
-RUN chmod +x /usr/local/bin/worker-deletes
-RUN chmod +x /usr/local/bin/worker-functions
-RUN chmod +x /usr/local/bin/worker-mails
-RUN chmod +x /usr/local/bin/worker-tasks
-RUN chmod +x /usr/local/bin/worker-usage
-RUN chmod +x /usr/local/bin/worker-webhooks
-
-# Letsencrypt Permissions
-RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
-
-# Enable Extensions
-RUN echo extension=swoole.so >> /usr/local/etc/php/conf.d/swoole.ini
-RUN echo extension=redis.so >> /usr/local/etc/php/conf.d/redis.ini
-# RUN echo zend_extension=xdebug.so >> /usr/local/etc/php/conf.d/xdebug.ini
-# RUN echo extension=meminfo.so >> /usr/local/etc/php/conf.d/meminfo.ini
-
-RUN echo "opcache.preload_user=www-data" >> /usr/local/etc/php/conf.d/appwrite.ini
-RUN echo "opcache.preload=/usr/src/code/app/preload.php" >> /usr/local/etc/php/conf.d/appwrite.ini
-RUN echo "opcache.enable_cli = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
-# RUN echo "xdebug.profiler_enable = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
-# RUN echo "xdebug.profiler_output_dir = /tmp/" >> /usr/local/etc/php/conf.d/appwrite.ini
-# RUN echo "xdebug.profiler_enable_trigger = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
-# RUN echo "xdebug.trace_format = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
-
-EXPOSE 80
-
-#, "-dxdebug.auto_trace=1"
-#, "-dxdebug.profiler_enable=1"
-#, "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php"
-
-CMD [ "php", "app/server.php", "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php" ]
\ No newline at end of file
diff --git a/Dockerfile.debian b/Dockerfile.debian
deleted file mode 100755
index 0d55f0a6f5..0000000000
--- a/Dockerfile.debian
+++ /dev/null
@@ -1,180 +0,0 @@
-FROM composer:2.0 as step0
-
-ARG TESTING=false
-ENV TESTING=$TESTING
-
-WORKDIR /usr/local/src/
-
-COPY composer.lock /usr/local/src/
-COPY composer.json /usr/local/src/
-
-RUN composer update --ignore-platform-reqs --optimize-autoloader \
- --no-plugins --no-scripts --prefer-dist \
- `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
-
-FROM php:7.4-cli as step1
-
-ENV TZ=Asia/Tel_Aviv \
- DEBIAN_FRONTEND=noninteractive \
- PHP_REDIS_VERSION=5.3.0 \
- PHP_SWOOLE_VERSION=4.5.2 \
- PHP_XDEBUG_VERSION=sdebug_2_9-beta
-
-RUN \
- apt-get update && \
- apt-get install -y --no-install-recommends --no-install-suggests ca-certificates software-properties-common wget git openssl make zip unzip libbrotli-dev libz-dev
-
-RUN docker-php-ext-install sockets
-
-RUN \
- # Redis Extension
- wget -q https://github.com/phpredis/phpredis/archive/$PHP_REDIS_VERSION.tar.gz && \
- tar -xf $PHP_REDIS_VERSION.tar.gz && \
- cd phpredis-$PHP_REDIS_VERSION && \
- phpize && \
- ./configure && \
- make && make install && \
- cd .. && \
- ## Swoole Extension
- git clone https://github.com/swoole/swoole-src.git && \
- cd swoole-src && \
- git checkout v$PHP_SWOOLE_VERSION && \
- phpize && \
- ./configure --enable-sockets --enable-http2 && \
- make && make install && \
- cd ..
- ## XDebug Extension
- # git clone https://github.com/swoole/sdebug.git && \
- # cd sdebug && \
- # git checkout $PHP_XDEBUG_VERSION && \
- # phpize && \
- # ./configure --enable-xdebug && \
- # make clean && make && make install
- # cd .. && \
- # Meminfo Extension
- # git clone https://github.com/BitOne/php-meminfo.git && \
- # cd php-meminfo && \
- # git checkout v1.0.5 && \
- # cd extension/php7 && \
- # phpize && \
- # ./configure --enable-meminfo && \
- # make && make install
-
-FROM php:7.4-cli as final
-
-LABEL maintainer="team@appwrite.io"
-
-ARG VERSION=dev
-
-ENV TZ=Asia/Tel_Aviv \
- DEBIAN_FRONTEND=noninteractive \
- _APP_SERVER=swoole \
- _APP_ENV=production \
- _APP_DOMAIN=localhost \
- _APP_DOMAIN_TARGET=localhost \
- _APP_HOME=https://appwrite.io \
- _APP_EDITION=community \
- _APP_OPTIONS_ABUSE=enabled \
- _APP_OPTIONS_FORCE_HTTPS=disabled \
- _APP_OPENSSL_KEY_V1=your-secret-key \
- _APP_STORAGE_LIMIT=100000000 \
- _APP_STORAGE_ANTIVIRUS=enabled \
- _APP_REDIS_HOST=redis \
- _APP_REDIS_PORT=6379 \
- _APP_DB_HOST=mariadb \
- _APP_DB_PORT=3306 \
- _APP_DB_USER=root \
- _APP_DB_PASS=password \
- _APP_DB_SCHEMA=appwrite \
- _APP_INFLUXDB_HOST=influxdb \
- _APP_INFLUXDB_PORT=8086 \
- _APP_STATSD_HOST=telegraf \
- _APP_STATSD_PORT=8125 \
- _APP_SMTP_HOST=smtp \
- _APP_SMTP_PORT=25 \
- _APP_FUNCTIONS_TIMEOUT=900 \
- _APP_FUNCTIONS_CONTAINERS=10 \
- _APP_SETUP=self-hosted \
- _APP_VERSION=$VERSION
-#ENV _APP_SMTP_SECURE ''
-#ENV _APP_SMTP_USERNAME ''
-#ENV _APP_SMTP_PASSWORD ''
-
-RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
-
-RUN \
- apt-get update && \
- apt-get install -y --no-install-recommends --no-install-suggests webp certbot htop procps docker.io \
- libonig-dev libcurl4-gnutls-dev libmagickwand-dev libyaml-dev libbrotli-dev libz-dev && \
- pecl install imagick yaml && \
- docker-php-ext-enable imagick yaml
-
-RUN docker-php-ext-install sockets curl opcache pdo pdo_mysql
-
-WORKDIR /usr/src/code
-
-COPY --from=step0 /usr/local/src/vendor /usr/src/code/vendor
-COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
-COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
-# COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
-# COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/meminfo.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
-
-# Add Source Code
-COPY ./app /usr/src/code/app
-COPY ./bin /usr/local/bin
-COPY ./docs /usr/src/code/docs
-COPY ./public /usr/src/code/public
-COPY ./src /usr/src/code/src
-
-# Set Volumes
-RUN mkdir -p /storage/uploads && \
- mkdir -p /storage/cache && \
- mkdir -p /storage/config && \
- mkdir -p /storage/certificates && \
- mkdir -p /storage/functions && \
- mkdir -p /storage/debug && \
- chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \
- chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache && \
- chown -Rf www-data.www-data /storage/config && chmod -Rf 0755 /storage/config && \
- chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \
- chown -Rf www-data.www-data /storage/functions && chmod -Rf 0755 /storage/functions && \
- chown -Rf www-data.www-data /storage/debug && chmod -Rf 0755 /storage/debug
-
-# Executables
-RUN chmod +x /usr/local/bin/doctor
-RUN chmod +x /usr/local/bin/migrate
-RUN chmod +x /usr/local/bin/schedule
-RUN chmod +x /usr/local/bin/test
-RUN chmod +x /usr/local/bin/worker-audits
-RUN chmod +x /usr/local/bin/worker-certificates
-RUN chmod +x /usr/local/bin/worker-deletes
-RUN chmod +x /usr/local/bin/worker-functions
-RUN chmod +x /usr/local/bin/worker-mails
-RUN chmod +x /usr/local/bin/worker-tasks
-RUN chmod +x /usr/local/bin/worker-usage
-RUN chmod +x /usr/local/bin/worker-webhooks
-
-# Letsencrypt Permissions
-RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
-
-# Enable Extensions
-RUN echo extension=swoole.so >> /usr/local/etc/php/conf.d/swoole.ini
-RUN echo extension=redis.so >> /usr/local/etc/php/conf.d/redis.ini
-# RUN echo zend_extension=xdebug.so >> /usr/local/etc/php/conf.d/xdebug.ini
-# RUN echo extension=meminfo.so >> /usr/local/etc/php/conf.d/meminfo.ini
-
-RUN echo "opcache.preload_user=www-data" >> /usr/local/etc/php/conf.d/appwrite.ini
-RUN echo "opcache.preload=/usr/src/code/app/preload.php" >> /usr/local/etc/php/conf.d/appwrite.ini
-RUN echo "opcache.enable_cli = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
-# RUN echo "xdebug.profiler_enable = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
-# RUN echo "xdebug.profiler_output_dir = /tmp/" >> /usr/local/etc/php/conf.d/appwrite.ini
-# RUN echo "xdebug.profiler_enable_trigger = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
-# RUN echo "xdebug.trace_format = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
-
-EXPOSE 80
-
-#, "-dxdebug.auto_trace=1"
-#, "-dxdebug.profiler_enable=1"
-#, "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php"
-
-CMD [ "php", "app/server.php", "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php" ]
\ No newline at end of file
diff --git a/Dockerfile.php8 b/Dockerfile.php8
deleted file mode 100755
index 2cc74ef76d..0000000000
--- a/Dockerfile.php8
+++ /dev/null
@@ -1,178 +0,0 @@
-FROM composer:2.0 as step0
-
-ARG TESTING=false
-ENV TESTING=$TESTING
-
-WORKDIR /usr/local/src/
-
-COPY composer.lock /usr/local/src/
-COPY composer.json /usr/local/src/
-
-RUN composer update --ignore-platform-reqs --optimize-autoloader \
- --no-plugins --no-scripts --prefer-dist \
- `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
-
-FROM php:8.0-rc as step1
-
-ENV TZ=Asia/Tel_Aviv \
- DEBIAN_FRONTEND=noninteractive \
- PHP_REDIS_VERSION=5.3.0 \
- PHP_SWOOLE_VERSION=4.5.2 \
- PHP_XDEBUG_VERSION=sdebug_2_9-beta
-
-RUN \
- apt-get update && \
- apt-get install -y --no-install-recommends --no-install-suggests ca-certificates software-properties-common wget git openssl make zip unzip libbrotli-dev libz-dev
-
-RUN docker-php-ext-install sockets
-
-RUN \
- # Redis Extension
- wget -q https://github.com/phpredis/phpredis/archive/$PHP_REDIS_VERSION.tar.gz && \
- tar -xf $PHP_REDIS_VERSION.tar.gz && \
- cd phpredis-$PHP_REDIS_VERSION && \
- phpize && \
- ./configure && \
- make && make install && \
- cd .. && \
- ## Swoole Extension
- git clone https://github.com/swoole/swoole-src.git && \
- cd swoole-src && \
- #git checkout v$PHP_SWOOLE_VERSION && \
- phpize && \
- ./configure --enable-sockets --enable-http2 && \
- make && make install && \
- cd ..
- ## XDebug Extension
- # git clone https://github.com/swoole/sdebug.git && \
- # cd sdebug && \
- # git checkout $PHP_XDEBUG_VERSION && \
- # phpize && \
- # ./configure --enable-xdebug && \
- # make clean && make && make install
- # cd .. && \
- # Meminfo Extension
- # git clone https://github.com/BitOne/php-meminfo.git && \
- # cd php-meminfo && \
- # git checkout v1.0.5 && \
- # cd extension/php7 && \
- # phpize && \
- # ./configure --enable-meminfo && \
- # make && make install
-
-FROM php:8.0-rc as final
-
-LABEL maintainer="team@appwrite.io"
-
-ARG VERSION=dev
-
-ENV TZ=Asia/Tel_Aviv \
- DEBIAN_FRONTEND=noninteractive \
- _APP_SERVER=swoole \
- _APP_ENV=production \
- _APP_DOMAIN=localhost \
- _APP_DOMAIN_TARGET=localhost \
- _APP_HOME=https://appwrite.io \
- _APP_EDITION=community \
- _APP_OPTIONS_ABUSE=enabled \
- _APP_OPTIONS_FORCE_HTTPS=disabled \
- _APP_OPENSSL_KEY_V1=your-secret-key \
- _APP_STORAGE_LIMIT=100000000 \
- _APP_STORAGE_ANTIVIRUS=enabled \
- _APP_REDIS_HOST=redis \
- _APP_REDIS_PORT=6379 \
- _APP_DB_HOST=mariadb \
- _APP_DB_PORT=3306 \
- _APP_DB_USER=root \
- _APP_DB_PASS=password \
- _APP_DB_SCHEMA=appwrite \
- _APP_INFLUXDB_HOST=influxdb \
- _APP_INFLUXDB_PORT=8086 \
- _APP_STATSD_HOST=telegraf \
- _APP_STATSD_PORT=8125 \
- _APP_SMTP_HOST=smtp \
- _APP_SMTP_PORT=25 \
- _APP_SETUP=self-hosted \
- _APP_VERSION=$VERSION
-#ENV _APP_SMTP_SECURE ''
-#ENV _APP_SMTP_USERNAME ''
-#ENV _APP_SMTP_PASSWORD ''
-
-RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
-
-RUN \
- apt-get update && \
- apt-get install -y --no-install-recommends --no-install-suggests webp certbot htop procps \
- libonig-dev libcurl4-gnutls-dev libmagickwand-dev libyaml-dev libbrotli-dev libz-dev
- # pecl install imagick yaml && \
- # docker-php-ext-enable imagick yaml
-
-RUN docker-php-ext-install sockets curl opcache pdo pdo_mysql
-
-WORKDIR /usr/src/code
-
-COPY --from=step0 /usr/local/src/vendor /usr/src/code/vendor
-COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
-COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
-# COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
-# COPY --from=step1 /usr/local/lib/php/extensions/no-debug-non-zts-20190902/meminfo.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
-
-# Add Source Code
-COPY ./app /usr/src/code/app
-COPY ./bin /usr/local/bin
-COPY ./docs /usr/src/code/docs
-COPY ./public /usr/src/code/public
-COPY ./src /usr/src/code/src
-
-# Set Volumes
-RUN mkdir -p /storage/uploads && \
- mkdir -p /storage/cache && \
- mkdir -p /storage/config && \
- mkdir -p /storage/certificates && \
- mkdir -p /storage/functions && \
- mkdir -p /storage/debug && \
- chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \
- chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache && \
- chown -Rf www-data.www-data /storage/config && chmod -Rf 0755 /storage/config && \
- chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \
- chown -Rf www-data.www-data /storage/functions && chmod -Rf 0755 /storage/functions && \
- chown -Rf www-data.www-data /storage/debug && chmod -Rf 0755 /storage/debug
-
-# Executables
-RUN chmod +x /usr/local/bin/doctor
-RUN chmod +x /usr/local/bin/migrate
-RUN chmod +x /usr/local/bin/schedule
-RUN chmod +x /usr/local/bin/test
-RUN chmod +x /usr/local/bin/worker-audits
-RUN chmod +x /usr/local/bin/worker-certificates
-RUN chmod +x /usr/local/bin/worker-deletes
-RUN chmod +x /usr/local/bin/worker-functions
-RUN chmod +x /usr/local/bin/worker-mails
-RUN chmod +x /usr/local/bin/worker-tasks
-RUN chmod +x /usr/local/bin/worker-usage
-RUN chmod +x /usr/local/bin/worker-webhooks
-
-# Letsencrypt Permissions
-RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
-
-# Enable Extensions
-RUN echo extension=swoole.so >> /usr/local/etc/php/conf.d/swoole.ini
-RUN echo extension=redis.so >> /usr/local/etc/php/conf.d/redis.ini
-# RUN echo zend_extension=xdebug.so >> /usr/local/etc/php/conf.d/xdebug.ini
-# RUN echo extension=meminfo.so >> /usr/local/etc/php/conf.d/meminfo.ini
-
-RUN echo "opcache.preload_user=www-data" >> /usr/local/etc/php/conf.d/appwrite.ini
-RUN echo "opcache.preload=/usr/src/code/app/preload.php" >> /usr/local/etc/php/conf.d/appwrite.ini
-RUN echo "opcache.enable_cli = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
-# RUN echo "xdebug.profiler_enable = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
-# RUN echo "xdebug.profiler_output_dir = /tmp/" >> /usr/local/etc/php/conf.d/appwrite.ini
-# RUN echo "xdebug.profiler_enable_trigger = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
-# RUN echo "xdebug.trace_format = 1" >> /usr/local/etc/php/conf.d/appwrite.ini
-
-EXPOSE 80
-
-#, "-dxdebug.auto_trace=1"
-#, "-dxdebug.profiler_enable=1"
-#, "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php"
-
-CMD [ "php", "app/server.php", "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php" ]
\ No newline at end of file
diff --git a/README.md b/README.md
index a48e764fcf..ba01dc08f0 100644
--- a/README.md
+++ b/README.md
@@ -2,12 +2,12 @@
- A complete backend solution for your [Flutter / Vue / Angular / React / iOS / Android / *ANY OTHER*] client app
+ A complete backend solution for your [Flutter / Vue / Angular / React / iOS / Android / *ANY OTHER*] app
-
+[](CONTRIBUTING.md)
[](https://discord.gg/GSeTUeA)
[](https://travis-ci.org/appwrite/appwrite)
[](https://travis-ci.org/appwrite/appwrite)
@@ -51,6 +51,7 @@ The easiest way to start running your Appwrite server is by running our docker-c
docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
+ --entrypoint="install" \
appwrite/appwrite:0.7.0
```
@@ -62,6 +63,7 @@ docker run -it --rm \
docker run -it --rm ^
--volume //var/run/docker.sock:/var/run/docker.sock ^
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
+ --entrypoint="install" ^
appwrite/appwrite:0.7.0
```
@@ -71,6 +73,7 @@ docker run -it --rm ^
docker run -it --rm ,
--volume /var/run/docker.sock:/var/run/docker.sock ,
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ,
+ --entrypoint="install" ,
appwrite/appwrite:0.7.0
```
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 0000000000..a09be23628
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,14 @@
+# Security Policy
+
+## Supported Versions
+
+| Version | Supported |
+| ------- | ------------------ |
+| < 0.5 | :x: |
+| 0.6.x | :white_check_mark: |
+| 0.7.x | :white_check_mark: |
+| 0.8.0 | :white_check_mark: |
+
+## Reporting a Vulnerability
+
+For security issues, kindly email us security@appwrite.io instead of posting a public issue in GitHub.
diff --git a/app/config/collections.php b/app/config/collections.php
index 2f630e0ba1..249f75f016 100644
--- a/app/config/collections.php
+++ b/app/config/collections.php
@@ -656,6 +656,7 @@ $collections = [
'default' => '',
'required' => false,
'array' => false,
+ 'filter' => ['encrypt'],
],
],
],
@@ -826,6 +827,7 @@ $collections = [
'default' => '',
'required' => false,
'array' => false,
+ 'filter' => ['encrypt'],
],
[
'$collection' => Database::SYSTEM_COLLECTION_RULES,
@@ -1433,6 +1435,13 @@ $collections = [
],
],
],
+ Database::SYSTEM_COLLECTION_RESERVED => [
+ '$collection' => Database::SYSTEM_COLLECTION_COLLECTIONS,
+ '$id' => Database::SYSTEM_COLLECTION_RESERVED,
+ '$permissions' => ['read' => ['*']],
+ 'name' => 'Reserved',
+ 'structure' => true,
+ ],
];
/*
@@ -1461,6 +1470,7 @@ foreach ($providers as $index => $provider) {
'default' => '',
'required' => false,
'array' => false,
+ 'filter' => ['encrypt'],
];
$collections[Database::SYSTEM_COLLECTION_USERS]['rules'][] = [
diff --git a/app/config/platforms.php b/app/config/platforms.php
index 5932577501..eea2a273e9 100644
--- a/app/config/platforms.php
+++ b/app/config/platforms.php
@@ -30,7 +30,7 @@ return [
[
'key' => 'flutter',
'name' => 'Flutter',
- 'version' => '0.2.3',
+ 'version' => '0.3.0-dev.2',
'url' => 'https://github.com/appwrite/sdk-for-flutter',
'enabled' => true,
'beta' => true,
@@ -45,7 +45,7 @@ return [
[
'key' => 'flutter-dev',
'name' => 'Flutter (Dev Channel)',
- 'version' => '0.2.3',
+ 'version' => '0.3.2',
'url' => 'https://github.com/appwrite/sdk-for-flutter-dev',
'enabled' => true,
'beta' => true,
diff --git a/app/config/specs/0.6.2.client.json b/app/config/specs/0.6.2.client.json
new file mode 100644
index 0000000000..2a778b4596
--- /dev/null
+++ b/app/config/specs/0.6.2.client.json
@@ -0,0 +1,2 @@
+
+{"swagger":"2.0","info":{"version":"0.6.2","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","extensions":{"demo":"5df5acd0d48c2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","extensions":{"demo":"en"}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"get","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","extensions":{"weight":38,"cookies":false,"type":"","demo":"docs\/examples\/account\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"post":{"summary":"Create Account","operationId":"create","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](\/docs\/client\/account#createVerification) route to start verifying the user email address. To allow your new user to login to his new account, you need to create a new [account session](\/docs\/client\/account#createSession).","extensions":{"weight":32,"cookies":false,"type":"","demo":"docs\/examples\/account\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Account","operationId":"delete","consumes":["application\/json"],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","extensions":{"weight":46,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"updateEmail","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.","extensions":{"weight":44,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","extensions":{"weight":41,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account Name","operationId":"updateName","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account name.","extensions":{"weight":42,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"User name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]}},"\/account\/password":{"patch":{"summary":"Update Account Password","operationId":"updatePassword","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user password. For validation, user is required to pass the password twice.","extensions":{"weight":43,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"password","description":"New user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"oldPassword","description":"Old user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","extensions":{"weight":39,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","extensions":{"weight":45,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/account\/recovery":{"post":{"summary":"Create Password Recovery","operationId":"createRecovery","consumes":["application\/json"],"tags":["account"],"description":"Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](\/docs\/client\/account#updateRecovery) endpoint to complete the process.","extensions":{"weight":49,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-recovery.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Password Recovery","operationId":"updateRecovery","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/docs\/client\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.","extensions":{"weight":50,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-recovery.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"userId","description":"User account UID address.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid reset token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"},{"name":"password","description":"New password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"passwordAgain","description":"New password again. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","extensions":{"weight":40,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"post":{"summary":"Create Account Session","operationId":"createSession","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login into his account by providing a valid email and password combination. This route will create a new session for the user.","extensions":{"weight":33,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]},"delete":{"summary":"Delete All Account Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["account"],"description":"Delete all sessions from the user account and remove any sessions cookies from the end client.","extensions":{"weight":48,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"createOAuth2Session","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login to his account using the OAuth2 provider of his choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.","extensions":{"weight":34,"cookies":false,"type":"webAuth","demo":"docs\/examples\/account\/create-o-auth2session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-oauth2.md","rate-limit":50,"rate-time":3600,"rate-key":"ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted.","extensions":{"weight":47,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"createVerification","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](\/docs\/client\/account#updateAccountVerification). \n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n","extensions":{"weight":51,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"url","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Email Verification","operationId":"updateVerification","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","extensions":{"weight":52,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid verification token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","extensions":{"weight":54,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-browser.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.","extensions":{"weight":53,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-credit-card.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","extensions":{"weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-favicon.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"url","description":"Website URL which you want to fetch the favicon from.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"}]}},"\/avatars\/flags\/{code}":{"get":{"summary":"Get Country Flag","operationId":"getFlag","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings.","extensions":{"weight":55,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-flag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.","extensions":{"weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-image.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"url","description":"Image URL which you want to crop.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.","extensions":{"weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-initials.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"query"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"getQR","consumes":["application\/json"],"tags":["avatars"],"description":"Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.","extensions":{"weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"text","description":"Plain text to be converted to QR code image.","required":true,"type":"string","x-example":"[TEXT]","in":"query"},{"name":"size","description":"QR code size. Pass an integer between 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":66,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":50,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","extensions":{"weight":65,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","extensions":{"weight":67,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","extensions":{"weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","extensions":{"weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["application\/json"],"tags":["locale"],"description":"Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))","extensions":{"weight":70,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","extensions":{"weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","extensions":{"weight":71,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.","extensions":{"weight":72,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries phone codes. You can use the locale header to get the data in a supported language.","extensions":{"weight":73,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["application\/json"],"tags":["locale"],"description":"List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.","extensions":{"weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["application\/json"],"tags":["locale"],"description":"List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.","extensions":{"weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":124,"cookies":false,"type":"","demo":"docs\/examples\/storage\/list-files.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","extensions":{"weight":123,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"file","description":"Binary File.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","extensions":{"weight":125,"cookies":false,"type":"","demo":"docs\/examples\/storage\/get-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","extensions":{"weight":129,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":130,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.","extensions":{"weight":127,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-download.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"tags":["storage"],"description":"Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image.","extensions":{"weight":126,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-preview.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","extensions":{"weight":128,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-view.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":132,"cookies":false,"type":"","demo":"docs\/examples\/teams\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["application\/json"],"tags":["teams"],"description":"Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","extensions":{"weight":131,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","extensions":{"weight":133,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":134,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":135,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","extensions":{"weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","extensions":{"weight":136,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if he didn't accept it.","extensions":{"weight":139,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"updateMembershipStatus","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after he is being redirected back to your app from the invitation email he was sent.","extensions":{"weight":138,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update-membership-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Secret key.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}}
\ No newline at end of file
diff --git a/app/config/specs/0.6.2.console.json b/app/config/specs/0.6.2.console.json
new file mode 100644
index 0000000000..8963e9ef3a
--- /dev/null
+++ b/app/config/specs/0.6.2.console.json
@@ -0,0 +1 @@
+{"swagger":"2.0","info":{"version":"0.6.2","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","extensions":{"demo":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","extensions":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","extensions":{"demo":"en"}},"Mode":{"type":"apiKey","name":"X-Appwrite-Mode","description":"","in":"header","extensions":{"demo":""}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"get","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","extensions":{"weight":38,"cookies":false,"type":"","demo":"docs\/examples\/account\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]},"post":{"summary":"Create Account","operationId":"create","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](\/docs\/client\/account#createVerification) route to start verifying the user email address. To allow your new user to login to his new account, you need to create a new [account session](\/docs\/client\/account#createSession).","extensions":{"weight":32,"cookies":false,"type":"","demo":"docs\/examples\/account\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Account","operationId":"delete","consumes":["application\/json"],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","extensions":{"weight":46,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"updateEmail","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.","extensions":{"weight":44,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","extensions":{"weight":41,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account Name","operationId":"updateName","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account name.","extensions":{"weight":42,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"User name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]}},"\/account\/password":{"patch":{"summary":"Update Account Password","operationId":"updatePassword","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user password. For validation, user is required to pass the password twice.","extensions":{"weight":43,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"password","description":"New user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"oldPassword","description":"Old user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","extensions":{"weight":39,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","extensions":{"weight":45,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/account\/recovery":{"post":{"summary":"Create Password Recovery","operationId":"createRecovery","consumes":["application\/json"],"tags":["account"],"description":"Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](\/docs\/client\/account#updateRecovery) endpoint to complete the process.","extensions":{"weight":49,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-recovery.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Password Recovery","operationId":"updateRecovery","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/docs\/client\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.","extensions":{"weight":50,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-recovery.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User account UID address.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid reset token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"},{"name":"password","description":"New password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"passwordAgain","description":"New password again. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","extensions":{"weight":40,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]},"post":{"summary":"Create Account Session","operationId":"createSession","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login into his account by providing a valid email and password combination. This route will create a new session for the user.","extensions":{"weight":33,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]},"delete":{"summary":"Delete All Account Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["account"],"description":"Delete all sessions from the user account and remove any sessions cookies from the end client.","extensions":{"weight":48,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"createOAuth2Session","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login to his account using the OAuth2 provider of his choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.","extensions":{"weight":34,"cookies":false,"type":"webAuth","demo":"docs\/examples\/account\/create-o-auth2session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-oauth2.md","rate-limit":50,"rate-time":3600,"rate-key":"ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted.","extensions":{"weight":47,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"createVerification","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](\/docs\/client\/account#updateAccountVerification). \n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n","extensions":{"weight":51,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Email Verification","operationId":"updateVerification","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","extensions":{"weight":52,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid verification token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","extensions":{"weight":54,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-browser.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.","extensions":{"weight":53,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-credit-card.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","extensions":{"weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-favicon.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"Website URL which you want to fetch the favicon from.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"}]}},"\/avatars\/flags\/{code}":{"get":{"summary":"Get Country Flag","operationId":"getFlag","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings.","extensions":{"weight":55,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-flag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.","extensions":{"weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-image.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"Image URL which you want to crop.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.","extensions":{"weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-initials.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"query"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"getQR","consumes":["application\/json"],"tags":["avatars"],"description":"Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.","extensions":{"weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"text","description":"Plain text to be converted to QR code image.","required":true,"type":"string","x-example":"[TEXT]","in":"query"},{"name":"size","description":"QR code size. Pass an integer between 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"listCollections","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":61,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"createCollection","consumes":["application\/json"],"tags":["database"],"description":"Create a new Collection.","extensions":{"weight":60,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Collection name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"getCollection","consumes":["application\/json"],"tags":["database"],"description":"Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","extensions":{"weight":62,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"updateCollection","consumes":["application\/json"],"tags":["database"],"description":"Update collection by its unique ID.","extensions":{"weight":63,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"name","description":"Collection name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"}]},"delete":{"summary":"Delete Collection","operationId":"deleteCollection","consumes":["application\/json"],"tags":["database"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":64,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":66,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":50,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","extensions":{"weight":65,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","extensions":{"weight":67,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","extensions":{"weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","extensions":{"weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"get","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","extensions":{"weight":77,"cookies":false,"type":"","demo":"docs\/examples\/health\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/anti-virus":{"get":{"summary":"Get Anti virus","operationId":"getAntiVirus","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","extensions":{"weight":89,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-anti-virus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"getCache","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","extensions":{"weight":80,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-cache.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-cache.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/db":{"get":{"summary":"Get DB","operationId":"getDB","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","extensions":{"weight":79,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-d-b.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-db.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"getQueueCertificates","consumes":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","extensions":{"weight":86,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-certificates.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-certificates.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"getQueueFunctions","consumes":["application\/json"],"tags":["health"],"description":"","extensions":{"weight":87,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-functions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"getQueueLogs","consumes":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":84,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"getQueueTasks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":83,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"getQueueUsage","consumes":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":85,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"getQueueWebhooks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":82,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-webhooks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-webhooks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"getStorageLocal","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","extensions":{"weight":88,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-storage-local.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-local.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/time":{"get":{"summary":"Get Time","operationId":"getTime","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","extensions":{"weight":81,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-time.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-time.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["application\/json"],"tags":["locale"],"description":"Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))","extensions":{"weight":70,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","extensions":{"weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","extensions":{"weight":71,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.","extensions":{"weight":72,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries phone codes. You can use the locale header to get the data in a supported language.","extensions":{"weight":73,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["application\/json"],"tags":["locale"],"description":"List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.","extensions":{"weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["application\/json"],"tags":["locale"],"description":"List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.","extensions":{"weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/bar":{"get":{"summary":"Mock a get request for SDK tests","operationId":"get","consumes":["application\/json"],"tags":["bar"],"description":"","extensions":{"weight":155,"cookies":false,"type":"","demo":"docs\/examples\/bar\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a get request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"query"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"query"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"query"}]},"post":{"summary":"Mock a post request for SDK tests","operationId":"post","consumes":["application\/json"],"tags":["bar"],"description":"","extensions":{"weight":156,"cookies":false,"type":"","demo":"docs\/examples\/bar\/post.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a post request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"put":{"summary":"Mock a put request for SDK tests","operationId":"put","consumes":["application\/json"],"tags":["bar"],"description":"","extensions":{"weight":158,"cookies":false,"type":"","demo":"docs\/examples\/bar\/put.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a put request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"patch":{"summary":"Mock a patch request for SDK tests","operationId":"patch","consumes":["application\/json"],"tags":["bar"],"description":"","extensions":{"weight":157,"cookies":false,"type":"","demo":"docs\/examples\/bar\/patch.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a get request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Mock a delete request for SDK tests","operationId":"delete","consumes":["application\/json"],"tags":["bar"],"description":"","extensions":{"weight":159,"cookies":false,"type":"","demo":"docs\/examples\/bar\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a delete request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/mock\/tests\/foo":{"get":{"summary":"Mock a get request for SDK tests","operationId":"get","consumes":["application\/json"],"tags":["foo"],"description":"","extensions":{"weight":150,"cookies":false,"type":"","demo":"docs\/examples\/foo\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a get request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"query"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"query"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"query"}]},"post":{"summary":"Mock a post request for SDK tests","operationId":"post","consumes":["application\/json"],"tags":["foo"],"description":"","extensions":{"weight":151,"cookies":false,"type":"","demo":"docs\/examples\/foo\/post.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a post request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"put":{"summary":"Mock a put request for SDK tests","operationId":"put","consumes":["application\/json"],"tags":["foo"],"description":"","extensions":{"weight":153,"cookies":false,"type":"","demo":"docs\/examples\/foo\/put.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a put request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"patch":{"summary":"Mock a patch request for SDK tests","operationId":"patch","consumes":["application\/json"],"tags":["foo"],"description":"","extensions":{"weight":152,"cookies":false,"type":"","demo":"docs\/examples\/foo\/patch.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a get request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Mock a delete request for SDK tests","operationId":"delete","consumes":["application\/json"],"tags":["foo"],"description":"","extensions":{"weight":154,"cookies":false,"type":"","demo":"docs\/examples\/foo\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a delete request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/mock\/tests\/general\/empty":{"get":{"summary":"Mock a post request for SDK tests","operationId":"empty","consumes":["application\/json"],"tags":["general"],"description":"","extensions":{"weight":165,"cookies":false,"type":"","demo":"docs\/examples\/general\/empty.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a redirected request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/general\/get-cookie":{"get":{"summary":"Mock a cookie request for SDK tests","operationId":"getCookie","consumes":["application\/json"],"tags":["general"],"description":"","extensions":{"weight":164,"cookies":false,"type":"","demo":"docs\/examples\/general\/get-cookie.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a get cookie request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/general\/redirect":{"get":{"summary":"Mock a post request for SDK tests","operationId":"redirect","consumes":["application\/json"],"tags":["general"],"description":"","extensions":{"weight":161,"cookies":false,"type":"","demo":"docs\/examples\/general\/redirect.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a redirect request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/general\/redirected":{"get":{"summary":"Mock a post request for SDK tests","operationId":"redirected","consumes":["application\/json"],"tags":["general"],"description":"","extensions":{"weight":162,"cookies":false,"type":"","demo":"docs\/examples\/general\/redirected.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a redirected request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/general\/set-cookie":{"get":{"summary":"Mock a cookie request for SDK tests","operationId":"setCookie","consumes":["application\/json"],"tags":["general"],"description":"","extensions":{"weight":163,"cookies":false,"type":"","demo":"docs\/examples\/general\/set-cookie.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a set cookie request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}]}},"\/mock\/tests\/general\/upload":{"post":{"summary":"Mock a post request for SDK tests","operationId":"upload","consumes":["multipart\/form-data"],"tags":["general"],"description":"","extensions":{"weight":160,"cookies":false,"type":"","demo":"docs\/examples\/general\/upload.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/masterMock a delete request for SDK tests","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"x","description":"Sample string param","required":true,"type":"string","x-example":"[]","in":"formData"},{"name":"y","description":"Sample numeric param","required":true,"type":"integer","format":"int32","in":"formData"},{"name":"z","description":"Sample array param","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"file","description":"Sample file param","required":true,"type":"file","in":"formData"}]}},"\/projects":{"get":{"summary":"List Projects","operationId":"list","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":92,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}]},"post":{"summary":"Create Project","operationId":"create","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":91,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Project name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"formData"},{"name":"description","description":"Project description.","required":false,"type":"string","x-example":"[DESCRIPTION]","default":"","in":"formData"},{"name":"logo","description":"Project logo.","required":false,"type":"string","x-example":"[LOGO]","default":"","in":"formData"},{"name":"url","description":"Project URL.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"","in":"formData"},{"name":"legalName","description":"Project legal Name.","required":false,"type":"string","x-example":"[LEGAL_NAME]","default":"","in":"formData"},{"name":"legalCountry","description":"Project legal Country.","required":false,"type":"string","x-example":"[LEGAL_COUNTRY]","default":"","in":"formData"},{"name":"legalState","description":"Project legal State.","required":false,"type":"string","x-example":"[LEGAL_STATE]","default":"","in":"formData"},{"name":"legalCity","description":"Project legal City.","required":false,"type":"string","x-example":"[LEGAL_CITY]","default":"","in":"formData"},{"name":"legalAddress","description":"Project legal Address.","required":false,"type":"string","x-example":"[LEGAL_ADDRESS]","default":"","in":"formData"},{"name":"legalTaxId","description":"Project legal Tax ID.","required":false,"type":"string","x-example":"[LEGAL_TAX_ID]","default":"","in":"formData"}]}},"\/projects\/{projectId}":{"get":{"summary":"Get Project","operationId":"get","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":93,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"patch":{"summary":"Update Project","operationId":"update","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":95,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Project name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"description","description":"Project description.","required":false,"type":"string","x-example":"[DESCRIPTION]","default":"","in":"formData"},{"name":"logo","description":"Project logo.","required":false,"type":"string","x-example":"[LOGO]","default":"","in":"formData"},{"name":"url","description":"Project URL.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"","in":"formData"},{"name":"legalName","description":"Project legal name.","required":false,"type":"string","x-example":"[LEGAL_NAME]","default":"","in":"formData"},{"name":"legalCountry","description":"Project legal country..","required":false,"type":"string","x-example":"[LEGAL_COUNTRY]","default":"","in":"formData"},{"name":"legalState","description":"Project legal state.","required":false,"type":"string","x-example":"[LEGAL_STATE]","default":"","in":"formData"},{"name":"legalCity","description":"Project legal city.","required":false,"type":"string","x-example":"[LEGAL_CITY]","default":"","in":"formData"},{"name":"legalAddress","description":"Project legal address.","required":false,"type":"string","x-example":"[LEGAL_ADDRESS]","default":"","in":"formData"},{"name":"legalTaxId","description":"Project legal tax ID.","required":false,"type":"string","x-example":"[LEGAL_TAX_ID]","default":"","in":"formData"}]},"delete":{"summary":"Delete Project","operationId":"delete","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":97,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"password","description":"Your user password for confirmation. Must be between 6 to 32 chars.","required":true,"type":"string","x-example":"[PASSWORD]","in":"formData"}]}},"\/projects\/{projectId}\/domains":{"get":{"summary":"List Domains","operationId":"listDomains","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":119,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-domains.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Domain","operationId":"createDomain","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":118,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domain","description":"Domain name.","required":true,"type":"string","in":"formData"}]}},"\/projects\/{projectId}\/domains\/{domainId}":{"get":{"summary":"Get Domain","operationId":"getDomain","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":120,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]},"delete":{"summary":"Delete Domain","operationId":"deleteDomain","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":122,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/domains\/{domainId}\/verification":{"patch":{"summary":"Update Domain Verification Status","operationId":"updateDomainVerification","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":121,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-domain-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/keys":{"get":{"summary":"List Keys","operationId":"listKeys","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":104,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-keys.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Key","operationId":"createKey","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":103,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Key name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"scopes","description":"Key scopes list.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/projects\/{projectId}\/keys\/{keyId}":{"get":{"summary":"Get Key","operationId":"getKey","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":105,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"keyId","description":"Key unique ID.","required":true,"type":"string","x-example":"[KEY_ID]","in":"path"}]},"put":{"summary":"Update Key","operationId":"updateKey","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":106,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"keyId","description":"Key unique ID.","required":true,"type":"string","x-example":"[KEY_ID]","in":"path"},{"name":"name","description":"Key name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"scopes","description":"Key scopes list","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Key","operationId":"deleteKey","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":107,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"keyId","description":"Key unique ID.","required":true,"type":"string","x-example":"[KEY_ID]","in":"path"}]}},"\/projects\/{projectId}\/oauth2":{"patch":{"summary":"Update Project OAuth2","operationId":"updateOAuth2","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":96,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-o-auth2.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"provider","description":"Provider Name","required":true,"type":"string","x-example":"amazon","in":"formData"},{"name":"appId","description":"Provider app ID.","required":false,"type":"string","x-example":"[APP_ID]","default":"","in":"formData"},{"name":"secret","description":"Provider secret key.","required":false,"type":"string","x-example":"[SECRET]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/platforms":{"get":{"summary":"List Platforms","operationId":"listPlatforms","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":114,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-platforms.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Platform","operationId":"createPlatform","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":113,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"type","description":"Platform type.","required":true,"type":"string","x-example":"web","in":"formData"},{"name":"name","description":"Platform name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"key","description":"Package name for android or bundle ID for iOS.","required":false,"type":"string","x-example":"[KEY]","default":"","in":"formData"},{"name":"store","description":"App store or Google Play store ID.","required":false,"type":"string","x-example":"[STORE]","default":"","in":"formData"},{"name":"hostname","description":"Platform client hostname.","required":false,"type":"string","x-example":"[HOSTNAME]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/platforms\/{platformId}":{"get":{"summary":"Get Platform","operationId":"getPlatform","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":115,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"platformId","description":"Platform unique ID.","required":true,"type":"string","x-example":"[PLATFORM_ID]","in":"path"}]},"put":{"summary":"Update Platform","operationId":"updatePlatform","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":116,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"platformId","description":"Platform unique ID.","required":true,"type":"string","x-example":"[PLATFORM_ID]","in":"path"},{"name":"name","description":"Platform name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"key","description":"Package name for android or bundle ID for iOS.","required":false,"type":"string","x-example":"[KEY]","default":"","in":"formData"},{"name":"store","description":"App store or Google Play store ID.","required":false,"type":"string","x-example":"[STORE]","default":"","in":"formData"},{"name":"hostname","description":"Platform client URL.","required":false,"type":"string","x-example":"[HOSTNAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Platform","operationId":"deletePlatform","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":117,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"platformId","description":"Platform unique ID.","required":true,"type":"string","x-example":"[PLATFORM_ID]","in":"path"}]}},"\/projects\/{projectId}\/tasks":{"get":{"summary":"List Tasks","operationId":"listTasks","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":109,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Task","operationId":"createTask","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":108,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Task name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"status","description":"Task status.","required":true,"type":"string","x-example":"play","in":"formData"},{"name":"schedule","description":"Task schedule CRON syntax.","required":true,"type":"string","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpMethod","description":"Task HTTP method.","required":true,"type":"string","x-example":"GET","in":"formData"},{"name":"httpUrl","description":"Task HTTP URL","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"},{"name":"httpHeaders","description":"Task HTTP headers list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"httpUser","description":"Task HTTP user.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Task HTTP password.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/tasks\/{taskId}":{"get":{"summary":"Get Task","operationId":"getTask","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":110,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]},"put":{"summary":"Update Task","operationId":"updateTask","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":111,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"},{"name":"name","description":"Task name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"status","description":"Task status.","required":true,"type":"string","x-example":"play","in":"formData"},{"name":"schedule","description":"Task schedule CRON syntax.","required":true,"type":"string","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpMethod","description":"Task HTTP method.","required":true,"type":"string","x-example":"GET","in":"formData"},{"name":"httpUrl","description":"Task HTTP URL.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"},{"name":"httpHeaders","description":"Task HTTP headers list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"httpUser","description":"Task HTTP user.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Task HTTP password.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]},"delete":{"summary":"Delete Task","operationId":"deleteTask","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":112,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get Project","operationId":"getUsage","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":94,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"daily","default":"last30","in":"query"}]}},"\/projects\/{projectId}\/webhooks":{"get":{"summary":"List Webhooks","operationId":"listWebhooks","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":99,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-webhooks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Webhook","operationId":"createWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":98,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Webhook name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"events","description":"Webhook events list.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"Webhook URL.","required":true,"type":"string","x-example":"[URL]","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpUser","description":"Webhook HTTP user.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Webhook HTTP password.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/webhooks\/{webhookId}":{"get":{"summary":"Get Webhook","operationId":"getWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":100,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"webhookId","description":"Webhook unique ID.","required":true,"type":"string","x-example":"[WEBHOOK_ID]","in":"path"}]},"put":{"summary":"Update Webhook","operationId":"updateWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":101,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"webhookId","description":"Webhook unique ID.","required":true,"type":"string","x-example":"[WEBHOOK_ID]","in":"path"},{"name":"name","description":"Webhook name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"events","description":"Webhook events list.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"Webhook URL.","required":true,"type":"string","x-example":"[URL]","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpUser","description":"Webhook HTTP user.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Webhook HTTP password.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]},"delete":{"summary":"Delete Webhook","operationId":"deleteWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":102,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"webhookId","description":"Webhook unique ID.","required":true,"type":"string","x-example":"[WEBHOOK_ID]","in":"path"}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":124,"cookies":false,"type":"","demo":"docs\/examples\/storage\/list-files.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","extensions":{"weight":123,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"file","description":"Binary File.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","extensions":{"weight":125,"cookies":false,"type":"","demo":"docs\/examples\/storage\/get-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","extensions":{"weight":129,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":130,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.","extensions":{"weight":127,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-download.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"tags":["storage"],"description":"Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image.","extensions":{"weight":126,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-preview.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","extensions":{"weight":128,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-view.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":132,"cookies":false,"type":"","demo":"docs\/examples\/teams\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["application\/json"],"tags":["teams"],"description":"Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","extensions":{"weight":131,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","extensions":{"weight":133,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":134,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":135,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","extensions":{"weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","extensions":{"weight":136,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if he didn't accept it.","extensions":{"weight":139,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"updateMembershipStatus","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after he is being redirected back to your app from the invitation email he was sent.","extensions":{"weight":138,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update-membership-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Secret key.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/users":{"get":{"summary":"List Users","operationId":"list","consumes":["application\/json"],"tags":["users"],"description":"Get a list of all the project users. You can use the query params to filter your results.","extensions":{"weight":141,"cookies":false,"type":"","demo":"docs\/examples\/users\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-users.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create User","operationId":"create","consumes":["application\/json"],"tags":["users"],"description":"Create a new user.","extensions":{"weight":140,"cookies":false,"type":"","demo":"docs\/examples\/users\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"get","consumes":["application\/json"],"tags":["users"],"description":"Get user by its unique ID.","extensions":{"weight":142,"cookies":false,"type":"","demo":"docs\/examples\/users\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["users"],"description":"Get user activity logs list by its unique ID.","extensions":{"weight":145,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["users"],"description":"Get user preferences by its unique ID.","extensions":{"weight":143,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["users"],"description":"Update user preferences by its unique ID. You can pass only the specific settings you wish to update.","extensions":{"weight":147,"cookies":false,"type":"","demo":"docs\/examples\/users\/update-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["users"],"description":"Get user sessions list by its unique ID.","extensions":{"weight":144,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["users"],"description":"Delete all user sessions by its unique ID.","extensions":{"weight":149,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/sessions\/{sessionId}":{"delete":{"summary":"Delete User Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["users"],"description":"Delete user sessions by its unique ID.","extensions":{"weight":148,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"updateStatus","consumes":["application\/json"],"tags":["users"],"description":"Update user status by its unique ID.","extensions":{"weight":146,"cookies":false,"type":"","demo":"docs\/examples\/users\/update-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"status","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","required":true,"type":"string","x-example":1,"in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}}
\ No newline at end of file
diff --git a/app/config/specs/0.6.2.server.json b/app/config/specs/0.6.2.server.json
new file mode 100644
index 0000000000..c13f492351
--- /dev/null
+++ b/app/config/specs/0.6.2.server.json
@@ -0,0 +1 @@
+{"swagger":"2.0","info":{"version":"0.6.2","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","extensions":{"demo":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","extensions":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","extensions":{"demo":"en"}}},"paths":{"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","extensions":{"weight":54,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-browser.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.","extensions":{"weight":53,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-credit-card.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","extensions":{"weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-favicon.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"Website URL which you want to fetch the favicon from.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"}]}},"\/avatars\/flags\/{code}":{"get":{"summary":"Get Country Flag","operationId":"getFlag","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings.","extensions":{"weight":55,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-flag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.","extensions":{"weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-image.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"Image URL which you want to crop.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.","extensions":{"weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-initials.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"query"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"getQR","consumes":["application\/json"],"tags":["avatars"],"description":"Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.","extensions":{"weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"text","description":"Plain text to be converted to QR code image.","required":true,"type":"string","x-example":"[TEXT]","in":"query"},{"name":"size","description":"QR code size. Pass an integer between 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"listCollections","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":61,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"createCollection","consumes":["application\/json"],"tags":["database"],"description":"Create a new Collection.","extensions":{"weight":60,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Collection name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"getCollection","consumes":["application\/json"],"tags":["database"],"description":"Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","extensions":{"weight":62,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"updateCollection","consumes":["application\/json"],"tags":["database"],"description":"Update collection by its unique ID.","extensions":{"weight":63,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"name","description":"Collection name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"}]},"delete":{"summary":"Delete Collection","operationId":"deleteCollection","consumes":["application\/json"],"tags":["database"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":64,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":66,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":50,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","extensions":{"weight":65,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","extensions":{"weight":67,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","extensions":{"weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","extensions":{"weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"get","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","extensions":{"weight":77,"cookies":false,"type":"","demo":"docs\/examples\/health\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/anti-virus":{"get":{"summary":"Get Anti virus","operationId":"getAntiVirus","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","extensions":{"weight":89,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-anti-virus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"getCache","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","extensions":{"weight":80,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-cache.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-cache.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/db":{"get":{"summary":"Get DB","operationId":"getDB","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","extensions":{"weight":79,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-d-b.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-db.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"getQueueCertificates","consumes":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","extensions":{"weight":86,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-certificates.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-certificates.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"getQueueFunctions","consumes":["application\/json"],"tags":["health"],"description":"","extensions":{"weight":87,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-functions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"getQueueLogs","consumes":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":84,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"getQueueTasks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":83,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"getQueueUsage","consumes":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":85,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"getQueueWebhooks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":82,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-webhooks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-webhooks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"getStorageLocal","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","extensions":{"weight":88,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-storage-local.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-local.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/time":{"get":{"summary":"Get Time","operationId":"getTime","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","extensions":{"weight":81,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-time.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-time.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["application\/json"],"tags":["locale"],"description":"Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))","extensions":{"weight":70,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","extensions":{"weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","extensions":{"weight":71,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.","extensions":{"weight":72,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries phone codes. You can use the locale header to get the data in a supported language.","extensions":{"weight":73,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["application\/json"],"tags":["locale"],"description":"List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.","extensions":{"weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["application\/json"],"tags":["locale"],"description":"List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.","extensions":{"weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":124,"cookies":false,"type":"","demo":"docs\/examples\/storage\/list-files.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","extensions":{"weight":123,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"file","description":"Binary File.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","extensions":{"weight":125,"cookies":false,"type":"","demo":"docs\/examples\/storage\/get-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","extensions":{"weight":129,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":130,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.","extensions":{"weight":127,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-download.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"tags":["storage"],"description":"Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image.","extensions":{"weight":126,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-preview.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","extensions":{"weight":128,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-view.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":132,"cookies":false,"type":"","demo":"docs\/examples\/teams\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["application\/json"],"tags":["teams"],"description":"Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","extensions":{"weight":131,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","extensions":{"weight":133,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":134,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":135,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","extensions":{"weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","extensions":{"weight":136,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if he didn't accept it.","extensions":{"weight":139,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/users":{"get":{"summary":"List Users","operationId":"list","consumes":["application\/json"],"tags":["users"],"description":"Get a list of all the project users. You can use the query params to filter your results.","extensions":{"weight":141,"cookies":false,"type":"","demo":"docs\/examples\/users\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-users.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create User","operationId":"create","consumes":["application\/json"],"tags":["users"],"description":"Create a new user.","extensions":{"weight":140,"cookies":false,"type":"","demo":"docs\/examples\/users\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"get","consumes":["application\/json"],"tags":["users"],"description":"Get user by its unique ID.","extensions":{"weight":142,"cookies":false,"type":"","demo":"docs\/examples\/users\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["users"],"description":"Get user activity logs list by its unique ID.","extensions":{"weight":145,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["users"],"description":"Get user preferences by its unique ID.","extensions":{"weight":143,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["users"],"description":"Update user preferences by its unique ID. You can pass only the specific settings you wish to update.","extensions":{"weight":147,"cookies":false,"type":"","demo":"docs\/examples\/users\/update-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["users"],"description":"Get user sessions list by its unique ID.","extensions":{"weight":144,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["users"],"description":"Delete all user sessions by its unique ID.","extensions":{"weight":149,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/sessions\/{sessionId}":{"delete":{"summary":"Delete User Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["users"],"description":"Delete user sessions by its unique ID.","extensions":{"weight":148,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"updateStatus","consumes":["application\/json"],"tags":["users"],"description":"Update user status by its unique ID.","extensions":{"weight":146,"cookies":false,"type":"","demo":"docs\/examples\/users\/update-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"status","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","required":true,"type":"string","x-example":1,"in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}}
\ No newline at end of file
diff --git a/app/config/specs/0.7.0.client.json b/app/config/specs/0.7.0.client.json
new file mode 100644
index 0000000000..1453566c2b
--- /dev/null
+++ b/app/config/specs/0.7.0.client.json
@@ -0,0 +1,2 @@
+
+{"swagger":"2.0","info":{"version":"0.7.0","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","extensions":{"demo":"5df5acd0d48c2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","extensions":{"demo":"en"}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"get","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","extensions":{"weight":41,"cookies":false,"type":"","demo":"docs\/examples\/account\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"post":{"summary":"Create Account","operationId":"create","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](\/docs\/client\/account#createVerification) route to start verifying the user email address. To allow your new user to login to his new account, you need to create a new [account session](\/docs\/client\/account#createSession).","extensions":{"weight":35,"cookies":false,"type":"","demo":"docs\/examples\/account\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Account","operationId":"delete","consumes":["application\/json"],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","extensions":{"weight":49,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"updateEmail","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.","extensions":{"weight":47,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","extensions":{"weight":44,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account Name","operationId":"updateName","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account name.","extensions":{"weight":45,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"User name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]}},"\/account\/password":{"patch":{"summary":"Update Account Password","operationId":"updatePassword","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user password. For validation, user is required to pass the password twice.","extensions":{"weight":46,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"password","description":"New user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"oldPassword","description":"Old user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","extensions":{"weight":42,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","extensions":{"weight":48,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/account\/recovery":{"post":{"summary":"Create Password Recovery","operationId":"createRecovery","consumes":["application\/json"],"tags":["account"],"description":"Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](\/docs\/client\/account#updateRecovery) endpoint to complete the process.","extensions":{"weight":52,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-recovery.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Password Recovery","operationId":"updateRecovery","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/docs\/client\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.","extensions":{"weight":53,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-recovery.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"userId","description":"User account UID address.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid reset token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"},{"name":"password","description":"New password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"passwordAgain","description":"New password again. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","extensions":{"weight":43,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]},"post":{"summary":"Create Account Session","operationId":"createSession","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login into his account by providing a valid email and password combination. This route will create a new session for the user.","extensions":{"weight":36,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]},"delete":{"summary":"Delete All Account Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["account"],"description":"Delete all sessions from the user account and remove any sessions cookies from the end client.","extensions":{"weight":51,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"createOAuth2Session","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login to his account using the OAuth2 provider of his choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.","extensions":{"weight":37,"cookies":false,"type":"webAuth","demo":"docs\/examples\/account\/create-o-auth2session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-oauth2.md","rate-limit":50,"rate-time":3600,"rate-key":"ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted.","extensions":{"weight":50,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"createVerification","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](\/docs\/client\/account#updateAccountVerification). \n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n","extensions":{"weight":54,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"url","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Email Verification","operationId":"updateVerification","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","extensions":{"weight":55,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid verification token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","extensions":{"weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-browser.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.","extensions":{"weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-credit-card.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","extensions":{"weight":60,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-favicon.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"url","description":"Website URL which you want to fetch the favicon from.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"}]}},"\/avatars\/flags\/{code}":{"get":{"summary":"Get Country Flag","operationId":"getFlag","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings.","extensions":{"weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-flag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.","extensions":{"weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-image.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"url","description":"Image URL which you want to crop.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.","extensions":{"weight":62,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-initials.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"query"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"getQR","consumes":["application\/json"],"tags":["avatars"],"description":"Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.","extensions":{"weight":61,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"text","description":"Plain text to be converted to QR code image.","required":true,"type":"string","x-example":"[TEXT]","in":"query"},{"name":"size","description":"QR code size. Pass an integer between 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","extensions":{"weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","extensions":{"weight":70,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","extensions":{"weight":71,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","extensions":{"weight":72,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["application\/json"],"tags":["locale"],"description":"Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))","extensions":{"weight":73,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","extensions":{"weight":77,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","extensions":{"weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.","extensions":{"weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries phone codes. You can use the locale header to get the data in a supported language.","extensions":{"weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["application\/json"],"tags":["locale"],"description":"List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.","extensions":{"weight":78,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["application\/json"],"tags":["locale"],"description":"List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.","extensions":{"weight":79,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":127,"cookies":false,"type":"","demo":"docs\/examples\/storage\/list-files.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","extensions":{"weight":126,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","extensions":{"weight":128,"cookies":false,"type":"","demo":"docs\/examples\/storage\/get-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","extensions":{"weight":132,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":133,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.","extensions":{"weight":130,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-download.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"tags":["storage"],"description":"Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image.","extensions":{"weight":129,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-preview.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","extensions":{"weight":131,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-view.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":135,"cookies":false,"type":"","demo":"docs\/examples\/teams\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["application\/json"],"tags":["teams"],"description":"Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","extensions":{"weight":134,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"name","description":"Team name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","extensions":{"weight":136,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":138,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","extensions":{"weight":140,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","extensions":{"weight":139,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if he didn't accept it.","extensions":{"weight":142,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"updateMembershipStatus","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after he is being redirected back to your app from the invitation email he was sent.","extensions":{"weight":141,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update-membership-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Secret key.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}}
\ No newline at end of file
diff --git a/app/config/specs/0.7.0.console.json b/app/config/specs/0.7.0.console.json
new file mode 100644
index 0000000000..67769fa542
--- /dev/null
+++ b/app/config/specs/0.7.0.console.json
@@ -0,0 +1,2 @@
+
+{"swagger":"2.0","info":{"version":"0.7.0","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","extensions":{"demo":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","extensions":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","extensions":{"demo":"en"}},"Mode":{"type":"apiKey","name":"X-Appwrite-Mode","description":"","in":"header","extensions":{"demo":""}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"get","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","extensions":{"weight":41,"cookies":false,"type":"","demo":"docs\/examples\/account\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]},"post":{"summary":"Create Account","operationId":"create","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [\/account\/verfication](\/docs\/client\/account#createVerification) route to start verifying the user email address. To allow your new user to login to his new account, you need to create a new [account session](\/docs\/client\/account#createSession).","extensions":{"weight":35,"cookies":false,"type":"","demo":"docs\/examples\/account\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Account","operationId":"delete","consumes":["application\/json"],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","extensions":{"weight":49,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"updateEmail","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.","extensions":{"weight":47,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-email.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","extensions":{"weight":44,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account Name","operationId":"updateName","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account name.","extensions":{"weight":45,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-name.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-name.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"User name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]}},"\/account\/password":{"patch":{"summary":"Update Account Password","operationId":"updatePassword","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user password. For validation, user is required to pass the password twice.","extensions":{"weight":46,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"password","description":"New user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"oldPassword","description":"Old user password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","extensions":{"weight":42,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","extensions":{"weight":48,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/account\/recovery":{"post":{"summary":"Create Password Recovery","operationId":"createRecovery","consumes":["application\/json"],"tags":["account"],"description":"Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT \/account\/recovery](\/docs\/client\/account#updateRecovery) endpoint to complete the process.","extensions":{"weight":52,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-recovery.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-recovery.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Password Recovery","operationId":"updateRecovery","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](\/docs\/client\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.","extensions":{"weight":53,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-recovery.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-recovery.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User account UID address.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid reset token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"},{"name":"password","description":"New password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"passwordAgain","description":"New password again. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","extensions":{"weight":43,"cookies":false,"type":"","demo":"docs\/examples\/account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]},"post":{"summary":"Create Account Session","operationId":"createSession","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login into his account by providing a valid email and password combination. This route will create a new session for the user.","extensions":{"weight":36,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"}]},"delete":{"summary":"Delete All Account Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["account"],"description":"Delete all sessions from the user account and remove any sessions cookies from the end client.","extensions":{"weight":51,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"createOAuth2Session","consumes":["application\/json"],"tags":["account"],"description":"Allow the user to login to his account using the OAuth2 provider of his choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.","extensions":{"weight":37,"cookies":false,"type":"webAuth","demo":"docs\/examples\/account\/create-o-auth2session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-oauth2.md","rate-limit":50,"rate-time":3600,"rate-key":"ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted.","extensions":{"weight":50,"cookies":false,"type":"","demo":"docs\/examples\/account\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"createVerification","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](\/docs\/client\/account#updateAccountVerification). \n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n","extensions":{"weight":54,"cookies":false,"type":"","demo":"docs\/examples\/account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]},"put":{"summary":"Complete Email Verification","operationId":"updateVerification","consumes":["application\/json"],"tags":["account"],"description":"Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.","extensions":{"weight":55,"cookies":false,"type":"","demo":"docs\/examples\/account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Valid verification token.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","extensions":{"weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-browser.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.","extensions":{"weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-credit-card.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","extensions":{"weight":60,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-favicon.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"Website URL which you want to fetch the favicon from.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"}]}},"\/avatars\/flags\/{code}":{"get":{"summary":"Get Country Flag","operationId":"getFlag","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings.","extensions":{"weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-flag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.","extensions":{"weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-image.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"Image URL which you want to crop.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.","extensions":{"weight":62,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-initials.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"query"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"getQR","consumes":["application\/json"],"tags":["avatars"],"description":"Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.","extensions":{"weight":61,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"text","description":"Plain text to be converted to QR code image.","required":true,"type":"string","x-example":"[TEXT]","in":"query"},{"name":"size","description":"QR code size. Pass an integer between 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"listCollections","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":64,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"createCollection","consumes":["application\/json"],"tags":["database"],"description":"Create a new Collection.","extensions":{"weight":63,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Collection name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"getCollection","consumes":["application\/json"],"tags":["database"],"description":"Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","extensions":{"weight":65,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"updateCollection","consumes":["application\/json"],"tags":["database"],"description":"Update collection by its unique ID.","extensions":{"weight":66,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"name","description":"Collection name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"}]},"delete":{"summary":"Delete Collection","operationId":"deleteCollection","consumes":["application\/json"],"tags":["database"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":67,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","extensions":{"weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","extensions":{"weight":70,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","extensions":{"weight":71,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","extensions":{"weight":72,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions":{"get":{"summary":"List Functions","operationId":"list","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":155,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Function","operationId":"create","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":154,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Function name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"env","description":"Execution enviornment.","required":true,"type":"string","x-example":"node-14","in":"formData"},{"name":"vars","description":"Key-value JSON object.","required":false,"type":"object","x-example":"{}","default":[],"in":"formData"},{"name":"events","description":"Events list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"},{"name":"schedule","description":"Schedule CRON syntax.","required":false,"type":"string","default":"","in":"formData"},{"name":"timeout","description":"Function maximum execution time in seconds.","required":false,"type":"integer","format":"int32","x-example":1,"default":15,"in":"formData"}]}},"\/functions\/{functionId}":{"get":{"summary":"Get Function","operationId":"get","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":156,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]},"put":{"summary":"Update Function","operationId":"update","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":157,"cookies":false,"type":"","demo":"docs\/examples\/functions\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"name","description":"Function name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"vars","description":"Key-value JSON object.","required":false,"type":"object","x-example":"{}","default":[],"in":"formData"},{"name":"events","description":"Events list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"},{"name":"schedule","description":"Schedule CRON syntax.","required":false,"type":"string","default":"","in":"formData"},{"name":"timeout","description":"Function maximum execution time in seconds.","required":false,"type":"integer","format":"int32","x-example":1,"default":15,"in":"formData"}]},"delete":{"summary":"Delete Function","operationId":"delete","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":159,"cookies":false,"type":"","demo":"docs\/examples\/functions\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/executions":{"get":{"summary":"List Executions","operationId":"listExecutions","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":165,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list-executions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-executions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Execution","operationId":"createExecution","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":164,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"async","description":"Execute code asynchronously. Pass 1 for true, 0 for false. Default value is 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"formData"}]}},"\/functions\/{functionId}\/executions\/{executionId}":{"get":{"summary":"Get Execution","operationId":"getExecution","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":166,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution unique ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/tag":{"patch":{"summary":"Update Function Tag","operationId":"updateTag","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":158,"cookies":false,"type":"","demo":"docs\/examples\/functions\/update-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tag","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG]","in":"formData"}]}},"\/functions\/{functionId}\/tags":{"get":{"summary":"List Tags","operationId":"listTags","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":161,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list-tags.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-tags.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Tag","operationId":"createTag","consumes":["multipart\/form-data"],"tags":["functions"],"description":"","extensions":{"weight":160,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"command","description":"Code execution command.","required":true,"type":"string","x-example":"[COMMAND]","in":"formData"},{"name":"code","description":"Gzip file containing your code.","required":true,"type":"file","in":"formData"}]}},"\/functions\/{functionId}\/tags\/{tagId}":{"get":{"summary":"Get Tag","operationId":"getTag","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":162,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]},"delete":{"summary":"Delete Tag","operationId":"deleteTag","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":163,"cookies":false,"type":"","demo":"docs\/examples\/functions\/delete-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"get","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","extensions":{"weight":80,"cookies":false,"type":"","demo":"docs\/examples\/health\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/anti-virus":{"get":{"summary":"Get Anti virus","operationId":"getAntiVirus","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","extensions":{"weight":92,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-anti-virus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"getCache","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","extensions":{"weight":83,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-cache.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-cache.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/db":{"get":{"summary":"Get DB","operationId":"getDB","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","extensions":{"weight":82,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-d-b.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-db.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"getQueueCertificates","consumes":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","extensions":{"weight":89,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-certificates.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-certificates.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"getQueueFunctions","consumes":["application\/json"],"tags":["health"],"description":"","extensions":{"weight":90,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-functions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"getQueueLogs","consumes":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":87,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"getQueueTasks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":86,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"getQueueUsage","consumes":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":88,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"getQueueWebhooks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":85,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-webhooks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-webhooks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"getStorageLocal","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","extensions":{"weight":91,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-storage-local.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-local.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/time":{"get":{"summary":"Get Time","operationId":"getTime","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","extensions":{"weight":84,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-time.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-time.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["application\/json"],"tags":["locale"],"description":"Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))","extensions":{"weight":73,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","extensions":{"weight":77,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","extensions":{"weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.","extensions":{"weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries phone codes. You can use the locale header to get the data in a supported language.","extensions":{"weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["application\/json"],"tags":["locale"],"description":"List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.","extensions":{"weight":78,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["application\/json"],"tags":["locale"],"description":"List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.","extensions":{"weight":79,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/projects":{"get":{"summary":"List Projects","operationId":"list","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":95,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Project","operationId":"create","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":94,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Project name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"formData"},{"name":"description","description":"Project description. Max length: 256 chars.","required":false,"type":"string","x-example":"[DESCRIPTION]","default":"","in":"formData"},{"name":"logo","description":"Project logo.","required":false,"type":"string","x-example":"[LOGO]","default":"","in":"formData"},{"name":"url","description":"Project URL.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"","in":"formData"},{"name":"legalName","description":"Project legal Name. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_NAME]","default":"","in":"formData"},{"name":"legalCountry","description":"Project legal Country. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_COUNTRY]","default":"","in":"formData"},{"name":"legalState","description":"Project legal State. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_STATE]","default":"","in":"formData"},{"name":"legalCity","description":"Project legal City. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_CITY]","default":"","in":"formData"},{"name":"legalAddress","description":"Project legal Address. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_ADDRESS]","default":"","in":"formData"},{"name":"legalTaxId","description":"Project legal Tax ID. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_TAX_ID]","default":"","in":"formData"}]}},"\/projects\/{projectId}":{"get":{"summary":"Get Project","operationId":"get","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":96,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"patch":{"summary":"Update Project","operationId":"update","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":98,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Project name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"description","description":"Project description. Max length: 256 chars.","required":false,"type":"string","x-example":"[DESCRIPTION]","default":"","in":"formData"},{"name":"logo","description":"Project logo.","required":false,"type":"string","x-example":"[LOGO]","default":"","in":"formData"},{"name":"url","description":"Project URL.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"","in":"formData"},{"name":"legalName","description":"Project legal name. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_NAME]","default":"","in":"formData"},{"name":"legalCountry","description":"Project legal country. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_COUNTRY]","default":"","in":"formData"},{"name":"legalState","description":"Project legal state. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_STATE]","default":"","in":"formData"},{"name":"legalCity","description":"Project legal city. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_CITY]","default":"","in":"formData"},{"name":"legalAddress","description":"Project legal address. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_ADDRESS]","default":"","in":"formData"},{"name":"legalTaxId","description":"Project legal tax ID. Max length: 256 chars.","required":false,"type":"string","x-example":"[LEGAL_TAX_ID]","default":"","in":"formData"}]},"delete":{"summary":"Delete Project","operationId":"delete","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":100,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"password","description":"Your user password for confirmation. Must be between 6 to 32 chars.","required":true,"type":"string","x-example":"[PASSWORD]","in":"formData"}]}},"\/projects\/{projectId}\/domains":{"get":{"summary":"List Domains","operationId":"listDomains","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":122,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-domains.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Domain","operationId":"createDomain","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":121,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domain","description":"Domain name.","required":true,"type":"string","in":"formData"}]}},"\/projects\/{projectId}\/domains\/{domainId}":{"get":{"summary":"Get Domain","operationId":"getDomain","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":123,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]},"delete":{"summary":"Delete Domain","operationId":"deleteDomain","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":125,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/domains\/{domainId}\/verification":{"patch":{"summary":"Update Domain Verification Status","operationId":"updateDomainVerification","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":124,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-domain-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/keys":{"get":{"summary":"List Keys","operationId":"listKeys","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":107,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-keys.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Key","operationId":"createKey","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":106,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Key name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"scopes","description":"Key scopes list.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/projects\/{projectId}\/keys\/{keyId}":{"get":{"summary":"Get Key","operationId":"getKey","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":108,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"keyId","description":"Key unique ID.","required":true,"type":"string","x-example":"[KEY_ID]","in":"path"}]},"put":{"summary":"Update Key","operationId":"updateKey","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":109,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"keyId","description":"Key unique ID.","required":true,"type":"string","x-example":"[KEY_ID]","in":"path"},{"name":"name","description":"Key name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"scopes","description":"Key scopes list","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Key","operationId":"deleteKey","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":110,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"keyId","description":"Key unique ID.","required":true,"type":"string","x-example":"[KEY_ID]","in":"path"}]}},"\/projects\/{projectId}\/oauth2":{"patch":{"summary":"Update Project OAuth2","operationId":"updateOAuth2","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":99,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-o-auth2.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"provider","description":"Provider Name","required":true,"type":"string","x-example":"amazon","in":"formData"},{"name":"appId","description":"Provider app ID. Max length: 256 chars.","required":false,"type":"string","x-example":"[APP_ID]","default":"","in":"formData"},{"name":"secret","description":"Provider secret key. Max length: 512 chars.","required":false,"type":"string","x-example":"[SECRET]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/platforms":{"get":{"summary":"List Platforms","operationId":"listPlatforms","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":117,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-platforms.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Platform","operationId":"createPlatform","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":116,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"type","description":"Platform type.","required":true,"type":"string","x-example":"web","in":"formData"},{"name":"name","description":"Platform name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"key","description":"Package name for android or bundle ID for iOS. Max length: 256 chars.","required":false,"type":"string","x-example":"[KEY]","default":"","in":"formData"},{"name":"store","description":"App store or Google Play store ID. Max length: 256 chars.","required":false,"type":"string","x-example":"[STORE]","default":"","in":"formData"},{"name":"hostname","description":"Platform client hostname. Max length: 256 chars.","required":false,"type":"string","x-example":"[HOSTNAME]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/platforms\/{platformId}":{"get":{"summary":"Get Platform","operationId":"getPlatform","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":118,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"platformId","description":"Platform unique ID.","required":true,"type":"string","x-example":"[PLATFORM_ID]","in":"path"}]},"put":{"summary":"Update Platform","operationId":"updatePlatform","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":119,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"platformId","description":"Platform unique ID.","required":true,"type":"string","x-example":"[PLATFORM_ID]","in":"path"},{"name":"name","description":"Platform name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"key","description":"Package name for android or bundle ID for iOS. Max length: 256 chars.","required":false,"type":"string","x-example":"[KEY]","default":"","in":"formData"},{"name":"store","description":"App store or Google Play store ID. Max length: 256 chars.","required":false,"type":"string","x-example":"[STORE]","default":"","in":"formData"},{"name":"hostname","description":"Platform client URL. Max length: 256 chars.","required":false,"type":"string","x-example":"[HOSTNAME]","default":"","in":"formData"}]},"delete":{"summary":"Delete Platform","operationId":"deletePlatform","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":120,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"platformId","description":"Platform unique ID.","required":true,"type":"string","x-example":"[PLATFORM_ID]","in":"path"}]}},"\/projects\/{projectId}\/tasks":{"get":{"summary":"List Tasks","operationId":"listTasks","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":112,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Task","operationId":"createTask","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":111,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Task name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"status","description":"Task status.","required":true,"type":"string","x-example":"play","in":"formData"},{"name":"schedule","description":"Task schedule CRON syntax.","required":true,"type":"string","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpMethod","description":"Task HTTP method.","required":true,"type":"string","x-example":"GET","in":"formData"},{"name":"httpUrl","description":"Task HTTP URL","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"},{"name":"httpHeaders","description":"Task HTTP headers list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"httpUser","description":"Task HTTP user. Max length: 256 chars.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Task HTTP password. Max length: 256 chars.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/tasks\/{taskId}":{"get":{"summary":"Get Task","operationId":"getTask","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":113,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]},"put":{"summary":"Update Task","operationId":"updateTask","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":114,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"},{"name":"name","description":"Task name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"status","description":"Task status.","required":true,"type":"string","x-example":"play","in":"formData"},{"name":"schedule","description":"Task schedule CRON syntax.","required":true,"type":"string","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpMethod","description":"Task HTTP method.","required":true,"type":"string","x-example":"GET","in":"formData"},{"name":"httpUrl","description":"Task HTTP URL.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"},{"name":"httpHeaders","description":"Task HTTP headers list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"httpUser","description":"Task HTTP user. Max length: 256 chars.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Task HTTP password. Max length: 256 chars.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]},"delete":{"summary":"Delete Task","operationId":"deleteTask","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":115,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get Project","operationId":"getUsage","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":97,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"daily","default":"last30","in":"query"}]}},"\/projects\/{projectId}\/webhooks":{"get":{"summary":"List Webhooks","operationId":"listWebhooks","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":102,"cookies":false,"type":"","demo":"docs\/examples\/projects\/list-webhooks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"}]},"post":{"summary":"Create Webhook","operationId":"createWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":101,"cookies":false,"type":"","demo":"docs\/examples\/projects\/create-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"name","description":"Webhook name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"events","description":"Events list.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"Webhook URL.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpUser","description":"Webhook HTTP user. Max length: 256 chars.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Webhook HTTP password. Max length: 256 chars.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]}},"\/projects\/{projectId}\/webhooks\/{webhookId}":{"get":{"summary":"Get Webhook","operationId":"getWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":103,"cookies":false,"type":"","demo":"docs\/examples\/projects\/get-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"webhookId","description":"Webhook unique ID.","required":true,"type":"string","x-example":"[WEBHOOK_ID]","in":"path"}]},"put":{"summary":"Update Webhook","operationId":"updateWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":104,"cookies":false,"type":"","demo":"docs\/examples\/projects\/update-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"webhookId","description":"Webhook unique ID.","required":true,"type":"string","x-example":"[WEBHOOK_ID]","in":"path"},{"name":"name","description":"Webhook name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"events","description":"Events list.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"Webhook URL.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"},{"name":"security","description":"Certificate verification, false for disabled or true for enabled.","required":true,"type":"boolean","x-example":false,"in":"formData"},{"name":"httpUser","description":"Webhook HTTP user. Max length: 256 chars.","required":false,"type":"string","x-example":"[HTTP_USER]","default":"","in":"formData"},{"name":"httpPass","description":"Webhook HTTP password. Max length: 256 chars.","required":false,"type":"string","x-example":"[HTTP_PASS]","default":"","in":"formData"}]},"delete":{"summary":"Delete Webhook","operationId":"deleteWebhook","consumes":["application\/json"],"tags":["projects"],"description":"","extensions":{"weight":105,"cookies":false,"type":"","demo":"docs\/examples\/projects\/delete-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":[]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"projectId","description":"Project unique ID.","required":true,"type":"string","x-example":"[PROJECT_ID]","in":"path"},{"name":"webhookId","description":"Webhook unique ID.","required":true,"type":"string","x-example":"[WEBHOOK_ID]","in":"path"}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":127,"cookies":false,"type":"","demo":"docs\/examples\/storage\/list-files.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","extensions":{"weight":126,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","extensions":{"weight":128,"cookies":false,"type":"","demo":"docs\/examples\/storage\/get-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","extensions":{"weight":132,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":133,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.","extensions":{"weight":130,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-download.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"tags":["storage"],"description":"Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image.","extensions":{"weight":129,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-preview.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","extensions":{"weight":131,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-view.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":135,"cookies":false,"type":"","demo":"docs\/examples\/teams\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["application\/json"],"tags":["teams"],"description":"Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","extensions":{"weight":134,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Team name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","extensions":{"weight":136,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":138,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","extensions":{"weight":140,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","extensions":{"weight":139,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if he didn't accept it.","extensions":{"weight":142,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}\/status":{"patch":{"summary":"Update Team Membership Status","operationId":"updateMembershipStatus","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to allow a user to accept an invitation to join a team after he is being redirected back to your app from the invitation email he was sent.","extensions":{"weight":141,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update-membership-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"public","platforms":["client"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"},{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"formData"},{"name":"secret","description":"Secret key.","required":true,"type":"string","x-example":"[SECRET]","in":"formData"}]}},"\/users":{"get":{"summary":"List Users","operationId":"list","consumes":["application\/json"],"tags":["users"],"description":"Get a list of all the project users. You can use the query params to filter your results.","extensions":{"weight":144,"cookies":false,"type":"","demo":"docs\/examples\/users\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-users.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create User","operationId":"create","consumes":["application\/json"],"tags":["users"],"description":"Create a new user.","extensions":{"weight":143,"cookies":false,"type":"","demo":"docs\/examples\/users\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"get","consumes":["application\/json"],"tags":["users"],"description":"Get user by its unique ID.","extensions":{"weight":145,"cookies":false,"type":"","demo":"docs\/examples\/users\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User","operationId":"deleteUser","consumes":["application\/json"],"tags":["users"],"description":"Delete a user by its unique ID.","extensions":{"weight":153,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["users"],"description":"Get user activity logs list by its unique ID.","extensions":{"weight":148,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["users"],"description":"Get user preferences by its unique ID.","extensions":{"weight":146,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["users"],"description":"Update user preferences by its unique ID. You can pass only the specific settings you wish to update.","extensions":{"weight":150,"cookies":false,"type":"","demo":"docs\/examples\/users\/update-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["users"],"description":"Get user sessions list by its unique ID.","extensions":{"weight":147,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["users"],"description":"Delete all user sessions by its unique ID.","extensions":{"weight":152,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/sessions\/{sessionId}":{"delete":{"summary":"Delete User Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["users"],"description":"Delete user sessions by its unique ID.","extensions":{"weight":151,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"updateStatus","consumes":["application\/json"],"tags":["users"],"description":"Update user status by its unique ID.","extensions":{"weight":149,"cookies":false,"type":"","demo":"docs\/examples\/users\/update-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"status","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","required":true,"type":"string","x-example":1,"in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}}
\ No newline at end of file
diff --git a/app/config/specs/0.7.0.server.json b/app/config/specs/0.7.0.server.json
new file mode 100644
index 0000000000..4b7c8546f8
--- /dev/null
+++ b/app/config/specs/0.7.0.server.json
@@ -0,0 +1,2 @@
+
+{"swagger":"2.0","info":{"version":"0.7.0","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@localhost.test"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","extensions":{"demo":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","extensions":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","extensions":{"demo":"en"}}},"paths":{"\/avatars\/browsers\/{code}":{"get":{"summary":"Get Browser Icon","operationId":"getBrowser","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","extensions":{"weight":57,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-browser.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-browser.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"getCreditCard","consumes":["application\/json"],"tags":["avatars"],"description":"Need to display your users with your billing method or their payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.","extensions":{"weight":56,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-credit-card.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-credit-card.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"getFavicon","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL.","extensions":{"weight":60,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-favicon.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-favicon.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"Website URL which you want to fetch the favicon from.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"}]}},"\/avatars\/flags\/{code}":{"get":{"summary":"Get Country Flag","operationId":"getFlag","consumes":["application\/json"],"tags":["avatars"],"description":"You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings.","extensions":{"weight":58,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-flag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-flag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"getImage","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.","extensions":{"weight":59,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-image.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-image.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"url","description":"Image URL which you want to crop.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"query"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"getInitials","consumes":["application\/json"],"tags":["avatars"],"description":"Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.","extensions":{"weight":62,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-initials.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-initials.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Full Name. When empty, current user name or email will be used. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"query"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":500,"in":"query"},{"name":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"getQR","consumes":["application\/json"],"tags":["avatars"],"description":"Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.","extensions":{"weight":61,"cookies":false,"type":"location","demo":"docs\/examples\/avatars\/get-q-r.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/avatars\/get-qr.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"avatars.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"text","description":"Plain text to be converted to QR code image.","required":true,"type":"string","x-example":"[TEXT]","in":"query"},{"name":"size","description":"QR code size. Pass an integer between 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"listCollections","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project collections. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":64,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"createCollection","consumes":["application\/json"],"tags":["database"],"description":"Create a new Collection.","extensions":{"weight":63,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Collection name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"getCollection","consumes":["application\/json"],"tags":["database"],"description":"Get collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.","extensions":{"weight":65,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"updateCollection","consumes":["application\/json"],"tags":["database"],"description":"Update collection by its unique ID.","extensions":{"weight":66,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"name","description":"Collection name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"rules","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"}]},"delete":{"summary":"Delete Collection","operationId":"deleteCollection","consumes":["application\/json"],"tags":["database"],"description":"Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":67,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"listDocuments","consumes":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":69,"cookies":false,"type":"","demo":"docs\/examples\/database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. Use this value to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"$id","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"createDocument","consumes":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database?sdk=nodejs#createCollection) API or directly from your database console.","extensions":{"weight":68,"cookies":false,"type":"","demo":"docs\/examples\/database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"parentDocument","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"[PARENT_DOCUMENT]","default":"","in":"formData"},{"name":"parentProperty","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","default":"","in":"formData"},{"name":"parentPropertyType","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","required":false,"type":"string","x-example":"assign","default":"assign","in":"formData"}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"getDocument","consumes":["application\/json"],"tags":["database"],"description":"Get document by its unique ID. This endpoint response returns a JSON object with the document data.","extensions":{"weight":70,"cookies":false,"type":"","demo":"docs\/examples\/database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"updateDocument","consumes":["application\/json"],"tags":["database"],"description":"","extensions":{"weight":71,"cookies":false,"type":"","demo":"docs\/examples\/database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"data","description":"Document data as JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete Document","operationId":"deleteDocument","consumes":["application\/json"],"tags":["database"],"description":"Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted.","extensions":{"weight":72,"cookies":false,"type":"","demo":"docs\/examples\/database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions":{"get":{"summary":"List Functions","operationId":"list","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":155,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Function","operationId":"create","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":154,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Function name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"env","description":"Execution enviornment.","required":true,"type":"string","x-example":"node-14","in":"formData"},{"name":"vars","description":"Key-value JSON object.","required":false,"type":"object","x-example":"{}","default":[],"in":"formData"},{"name":"events","description":"Events list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"},{"name":"schedule","description":"Schedule CRON syntax.","required":false,"type":"string","default":"","in":"formData"},{"name":"timeout","description":"Function maximum execution time in seconds.","required":false,"type":"integer","format":"int32","x-example":1,"default":15,"in":"formData"}]}},"\/functions\/{functionId}":{"get":{"summary":"Get Function","operationId":"get","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":156,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]},"put":{"summary":"Update Function","operationId":"update","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":157,"cookies":false,"type":"","demo":"docs\/examples\/functions\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"name","description":"Function name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"vars","description":"Key-value JSON object.","required":false,"type":"object","x-example":"{}","default":[],"in":"formData"},{"name":"events","description":"Events list.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"formData"},{"name":"schedule","description":"Schedule CRON syntax.","required":false,"type":"string","default":"","in":"formData"},{"name":"timeout","description":"Function maximum execution time in seconds.","required":false,"type":"integer","format":"int32","x-example":1,"default":15,"in":"formData"}]},"delete":{"summary":"Delete Function","operationId":"delete","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":159,"cookies":false,"type":"","demo":"docs\/examples\/functions\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/executions":{"get":{"summary":"List Executions","operationId":"listExecutions","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":165,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list-executions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-executions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Execution","operationId":"createExecution","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":164,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"async","description":"Execute code asynchronously. Pass 1 for true, 0 for false. Default value is 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"formData"}]}},"\/functions\/{functionId}\/executions\/{executionId}":{"get":{"summary":"Get Execution","operationId":"getExecution","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":166,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution unique ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/tag":{"patch":{"summary":"Update Function Tag","operationId":"updateTag","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":158,"cookies":false,"type":"","demo":"docs\/examples\/functions\/update-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tag","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG]","in":"formData"}]}},"\/functions\/{functionId}\/tags":{"get":{"summary":"List Tags","operationId":"listTags","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":161,"cookies":false,"type":"","demo":"docs\/examples\/functions\/list-tags.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-tags.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Tag","operationId":"createTag","consumes":["multipart\/form-data"],"tags":["functions"],"description":"","extensions":{"weight":160,"cookies":false,"type":"","demo":"docs\/examples\/functions\/create-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"command","description":"Code execution command.","required":true,"type":"string","x-example":"[COMMAND]","in":"formData"},{"name":"code","description":"Gzip file containing your code.","required":true,"type":"file","in":"formData"}]}},"\/functions\/{functionId}\/tags\/{tagId}":{"get":{"summary":"Get Tag","operationId":"getTag","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":162,"cookies":false,"type":"","demo":"docs\/examples\/functions\/get-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]},"delete":{"summary":"Delete Tag","operationId":"deleteTag","consumes":["application\/json"],"tags":["functions"],"description":"","extensions":{"weight":163,"cookies":false,"type":"","demo":"docs\/examples\/functions\/delete-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"get","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","extensions":{"weight":80,"cookies":false,"type":"","demo":"docs\/examples\/health\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/anti-virus":{"get":{"summary":"Get Anti virus","operationId":"getAntiVirus","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","extensions":{"weight":92,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-anti-virus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"getCache","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","extensions":{"weight":83,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-cache.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-cache.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/db":{"get":{"summary":"Get DB","operationId":"getDB","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","extensions":{"weight":82,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-d-b.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-db.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"getQueueCertificates","consumes":["application\/json"],"tags":["health"],"description":"Get the number of certificates that are waiting to be issued against [Letsencrypt](https:\/\/letsencrypt.org\/) in the Appwrite internal queue server.","extensions":{"weight":89,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-certificates.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-certificates.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"getQueueFunctions","consumes":["application\/json"],"tags":["health"],"description":"","extensions":{"weight":90,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-functions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"getQueueLogs","consumes":["application\/json"],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":87,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"getQueueTasks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":86,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"getQueueUsage","consumes":["application\/json"],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":88,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"getQueueWebhooks","consumes":["application\/json"],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","extensions":{"weight":85,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-queue-webhooks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-webhooks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"getStorageLocal","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","extensions":{"weight":91,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-storage-local.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-local.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/health\/time":{"get":{"summary":"Get Time","operationId":"getTime","consumes":["application\/json"],"tags":["health"],"description":"Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.","extensions":{"weight":84,"cookies":false,"type":"","demo":"docs\/examples\/health\/get-time.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-time.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"get","consumes":["application\/json"],"tags":["locale"],"description":"Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))","extensions":{"weight":73,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-locale.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"getContinents","consumes":["application\/json"],"tags":["locale"],"description":"List of all continents. You can use the locale header to get the data in a supported language.","extensions":{"weight":77,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"getCountries","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries. You can use the locale header to get the data in a supported language.","extensions":{"weight":74,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"getCountriesEU","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.","extensions":{"weight":75,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"getCountriesPhones","consumes":["application\/json"],"tags":["locale"],"description":"List of all countries phone codes. You can use the locale header to get the data in a supported language.","extensions":{"weight":76,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"getCurrencies","consumes":["application\/json"],"tags":["locale"],"description":"List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.","extensions":{"weight":78,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"getLanguages","consumes":["application\/json"],"tags":["locale"],"description":"List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.","extensions":{"weight":79,"cookies":false,"type":"","demo":"docs\/examples\/locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"listFiles","consumes":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":127,"cookies":false,"type":"","demo":"docs\/examples\/storage\/list-files.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-files.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"createFile","consumes":["multipart\/form-data"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","extensions":{"weight":126,"cookies":false,"type":"upload","demo":"docs\/examples\/storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"getFile","consumes":["application\/json"],"tags":["storage"],"description":"Get file by its unique ID. This endpoint response returns a JSON object with the file metadata.","extensions":{"weight":128,"cookies":false,"type":"","demo":"docs\/examples\/storage\/get-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]},"put":{"summary":"Update File","operationId":"updateFile","consumes":["application\/json"],"tags":["storage"],"description":"Update file by its unique ID. Only users with write permissions have access to update this resource.","extensions":{"weight":132,"cookies":false,"type":"","demo":"docs\/examples\/storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"read","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]},"delete":{"summary":"Delete File","operationId":"deleteFile","consumes":["application\/json"],"tags":["storage"],"description":"Delete a file by its unique ID. Only users with write permissions have access to delete this resource.","extensions":{"weight":133,"cookies":false,"type":"","demo":"docs\/examples\/storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"getFileDownload","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.","extensions":{"weight":130,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-download.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-download.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"getFilePreview","consumes":["application\/json"],"tags":["storage"],"description":"Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image.","extensions":{"weight":129,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-preview.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-preview.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"background","description":"Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.","required":false,"type":"string","default":"","in":"query"},{"name":"output","description":"Output format type (jpeg, jpg, png, gif and webp).","required":false,"type":"string","x-example":"jpg","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"getFileView","consumes":["application\/json"],"tags":["storage"],"description":"Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.","extensions":{"weight":131,"cookies":false,"type":"location","demo":"docs\/examples\/storage\/get-file-view.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-file-view.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"as","description":"Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.","required":false,"type":"string","x-example":"pdf","default":"","in":"query"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"list","consumes":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](\/docs\/admin).","extensions":{"weight":135,"cookies":false,"type":"","demo":"docs\/examples\/teams\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-teams.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"create","consumes":["application\/json"],"tags":["teams"],"description":"Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","extensions":{"weight":134,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"name","description":"Team name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":["owner"],"in":"formData"}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"get","consumes":["application\/json"],"tags":["teams"],"description":"Get team by its unique ID. All team members have read access for this resource.","extensions":{"weight":136,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"update","consumes":["application\/json"],"tags":["teams"],"description":"Update team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":137,"cookies":false,"type":"","demo":"docs\/examples\/teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"name","description":"Team name. Max length: 128 chars.","required":true,"type":"string","x-example":"[NAME]","in":"formData"}]},"delete":{"summary":"Delete Team","operationId":"delete","consumes":["application\/json"],"tags":["teams"],"description":"Delete team by its unique ID. Only team owners have write access for this resource.","extensions":{"weight":138,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"getMemberships","consumes":["application\/json"],"tags":["teams"],"description":"Get team members by the team unique ID. All team members have read access for this list of resources.","extensions":{"weight":140,"cookies":false,"type":"","demo":"docs\/examples\/teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"createMembership","consumes":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","extensions":{"weight":139,"cookies":false,"type":"","demo":"docs\/examples\/teams\/create-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"email","description":"New team member email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"name","description":"New team member name. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"},{"name":"roles","description":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions).","required":true,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"url","description":"URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":true,"type":"string","format":"url","x-example":"https:\/\/example.com","in":"formData"}]}},"\/teams\/{teamId}\/memberships\/{inviteId}":{"delete":{"summary":"Delete Team Membership","operationId":"deleteMembership","consumes":["application\/json"],"tags":["teams"],"description":"This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if he didn't accept it.","extensions":{"weight":142,"cookies":false,"type":"","demo":"docs\/examples\/teams\/delete-membership.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/delete-team-membership.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"inviteId","description":"Invite unique ID.","required":true,"type":"string","x-example":"[INVITE_ID]","in":"path"}]}},"\/users":{"get":{"summary":"List Users","operationId":"list","consumes":["application\/json"],"tags":["users"],"description":"Get a list of all the project users. You can use the query params to filter your results.","extensions":{"weight":144,"cookies":false,"type":"","demo":"docs\/examples\/users\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-users.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create User","operationId":"create","consumes":["application\/json"],"tags":["users"],"description":"Create a new user.","extensions":{"weight":143,"cookies":false,"type":"","demo":"docs\/examples\/users\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"email","description":"User email.","required":true,"type":"string","format":"email","x-example":"email@example.com","in":"formData"},{"name":"password","description":"User password. Must be between 6 to 32 chars.","required":true,"type":"string","format":"format","x-example":"password","in":"formData"},{"name":"name","description":"User name. Max length: 128 chars.","required":false,"type":"string","x-example":"[NAME]","default":"","in":"formData"}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"get","consumes":["application\/json"],"tags":["users"],"description":"Get user by its unique ID.","extensions":{"weight":145,"cookies":false,"type":"","demo":"docs\/examples\/users\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User","operationId":"deleteUser","consumes":["application\/json"],"tags":["users"],"description":"Delete a user by its unique ID.","extensions":{"weight":153,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-user.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"getLogs","consumes":["application\/json"],"tags":["users"],"description":"Get user activity logs list by its unique ID.","extensions":{"weight":148,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"getPrefs","consumes":["application\/json"],"tags":["users"],"description":"Get user preferences by its unique ID.","extensions":{"weight":146,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"patch":{"summary":"Update User Preferences","operationId":"updatePrefs","consumes":["application\/json"],"tags":["users"],"description":"Update user preferences by its unique ID. You can pass only the specific settings you wish to update.","extensions":{"weight":150,"cookies":false,"type":"","demo":"docs\/examples\/users\/update-prefs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-prefs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"prefs","description":"Prefs key-value JSON object.","required":true,"type":"object","x-example":"{}","in":"formData"}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"getSessions","consumes":["application\/json"],"tags":["users"],"description":"Get user sessions list by its unique ID.","extensions":{"weight":147,"cookies":false,"type":"","demo":"docs\/examples\/users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"deleteSessions","consumes":["application\/json"],"tags":["users"],"description":"Delete all user sessions by its unique ID.","extensions":{"weight":152,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/sessions\/{sessionId}":{"delete":{"summary":"Delete User Session","operationId":"deleteSession","consumes":["application\/json"],"tags":["users"],"description":"Delete user sessions by its unique ID.","extensions":{"weight":151,"cookies":false,"type":"","demo":"docs\/examples\/users\/delete-session.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md","rate-limit":100,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"updateStatus","consumes":["application\/json"],"tags":["users"],"description":"Update user status by its unique ID.","extensions":{"weight":149,"cookies":false,"type":"","demo":"docs\/examples\/users\/update-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-status.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.write","platforms":["server"]},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"status","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","required":true,"type":"string","x-example":1,"in":"formData"}]}}},"definitions":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/localhost\/docs"}}
\ No newline at end of file
diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php
index 48ad948263..f80c09c6b9 100644
--- a/app/controllers/api/account.php
+++ b/app/controllers/api/account.php
@@ -51,9 +51,9 @@ App::post('/v1/account')
->label('sdk.method', 'create')
->label('sdk.description', '/docs/references/account/create.md')
->label('abuse-limit', 10)
- ->param('email', '', function () { return new Email(); }, 'User email.')
- ->param('password', '', function () { return new Password(); }, 'User password. Must be between 6 to 32 chars.')
- ->param('name', '', function () { return new Text(100); }, 'User name.', true)
+ ->param('email', '', new Email(), 'User email.')
+ ->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.')
+ ->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true)
->action(function ($email, $password, $name, $request, $response, $project, $projectDB, $webhooks, $audits) use ($oauth2Keys) {
/** @var Utopia\Request $request */
/** @var Utopia\Response $response */
@@ -157,8 +157,8 @@ App::post('/v1/account/sessions')
->label('sdk.description', '/docs/references/account/create-session.md')
->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},email:{param-email}')
- ->param('email', '', function () { return new Email(); }, 'User email.')
- ->param('password', '', function () { return new Password(); }, 'User password. Must be between 6 to 32 chars.')
+ ->param('email', '', new Email(), 'User email.')
+ ->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.')
->action(function ($email, $password, $request, $response, $projectDB, $webhooks, $audits) {
/** @var Appwrite\Swoole\Request $request */
/** @var Appwrite\Utopia\Response $response */
@@ -256,10 +256,10 @@ App::get('/v1/account/sessions/oauth2/:provider')
->label('sdk.methodType', 'webAuth')
->label('abuse-limit', 50)
->label('abuse-key', 'ip:{ip}')
- ->param('provider', '', function () { return new WhiteList(\array_keys(Config::getParam('providers'))); }, 'OAuth2 Provider. Currently, supported providers are: ' . \implode(', ', \array_keys(\array_filter(Config::getParam('providers'), function($node) {return (!$node['mock']);}))).'.')
+ ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'OAuth2 Provider. Currently, supported providers are: ' . \implode(', ', \array_keys(\array_filter(Config::getParam('providers'), function($node) {return (!$node['mock']);}))).'.')
->param('success', $oauthDefaultSuccess, function ($clients) { return new Host($clients); }, 'URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['clients'])
->param('failure', $oauthDefaultFailure, function ($clients) { return new Host($clients); }, 'URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['clients'])
- ->param('scopes', [], function () { return new ArrayList(new Text(128)); }, 'A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.', true)
+ ->param('scopes', [], new ArrayList(new Text(128)), 'A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.', true)
->action(function ($provider, $success, $failure, $scopes, $request, $response, $project) {
/** @var Utopia\Request $request */
/** @var Utopia\Response $response */
@@ -301,10 +301,10 @@ App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId')
->label('error', __DIR__.'/../../views/general/error.phtml')
->label('scope', 'public')
->label('docs', false)
- ->param('projectId', '', function () { return new Text(1024); }, 'Project unique ID.')
- ->param('provider', '', function () { return new WhiteList(\array_keys(Config::getParam('providers'))); }, 'OAuth2 provider.')
- ->param('code', '', function () { return new Text(1024); }, 'OAuth2 code.')
- ->param('state', '', function () { return new Text(2048); }, 'Login state params.', true)
+ ->param('projectId', '', new Text(1024), 'Project unique ID.')
+ ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'OAuth2 provider.')
+ ->param('code', '', new Text(1024), 'OAuth2 code.')
+ ->param('state', '', new Text(2048), 'Login state params.', true)
->action(function ($projectId, $provider, $code, $state, $request, $response) {
/** @var Utopia\Request $request */
/** @var Utopia\Response $response */
@@ -326,10 +326,10 @@ App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId')
->label('scope', 'public')
->label('origin', '*')
->label('docs', false)
- ->param('projectId', '', function () { return new Text(1024); }, 'Project unique ID.')
- ->param('provider', '', function () { return new WhiteList(\array_keys(Config::getParam('providers'))); }, 'OAuth2 provider.')
- ->param('code', '', function () { return new Text(1024); }, 'OAuth2 code.')
- ->param('state', '', function () { return new Text(2048); }, 'Login state params.', true)
+ ->param('projectId', '', new Text(1024), 'Project unique ID.')
+ ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'OAuth2 provider.')
+ ->param('code', '', new Text(1024), 'OAuth2 code.')
+ ->param('state', '', new Text(2048), 'Login state params.', true)
->action(function ($projectId, $provider, $code, $state, $request, $response) {
/** @var Utopia\Request $request */
/** @var Utopia\Response $response */
@@ -353,9 +353,9 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
->label('abuse-limit', 50)
->label('abuse-key', 'ip:{ip}')
->label('docs', false)
- ->param('provider', '', function () { return new WhiteList(\array_keys(Config::getParam('providers'))); }, 'OAuth2 provider.')
- ->param('code', '', function () { return new Text(1024); }, 'OAuth2 code.')
- ->param('state', '', function () { return new Text(2048); }, 'OAuth2 state params.', true)
+ ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'OAuth2 provider.')
+ ->param('code', '', new Text(1024), 'OAuth2 code.')
+ ->param('state', '', new Text(2048), 'OAuth2 state params.', true)
->action(function ($provider, $code, $state, $request, $response, $project, $user, $projectDB, $audits) use ($oauthDefaultSuccess) {
/** @var Utopia\Request $request */
/** @var Utopia\Response $response */
@@ -738,7 +738,7 @@ App::patch('/v1/account/name')
->label('sdk.namespace', 'account')
->label('sdk.method', 'updateName')
->label('sdk.description', '/docs/references/account/update-name.md')
- ->param('name', '', function () { return new Text(100); }, 'User name.')
+ ->param('name', '', new Text(128), 'User name. Max length: 128 chars.')
->action(function ($name, $response, $user, $projectDB, $audits) use ($oauth2Keys) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Document $user */
@@ -779,8 +779,8 @@ App::patch('/v1/account/password')
->label('sdk.namespace', 'account')
->label('sdk.method', 'updatePassword')
->label('sdk.description', '/docs/references/account/update-password.md')
- ->param('password', '', function () { return new Password(); }, 'New user password. Must be between 6 to 32 chars.')
- ->param('oldPassword', '', function () { return new Password(); }, 'Old user password. Must be between 6 to 32 chars.')
+ ->param('password', '', new Password(), 'New user password. Must be between 6 to 32 chars.')
+ ->param('oldPassword', '', new Password(), 'Old user password. Must be between 6 to 32 chars.')
->action(function ($password, $oldPassword, $response, $user, $projectDB, $audits) use ($oauth2Keys) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Document $user */
@@ -825,8 +825,8 @@ App::patch('/v1/account/email')
->label('sdk.namespace', 'account')
->label('sdk.method', 'updateEmail')
->label('sdk.description', '/docs/references/account/update-email.md')
- ->param('email', '', function () { return new Email(); }, 'User email.')
- ->param('password', '', function () { return new Password(); }, 'User password. Must be between 6 to 32 chars.')
+ ->param('email', '', new Email(), 'User email.')
+ ->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.')
->action(function ($email, $password, $response, $user, $projectDB, $audits) use ($oauth2Keys) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Document $user */
@@ -885,7 +885,7 @@ App::patch('/v1/account/prefs')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'updatePrefs')
- ->param('prefs', '', function () { return new Assoc();}, 'Prefs key-value JSON object.')
+ ->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.')
->label('sdk.description', '/docs/references/account/update-prefs.md')
->action(function ($prefs, $response, $user, $projectDB, $audits) {
/** @var Utopia\Response $response */
@@ -992,7 +992,7 @@ App::delete('/v1/account/sessions/:sessionId')
->label('sdk.method', 'deleteSession')
->label('sdk.description', '/docs/references/account/delete-session.md')
->label('abuse-limit', 100)
- ->param('sessionId', null, function () { return new UID(); }, 'Session unique ID. Use the string \'current\' to delete the current device session.')
+ ->param('sessionId', null, new UID(), 'Session unique ID. Use the string \'current\' to delete the current device session.')
->action(function ($sessionId, $request, $response, $user, $projectDB, $audits, $webhooks) {
/** @var Utopia\Request $request */
/** @var Utopia\Response $response */
@@ -1113,7 +1113,7 @@ App::post('/v1/account/recovery')
->label('sdk.description', '/docs/references/account/create-recovery.md')
->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},email:{param-email}')
- ->param('email', '', function () { return new Email(); }, 'User email.')
+ ->param('email', '', new Email(), 'User email.')
->param('url', '', function ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients'])
->action(function ($email, $url, $request, $response, $projectDB, $project, $locale, $mails, $audits) {
/** @var Utopia\Request $request */
@@ -1219,10 +1219,10 @@ App::put('/v1/account/recovery')
->label('sdk.description', '/docs/references/account/update-recovery.md')
->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},userId:{param-userId}')
- ->param('userId', '', function () { return new UID(); }, 'User account UID address.')
- ->param('secret', '', function () { return new Text(256); }, 'Valid reset token.')
- ->param('password', '', function () { return new Password(); }, 'New password. Must be between 6 to 32 chars.')
- ->param('passwordAgain', '', function () {return new Password(); }, 'New password again. Must be between 6 to 32 chars.')
+ ->param('userId', '', new UID(), 'User account UID address.')
+ ->param('secret', '', new Text(256), 'Valid reset token.')
+ ->param('password', '', new Password(), 'New password. Must be between 6 to 32 chars.')
+ ->param('passwordAgain', '', new Password(), 'New password again. Must be between 6 to 32 chars.')
->action(function ($userId, $secret, $password, $passwordAgain, $response, $projectDB, $audits) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -1386,8 +1386,8 @@ App::put('/v1/account/verification')
->label('sdk.description', '/docs/references/account/update-verification.md')
->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},userId:{param-userId}')
- ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
- ->param('secret', '', function () { return new Text(256); }, 'Valid verification token.')
+ ->param('userId', '', new UID(), 'User unique ID.')
+ ->param('secret', '', new Text(256), 'Valid verification token.')
->action(function ($userId, $secret, $response, $user, $projectDB, $audits) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Document $user */
diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php
index fb8055870c..0930806983 100644
--- a/app/controllers/api/avatars.php
+++ b/app/controllers/api/avatars.php
@@ -90,10 +90,10 @@ App::get('/v1/avatars/credit-cards/:code')
->label('sdk.method', 'getCreditCard')
->label('sdk.methodType', 'location')
->label('sdk.description', '/docs/references/avatars/get-credit-card.md')
- ->param('code', '', function () { return new WhiteList(\array_keys(Config::getParam('avatar-credit-cards'))); }, 'Credit Card Code. Possible values: '.\implode(', ', \array_keys(Config::getParam('avatar-credit-cards'))).'.')
- ->param('width', 100, function () { return new Range(0, 2000); }, 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true)
- ->param('height', 100, function () { return new Range(0, 2000); }, 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true)
- ->param('quality', 100, function () { return new Range(0, 100); }, 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true)
+ ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-credit-cards'))), 'Credit Card Code. Possible values: '.\implode(', ', \array_keys(Config::getParam('avatar-credit-cards'))).'.')
+ ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true)
+ ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true)
+ ->param('quality', 100, new Range(0, 100), 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true)
->action(function ($code, $width, $height, $quality, $response) use ($avatarCallback) {
return $avatarCallback('credit-cards', $code, $width, $height, $quality, $response);
}, ['response']);
@@ -107,10 +107,10 @@ App::get('/v1/avatars/browsers/:code')
->label('sdk.method', 'getBrowser')
->label('sdk.methodType', 'location')
->label('sdk.description', '/docs/references/avatars/get-browser.md')
- ->param('code', '', function () { return new WhiteList(\array_keys(Config::getParam('avatar-browsers'))); }, 'Browser Code.')
- ->param('width', 100, function () { return new Range(0, 2000); }, 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true)
- ->param('height', 100, function () { return new Range(0, 2000); }, 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true)
- ->param('quality', 100, function () { return new Range(0, 100); }, 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true)
+ ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-browsers'))), 'Browser Code.')
+ ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true)
+ ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true)
+ ->param('quality', 100, new Range(0, 100), 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true)
->action(function ($code, $width, $height, $quality, $response) use ($avatarCallback) {
return $avatarCallback('browsers', $code, $width, $height, $quality, $response);
}, ['response']);
@@ -124,10 +124,10 @@ App::get('/v1/avatars/flags/:code')
->label('sdk.method', 'getFlag')
->label('sdk.methodType', 'location')
->label('sdk.description', '/docs/references/avatars/get-flag.md')
- ->param('code', '', function () { return new WhiteList(\array_keys(Config::getParam('avatar-flags'))); }, 'Country Code. ISO Alpha-2 country code format.')
- ->param('width', 100, function () { return new Range(0, 2000); }, 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true)
- ->param('height', 100, function () { return new Range(0, 2000); }, 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true)
- ->param('quality', 100, function () { return new Range(0, 100); }, 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true)
+ ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-flags'))), 'Country Code. ISO Alpha-2 country code format.')
+ ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true)
+ ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true)
+ ->param('quality', 100, new Range(0, 100), 'Image quality. Pass an integer between 0 to 100. Defaults to 100.', true)
->action(function ($code, $width, $height, $quality, $response) use ($avatarCallback) {
return $avatarCallback('flags', $code, $width, $height, $quality, $response);
}, ['response']);
@@ -141,9 +141,9 @@ App::get('/v1/avatars/image')
->label('sdk.method', 'getImage')
->label('sdk.methodType', 'location')
->label('sdk.description', '/docs/references/avatars/get-image.md')
- ->param('url', '', function () { return new URL(); }, 'Image URL which you want to crop.')
- ->param('width', 400, function () { return new Range(0, 2000); }, 'Resize preview image width, Pass an integer between 0 to 2000.', true)
- ->param('height', 400, function () { return new Range(0, 2000); }, 'Resize preview image height, Pass an integer between 0 to 2000.', true)
+ ->param('url', '', new URL(), 'Image URL which you want to crop.')
+ ->param('width', 400, new Range(0, 2000), 'Resize preview image width, Pass an integer between 0 to 2000.', true)
+ ->param('height', 400, new Range(0, 2000), 'Resize preview image height, Pass an integer between 0 to 2000.', true)
->action(function ($url, $width, $height, $response) {
/** @var Utopia\Response $response */
@@ -207,7 +207,7 @@ App::get('/v1/avatars/favicon')
->label('sdk.method', 'getFavicon')
->label('sdk.methodType', 'location')
->label('sdk.description', '/docs/references/avatars/get-favicon.md')
- ->param('url', '', function () { return new URL(); }, 'Website URL which you want to fetch the favicon from.')
+ ->param('url', '', new URL(), 'Website URL which you want to fetch the favicon from.')
->action(function ($url, $response) {
/** @var Utopia\Response $response */
@@ -357,10 +357,10 @@ App::get('/v1/avatars/qr')
->label('sdk.method', 'getQR')
->label('sdk.methodType', 'location')
->label('sdk.description', '/docs/references/avatars/get-qr.md')
- ->param('text', '', function () { return new Text(512); }, 'Plain text to be converted to QR code image.')
- ->param('size', 400, function () { return new Range(0, 1000); }, 'QR code size. Pass an integer between 0 to 1000. Defaults to 400.', true)
- ->param('margin', 1, function () { return new Range(0, 10); }, 'Margin from edge. Pass an integer between 0 to 10. Defaults to 1.', true)
- ->param('download', false, function () { return new Boolean(true); }, 'Return resulting image with \'Content-Disposition: attachment \' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.', true)
+ ->param('text', '', new Text(512), 'Plain text to be converted to QR code image.')
+ ->param('size', 400, new Range(0, 1000), 'QR code size. Pass an integer between 0 to 1000. Defaults to 400.', true)
+ ->param('margin', 1, new Range(0, 10), 'Margin from edge. Pass an integer between 0 to 10. Defaults to 1.', true)
+ ->param('download', false, new Boolean(true), 'Return resulting image with \'Content-Disposition: attachment \' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.', true)
->action(function ($text, $size, $margin, $download, $response) {
/** @var Utopia\Response $response */
@@ -393,11 +393,11 @@ App::get('/v1/avatars/initials')
->label('sdk.method', 'getInitials')
->label('sdk.methodType', 'location')
->label('sdk.description', '/docs/references/avatars/get-initials.md')
- ->param('name', '', function () { return new Text(512); }, 'Full Name. When empty, current user name or email will be used.', true)
- ->param('width', 500, function () { return new Range(0, 2000); }, 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true)
- ->param('height', 500, function () { return new Range(0, 2000); }, 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true)
- ->param('color', '', function () { return new HexColor(); }, 'Changes text color. By default a random color will be picked and stay will persistent to the given name.', true)
- ->param('background', '', function () { return new HexColor(); }, 'Changes background color. By default a random color will be picked and stay will persistent to the given name.', true)
+ ->param('name', '', new Text(128), 'Full Name. When empty, current user name or email will be used. Max length: 128 chars.', true)
+ ->param('width', 500, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true)
+ ->param('height', 500, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true)
+ ->param('color', '', new HexColor(), 'Changes text color. By default a random color will be picked and stay will persistent to the given name.', true)
+ ->param('background', '', new HexColor(), 'Changes background color. By default a random color will be picked and stay will persistent to the given name.', true)
->action(function ($name, $width, $height, $color, $background, $response, $user) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Document $user */
diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php
index 548905edae..70fdfac4f8 100644
--- a/app/controllers/api/database.php
+++ b/app/controllers/api/database.php
@@ -30,9 +30,9 @@ App::post('/v1/database/collections')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.method', 'createCollection')
->label('sdk.description', '/docs/references/database/create-collection.md')
- ->param('name', '', function () { return new Text(256); }, 'Collection name.')
- ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
- ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
+ ->param('name', '', new Text(128), 'Collection name. Max length: 128 chars.')
+ ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
+ ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
->param('rules', [], function ($projectDB) { return new ArrayList(new Collection($projectDB, [Database::SYSTEM_COLLECTION_RULES], ['$collection' => Database::SYSTEM_COLLECTION_RULES, '$permissions' => ['read' => [], 'write' => []]])); }, 'Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation.', false, ['projectDB'])
->action(function ($name, $read, $write, $rules, $response, $projectDB, $webhooks, $audits) {
/** @var Utopia\Response $response */
@@ -66,7 +66,7 @@ App::post('/v1/database/collections')
'rules' => $parsedRules,
]);
} catch (AuthorizationException $exception) {
- throw new Exception('Unauthorized action', 401);
+ throw new Exception('Unauthorized permissions', 401);
} catch (StructureException $exception) {
throw new Exception('Bad structure. '.$exception->getMessage(), 400);
} catch (\Exception $exception) {
@@ -106,10 +106,10 @@ App::get('/v1/database/collections')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.method', 'listCollections')
->label('sdk.description', '/docs/references/database/list-collections.md')
- ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
- ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
- ->param('offset', 0, function () { return new Range(0, 40000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true)
- ->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true)
+ ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
+ ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
+ ->param('offset', 0, new Range(0, 40000), 'Results offset. The default value is 0. Use this param to manage pagination.', true)
+ ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true)
->action(function ($search, $limit, $offset, $orderType, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -137,7 +137,7 @@ App::get('/v1/database/collections/:collectionId')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.method', 'getCollection')
->label('sdk.description', '/docs/references/database/get-collection.md')
- ->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.')
+ ->param('collectionId', '', new UID(), 'Collection unique ID.')
->action(function ($collectionId, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -159,7 +159,7 @@ App::get('/v1/database/collections/:collectionId')
// ->label('sdk.namespace', 'database')
// ->label('sdk.method', 'getCollectionLogs')
// ->label('sdk.description', '/docs/references/database/get-collection-logs.md')
-// ->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.')
+// ->param('collectionId', '', new UID(), 'Collection unique ID.')
// ->action(
// function ($collectionId) use ($response, $register, $projectDB, $project) {
// $collection = $projectDB->getDocument($collectionId, false);
@@ -225,10 +225,10 @@ App::put('/v1/database/collections/:collectionId')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.method', 'updateCollection')
->label('sdk.description', '/docs/references/database/update-collection.md')
- ->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.')
- ->param('name', null, function () { return new Text(256); }, 'Collection name.')
- ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(/docs/permissions) and get a full list of available permissions.')
- ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
+ ->param('collectionId', '', new UID(), 'Collection unique ID.')
+ ->param('name', null, new Text(128), 'Collection name. Max length: 128 chars.')
+ ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions(/docs/permissions) and get a full list of available permissions.')
+ ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
->param('rules', [], function ($projectDB) { return new ArrayList(new Collection($projectDB, [Database::SYSTEM_COLLECTION_RULES], ['$collection' => Database::SYSTEM_COLLECTION_RULES, '$permissions' => ['read' => [], 'write' => []]])); }, 'Array of [rule objects](/docs/rules). Each rule define a collection field name, data type and validation.', true, ['projectDB'])
->action(function ($collectionId, $name, $read, $write, $rules, $response, $projectDB, $webhooks, $audits) {
/** @var Utopia\Response $response */
@@ -266,7 +266,7 @@ App::put('/v1/database/collections/:collectionId')
'rules' => $parsedRules,
]));
} catch (AuthorizationException $exception) {
- throw new Exception('Unauthorized action', 401);
+ throw new Exception('Unauthorized permissions', 401);
} catch (StructureException $exception) {
throw new Exception('Bad structure. '.$exception->getMessage(), 400);
} catch (\Exception $exception) {
@@ -301,7 +301,7 @@ App::delete('/v1/database/collections/:collectionId')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.method', 'deleteCollection')
->label('sdk.description', '/docs/references/database/delete-collection.md')
- ->param('collectionId', '', function () { return new UID(); }, 'Collection unique ID.')
+ ->param('collectionId', '', new UID(), 'Collection unique ID.')
->action(function ($collectionId, $response, $projectDB, $webhooks, $audits) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -342,13 +342,13 @@ App::post('/v1/database/collections/:collectionId/documents')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.method', 'createDocument')
->label('sdk.description', '/docs/references/database/create-document.md')
- ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
- ->param('data', [], function () { return new JSON(); }, 'Document data as JSON object.')
- ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
- ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
- ->param('parentDocument', '', function () { return new UID(); }, 'Parent document unique ID. Use when you want your new document to be a child of a parent document.', true)
- ->param('parentProperty', '', function () { return new Key(); }, 'Parent document property name. Use when you want your new document to be a child of a parent document.', true)
- ->param('parentPropertyType', Document::SET_TYPE_ASSIGN, function () { return new WhiteList([Document::SET_TYPE_ASSIGN, Document::SET_TYPE_APPEND, Document::SET_TYPE_PREPEND]); }, 'Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.', true)
+ ->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
+ ->param('data', [], new JSON(), 'Document data as JSON object.')
+ ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
+ ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
+ ->param('parentDocument', '', new UID(), 'Parent document unique ID. Use when you want your new document to be a child of a parent document.', true)
+ ->param('parentProperty', '', new Key(), 'Parent document property name. Use when you want your new document to be a child of a parent document.', true)
+ ->param('parentPropertyType', Document::SET_TYPE_ASSIGN, new WhiteList([Document::SET_TYPE_ASSIGN, Document::SET_TYPE_APPEND, Document::SET_TYPE_PREPEND], true), 'Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.', true)
->action(function ($collectionId, $data, $read, $write, $parentDocument, $parentProperty, $parentPropertyType, $response, $projectDB, $webhooks, $audits) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -404,7 +404,7 @@ App::post('/v1/database/collections/:collectionId/documents')
$authorization = new Authorization($parentDocument, 'write');
if (!$authorization->isValid($new->getPermissions())) {
- throw new Exception('Unauthorized action', 401);
+ throw new Exception('Unauthorized permissions', 401);
}
$parentDocument
@@ -429,7 +429,7 @@ App::post('/v1/database/collections/:collectionId/documents')
try {
$data = $projectDB->createDocument($data);
} catch (AuthorizationException $exception) {
- throw new Exception('Unauthorized action', 401);
+ throw new Exception('Unauthorized permissions', 401);
} catch (StructureException $exception) {
throw new Exception('Bad structure. '.$exception->getMessage(), 400);
} catch (\Exception $exception) {
@@ -465,14 +465,14 @@ App::get('/v1/database/collections/:collectionId/documents')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.method', 'listDocuments')
->label('sdk.description', '/docs/references/database/list-documents.md')
- ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
- ->param('filters', [], function () { return new ArrayList(new Text(128)); }, 'Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: \'name=John Doe\' or \'category.$id>=5bed2d152c362\'.', true)
- ->param('limit', 25, function () { return new Range(0, 1000); }, 'Maximum number of documents to return in response. Use this value to manage pagination.', true)
- ->param('offset', 0, function () { return new Range(0, 900000000); }, 'Offset value. Use this value to manage pagination.', true)
- ->param('orderField', '$id', function () { return new Text(128); }, 'Document field that results will be sorted by.', true)
- ->param('orderType', 'ASC', function () { return new WhiteList(array('DESC', 'ASC')); }, 'Order direction. Possible values are DESC for descending order, or ASC for ascending order.', true)
- ->param('orderCast', 'string', function () { return new WhiteList(array('int', 'string', 'date', 'time', 'datetime')); }, 'Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.', true)
- ->param('search', '', function () { return new Text(256); }, 'Search query. Enter any free text search. The database will try to find a match against all document attributes and children.', true)
+ ->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
+ ->param('filters', [], new ArrayList(new Text(128)), 'Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: \'name=John Doe\' or \'category.$id>=5bed2d152c362\'.', true)
+ ->param('limit', 25, new Range(0, 1000), 'Maximum number of documents to return in response. Use this value to manage pagination.', true)
+ ->param('offset', 0, new Range(0, 900000000), 'Offset value. Use this value to manage pagination.', true)
+ ->param('orderField', '$id', new Text(128), 'Document field that results will be sorted by.', true)
+ ->param('orderType', 'ASC', new WhiteList(['DESC', 'ASC'], true), 'Order direction. Possible values are DESC for descending order, or ASC for ascending order.', true)
+ ->param('orderCast', 'string', new WhiteList(['int', 'string', 'date', 'time', 'datetime'], true), 'Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.', true)
+ ->param('search', '', new Text(256), 'Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.', true)
->action(function ($collectionId, $filters, $limit, $offset, $orderField, $orderType, $orderCast, $search, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -526,8 +526,8 @@ App::get('/v1/database/collections/:collectionId/documents/:documentId')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.method', 'getDocument')
->label('sdk.description', '/docs/references/database/get-document.md')
- ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
- ->param('documentId', null, function () { return new UID(); }, 'Document unique ID.')
+ ->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
+ ->param('documentId', null, new UID(), 'Document unique ID.')
->action(function ($collectionId, $documentId, $request, $response, $projectDB) {
/** @var Utopia\Request $request */
/** @var Utopia\Response $response */
@@ -575,11 +575,11 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.method', 'updateDocument')
->label('sdk.description', '/docs/references/database/update-document.md')
- ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
- ->param('documentId', null, function () { return new UID(); }, 'Document unique ID.')
- ->param('data', [], function () { return new JSON(); }, 'Document data as JSON object.')
- ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
- ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
+ ->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
+ ->param('documentId', null, new UID(), 'Document unique ID.')
+ ->param('data', [], new JSON(), 'Document data as JSON object.')
+ ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
+ ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
->action(function ($collectionId, $documentId, $data, $read, $write, $response, $projectDB, $webhooks, $audits) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -624,7 +624,7 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId')
try {
$data = $projectDB->updateDocument($data);
} catch (AuthorizationException $exception) {
- throw new Exception('Unauthorized action', 401);
+ throw new Exception('Unauthorized permissions', 401);
} catch (StructureException $exception) {
throw new Exception('Bad structure. '.$exception->getMessage(), 400);
} catch (\Exception $exception) {
@@ -658,8 +658,8 @@ App::delete('/v1/database/collections/:collectionId/documents/:documentId')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.method', 'deleteDocument')
->label('sdk.description', '/docs/references/database/delete-document.md')
- ->param('collectionId', null, function () { return new UID(); }, 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
- ->param('documentId', null, function () { return new UID(); }, 'Document unique ID.')
+ ->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
+ ->param('documentId', null, new UID(), 'Document unique ID.')
->action(function ($collectionId, $documentId, $response, $projectDB, $webhooks, $audits) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -680,7 +680,7 @@ App::delete('/v1/database/collections/:collectionId/documents/:documentId')
try {
$projectDB->deleteDocument($documentId);
} catch (AuthorizationException $exception) {
- throw new Exception('Unauthorized action', 401);
+ throw new Exception('Unauthorized permissions', 401);
} catch (StructureException $exception) {
throw new Exception('Bad structure. '.$exception->getMessage(), 400);
} catch (\Exception $exception) {
diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php
index 6118fa6dcc..039eeb3f55 100644
--- a/app/controllers/api/functions.php
+++ b/app/controllers/api/functions.php
@@ -28,12 +28,12 @@ App::post('/v1/functions')
->label('sdk.namespace', 'functions')
->label('sdk.method', 'create')
->label('sdk.description', '/docs/references/functions/create-function.md')
- ->param('name', '', function () { return new Text(128); }, 'Function name.')
- ->param('env', '', function () { return new WhiteList(array_keys(Config::getParam('environments'))); }, 'Execution enviornment.')
- ->param('vars', [], function () { return new Assoc();}, 'Key-value JSON object.', true)
- ->param('events', [], function () { return new ArrayList(new WhiteList(array_keys(Config::getParam('events')), true)); }, 'Events list.', true)
- ->param('schedule', '', function () { return new Cron(); }, 'Schedule CRON syntax.', true)
- ->param('timeout', 15, function () { return new Range(1, 900); }, 'Function maximum execution time in seconds.', true)
+ ->param('name', '', new Text(128), 'Function name. Max length: 128 chars.')
+ ->param('env', '', new WhiteList(array_keys(Config::getParam('environments')), true), 'Execution enviornment.')
+ ->param('vars', [], new Assoc(), 'Key-value JSON object.', true)
+ ->param('events', [], new ArrayList(new WhiteList(array_keys(Config::getParam('events')), true)), 'Events list.', true)
+ ->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true)
+ ->param('timeout', 15, new Range(1, 900), 'Function maximum execution time in seconds.', true)
->action(function ($name, $env, $vars, $events, $schedule, $timeout, $response, $projectDB) {
$function = $projectDB->createDocument([
'$collection' => Database::SYSTEM_COLLECTION_FUNCTIONS,
@@ -73,10 +73,10 @@ App::get('/v1/functions')
->label('sdk.namespace', 'functions')
->label('sdk.method', 'list')
->label('sdk.description', '/docs/references/functions/list-functions.md')
- ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
- ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
- ->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true)
- ->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true)
+ ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
+ ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
+ ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true)
+ ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true)
->action(function ($search, $limit, $offset, $orderType, $response, $projectDB) {
$results = $projectDB->getCollection([
'limit' => $limit,
@@ -101,7 +101,7 @@ App::get('/v1/functions/:functionId')
->label('sdk.namespace', 'functions')
->label('sdk.method', 'get')
->label('sdk.description', '/docs/references/functions/get-function.md')
- ->param('functionId', '', function () { return new UID(); }, 'Function unique ID.')
+ ->param('functionId', '', new UID(), 'Function unique ID.')
->action(function ($functionId, $response, $projectDB) {
$function = $projectDB->getDocument($functionId);
@@ -120,12 +120,12 @@ App::put('/v1/functions/:functionId')
->label('sdk.namespace', 'functions')
->label('sdk.method', 'update')
->label('sdk.description', '/docs/references/functions/update-function.md')
- ->param('functionId', '', function () { return new UID(); }, 'Function unique ID.')
- ->param('name', '', function () { return new Text(128); }, 'Function name.')
- ->param('vars', [], function () { return new Assoc();}, 'Key-value JSON object.', true)
- ->param('events', [], function () { return new ArrayList(new WhiteList(array_keys(Config::getParam('events')), true)); }, 'Events list.', true)
- ->param('schedule', '', function () { return new Cron(); }, 'Schedule CRON syntax.', true)
- ->param('timeout', 15, function () { return new Range(1, 900); }, 'Function maximum execution time in seconds.', true)
+ ->param('functionId', '', new UID(), 'Function unique ID.')
+ ->param('name', '', new Text(128), 'Function name. Max length: 128 chars.')
+ ->param('vars', [], new Assoc(), 'Key-value JSON object.', true)
+ ->param('events', [], new ArrayList(new WhiteList(array_keys(Config::getParam('events')), true)), 'Events list.', true)
+ ->param('schedule', '', new Cron(), 'Schedule CRON syntax.', true)
+ ->param('timeout', 15, new Range(1, 900), 'Function maximum execution time in seconds.', true)
->action(function ($functionId, $name, $vars, $events, $schedule, $timeout, $response, $projectDB) {
$function = $projectDB->getDocument($functionId);
@@ -162,8 +162,8 @@ App::patch('/v1/functions/:functionId/tag')
->label('sdk.namespace', 'functions')
->label('sdk.method', 'updateTag')
->label('sdk.description', '/docs/references/functions/update-tag.md')
- ->param('functionId', '', function () { return new UID(); }, 'Function unique ID.')
- ->param('tag', '', function () { return new UID(); }, 'Tag unique ID.')
+ ->param('functionId', '', new UID(), 'Function unique ID.')
+ ->param('tag', '', new UID(), 'Tag unique ID.')
->action(function ($functionId, $tag, $response, $projectDB) {
$function = $projectDB->getDocument($functionId);
$tag = $projectDB->getDocument($tag);
@@ -200,7 +200,7 @@ App::delete('/v1/functions/:functionId')
->label('sdk.namespace', 'functions')
->label('sdk.method', 'delete')
->label('sdk.description', '/docs/references/functions/delete-function.md')
- ->param('functionId', '', function () { return new UID(); }, 'Function unique ID.')
+ ->param('functionId', '', new UID(), 'Function unique ID.')
->action(function ($functionId, $response, $projectDB) {
$function = $projectDB->getDocument($functionId);
@@ -223,10 +223,10 @@ App::post('/v1/functions/:functionId/tags')
->label('sdk.namespace', 'functions')
->label('sdk.method', 'createTag')
->label('sdk.description', '/docs/references/functions/create-tag.md')
- ->param('functionId', '', function () { return new UID(); }, 'Function unique ID.')
- ->param('command', '', function () { return new Text('1028'); }, 'Code execution command.')
- ->param('code', [], function () { return new File(); }, 'Gzip file containing your code.', false)
- // ->param('code', '', function () { return new Text(128); }, 'Code package. Use the '.APP_NAME.' code packager to create a deployable package file.')
+ ->param('functionId', '', new UID(), 'Function unique ID.')
+ ->param('command', '', new Text('1028'), 'Code execution command.')
+ ->param('code', [], new File(), 'Gzip file containing your code.', false)
+ // ->param('code', '', new Text(128), 'Code package. Use the '.APP_NAME.' code packager to create a deployable package file.')
->action(function ($functionId, $command, $code, $request, $response, $projectDB, $usage) {
$function = $projectDB->getDocument($functionId);
@@ -305,11 +305,11 @@ App::get('/v1/functions/:functionId/tags')
->label('sdk.namespace', 'functions')
->label('sdk.method', 'listTags')
->label('sdk.description', '/docs/references/functions/list-tags.md')
- ->param('functionId', '', function () { return new UID(); }, 'Function unique ID.')
- ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
- ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
- ->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true)
- ->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true)
+ ->param('functionId', '', new UID(), 'Function unique ID.')
+ ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
+ ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
+ ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true)
+ ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true)
->action(function ($functionId, $search, $limit, $offset, $orderType, $response, $projectDB) {
$function = $projectDB->getDocument($functionId);
@@ -341,8 +341,8 @@ App::get('/v1/functions/:functionId/tags/:tagId')
->label('sdk.namespace', 'functions')
->label('sdk.method', 'getTag')
->label('sdk.description', '/docs/references/functions/get-tag.md')
- ->param('functionId', '', function () { return new UID(); }, 'Function unique ID.')
- ->param('tagId', '', function () { return new UID(); }, 'Tag unique ID.')
+ ->param('functionId', '', new UID(), 'Function unique ID.')
+ ->param('tagId', '', new UID(), 'Tag unique ID.')
->action(function ($functionId, $tagId, $response, $projectDB) {
$function = $projectDB->getDocument($functionId);
@@ -371,8 +371,8 @@ App::delete('/v1/functions/:functionId/tags/:tagId')
->label('sdk.namespace', 'functions')
->label('sdk.method', 'deleteTag')
->label('sdk.description', '/docs/references/functions/delete-tag.md')
- ->param('functionId', '', function () { return new UID(); }, 'Function unique ID.')
- ->param('tagId', '', function () { return new UID(); }, 'Tag unique ID.')
+ ->param('functionId', '', new UID(), 'Function unique ID.')
+ ->param('tagId', '', new UID(), 'Tag unique ID.')
->action(function ($functionId, $tagId, $response, $projectDB, $usage) {
$function = $projectDB->getDocument($functionId);
@@ -413,8 +413,8 @@ App::post('/v1/functions/:functionId/executions')
->label('sdk.namespace', 'functions')
->label('sdk.method', 'createExecution')
->label('sdk.description', '/docs/references/functions/create-execution.md')
- ->param('functionId', '', function () { return new UID(); }, 'Function unique ID.')
- ->param('async', 1, function () { return new Range(0, 1); }, 'Execute code asynchronously. Pass 1 for true, 0 for false. Default value is 1.', true)
+ ->param('functionId', '', new UID(), 'Function unique ID.')
+ ->param('async', 1, new Range(0, 1), 'Execute code asynchronously. Pass 1 for true, 0 for false. Default value is 1.', true)
->action(function ($functionId, $async, $response, $project, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Document $project */
@@ -480,11 +480,11 @@ App::get('/v1/functions/:functionId/executions')
->label('sdk.namespace', 'functions')
->label('sdk.method', 'listExecutions')
->label('sdk.description', '/docs/references/functions/list-executions.md')
- ->param('functionId', '', function () { return new UID(); }, 'Function unique ID.')
- ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
- ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
- ->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true)
- ->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true)
+ ->param('functionId', '', new UID(), 'Function unique ID.')
+ ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
+ ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
+ ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true)
+ ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true)
->action(function ($functionId, $search, $limit, $offset, $orderType, $response, $projectDB) {
$function = $projectDB->getDocument($functionId);
@@ -516,8 +516,8 @@ App::get('/v1/functions/:functionId/executions/:executionId')
->label('sdk.namespace', 'functions')
->label('sdk.method', 'getExecution')
->label('sdk.description', '/docs/references/functions/get-execution.md')
- ->param('functionId', '', function () { return new UID(); }, 'Function unique ID.')
- ->param('executionId', '', function () { return new UID(); }, 'Execution unique ID.')
+ ->param('functionId', '', new UID(), 'Function unique ID.')
+ ->param('executionId', '', new UID(), 'Execution unique ID.')
->action(function ($functionId, $executionId, $response, $projectDB) {
$function = $projectDB->getDocument($functionId);
diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php
index 5da7be03f3..3f62a66c6a 100644
--- a/app/controllers/api/projects.php
+++ b/app/controllers/api/projects.php
@@ -16,7 +16,6 @@ use Appwrite\Task\Validator\Cron;
use Appwrite\Database\Database;
use Appwrite\Database\Document;
use Appwrite\Database\Validator\UID;
-use Appwrite\OpenSSL\OpenSSL;
use Appwrite\Network\Validator\CNAME;
use Appwrite\Network\Validator\Domain as DomainValidator;
use Cron\CronExpression;
@@ -27,17 +26,17 @@ App::post('/v1/projects')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'create')
- ->param('name', null, function () { return new Text(100); }, 'Project name.')
- ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
- ->param('description', '', function () { return new Text(255); }, 'Project description.', true)
- ->param('logo', '', function () { return new Text(1024); }, 'Project logo.', true)
- ->param('url', '', function () { return new URL(); }, 'Project URL.', true)
- ->param('legalName', '', function () { return new Text(256); }, 'Project legal Name.', true)
- ->param('legalCountry', '', function () { return new Text(256); }, 'Project legal Country.', true)
- ->param('legalState', '', function () { return new Text(256); }, 'Project legal State.', true)
- ->param('legalCity', '', function () { return new Text(256); }, 'Project legal City.', true)
- ->param('legalAddress', '', function () { return new Text(256); }, 'Project legal Address.', true)
- ->param('legalTaxId', '', function () { return new Text(256); }, 'Project legal Tax ID.', true)
+ ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.')
+ ->param('teamId', '', new UID(), 'Team unique ID.')
+ ->param('description', '', new Text(256), 'Project description. Max length: 256 chars.', true)
+ ->param('logo', '', new Text(1024), 'Project logo.', true)
+ ->param('url', '', new URL(), 'Project URL.', true)
+ ->param('legalName', '', new Text(256), 'Project legal Name. Max length: 256 chars.', true)
+ ->param('legalCountry', '', new Text(256), 'Project legal Country. Max length: 256 chars.', true)
+ ->param('legalState', '', new Text(256), 'Project legal State. Max length: 256 chars.', true)
+ ->param('legalCity', '', new Text(256), 'Project legal City. Max length: 256 chars.', true)
+ ->param('legalAddress', '', new Text(256), 'Project legal Address. Max length: 256 chars.', true)
+ ->param('legalTaxId', '', new Text(256), 'Project legal Tax ID. Max length: 256 chars.', true)
->action(function ($name, $teamId, $description, $logo, $url, $legalName, $legalCountry, $legalState, $legalCity, $legalAddress, $legalTaxId, $response, $consoleDB, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -92,10 +91,10 @@ App::get('/v1/projects')
->label('scope', 'projects.read')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'list')
- ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
- ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
- ->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true)
- ->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true)
+ ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
+ ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
+ ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true)
+ ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true)
->action(function ($search, $limit, $offset, $orderType, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -111,16 +110,6 @@ App::get('/v1/projects')
'$collection='.Database::SYSTEM_COLLECTION_PROJECTS,
],
]);
- foreach ($results as $project) {
- foreach (Config::getParam('providers') as $provider => $node) {
- $secret = \json_decode($project->getAttribute('usersOauth2'.\ucfirst($provider).'Secret', '{}'), true);
-
- if (!empty($secret) && isset($secret['version'])) {
- $key = App::getEnv('_APP_OPENSSL_KEY_V'.$secret['version']);
- $project->setAttribute('usersOauth2'.\ucfirst($provider).'Secret', OpenSSL::decrypt($secret['data'], $secret['method'], $key, 0, \hex2bin($secret['iv']), \hex2bin($secret['tag'])));
- }
- }
- }
$response->json(['sum' => $consoleDB->getSum(), 'projects' => $results]);
}, ['response', 'consoleDB']);
@@ -131,7 +120,7 @@ App::get('/v1/projects/:projectId')
->label('scope', 'projects.read')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'get')
- ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.')
+ ->param('projectId', '', new UID(), 'Project unique ID.')
->action(function ($projectId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -142,15 +131,6 @@ App::get('/v1/projects/:projectId')
throw new Exception('Project not found', 404);
}
- foreach (Config::getParam('providers') as $provider => $node) {
- $secret = \json_decode($project->getAttribute('usersOauth2'.\ucfirst($provider).'Secret', '{}'), true);
-
- if (!empty($secret) && isset($secret['version'])) {
- $key = App::getEnv('_APP_OPENSSL_KEY_V'.$secret['version']);
- $project->setAttribute('usersOauth2'.\ucfirst($provider).'Secret', OpenSSL::decrypt($secret['data'], $secret['method'], $key, 0, \hex2bin($secret['iv']), \hex2bin($secret['tag'])));
- }
- }
-
$response->json($project->getArrayCopy());
}, ['response', 'consoleDB']);
@@ -160,8 +140,8 @@ App::get('/v1/projects/:projectId/usage')
->label('scope', 'projects.read')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'getUsage')
- ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.')
- ->param('range', 'last30', function () { return new WhiteList(['daily', 'monthly', 'last30', 'last90']); }, 'Date range.', true)
+ ->param('projectId', '', new UID(), 'Project unique ID.')
+ ->param('range', 'last30', new WhiteList(['daily', 'monthly', 'last30', 'last90'], true), 'Date range.', true)
->action(function ($projectId, $range, $response, $consoleDB, $projectDB, $register) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -334,17 +314,17 @@ App::patch('/v1/projects/:projectId')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'update')
- ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.')
- ->param('name', null, function () { return new Text(100); }, 'Project name.')
- ->param('description', '', function () { return new Text(255); }, 'Project description.', true)
- ->param('logo', '', function () { return new Text(1024); }, 'Project logo.', true)
- ->param('url', '', function () { return new URL(); }, 'Project URL.', true)
- ->param('legalName', '', function () { return new Text(256); }, 'Project legal name.', true)
- ->param('legalCountry', '', function () { return new Text(256); }, 'Project legal country..', true)
- ->param('legalState', '', function () { return new Text(256); }, 'Project legal state.', true)
- ->param('legalCity', '', function () { return new Text(256); }, 'Project legal city.', true)
- ->param('legalAddress', '', function () { return new Text(256); }, 'Project legal address.', true)
- ->param('legalTaxId', '', function () { return new Text(256); }, 'Project legal tax ID.', true)
+ ->param('projectId', '', new UID(), 'Project unique ID.')
+ ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.')
+ ->param('description', '', new Text(256), 'Project description. Max length: 256 chars.', true)
+ ->param('logo', '', new Text(1024), 'Project logo.', true)
+ ->param('url', '', new URL(), 'Project URL.', true)
+ ->param('legalName', '', new Text(256), 'Project legal name. Max length: 256 chars.', true)
+ ->param('legalCountry', '', new Text(256), 'Project legal country. Max length: 256 chars.', true)
+ ->param('legalState', '', new Text(256), 'Project legal state. Max length: 256 chars.', true)
+ ->param('legalCity', '', new Text(256), 'Project legal city. Max length: 256 chars.', true)
+ ->param('legalAddress', '', new Text(256), 'Project legal address. Max length: 256 chars.', true)
+ ->param('legalTaxId', '', new Text(256), 'Project legal tax ID. Max length: 256 chars.', true)
->action(function ($projectId, $name, $description, $logo, $url, $legalName, $legalCountry, $legalState, $legalCity, $legalAddress, $legalTaxId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -381,10 +361,10 @@ App::patch('/v1/projects/:projectId/oauth2')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'updateOAuth2')
- ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.')
- ->param('provider', '', function () { return new WhiteList(\array_keys(Config::getParam('providers'))); }, 'Provider Name', false)
- ->param('appId', '', function () { return new Text(256); }, 'Provider app ID.', true)
- ->param('secret', '', function () { return new text(512); }, 'Provider secret key.', true)
+ ->param('projectId', '', new UID(), 'Project unique ID.')
+ ->param('provider', '', new WhiteList(\array_keys(Config::getParam('providers')), true), 'Provider Name', false)
+ ->param('appId', '', new Text(256), 'Provider app ID. Max length: 256 chars.', true)
+ ->param('secret', '', new text(512), 'Provider secret key. Max length: 512 chars.', true)
->action(function ($projectId, $provider, $appId, $secret, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -395,17 +375,6 @@ App::patch('/v1/projects/:projectId/oauth2')
throw new Exception('Project not found', 404);
}
- $key = App::getEnv('_APP_OPENSSL_KEY_V1');
- $iv = OpenSSL::randomPseudoBytes(OpenSSL::cipherIVLength(OpenSSL::CIPHER_AES_128_GCM));
- $tag = null;
- $secret = \json_encode([
- 'data' => OpenSSL::encrypt($secret, OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag),
- 'method' => OpenSSL::CIPHER_AES_128_GCM,
- 'iv' => \bin2hex($iv),
- 'tag' => \bin2hex($tag),
- 'version' => '1',
- ]);
-
$project = $consoleDB->updateDocument(\array_merge($project->getArrayCopy(), [
'usersOauth2'.\ucfirst($provider).'Appid' => $appId,
'usersOauth2'.\ucfirst($provider).'Secret' => $secret,
@@ -424,8 +393,8 @@ App::delete('/v1/projects/:projectId')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'delete')
- ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.')
- ->param('password', '', function () { return new UID(); }, 'Your user password for confirmation. Must be between 6 to 32 chars.')
+ ->param('projectId', '', new UID(), 'Project unique ID.')
+ ->param('password', '', new UID(), 'Your user password for confirmation. Must be between 6 to 32 chars.')
->action(function ($projectId, $password, $response, $user, $consoleDB, $deletes) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Document $user */
@@ -473,13 +442,13 @@ App::post('/v1/projects/:projectId/webhooks')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'createWebhook')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('name', null, function () { return new Text(256); }, 'Webhook name.')
- ->param('events', null, function () { return new ArrayList(new WhiteList(array_keys(Config::getParam('events')), true)); }, 'Events list.')
- ->param('url', null, function () { return new URL(); }, 'Webhook URL.')
- ->param('security', false, function () { return new Boolean(true); }, 'Certificate verification, false for disabled or true for enabled.')
- ->param('httpUser', '', function () { return new Text(256); }, 'Webhook HTTP user.', true)
- ->param('httpPass', '', function () { return new Text(256); }, 'Webhook HTTP password.', true)
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.')
+ ->param('events', null, new ArrayList(new WhiteList(array_keys(Config::getParam('events'), true), true)), 'Events list.')
+ ->param('url', null, new URL(), 'Webhook URL.')
+ ->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.')
+ ->param('httpUser', '', new Text(256), 'Webhook HTTP user. Max length: 256 chars.', true)
+ ->param('httpPass', '', new Text(256), 'Webhook HTTP password. Max length: 256 chars.', true)
->action(function ($projectId, $name, $events, $url, $security, $httpUser, $httpPass, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -491,16 +460,6 @@ App::post('/v1/projects/:projectId/webhooks')
}
$security = ($security === '1' || $security === 'true' || $security === 1 || $security === true);
- $key = App::getEnv('_APP_OPENSSL_KEY_V1');
- $iv = OpenSSL::randomPseudoBytes(OpenSSL::cipherIVLength(OpenSSL::CIPHER_AES_128_GCM));
- $tag = null;
- $httpPass = \json_encode([
- 'data' => OpenSSL::encrypt($httpPass, OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag),
- 'method' => OpenSSL::CIPHER_AES_128_GCM,
- 'iv' => \bin2hex($iv),
- 'tag' => \bin2hex($tag),
- 'version' => '1',
- ]);
$webhook = $consoleDB->createDocument([
'$collection' => Database::SYSTEM_COLLECTION_WEBHOOKS,
@@ -540,7 +499,7 @@ App::get('/v1/projects/:projectId/webhooks')
->label('scope', 'projects.read')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'listWebhooks')
- ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.')
+ ->param('projectId', '', new UID(), 'Project unique ID.')
->action(function ($projectId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -553,18 +512,6 @@ App::get('/v1/projects/:projectId/webhooks')
$webhooks = $project->getAttribute('webhooks', []);
- foreach ($webhooks as $webhook) { /* @var $webhook Document */
- $httpPass = \json_decode($webhook->getAttribute('httpPass', '{}'), true);
-
- if (empty($httpPass) || !isset($httpPass['version'])) {
- continue;
- }
-
- $key = App::getEnv('_APP_OPENSSL_KEY_V'.$httpPass['version']);
-
- $webhook->setAttribute('httpPass', OpenSSL::decrypt($httpPass['data'], $httpPass['method'], $key, 0, \hex2bin($httpPass['iv']), \hex2bin($httpPass['tag'])));
- }
-
$response->json($webhooks);
}, ['response', 'consoleDB']);
@@ -574,8 +521,8 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId')
->label('scope', 'projects.read')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'getWebhook')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('webhookId', null, function () { return new UID(); }, 'Webhook unique ID.')
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('webhookId', null, new UID(), 'Webhook unique ID.')
->action(function ($projectId, $webhookId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -592,13 +539,6 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId')
throw new Exception('Webhook not found', 404);
}
- $httpPass = \json_decode($webhook->getAttribute('httpPass', '{}'), true);
-
- if (!empty($httpPass) && isset($httpPass['version'])) {
- $key = App::getEnv('_APP_OPENSSL_KEY_V'.$httpPass['version']);
- $webhook->setAttribute('httpPass', OpenSSL::decrypt($httpPass['data'], $httpPass['method'], $key, 0, \hex2bin($httpPass['iv']), \hex2bin($httpPass['tag'])));
- }
-
$response->json($webhook->getArrayCopy());
}, ['response', 'consoleDB']);
@@ -608,13 +548,14 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'updateWebhook')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('webhookId', null, function () { return new UID(); }, 'Webhook unique ID.')
- ->param('name', null, function () { return new Text(256); }, 'Webhook name.')
- ->param('events', null, function () { return new ArrayList(new WhiteList(array_keys(Config::getParam('events')), true)); }, 'Events list.')
- ->param('url', null, function () { return new URL(); }, 'Webhook URL.')
- ->param('security', false, function () { return new Boolean(true); }, 'Certificate verification, false for disabled or true for enabled.') ->param('httpUser', '', function () { return new Text(256); }, 'Webhook HTTP user.', true)
- ->param('httpPass', '', function () { return new Text(256); }, 'Webhook HTTP password.', true)
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('webhookId', null, new UID(), 'Webhook unique ID.')
+ ->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.')
+ ->param('events', null, new ArrayList(new WhiteList(array_keys(Config::getParam('events'), true), true)), 'Events list.')
+ ->param('url', null, new URL(), 'Webhook URL.')
+ ->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.')
+ ->param('httpUser', '', new Text(256), 'Webhook HTTP user. Max length: 256 chars.', true)
+ ->param('httpPass', '', new Text(256), 'Webhook HTTP password. Max length: 256 chars.', true)
->action(function ($projectId, $webhookId, $name, $events, $url, $security, $httpUser, $httpPass, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -626,16 +567,6 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId')
}
$security = ($security === '1' || $security === 'true' || $security === 1 || $security === true);
- $key = App::getEnv('_APP_OPENSSL_KEY_V1');
- $iv = OpenSSL::randomPseudoBytes(OpenSSL::cipherIVLength(OpenSSL::CIPHER_AES_128_GCM));
- $tag = null;
- $httpPass = \json_encode([
- 'data' => OpenSSL::encrypt($httpPass, OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag),
- 'method' => OpenSSL::CIPHER_AES_128_GCM,
- 'iv' => \bin2hex($iv),
- 'tag' => \bin2hex($tag),
- 'version' => '1',
- ]);
$webhook = $project->search('$id', $webhookId, $project->getAttribute('webhooks', []));
@@ -665,8 +596,8 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'deleteWebhook')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('webhookId', null, function () { return new UID(); }, 'Webhook unique ID.')
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('webhookId', null, new UID(), 'Webhook unique ID.')
->action(function ($projectId, $webhookId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -698,9 +629,9 @@ App::post('/v1/projects/:projectId/keys')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'createKey')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('name', null, function () { return new Text(256); }, 'Key name.')
- ->param('scopes', null, function () { return new ArrayList(new WhiteList(Config::getParam('scopes'))); }, 'Key scopes list.')
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.')
+ ->param('scopes', null, new ArrayList(new WhiteList(Config::getParam('scopes'), true)), 'Key scopes list.')
->action(function ($projectId, $name, $scopes, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -746,7 +677,7 @@ App::get('/v1/projects/:projectId/keys')
->label('scope', 'projects.read')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'listKeys')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
+ ->param('projectId', null, new UID(), 'Project unique ID.')
->action(function ($projectId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -766,8 +697,8 @@ App::get('/v1/projects/:projectId/keys/:keyId')
->label('scope', 'projects.read')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'getKey')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('keyId', null, function () { return new UID(); }, 'Key unique ID.')
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('keyId', null, new UID(), 'Key unique ID.')
->action(function ($projectId, $keyId, $response, $consoleDB) {
$project = $consoleDB->getDocument($projectId);
@@ -790,10 +721,10 @@ App::put('/v1/projects/:projectId/keys/:keyId')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'updateKey')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('keyId', null, function () { return new UID(); }, 'Key unique ID.')
- ->param('name', null, function () { return new Text(256); }, 'Key name.')
- ->param('scopes', null, function () { return new ArrayList(new WhiteList(Config::getParam('scopes'))); }, 'Key scopes list')
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('keyId', null, new UID(), 'Key unique ID.')
+ ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.')
+ ->param('scopes', null, new ArrayList(new WhiteList(Config::getParam('scopes'), true)), 'Key scopes list')
->action(function ($projectId, $keyId, $name, $scopes, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -828,8 +759,8 @@ App::delete('/v1/projects/:projectId/keys/:keyId')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'deleteKey')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('keyId', null, function () { return new UID(); }, 'Key unique ID.')
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('keyId', null, new UID(), 'Key unique ID.')
->action(function ($projectId, $keyId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -861,16 +792,16 @@ App::post('/v1/projects/:projectId/tasks')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'createTask')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('name', null, function () { return new Text(256); }, 'Task name.')
- ->param('status', null, function () { return new WhiteList(['play', 'pause']); }, 'Task status.')
- ->param('schedule', null, function () { return new Cron(); }, 'Task schedule CRON syntax.')
- ->param('security', false, function () { return new Boolean(true); }, 'Certificate verification, false for disabled or true for enabled.')
- ->param('httpMethod', '', function () { return new WhiteList(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT']); }, 'Task HTTP method.')
- ->param('httpUrl', '', function () { return new URL(); }, 'Task HTTP URL')
- ->param('httpHeaders', null, function () { return new ArrayList(new Text(256)); }, 'Task HTTP headers list.', true)
- ->param('httpUser', '', function () { return new Text(256); }, 'Task HTTP user.', true)
- ->param('httpPass', '', function () { return new Text(256); }, 'Task HTTP password.', true)
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('name', null, new Text(128), 'Task name. Max length: 128 chars.')
+ ->param('status', null, new WhiteList(['play', 'pause'], true), 'Task status.')
+ ->param('schedule', null, new Cron(), 'Task schedule CRON syntax.')
+ ->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.')
+ ->param('httpMethod', '', new WhiteList(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'], true), 'Task HTTP method.')
+ ->param('httpUrl', '', new URL(), 'Task HTTP URL')
+ ->param('httpHeaders', null, new ArrayList(new Text(256)), 'Task HTTP headers list.', true)
+ ->param('httpUser', '', new Text(256), 'Task HTTP user. Max length: 256 chars.', true)
+ ->param('httpPass', '', new Text(256), 'Task HTTP password. Max length: 256 chars.', true)
->action(function ($projectId, $name, $status, $schedule, $security, $httpMethod, $httpUrl, $httpHeaders, $httpUser, $httpPass, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -885,16 +816,6 @@ App::post('/v1/projects/:projectId/tasks')
$next = ($status == 'play') ? $cron->getNextRunDate()->format('U') : null;
$security = ($security === '1' || $security === 'true' || $security === 1 || $security === true);
- $key = App::getEnv('_APP_OPENSSL_KEY_V1');
- $iv = OpenSSL::randomPseudoBytes(OpenSSL::cipherIVLength(OpenSSL::CIPHER_AES_128_GCM));
- $tag = null;
- $httpPass = \json_encode([
- 'data' => OpenSSL::encrypt($httpPass, OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag),
- 'method' => OpenSSL::CIPHER_AES_128_GCM,
- 'iv' => \bin2hex($iv),
- 'tag' => \bin2hex($tag),
- 'version' => '1',
- ]);
$task = $consoleDB->createDocument([
'$collection' => Database::SYSTEM_COLLECTION_TASKS,
@@ -946,7 +867,7 @@ App::get('/v1/projects/:projectId/tasks')
->label('scope', 'projects.read')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'listTasks')
- ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.')
+ ->param('projectId', '', new UID(), 'Project unique ID.')
->action(function ($projectId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -959,18 +880,6 @@ App::get('/v1/projects/:projectId/tasks')
$tasks = $project->getAttribute('tasks', []);
- foreach ($tasks as $task) { /* @var $task Document */
- $httpPass = \json_decode($task->getAttribute('httpPass', '{}'), true);
-
- if (empty($httpPass) || !isset($httpPass['version'])) {
- continue;
- }
-
- $key = App::getEnv('_APP_OPENSSL_KEY_V'.$httpPass['version']);
-
- $task->setAttribute('httpPass', OpenSSL::decrypt($httpPass['data'], $httpPass['method'], $key, 0, \hex2bin($httpPass['iv']), \hex2bin($httpPass['tag'])));
- }
-
$response->json($tasks);
}, ['response', 'consoleDB']);
@@ -980,8 +889,8 @@ App::get('/v1/projects/:projectId/tasks/:taskId')
->label('scope', 'projects.read')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'getTask')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('taskId', null, function () { return new UID(); }, 'Task unique ID.')
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('taskId', null, new UID(), 'Task unique ID.')
->action(function ($projectId, $taskId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -998,13 +907,6 @@ App::get('/v1/projects/:projectId/tasks/:taskId')
throw new Exception('Task not found', 404);
}
- $httpPass = \json_decode($task->getAttribute('httpPass', '{}'), true);
-
- if (!empty($httpPass) && isset($httpPass['version'])) {
- $key = App::getEnv('_APP_OPENSSL_KEY_V'.$httpPass['version']);
- $task->setAttribute('httpPass', OpenSSL::decrypt($httpPass['data'], $httpPass['method'], $key, 0, \hex2bin($httpPass['iv']), \hex2bin($httpPass['tag'])));
- }
-
$response->json($task->getArrayCopy());
}, ['response', 'consoleDB']);
@@ -1014,17 +916,17 @@ App::put('/v1/projects/:projectId/tasks/:taskId')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'updateTask')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('taskId', null, function () { return new UID(); }, 'Task unique ID.')
- ->param('name', null, function () { return new Text(256); }, 'Task name.')
- ->param('status', null, function () { return new WhiteList(['play', 'pause']); }, 'Task status.')
- ->param('schedule', null, function () { return new Cron(); }, 'Task schedule CRON syntax.')
- ->param('security', false, function () { return new Boolean(true); }, 'Certificate verification, false for disabled or true for enabled.')
- ->param('httpMethod', '', function () { return new WhiteList(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT']); }, 'Task HTTP method.')
- ->param('httpUrl', '', function () { return new URL(); }, 'Task HTTP URL.')
- ->param('httpHeaders', null, function () { return new ArrayList(new Text(256)); }, 'Task HTTP headers list.', true)
- ->param('httpUser', '', function () { return new Text(256); }, 'Task HTTP user.', true)
- ->param('httpPass', '', function () { return new Text(256); }, 'Task HTTP password.', true)
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('taskId', null, new UID(), 'Task unique ID.')
+ ->param('name', null, new Text(128), 'Task name. Max length: 128 chars.')
+ ->param('status', null, new WhiteList(['play', 'pause'], true), 'Task status.')
+ ->param('schedule', null, new Cron(), 'Task schedule CRON syntax.')
+ ->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.')
+ ->param('httpMethod', '', new WhiteList(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'], true), 'Task HTTP method.')
+ ->param('httpUrl', '', new URL(), 'Task HTTP URL.')
+ ->param('httpHeaders', null, new ArrayList(new Text(256)), 'Task HTTP headers list.', true)
+ ->param('httpUser', '', new Text(256), 'Task HTTP user. Max length: 256 chars.', true)
+ ->param('httpPass', '', new Text(256), 'Task HTTP password. Max length: 256 chars.', true)
->action(function ($projectId, $taskId, $name, $status, $schedule, $security, $httpMethod, $httpUrl, $httpHeaders, $httpUser, $httpPass, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -1045,16 +947,6 @@ App::put('/v1/projects/:projectId/tasks/:taskId')
$next = ($status == 'play') ? $cron->getNextRunDate()->format('U') : null;
$security = ($security === '1' || $security === 'true' || $security === 1 || $security === true);
- $key = App::getEnv('_APP_OPENSSL_KEY_V1');
- $iv = OpenSSL::randomPseudoBytes(OpenSSL::cipherIVLength(OpenSSL::CIPHER_AES_128_GCM));
- $tag = null;
- $httpPass = \json_encode([
- 'data' => OpenSSL::encrypt($httpPass, OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag),
- 'method' => OpenSSL::CIPHER_AES_128_GCM,
- 'iv' => \bin2hex($iv),
- 'tag' => \bin2hex($tag),
- 'version' => '1',
- ]);
$task
->setAttribute('name', $name)
@@ -1087,8 +979,8 @@ App::delete('/v1/projects/:projectId/tasks/:taskId')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'deleteTask')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('taskId', null, function () { return new UID(); }, 'Task unique ID.')
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('taskId', null, new UID(), 'Task unique ID.')
->action(function ($projectId, $taskId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -1120,12 +1012,12 @@ App::post('/v1/projects/:projectId/platforms')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'createPlatform')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('type', null, function () { return new WhiteList(['web', 'flutter-ios', 'flutter-android', 'ios', 'android', 'unity']); }, 'Platform type.')
- ->param('name', null, function () { return new Text(256); }, 'Platform name.')
- ->param('key', '', function () { return new Text(256); }, 'Package name for android or bundle ID for iOS.', true)
- ->param('store', '', function () { return new Text(256); }, 'App store or Google Play store ID.', true)
- ->param('hostname', '', function () { return new Text(256); }, 'Platform client hostname.', true)
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('type', null, new WhiteList(['web', 'flutter-ios', 'flutter-android', 'ios', 'android', 'unity'], true), 'Platform type.')
+ ->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.')
+ ->param('key', '', new Text(256), 'Package name for android or bundle ID for iOS. Max length: 256 chars.', true)
+ ->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true)
+ ->param('hostname', '', new Text(256), 'Platform client hostname. Max length: 256 chars.', true)
->action(function ($projectId, $type, $name, $key, $store, $hostname, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -1175,7 +1067,7 @@ App::get('/v1/projects/:projectId/platforms')
->label('scope', 'projects.read')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'listPlatforms')
- ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.')
+ ->param('projectId', '', new UID(), 'Project unique ID.')
->action(function ($projectId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -1197,8 +1089,8 @@ App::get('/v1/projects/:projectId/platforms/:platformId')
->label('scope', 'projects.read')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'getPlatform')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('platformId', null, function () { return new UID(); }, 'Platform unique ID.')
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('platformId', null, new UID(), 'Platform unique ID.')
->action(function ($projectId, $platformId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -1224,12 +1116,12 @@ App::put('/v1/projects/:projectId/platforms/:platformId')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'updatePlatform')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('platformId', null, function () { return new UID(); }, 'Platform unique ID.')
- ->param('name', null, function () { return new Text(256); }, 'Platform name.')
- ->param('key', '', function () { return new Text(256); }, 'Package name for android or bundle ID for iOS.', true)
- ->param('store', '', function () { return new Text(256); }, 'App store or Google Play store ID.', true)
- ->param('hostname', '', function () { return new Text(256); }, 'Platform client URL.', true)
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('platformId', null, new UID(), 'Platform unique ID.')
+ ->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.')
+ ->param('key', '', new Text(256), 'Package name for android or bundle ID for iOS. Max length: 256 chars.', true)
+ ->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true)
+ ->param('hostname', '', new Text(256), 'Platform client URL. Max length: 256 chars.', true)
->action(function ($projectId, $platformId, $name, $key, $store, $hostname, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -1267,8 +1159,8 @@ App::delete('/v1/projects/:projectId/platforms/:platformId')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'deletePlatform')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('platformId', null, function () { return new UID(); }, 'Platform unique ID.')
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('platformId', null, new UID(), 'Platform unique ID.')
->action(function ($projectId, $platformId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -1300,8 +1192,8 @@ App::post('/v1/projects/:projectId/domains')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'createDomain')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('domain', null, function () { return new DomainValidator(); }, 'Domain name.')
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('domain', null, new DomainValidator(), 'Domain name.')
->action(function ($projectId, $domain, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -1364,7 +1256,7 @@ App::get('/v1/projects/:projectId/domains')
->label('scope', 'projects.read')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'listDomains')
- ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.')
+ ->param('projectId', '', new UID(), 'Project unique ID.')
->action(function ($projectId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -1386,8 +1278,8 @@ App::get('/v1/projects/:projectId/domains/:domainId')
->label('scope', 'projects.read')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'getDomain')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('domainId', null, function () { return new UID(); }, 'Domain unique ID.')
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('domainId', null, new UID(), 'Domain unique ID.')
->action(function ($projectId, $domainId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -1413,8 +1305,8 @@ App::patch('/v1/projects/:projectId/domains/:domainId/verification')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'updateDomainVerification')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('domainId', null, function () { return new UID(); }, 'Domain unique ID.')
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('domainId', null, new UID(), 'Domain unique ID.')
->action(function ($projectId, $domainId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
@@ -1471,8 +1363,8 @@ App::delete('/v1/projects/:projectId/domains/:domainId')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'deleteDomain')
- ->param('projectId', null, function () { return new UID(); }, 'Project unique ID.')
- ->param('domainId', null, function () { return new UID(); }, 'Domain unique ID.')
+ ->param('projectId', null, new UID(), 'Project unique ID.')
+ ->param('domainId', null, new UID(), 'Domain unique ID.')
->action(function ($projectId, $domainId, $response, $consoleDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $consoleDB */
diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php
index 2b9ebfe7eb..18cfb58f46 100644
--- a/app/controllers/api/storage.php
+++ b/app/controllers/api/storage.php
@@ -33,9 +33,9 @@ App::post('/v1/storage/files')
->label('sdk.description', '/docs/references/storage/create-file.md')
->label('sdk.consumes', 'multipart/form-data')
->label('sdk.methodType', 'upload')
- ->param('file', [], function () { return new File(); }, 'Binary file.', false)
- ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
- ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
+ ->param('file', [], new File(), 'Binary file.', false)
+ ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
+ ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
->action(function ($file, $read, $write, $request, $response, $user, $projectDB, $webhooks, $audits, $usage) {
/** @var Utopia\Request $request */
/** @var Utopia\Response $response */
@@ -167,10 +167,10 @@ App::get('/v1/storage/files')
->label('sdk.namespace', 'storage')
->label('sdk.method', 'listFiles')
->label('sdk.description', '/docs/references/storage/list-files.md')
- ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
- ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
- ->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true)
- ->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true)
+ ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
+ ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
+ ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true)
+ ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true)
->action(function ($search, $limit, $offset, $orderType, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -202,7 +202,7 @@ App::get('/v1/storage/files/:fileId')
->label('sdk.namespace', 'storage')
->label('sdk.method', 'getFile')
->label('sdk.description', '/docs/references/storage/get-file.md')
- ->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
+ ->param('fileId', '', new UID(), 'File unique ID.')
->action(function ($fileId, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -226,12 +226,12 @@ App::get('/v1/storage/files/:fileId/preview')
->label('sdk.description', '/docs/references/storage/get-file-preview.md')
->label('sdk.response.type', 'image/*')
->label('sdk.methodType', 'location')
- ->param('fileId', '', function () { return new UID(); }, 'File unique ID')
- ->param('width', 0, function () { return new Range(0, 4000); }, 'Resize preview image width, Pass an integer between 0 to 4000.', true)
- ->param('height', 0, function () { return new Range(0, 4000); }, 'Resize preview image height, Pass an integer between 0 to 4000.', true)
- ->param('quality', 100, function () { return new Range(0, 100); }, 'Preview image quality. Pass an integer between 0 to 100. Defaults to 100.', true)
- ->param('background', '', function () { return new HexColor(); }, 'Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.', true)
- ->param('output', '', function () { return new WhiteList(\array_keys(Config::getParam('storage-outputs'))); }, 'Output format type (jpeg, jpg, png, gif and webp).', true)
+ ->param('fileId', '', new UID(), 'File unique ID')
+ ->param('width', 0, new Range(0, 4000), 'Resize preview image width, Pass an integer between 0 to 4000.', true)
+ ->param('height', 0, new Range(0, 4000), 'Resize preview image height, Pass an integer between 0 to 4000.', true)
+ ->param('quality', 100, new Range(0, 100), 'Preview image quality. Pass an integer between 0 to 100. Defaults to 100.', true)
+ ->param('background', '', new HexColor(), 'Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.', true)
+ ->param('output', '', new WhiteList(\array_keys(Config::getParam('storage-outputs')), true), 'Output format type (jpeg, jpg, png, gif and webp).', true)
->action(function ($fileId, $width, $height, $quality, $background, $output, $request, $response, $project, $projectDB) {
/** @var Utopia\Request $request */
/** @var Utopia\Response $response */
@@ -352,7 +352,7 @@ App::get('/v1/storage/files/:fileId/download')
->label('sdk.description', '/docs/references/storage/get-file-download.md')
->label('sdk.response.type', '*')
->label('sdk.methodType', 'location')
- ->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
+ ->param('fileId', '', new UID(), 'File unique ID.')
->action(function ($fileId, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -407,8 +407,8 @@ App::get('/v1/storage/files/:fileId/view')
->label('sdk.description', '/docs/references/storage/get-file-view.md')
->label('sdk.response.type', '*')
->label('sdk.methodType', 'location')
- ->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
- ->param('as', '', function () { return new WhiteList(['pdf', /*'html',*/ 'text']); }, 'Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.', true)
+ ->param('fileId', '', new UID(), 'File unique ID.')
+ ->param('as', '', new WhiteList(['pdf', /*'html',*/ 'text'], true), 'Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk.', true)
->action(function ($fileId, $as, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -479,9 +479,9 @@ App::put('/v1/storage/files/:fileId')
->label('sdk.namespace', 'storage')
->label('sdk.method', 'updateFile')
->label('sdk.description', '/docs/references/storage/update-file.md')
- ->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
- ->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
- ->param('write', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
+ ->param('fileId', '', new UID(), 'File unique ID.')
+ ->param('read', [], new ArrayList(new Text(64)), 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
+ ->param('write', [], new ArrayList(new Text(64)), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
->action(function ($fileId, $read, $write, $response, $projectDB, $webhooks, $audits) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -527,7 +527,7 @@ App::delete('/v1/storage/files/:fileId')
->label('sdk.namespace', 'storage')
->label('sdk.method', 'deleteFile')
->label('sdk.description', '/docs/references/storage/delete-file.md')
- ->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
+ ->param('fileId', '', new UID(), 'File unique ID.')
->action(function ($fileId, $response, $projectDB, $webhooks, $audits, $usage) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -573,8 +573,8 @@ App::delete('/v1/storage/files/:fileId')
// ->label('sdk.namespace', 'storage')
// ->label('sdk.method', 'getFileScan')
// ->label('sdk.hide', true)
-// ->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
-// ->param('storage', 'files', function () { return new WhiteList(['files']);})
+// ->param('fileId', '', new UID(), 'File unique ID.')
+// ->param('storage', 'files', new WhiteList(['files']);})
// ->action(
// function ($fileId, $storage) use ($response, $request, $projectDB) {
// $file = $projectDB->getDocument($fileId);
diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php
index 159b0d2689..ae9e44015f 100644
--- a/app/controllers/api/teams.php
+++ b/app/controllers/api/teams.php
@@ -15,6 +15,7 @@ use Appwrite\Database\Document;
use Appwrite\Database\Validator\UID;
use Appwrite\Database\Validator\Authorization;
use Appwrite\Database\Exception\Duplicate;
+use Appwrite\Database\Validator\Key;
use Appwrite\Template\Template;
use Appwrite\Utopia\Response;
@@ -26,8 +27,8 @@ App::post('/v1/teams')
->label('sdk.namespace', 'teams')
->label('sdk.method', 'create')
->label('sdk.description', '/docs/references/teams/create-team.md')
- ->param('name', null, function () { return new Text(100); }, 'Team name.')
- ->param('roles', ['owner'], function () { return new ArrayList(new Text(128)); }, 'Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions).', true)
+ ->param('name', null, new Text(128), 'Team name. Max length: 128 chars.')
+ ->param('roles', ['owner'], new ArrayList(new Key()), 'Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.', true)
->action(function ($name, $roles, $response, $user, $projectDB, $mode) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Document $user */
@@ -93,10 +94,10 @@ App::get('/v1/teams')
->label('sdk.namespace', 'teams')
->label('sdk.method', 'list')
->label('sdk.description', '/docs/references/teams/list-teams.md')
- ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
- ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
- ->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true)
- ->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true)
+ ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
+ ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
+ ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true)
+ ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true)
->action(function ($search, $limit, $offset, $orderType, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -124,7 +125,7 @@ App::get('/v1/teams/:teamId')
->label('sdk.namespace', 'teams')
->label('sdk.method', 'get')
->label('sdk.description', '/docs/references/teams/get-team.md')
- ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
+ ->param('teamId', '', new UID(), 'Team unique ID.')
->action(function ($teamId, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -146,8 +147,8 @@ App::put('/v1/teams/:teamId')
->label('sdk.namespace', 'teams')
->label('sdk.method', 'update')
->label('sdk.description', '/docs/references/teams/update-team.md')
- ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
- ->param('name', null, function () { return new Text(100); }, 'Team name.')
+ ->param('teamId', '', new UID(), 'Team unique ID.')
+ ->param('name', null, new Text(128), 'Team name. Max length: 128 chars.')
->action(function ($teamId, $name, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -177,7 +178,7 @@ App::delete('/v1/teams/:teamId')
->label('sdk.namespace', 'teams')
->label('sdk.method', 'delete')
->label('sdk.description', '/docs/references/teams/delete-team.md')
- ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
+ ->param('teamId', '', new UID(), 'Team unique ID.')
->action(function ($teamId, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -218,10 +219,10 @@ App::post('/v1/teams/:teamId/memberships')
->label('sdk.namespace', 'teams')
->label('sdk.method', 'createMembership')
->label('sdk.description', '/docs/references/teams/create-team-membership.md')
- ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
- ->param('email', '', function () { return new Email(); }, 'New team member email.')
- ->param('name', '', function () { return new Text(100); }, 'New team member name.', true)
- ->param('roles', [], function () { return new ArrayList(new Text(128)); }, 'Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions).')
+ ->param('teamId', '', new UID(), 'Team unique ID.')
+ ->param('email', '', new Email(), 'New team member email.')
+ ->param('name', '', new Text(128), 'New team member name. Max length: 128 chars.', true)
+ ->param('roles', [], new ArrayList(new Key()), 'Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.')
->param('url', '', function ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients']) // TODO add our own built-in confirm page
->action(function ($teamId, $email, $name, $roles, $url, $response, $project, $user, $projectDB, $locale, $audits, $mails, $mode) {
/** @var Utopia\Response $response */
@@ -415,11 +416,11 @@ App::get('/v1/teams/:teamId/memberships')
->label('sdk.namespace', 'teams')
->label('sdk.method', 'getMemberships')
->label('sdk.description', '/docs/references/teams/get-team-members.md')
- ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
- ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
- ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
- ->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true)
- ->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true)
+ ->param('teamId', '', new UID(), 'Team unique ID.')
+ ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
+ ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
+ ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true)
+ ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true)
->action(function ($teamId, $search, $limit, $offset, $orderType, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -474,10 +475,10 @@ App::patch('/v1/teams/:teamId/memberships/:inviteId/status')
->label('sdk.namespace', 'teams')
->label('sdk.method', 'updateMembershipStatus')
->label('sdk.description', '/docs/references/teams/update-team-membership-status.md')
- ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
- ->param('inviteId', '', function () { return new UID(); }, 'Invite unique ID.')
- ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
- ->param('secret', '', function () { return new Text(256); }, 'Secret key.')
+ ->param('teamId', '', new UID(), 'Team unique ID.')
+ ->param('inviteId', '', new UID(), 'Invite unique ID.')
+ ->param('userId', '', new UID(), 'User unique ID.')
+ ->param('secret', '', new Text(256), 'Secret key.')
->action(function ($teamId, $inviteId, $userId, $secret, $request, $response, $user, $projectDB, $audits) {
/** @var Utopia\Request $request */
/** @var Utopia\Response $response */
@@ -604,8 +605,8 @@ App::delete('/v1/teams/:teamId/memberships/:inviteId')
->label('sdk.namespace', 'teams')
->label('sdk.method', 'deleteMembership')
->label('sdk.description', '/docs/references/teams/delete-team-membership.md')
- ->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
- ->param('inviteId', '', function () { return new UID(); }, 'Invite unique ID.')
+ ->param('teamId', '', new UID(), 'Team unique ID.')
+ ->param('inviteId', '', new UID(), 'Invite unique ID.')
->action(function ($teamId, $inviteId, $response, $projectDB, $audits) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php
index f195320d6b..21894e3131 100644
--- a/app/controllers/api/users.php
+++ b/app/controllers/api/users.php
@@ -26,9 +26,9 @@ App::post('/v1/users')
->label('sdk.namespace', 'users')
->label('sdk.method', 'create')
->label('sdk.description', '/docs/references/users/create-user.md')
- ->param('email', '', function () { return new Email(); }, 'User email.')
- ->param('password', '', function () { return new Password(); }, 'User password. Must be between 6 to 32 chars.')
- ->param('name', '', function () { return new Text(100); }, 'User name.', true)
+ ->param('email', '', new Email(), 'User email.')
+ ->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.')
+ ->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true)
->action(function ($email, $password, $name, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -96,10 +96,10 @@ App::get('/v1/users')
->label('sdk.namespace', 'users')
->label('sdk.method', 'list')
->label('sdk.description', '/docs/references/users/list-users.md')
- ->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
- ->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
- ->param('offset', 0, function () { return new Range(0, 2000); }, 'Results offset. The default value is 0. Use this param to manage pagination.', true)
- ->param('orderType', 'ASC', function () { return new WhiteList(['ASC', 'DESC']); }, 'Order result by ASC or DESC order.', true)
+ ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
+ ->param('limit', 25, new Range(0, 100), 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
+ ->param('offset', 0, new Range(0, 2000), 'Results offset. The default value is 0. Use this param to manage pagination.', true)
+ ->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true)
->action(function ($search, $limit, $offset, $orderType, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -152,7 +152,7 @@ App::get('/v1/users/:userId')
->label('sdk.namespace', 'users')
->label('sdk.method', 'get')
->label('sdk.description', '/docs/references/users/get-user.md')
- ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
+ ->param('userId', '', new UID(), 'User unique ID.')
->action(function ($userId, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -195,7 +195,7 @@ App::get('/v1/users/:userId/prefs')
->label('sdk.namespace', 'users')
->label('sdk.method', 'getPrefs')
->label('sdk.description', '/docs/references/users/get-user-prefs.md')
- ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
+ ->param('userId', '', new UID(), 'User unique ID.')
->action(function ($userId, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -226,7 +226,7 @@ App::get('/v1/users/:userId/sessions')
->label('sdk.namespace', 'users')
->label('sdk.method', 'getSessions')
->label('sdk.description', '/docs/references/users/get-user-sessions.md')
- ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
+ ->param('userId', '', new UID(), 'User unique ID.')
->action(function ($userId, $response, $projectDB, $locale, $geodb) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -292,7 +292,7 @@ App::get('/v1/users/:userId/logs')
->label('sdk.namespace', 'users')
->label('sdk.method', 'getLogs')
->label('sdk.description', '/docs/references/users/get-user-logs.md')
- ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
+ ->param('userId', '', new UID(), 'User unique ID.')
->action(function ($userId, $response, $register, $project, $projectDB, $locale, $geodb) {
/** @var Utopia\Response $response */
/** @var Utopia\Registry\Registry $register */
@@ -377,8 +377,8 @@ App::patch('/v1/users/:userId/status')
->label('sdk.namespace', 'users')
->label('sdk.method', 'updateStatus')
->label('sdk.description', '/docs/references/users/update-user-status.md')
- ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
- ->param('status', '', function () { return new WhiteList([Auth::USER_STATUS_ACTIVATED, Auth::USER_STATUS_BLOCKED, Auth::USER_STATUS_UNACTIVATED]); }, 'User Status code. To activate the user pass '.Auth::USER_STATUS_ACTIVATED.', to block the user pass '.Auth::USER_STATUS_BLOCKED.' and for disabling the user pass '.Auth::USER_STATUS_UNACTIVATED)
+ ->param('userId', '', new UID(), 'User unique ID.')
+ ->param('status', '', new WhiteList([Auth::USER_STATUS_ACTIVATED, Auth::USER_STATUS_BLOCKED, Auth::USER_STATUS_UNACTIVATED], true), 'User Status code. To activate the user pass '.Auth::USER_STATUS_ACTIVATED.', to block the user pass '.Auth::USER_STATUS_BLOCKED.' and for disabling the user pass '.Auth::USER_STATUS_UNACTIVATED)
->action(function ($userId, $status, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -427,8 +427,8 @@ App::patch('/v1/users/:userId/prefs')
->label('sdk.namespace', 'users')
->label('sdk.method', 'updatePrefs')
->label('sdk.description', '/docs/references/users/update-user-prefs.md')
- ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
- ->param('prefs', '', function () { return new Assoc();}, 'Prefs key-value JSON object.')
+ ->param('userId', '', new UID(), 'User unique ID.')
+ ->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.')
->action(function ($userId, $prefs, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -471,8 +471,8 @@ App::delete('/v1/users/:userId/sessions/:sessionId')
->label('sdk.method', 'deleteSession')
->label('sdk.description', '/docs/references/users/delete-user-session.md')
->label('abuse-limit', 100)
- ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
- ->param('sessionId', null, function () { return new UID(); }, 'User unique session ID.')
+ ->param('userId', '', new UID(), 'User unique ID.')
+ ->param('sessionId', null, new UID(), 'User unique session ID.')
->action(function ($userId, $sessionId, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -505,7 +505,7 @@ App::delete('/v1/users/:userId/sessions')
->label('sdk.method', 'deleteSessions')
->label('sdk.description', '/docs/references/users/delete-user-sessions.md')
->label('abuse-limit', 100)
- ->param('userId', '', function () { return new UID(); }, 'User unique ID.')
+ ->param('userId', '', new UID(), 'User unique ID.')
->action(function ($userId, $response, $projectDB) {
/** @var Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
@@ -526,3 +526,48 @@ App::delete('/v1/users/:userId/sessions')
$response->json(array('result' => 'success'));
}, ['response', 'projectDB']);
+
+App::delete('/v1/users/:userId')
+ ->desc('Delete User')
+ ->groups(['api', 'users'])
+ ->label('scope', 'users.write')
+ ->label('sdk.platform', [APP_PLATFORM_SERVER])
+ ->label('sdk.namespace', 'users')
+ ->label('sdk.method', 'deleteUser')
+ ->label('sdk.description', '/docs/references/users/delete-user.md')
+ ->label('abuse-limit', 100)
+ ->param('userId', '', function () {return new UID();}, 'User unique ID.')
+ ->action(function ($userId, $response, $projectDB, $deletes) {
+ /** @var Utopia\Response $response */
+ /** @var Appwrite\Database\Database $projectDB */
+ /** @var Appwrite\Event\Event $deletes */
+
+ $user = $projectDB->getDocument($userId);
+
+ if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) {
+ throw new Exception('User not found', 404);
+ }
+ if (!$projectDB->deleteDocument($userId)) {
+ throw new Exception('Failed to remove user from DB', 500);
+ }
+
+ if (!$projectDB->deleteUniqueKey(md5('users:email='.$user->getAttribute('email', null)))) {
+ throw new Exception('Failed to remove unique key from DB', 500);
+ }
+
+ $reservedId = $projectDB->createDocument([
+ '$collection' => Database::SYSTEM_COLLECTION_RESERVED,
+ '$id' => $userId,
+ '$permissions' => [
+ 'read' => ['*'],
+ ],
+ ]);
+
+ if (false === $reservedId) {
+ throw new Exception('Failed saving reserved id to DB', 500);
+ }
+
+ $deletes->setParam('document', $user);
+
+ $response->noContent();
+ }, ['response', 'projectDB', 'deletes']);
diff --git a/app/controllers/general.php b/app/controllers/general.php
index 751e6cdb04..e7350515cd 100644
--- a/app/controllers/general.php
+++ b/app/controllers/general.php
@@ -301,7 +301,7 @@ App::error(function ($error, $utopia, $request, $response, $layout, $project) {
/** @var Exception $error */
/** @var Utopia\App $utopia */
/** @var Utopia\Request $request */
- /** @var Utopia\Response $response */
+ /** @var Appwrite\Utopia\Response $response */
/** @var Utopia\View $layout */
/** @var Appwrite\Database\Document $project */
diff --git a/app/controllers/mock.php b/app/controllers/mock.php
index ea8c179efe..3f36a2238f 100644
--- a/app/controllers/mock.php
+++ b/app/controllers/mock.php
@@ -12,148 +12,159 @@ use Appwrite\Storage\Validator\File;
App::get('/v1/mock/tests/foo')
->desc('Mock a get request for SDK tests')
+ ->groups(['mock'])
->label('scope', 'public')
->label('sdk.namespace', 'foo')
->label('sdk.method', 'get')
->label('sdk.description', 'Mock a get request for SDK tests')
->label('sdk.mock', true)
- ->param('x', '', function () { return new Text(100); }, 'Sample string param')
- ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
- ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
+ ->param('x', '', new Text(100), 'Sample string param')
+ ->param('y', '', new Numeric(), 'Sample numeric param')
+ ->param('z', null, new ArrayList(new Text(256)), 'Sample array param')
->action(function ($x, $y, $z) {
});
App::post('/v1/mock/tests/foo')
->desc('Mock a post request for SDK tests')
+ ->groups(['mock'])
->label('scope', 'public')
->label('sdk.namespace', 'foo')
->label('sdk.method', 'post')
->label('sdk.description', 'Mock a post request for SDK tests')
->label('sdk.mock', true)
- ->param('x', '', function () { return new Text(100); }, 'Sample string param')
- ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
- ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
+ ->param('x', '', new Text(100), 'Sample string param')
+ ->param('y', '', new Numeric(), 'Sample numeric param')
+ ->param('z', null, new ArrayList(new Text(256)), 'Sample array param')
->action(function ($x, $y, $z) {
});
App::patch('/v1/mock/tests/foo')
->desc('Mock a patch request for SDK tests')
+ ->groups(['mock'])
->label('scope', 'public')
->label('sdk.namespace', 'foo')
->label('sdk.method', 'patch')
->label('sdk.description', 'Mock a get request for SDK tests')
->label('sdk.mock', true)
- ->param('x', '', function () { return new Text(100); }, 'Sample string param')
- ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
- ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
+ ->param('x', '', new Text(100), 'Sample string param')
+ ->param('y', '', new Numeric(), 'Sample numeric param')
+ ->param('z', null, new ArrayList(new Text(256)), 'Sample array param')
->action(function ($x, $y, $z) {
});
App::put('/v1/mock/tests/foo')
->desc('Mock a put request for SDK tests')
+ ->groups(['mock'])
->label('scope', 'public')
->label('sdk.namespace', 'foo')
->label('sdk.method', 'put')
->label('sdk.description', 'Mock a put request for SDK tests')
->label('sdk.mock', true)
- ->param('x', '', function () { return new Text(100); }, 'Sample string param')
- ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
- ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
+ ->param('x', '', new Text(100), 'Sample string param')
+ ->param('y', '', new Numeric(), 'Sample numeric param')
+ ->param('z', null, new ArrayList(new Text(256)), 'Sample array param')
->action(function ($x, $y, $z) {
});
App::delete('/v1/mock/tests/foo')
->desc('Mock a delete request for SDK tests')
+ ->groups(['mock'])
->label('scope', 'public')
->label('sdk.namespace', 'foo')
->label('sdk.method', 'delete')
->label('sdk.description', 'Mock a delete request for SDK tests')
->label('sdk.mock', true)
- ->param('x', '', function () { return new Text(100); }, 'Sample string param')
- ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
- ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
+ ->param('x', '', new Text(100), 'Sample string param')
+ ->param('y', '', new Numeric(), 'Sample numeric param')
+ ->param('z', null, new ArrayList(new Text(256)), 'Sample array param')
->action(function ($x, $y, $z) {
});
App::get('/v1/mock/tests/bar')
->desc('Mock a get request for SDK tests')
+ ->groups(['mock'])
->label('scope', 'public')
->label('sdk.namespace', 'bar')
->label('sdk.method', 'get')
->label('sdk.description', 'Mock a get request for SDK tests')
->label('sdk.mock', true)
- ->param('x', '', function () { return new Text(100); }, 'Sample string param')
- ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
- ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
+ ->param('x', '', new Text(100), 'Sample string param')
+ ->param('y', '', new Numeric(), 'Sample numeric param')
+ ->param('z', null, new ArrayList(new Text(256)), 'Sample array param')
->action(function ($x, $y, $z) {
});
App::post('/v1/mock/tests/bar')
->desc('Mock a post request for SDK tests')
+ ->groups(['mock'])
->label('scope', 'public')
->label('sdk.namespace', 'bar')
->label('sdk.method', 'post')
->label('sdk.description', 'Mock a post request for SDK tests')
->label('sdk.mock', true)
- ->param('x', '', function () { return new Text(100); }, 'Sample string param')
- ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
- ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
+ ->param('x', '', new Text(100), 'Sample string param')
+ ->param('y', '', new Numeric(), 'Sample numeric param')
+ ->param('z', null, new ArrayList(new Text(256)), 'Sample array param')
->action(function ($x, $y, $z) {
});
App::patch('/v1/mock/tests/bar')
->desc('Mock a patch request for SDK tests')
+ ->groups(['mock'])
->label('scope', 'public')
->label('sdk.namespace', 'bar')
->label('sdk.method', 'patch')
->label('sdk.description', 'Mock a get request for SDK tests')
->label('sdk.mock', true)
- ->param('x', '', function () { return new Text(100); }, 'Sample string param')
- ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
- ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
+ ->param('x', '', new Text(100), 'Sample string param')
+ ->param('y', '', new Numeric(), 'Sample numeric param')
+ ->param('z', null, new ArrayList(new Text(256)), 'Sample array param')
->action(function ($x, $y, $z) {
});
App::put('/v1/mock/tests/bar')
->desc('Mock a put request for SDK tests')
+ ->groups(['mock'])
->label('scope', 'public')
->label('sdk.namespace', 'bar')
->label('sdk.method', 'put')
->label('sdk.description', 'Mock a put request for SDK tests')
->label('sdk.mock', true)
- ->param('x', '', function () { return new Text(100); }, 'Sample string param')
- ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
- ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
+ ->param('x', '', new Text(100), 'Sample string param')
+ ->param('y', '', new Numeric(), 'Sample numeric param')
+ ->param('z', null, new ArrayList(new Text(256)), 'Sample array param')
->action(function ($x, $y, $z) {
});
App::delete('/v1/mock/tests/bar')
->desc('Mock a delete request for SDK tests')
+ ->groups(['mock'])
->label('scope', 'public')
->label('sdk.namespace', 'bar')
->label('sdk.method', 'delete')
->label('sdk.description', 'Mock a delete request for SDK tests')
->label('sdk.mock', true)
- ->param('x', '', function () { return new Text(100); }, 'Sample string param')
- ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
- ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
+ ->param('x', '', new Text(100), 'Sample string param')
+ ->param('y', '', new Numeric(), 'Sample numeric param')
+ ->param('z', null, new ArrayList(new Text(256)), 'Sample array param')
->action(function ($x, $y, $z) {
});
App::post('/v1/mock/tests/general/upload')
->desc('Mock a post request for SDK tests')
+ ->groups(['mock'])
->label('scope', 'public')
->label('sdk.namespace', 'general')
->label('sdk.method', 'upload')
->label('sdk.description', 'Mock a delete request for SDK tests')
->label('sdk.consumes', 'multipart/form-data')
->label('sdk.mock', true)
- ->param('x', '', function () { return new Text(100); }, 'Sample string param')
- ->param('y', '', function () { return new Numeric(); }, 'Sample numeric param')
- ->param('z', null, function () { return new ArrayList(new Text(256)); }, 'Sample array param')
- ->param('file', [], function () { return new File(); }, 'Sample file param', false)
+ ->param('x', '', new Text(100), 'Sample string param')
+ ->param('y', '', new Numeric(), 'Sample numeric param')
+ ->param('z', null, new ArrayList(new Text(256)), 'Sample array param')
+ ->param('file', [], new File(), 'Sample file param', false)
->action(function ($x, $y, $z, $file, $request) {
- /** @var Utopia\Request $request */
+ /** @var Utopia\Swoole\Request $request */
$file = $request->getFiles('file');
$file['tmp_name'] = (\is_array($file['tmp_name'])) ? $file['tmp_name'] : [$file['tmp_name']];
@@ -181,19 +192,21 @@ App::post('/v1/mock/tests/general/upload')
App::get('/v1/mock/tests/general/redirect')
->desc('Mock a post request for SDK tests')
+ ->groups(['mock'])
->label('scope', 'public')
->label('sdk.namespace', 'general')
->label('sdk.method', 'redirect')
->label('sdk.description', 'Mock a redirect request for SDK tests')
->label('sdk.mock', true)
->action(function ($response) {
- /** @var Utopia\Response $response */
+ /** @var Appwrite\Utopia\Response $response */
$response->redirect('/v1/mock/tests/general/redirected');
}, ['response']);
App::get('/v1/mock/tests/general/redirected')
->desc('Mock a post request for SDK tests')
+ ->groups(['mock'])
->label('scope', 'public')
->label('sdk.namespace', 'general')
->label('sdk.method', 'redirected')
@@ -204,26 +217,28 @@ App::get('/v1/mock/tests/general/redirected')
App::get('/v1/mock/tests/general/set-cookie')
->desc('Mock a cookie request for SDK tests')
+ ->groups(['mock'])
->label('scope', 'public')
->label('sdk.namespace', 'general')
->label('sdk.method', 'setCookie')
->label('sdk.description', 'Mock a set cookie request for SDK tests')
->label('sdk.mock', true)
->action(function ($response) {
- /** @var Utopia\Response $response */
+ /** @var Appwrite\Utopia\Response $response */
$response->addCookie('cookieName', 'cookieValue', \time() + 31536000, '/', 'localhost', true, true);
}, ['response']);
App::get('/v1/mock/tests/general/get-cookie')
->desc('Mock a cookie request for SDK tests')
+ ->groups(['mock'])
->label('scope', 'public')
->label('sdk.namespace', 'general')
->label('sdk.method', 'getCookie')
->label('sdk.description', 'Mock a get cookie request for SDK tests')
->label('sdk.mock', true)
->action(function ($request) {
- /** @var Utopia\Request $request */
+ /** @var Utopia\Swoole\Request $request */
if ($request->getCookie('cookieName', '') !== 'cookieValue') {
throw new Exception('Missing cookie value', 400);
@@ -232,13 +247,14 @@ App::get('/v1/mock/tests/general/get-cookie')
App::get('/v1/mock/tests/general/empty')
->desc('Mock a post request for SDK tests')
+ ->groups(['mock'])
->label('scope', 'public')
->label('sdk.namespace', 'general')
->label('sdk.method', 'empty')
->label('sdk.description', 'Mock a redirected request for SDK tests')
->label('sdk.mock', true)
->action(function ($response) {
- /** @var Utopia\Response $response */
+ /** @var Appwrite\Utopia\Response $response */
$response->noContent();
exit();
@@ -246,30 +262,32 @@ App::get('/v1/mock/tests/general/empty')
App::get('/v1/mock/tests/general/oauth2')
->desc('Mock an OAuth2 login route')
+ ->groups(['mock'])
->label('scope', 'public')
->label('docs', false)
->label('sdk.mock', true)
- ->param('client_id', '', function () { return new Text(100); }, 'OAuth2 Client ID.')
- ->param('redirect_uri', '', function () { return new Host(['localhost']); }, 'OAuth2 Redirect URI.') // Important to deny an open redirect attack
- ->param('scope', '', function () { return new Text(100); }, 'OAuth2 scope list.')
- ->param('state', '', function () { return new Text(1024); }, 'OAuth2 state.')
+ ->param('client_id', '', new Text(100), 'OAuth2 Client ID.')
+ ->param('redirect_uri', '', new Host(['localhost']), 'OAuth2 Redirect URI.') // Important to deny an open redirect attack
+ ->param('scope', '', new Text(100), 'OAuth2 scope list.')
+ ->param('state', '', new Text(1024), 'OAuth2 state.')
->action(function ($clientId, $redirectURI, $scope, $state, $response) {
- /** @var Utopia\Response $response */
+ /** @var Appwrite\Utopia\Response $response */
$response->redirect($redirectURI.'?'.\http_build_query(['code' => 'abcdef', 'state' => $state]));
}, ['response']);
App::get('/v1/mock/tests/general/oauth2/token')
->desc('Mock an OAuth2 login route')
+ ->groups(['mock'])
->label('scope', 'public')
->label('docs', false)
->label('sdk.mock', true)
- ->param('client_id', '', function () { return new Text(100); }, 'OAuth2 Client ID.')
- ->param('redirect_uri', '', function () { return new Host(['localhost']); }, 'OAuth2 Redirect URI.')
- ->param('client_secret', '', function () { return new Text(100); }, 'OAuth2 scope list.')
- ->param('code', '', function () { return new Text(100); }, 'OAuth2 state.')
+ ->param('client_id', '', new Text(100), 'OAuth2 Client ID.')
+ ->param('redirect_uri', '', new Host(['localhost']), 'OAuth2 Redirect URI.')
+ ->param('client_secret', '', new Text(100), 'OAuth2 scope list.')
+ ->param('code', '', new Text(100), 'OAuth2 state.')
->action(function ($clientId, $redirectURI, $clientSecret, $code, $response) {
- /** @var Utopia\Response $response */
+ /** @var Appwrite\Utopia\Response $response */
if ($clientId != '1') {
throw new Exception('Invalid client ID');
@@ -288,11 +306,12 @@ App::get('/v1/mock/tests/general/oauth2/token')
App::get('/v1/mock/tests/general/oauth2/user')
->desc('Mock an OAuth2 user route')
+ ->groups(['mock'])
->label('scope', 'public')
->label('docs', false)
- ->param('token', '', function () { return new Text(100); }, 'OAuth2 Access Token.')
+ ->param('token', '', new Text(100), 'OAuth2 Access Token.')
->action(function ($token, $response) {
- /** @var Utopia\Response $response */
+ /** @var Appwrite\Utopia\Response $response */
if ($token != '123456') {
throw new Exception('Invalid token');
@@ -307,9 +326,10 @@ App::get('/v1/mock/tests/general/oauth2/user')
App::get('/v1/mock/tests/general/oauth2/success')
->label('scope', 'public')
+ ->groups(['mock'])
->label('docs', false)
->action(function ($response) {
- /** @var Utopia\Response $response */
+ /** @var Appwrite\Utopia\Response $response */
$response->json([
'result' => 'success',
@@ -317,10 +337,11 @@ App::get('/v1/mock/tests/general/oauth2/success')
}, ['response']);
App::get('/v1/mock/tests/general/oauth2/failure')
+ ->groups(['mock'])
->label('scope', 'public')
->label('docs', false)
->action(function ($response) {
- /** @var Utopia\Response $response */
+ /** @var Appwrite\Utopia\Response $response */
$response
->setStatusCode(Response::STATUS_CODE_BAD_REQUEST)
@@ -331,8 +352,8 @@ App::get('/v1/mock/tests/general/oauth2/failure')
App::shutdown(function($utopia, $response, $request) {
/** @var Utopia\App $utopia */
- /** @var Utopia\Request $request */
- /** @var Utopia\Response $response */
+ /** @var Utopia\Swoole\Request $request */
+ /** @var Appwrite\Utopia\Response $response */
$result = [];
$route = $utopia->match($request);
diff --git a/app/controllers/shared/web.php b/app/controllers/shared/web.php
index d7b28de099..3452cd3535 100644
--- a/app/controllers/shared/web.php
+++ b/app/controllers/shared/web.php
@@ -36,7 +36,9 @@ App::init(function ($utopia, $request, $response, $layout) {
$response
->addHeader('Cache-Control', 'public, max-age='.$time)
->addHeader('Expires', \date('D, d M Y H:i:s', \time() + $time).' GMT') // 45 days cache
- ->addHeader('X-UA-Compatible', 'IE=Edge'); // Deny IE browsers from going into quirks mode
+ ->addHeader('X-Frame-Options', 'SAMEORIGIN') // Avoid console and homepage from showing in iframes
+ ->addHeader('X-UA-Compatible', 'IE=Edge') // Deny IE browsers from going into quirks mode
+ ;
$route = $utopia->match($request);
$scope = $route->getLabel('scope', '');
diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php
index 2a68c69592..6c2f7ba44c 100644
--- a/app/controllers/web/console.php
+++ b/app/controllers/web/console.php
@@ -211,7 +211,7 @@ App::get('/console/database/collection')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
- ->param('id', '', function () { return new UID(); }, 'Collection unique ID.')
+ ->param('id', '', new UID(), 'Collection unique ID.')
->action(function ($id, $response, $layout, $projectDB) {
/** @var Utopia\Response $response */
/** @var Utopia\View $layout */
@@ -247,7 +247,7 @@ App::get('/console/database/document')
->groups(['web', 'console'])
->label('permission', 'public')
->label('scope', 'console')
- ->param('collection', '', function () { return new UID(); }, 'Collection unique ID.')
+ ->param('collection', '', new UID(), 'Collection unique ID.')
->action(function ($collection, $layout, $projectDB) {
/** @var Utopia\View $layout */
/** @var Appwrite\Database\Database $projectDB */
diff --git a/app/controllers/web/home.php b/app/controllers/web/home.php
index b265fe1c8d..a6c2491c0f 100644
--- a/app/controllers/web/home.php
+++ b/app/controllers/web/home.php
@@ -184,9 +184,9 @@ App::get('/open-api-2.json')
->groups(['web', 'home'])
->label('scope', 'public')
->label('docs', false)
- ->param('platform', APP_PLATFORM_CLIENT, function () {return new WhiteList([APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER, APP_PLATFORM_CONSOLE]);}, 'Choose target platform.', true)
- ->param('extensions', 0, function () {return new Range(0, 1);}, 'Show extra data.', true)
- ->param('tests', 0, function () {return new Range(0, 1);}, 'Include only test services.', true)
+ ->param('platform', APP_PLATFORM_CLIENT, new WhiteList([APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER, APP_PLATFORM_CONSOLE], true), 'Choose target platform.', true)
+ ->param('extensions', 0, new Range(0, 1), 'Show extra data.', true)
+ ->param('tests', 0, new Range(0, 1), 'Include only test services.', true)
->action(function ($platform, $extensions, $tests, $utopia, $request, $response) {
/** @var Utopia\App $utopia */
/** @var Utopia\Request $request */
diff --git a/app/init.php b/app/init.php
index e21a60a722..4d56ac3f58 100644
--- a/app/init.php
+++ b/app/init.php
@@ -454,5 +454,6 @@ App::setResource('mode', function($request) {
}, ['request']);
App::setResource('geodb', function($request) {
+ /** @var Utopia\Request $request */
return new Reader(__DIR__.'/db/DBIP/dbip-country-lite-2020-01.mmdb');
}, ['request']);
diff --git a/app/sdks/client-flutter-dev/CHANGELOG.md b/app/sdks/client-flutter-dev/CHANGELOG.md
index c9013a17eb..2e9b0e0a91 100644
--- a/app/sdks/client-flutter-dev/CHANGELOG.md
+++ b/app/sdks/client-flutter-dev/CHANGELOG.md
@@ -1,3 +1,16 @@
+## 0.3.2
+
+- Fixed package namespaces
+
+## 0.3.1
+
+- Downgraded meta package version to 1.1.8
+
+## 0.3.0
+
+- Updated package dependencies (@lohanidamodar)
+- Added Flutter for Web compatibility (@lohanidamodar)
+
## 0.2.3
- Fixed OAuth2 cookie bug, where a new session cookie couldn't overwrite an old cookie
diff --git a/app/sdks/client-flutter-dev/README.md b/app/sdks/client-flutter-dev/README.md
index 09deaf5054..2c0ba754c3 100644
--- a/app/sdks/client-flutter-dev/README.md
+++ b/app/sdks/client-flutter-dev/README.md
@@ -20,13 +20,13 @@ Add this to your package's `pubspec.yaml` file:
```yml
dependencies:
- appwrite: ^0.2.3
+ appwrite_dev: ^0.3.2
```
You can install packages from the command line:
```bash
-pub get appwrite
+pub get appwrite_dev
```
## Contribution
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/create-o-auth2session.md b/app/sdks/client-flutter-dev/docs/examples/account/create-o-auth2session.md
index c617c34d4d..aae9d5f9a0 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/create-o-auth2session.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/create-o-auth2session.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/create-recovery.md b/app/sdks/client-flutter-dev/docs/examples/account/create-recovery.md
index 50db45b15d..32fe469cff 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/create-recovery.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/create-recovery.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/create-session.md b/app/sdks/client-flutter-dev/docs/examples/account/create-session.md
index ef824b4eca..a5930877f4 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/create-session.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/create-session.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/create-verification.md b/app/sdks/client-flutter-dev/docs/examples/account/create-verification.md
index 6b9b1ace40..738f22df42 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/create-verification.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/create-verification.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/create.md b/app/sdks/client-flutter-dev/docs/examples/account/create.md
index 384258ae68..1f92976c39 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/create.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/create.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/delete-session.md b/app/sdks/client-flutter-dev/docs/examples/account/delete-session.md
index 80a3f505d0..95b3641387 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/delete-session.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/delete-session.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/delete-sessions.md b/app/sdks/client-flutter-dev/docs/examples/account/delete-sessions.md
index 5e947fabc2..b9cbb46fd2 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/delete-sessions.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/delete-sessions.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/delete.md b/app/sdks/client-flutter-dev/docs/examples/account/delete.md
index 2853a1f437..8c99b2ac61 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/delete.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/delete.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/get-logs.md b/app/sdks/client-flutter-dev/docs/examples/account/get-logs.md
index 8f52f8220b..2ed66d88ce 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/get-logs.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/get-logs.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/get-prefs.md b/app/sdks/client-flutter-dev/docs/examples/account/get-prefs.md
index 01d57a5499..961a24dc19 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/get-prefs.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/get-prefs.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/get-sessions.md b/app/sdks/client-flutter-dev/docs/examples/account/get-sessions.md
index e921bda59b..76a566b959 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/get-sessions.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/get-sessions.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/get.md b/app/sdks/client-flutter-dev/docs/examples/account/get.md
index 35241b5607..cd05062a69 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/get.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/get.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/update-email.md b/app/sdks/client-flutter-dev/docs/examples/account/update-email.md
index 4a1a002db4..9fc86a7aae 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/update-email.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/update-email.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/update-name.md b/app/sdks/client-flutter-dev/docs/examples/account/update-name.md
index fa432bb34a..e5e218a515 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/update-name.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/update-name.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/update-password.md b/app/sdks/client-flutter-dev/docs/examples/account/update-password.md
index 9bd8ad9b77..869b4d9a30 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/update-password.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/update-password.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/update-prefs.md b/app/sdks/client-flutter-dev/docs/examples/account/update-prefs.md
index 443252f89a..0d50469742 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/update-prefs.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/update-prefs.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/update-recovery.md b/app/sdks/client-flutter-dev/docs/examples/account/update-recovery.md
index 5140235d49..e028e60a7d 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/update-recovery.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/update-recovery.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/account/update-verification.md b/app/sdks/client-flutter-dev/docs/examples/account/update-verification.md
index b795cde92d..48d669efcc 100644
--- a/app/sdks/client-flutter-dev/docs/examples/account/update-verification.md
+++ b/app/sdks/client-flutter-dev/docs/examples/account/update-verification.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/avatars/get-browser.md b/app/sdks/client-flutter-dev/docs/examples/avatars/get-browser.md
index 464767c4c0..dec7863b1f 100644
--- a/app/sdks/client-flutter-dev/docs/examples/avatars/get-browser.md
+++ b/app/sdks/client-flutter-dev/docs/examples/avatars/get-browser.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/avatars/get-credit-card.md b/app/sdks/client-flutter-dev/docs/examples/avatars/get-credit-card.md
index 482c642402..e2746c4999 100644
--- a/app/sdks/client-flutter-dev/docs/examples/avatars/get-credit-card.md
+++ b/app/sdks/client-flutter-dev/docs/examples/avatars/get-credit-card.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/avatars/get-favicon.md b/app/sdks/client-flutter-dev/docs/examples/avatars/get-favicon.md
index 60397b0af2..1c56335b9f 100644
--- a/app/sdks/client-flutter-dev/docs/examples/avatars/get-favicon.md
+++ b/app/sdks/client-flutter-dev/docs/examples/avatars/get-favicon.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/avatars/get-flag.md b/app/sdks/client-flutter-dev/docs/examples/avatars/get-flag.md
index a9f7a711d9..8a91f608ce 100644
--- a/app/sdks/client-flutter-dev/docs/examples/avatars/get-flag.md
+++ b/app/sdks/client-flutter-dev/docs/examples/avatars/get-flag.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/avatars/get-image.md b/app/sdks/client-flutter-dev/docs/examples/avatars/get-image.md
index 7cead1cb2f..a2cbea98e3 100644
--- a/app/sdks/client-flutter-dev/docs/examples/avatars/get-image.md
+++ b/app/sdks/client-flutter-dev/docs/examples/avatars/get-image.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/avatars/get-q-r.md b/app/sdks/client-flutter-dev/docs/examples/avatars/get-q-r.md
index a5bcfd2c05..2737297082 100644
--- a/app/sdks/client-flutter-dev/docs/examples/avatars/get-q-r.md
+++ b/app/sdks/client-flutter-dev/docs/examples/avatars/get-q-r.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/database/create-document.md b/app/sdks/client-flutter-dev/docs/examples/database/create-document.md
index b7d540bc2d..6fc27bdfbb 100644
--- a/app/sdks/client-flutter-dev/docs/examples/database/create-document.md
+++ b/app/sdks/client-flutter-dev/docs/examples/database/create-document.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/database/delete-document.md b/app/sdks/client-flutter-dev/docs/examples/database/delete-document.md
index 40c1cbdfe2..74bcd69d9a 100644
--- a/app/sdks/client-flutter-dev/docs/examples/database/delete-document.md
+++ b/app/sdks/client-flutter-dev/docs/examples/database/delete-document.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/database/get-document.md b/app/sdks/client-flutter-dev/docs/examples/database/get-document.md
index 0c98142315..639209ed3c 100644
--- a/app/sdks/client-flutter-dev/docs/examples/database/get-document.md
+++ b/app/sdks/client-flutter-dev/docs/examples/database/get-document.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/database/list-documents.md b/app/sdks/client-flutter-dev/docs/examples/database/list-documents.md
index 0685e7f1aa..41eac5dd9a 100644
--- a/app/sdks/client-flutter-dev/docs/examples/database/list-documents.md
+++ b/app/sdks/client-flutter-dev/docs/examples/database/list-documents.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/database/update-document.md b/app/sdks/client-flutter-dev/docs/examples/database/update-document.md
index 2f37cd767a..0b153b1595 100644
--- a/app/sdks/client-flutter-dev/docs/examples/database/update-document.md
+++ b/app/sdks/client-flutter-dev/docs/examples/database/update-document.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/locale/get-continents.md b/app/sdks/client-flutter-dev/docs/examples/locale/get-continents.md
index 2a6a6413ba..2c6bd7389f 100644
--- a/app/sdks/client-flutter-dev/docs/examples/locale/get-continents.md
+++ b/app/sdks/client-flutter-dev/docs/examples/locale/get-continents.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/locale/get-countries-e-u.md b/app/sdks/client-flutter-dev/docs/examples/locale/get-countries-e-u.md
index 1934fc6709..443fb2d115 100644
--- a/app/sdks/client-flutter-dev/docs/examples/locale/get-countries-e-u.md
+++ b/app/sdks/client-flutter-dev/docs/examples/locale/get-countries-e-u.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/locale/get-countries-phones.md b/app/sdks/client-flutter-dev/docs/examples/locale/get-countries-phones.md
index f6b1f58749..e08e2bca47 100644
--- a/app/sdks/client-flutter-dev/docs/examples/locale/get-countries-phones.md
+++ b/app/sdks/client-flutter-dev/docs/examples/locale/get-countries-phones.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/locale/get-countries.md b/app/sdks/client-flutter-dev/docs/examples/locale/get-countries.md
index 104584968f..a64a23c666 100644
--- a/app/sdks/client-flutter-dev/docs/examples/locale/get-countries.md
+++ b/app/sdks/client-flutter-dev/docs/examples/locale/get-countries.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/locale/get-currencies.md b/app/sdks/client-flutter-dev/docs/examples/locale/get-currencies.md
index 8dc01fc68e..e086245ffd 100644
--- a/app/sdks/client-flutter-dev/docs/examples/locale/get-currencies.md
+++ b/app/sdks/client-flutter-dev/docs/examples/locale/get-currencies.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/locale/get.md b/app/sdks/client-flutter-dev/docs/examples/locale/get.md
index 189fceb7d1..5cb8ae176e 100644
--- a/app/sdks/client-flutter-dev/docs/examples/locale/get.md
+++ b/app/sdks/client-flutter-dev/docs/examples/locale/get.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/storage/create-file.md b/app/sdks/client-flutter-dev/docs/examples/storage/create-file.md
index 9f61be12f4..d824bd5831 100644
--- a/app/sdks/client-flutter-dev/docs/examples/storage/create-file.md
+++ b/app/sdks/client-flutter-dev/docs/examples/storage/create-file.md
@@ -1,5 +1,5 @@
import 'dart:io';
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/storage/delete-file.md b/app/sdks/client-flutter-dev/docs/examples/storage/delete-file.md
index 271ed7b2dd..88e7b8815c 100644
--- a/app/sdks/client-flutter-dev/docs/examples/storage/delete-file.md
+++ b/app/sdks/client-flutter-dev/docs/examples/storage/delete-file.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/storage/get-file-download.md b/app/sdks/client-flutter-dev/docs/examples/storage/get-file-download.md
index be3385a61b..483340e24a 100644
--- a/app/sdks/client-flutter-dev/docs/examples/storage/get-file-download.md
+++ b/app/sdks/client-flutter-dev/docs/examples/storage/get-file-download.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/storage/get-file-preview.md b/app/sdks/client-flutter-dev/docs/examples/storage/get-file-preview.md
index 8bd1a47457..dd8d924fe7 100644
--- a/app/sdks/client-flutter-dev/docs/examples/storage/get-file-preview.md
+++ b/app/sdks/client-flutter-dev/docs/examples/storage/get-file-preview.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/storage/get-file-view.md b/app/sdks/client-flutter-dev/docs/examples/storage/get-file-view.md
index 5803fd409f..8ed6a946e0 100644
--- a/app/sdks/client-flutter-dev/docs/examples/storage/get-file-view.md
+++ b/app/sdks/client-flutter-dev/docs/examples/storage/get-file-view.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/storage/get-file.md b/app/sdks/client-flutter-dev/docs/examples/storage/get-file.md
index feca667fa9..4e398f88fd 100644
--- a/app/sdks/client-flutter-dev/docs/examples/storage/get-file.md
+++ b/app/sdks/client-flutter-dev/docs/examples/storage/get-file.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/storage/list-files.md b/app/sdks/client-flutter-dev/docs/examples/storage/list-files.md
index 1963ec694d..d72ba29e03 100644
--- a/app/sdks/client-flutter-dev/docs/examples/storage/list-files.md
+++ b/app/sdks/client-flutter-dev/docs/examples/storage/list-files.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/storage/update-file.md b/app/sdks/client-flutter-dev/docs/examples/storage/update-file.md
index a5ecbfe987..95e213ddc2 100644
--- a/app/sdks/client-flutter-dev/docs/examples/storage/update-file.md
+++ b/app/sdks/client-flutter-dev/docs/examples/storage/update-file.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/create-membership.md b/app/sdks/client-flutter-dev/docs/examples/teams/create-membership.md
index e5e82de7b4..31bf7ec1af 100644
--- a/app/sdks/client-flutter-dev/docs/examples/teams/create-membership.md
+++ b/app/sdks/client-flutter-dev/docs/examples/teams/create-membership.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/create.md b/app/sdks/client-flutter-dev/docs/examples/teams/create.md
index d11958ae6d..e50279de01 100644
--- a/app/sdks/client-flutter-dev/docs/examples/teams/create.md
+++ b/app/sdks/client-flutter-dev/docs/examples/teams/create.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/delete-membership.md b/app/sdks/client-flutter-dev/docs/examples/teams/delete-membership.md
index 3f57b840fe..015507d3a2 100644
--- a/app/sdks/client-flutter-dev/docs/examples/teams/delete-membership.md
+++ b/app/sdks/client-flutter-dev/docs/examples/teams/delete-membership.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/delete.md b/app/sdks/client-flutter-dev/docs/examples/teams/delete.md
index 9fb488afec..6cc1367f9b 100644
--- a/app/sdks/client-flutter-dev/docs/examples/teams/delete.md
+++ b/app/sdks/client-flutter-dev/docs/examples/teams/delete.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/get-memberships.md b/app/sdks/client-flutter-dev/docs/examples/teams/get-memberships.md
index 4edadfa2b4..d427c9ac47 100644
--- a/app/sdks/client-flutter-dev/docs/examples/teams/get-memberships.md
+++ b/app/sdks/client-flutter-dev/docs/examples/teams/get-memberships.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/get.md b/app/sdks/client-flutter-dev/docs/examples/teams/get.md
index 083565f7a6..1bca70a23f 100644
--- a/app/sdks/client-flutter-dev/docs/examples/teams/get.md
+++ b/app/sdks/client-flutter-dev/docs/examples/teams/get.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/list.md b/app/sdks/client-flutter-dev/docs/examples/teams/list.md
index 665020e928..c56e7a5dd5 100644
--- a/app/sdks/client-flutter-dev/docs/examples/teams/list.md
+++ b/app/sdks/client-flutter-dev/docs/examples/teams/list.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/update-membership-status.md b/app/sdks/client-flutter-dev/docs/examples/teams/update-membership-status.md
index 616f64e148..6098b38ed9 100644
--- a/app/sdks/client-flutter-dev/docs/examples/teams/update-membership-status.md
+++ b/app/sdks/client-flutter-dev/docs/examples/teams/update-membership-status.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/docs/examples/teams/update.md b/app/sdks/client-flutter-dev/docs/examples/teams/update.md
index 915fb57d38..2494f408d9 100644
--- a/app/sdks/client-flutter-dev/docs/examples/teams/update.md
+++ b/app/sdks/client-flutter-dev/docs/examples/teams/update.md
@@ -1,4 +1,4 @@
-import 'package:appwrite/appwrite.dart';
+import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
diff --git a/app/sdks/client-flutter-dev/lib/appwrite_dev.dart b/app/sdks/client-flutter-dev/lib/appwrite_dev.dart
new file mode 100644
index 0000000000..95d0b72cfe
--- /dev/null
+++ b/app/sdks/client-flutter-dev/lib/appwrite_dev.dart
@@ -0,0 +1,10 @@
+export 'package:dio/dio.dart' show Response;
+
+export 'client.dart';
+export 'enums.dart';
+export 'services/account.dart';
+export 'services/avatars.dart';
+export 'services/database.dart';
+export 'services/locale.dart';
+export 'services/storage.dart';
+export 'services/teams.dart';
diff --git a/app/sdks/client-flutter-dev/lib/client.dart b/app/sdks/client-flutter-dev/lib/client.dart
index 7a53d0414b..a5583fcd00 100644
--- a/app/sdks/client-flutter-dev/lib/client.dart
+++ b/app/sdks/client-flutter-dev/lib/client.dart
@@ -1,6 +1,7 @@
import 'dart:io';
import 'package:dio/dio.dart';
+import 'package:flutter/foundation.dart';
import 'package:dio/adapter.dart';
import 'package:dio_cookie_manager/dio_cookie_manager.dart';
import 'package:cookie_jar/cookie_jar.dart';
@@ -20,17 +21,21 @@ class Client {
PersistCookieJar cookieJar;
Client({this.endPoint = 'https://appwrite.io/v1', this.selfSigned = false, Dio http}) : this.http = http ?? Dio() {
-
- type = (Platform.isIOS) ? 'ios' : type;
- type = (Platform.isMacOS) ? 'macos' : type;
- type = (Platform.isAndroid) ? 'android' : type;
- type = (Platform.isLinux) ? 'linux' : type;
- type = (Platform.isWindows) ? 'windows' : type;
- type = (Platform.isFuchsia) ? 'fuchsia' : type;
+ // Platform is not supported in web so if web, set type to web automatically and skip Platform check
+ if(kIsWeb) {
+ type = 'web';
+ }else{
+ type = (Platform.isIOS) ? 'ios' : type;
+ type = (Platform.isMacOS) ? 'macos' : type;
+ type = (Platform.isAndroid) ? 'android' : type;
+ type = (Platform.isLinux) ? 'linux' : type;
+ type = (Platform.isWindows) ? 'windows' : type;
+ type = (Platform.isFuchsia) ? 'fuchsia' : type;
+ }
this.headers = {
'content-type': 'application/json',
- 'x-sdk-version': 'appwrite:dart:0.2.3',
+ 'x-sdk-version': 'appwrite:flutter:0.3.2',
};
this.config = {};
@@ -78,17 +83,20 @@ class Client {
Future init() async {
if(!initialized) {
- final Directory cookieDir = await _getCookiePath();
-
- cookieJar = new PersistCookieJar(dir:cookieDir.path);
+ // if web skip cookie implementation and origin header as those are automatically handled by browsers
+ if(!kIsWeb) {
+ final Directory cookieDir = await _getCookiePath();
+ cookieJar = new PersistCookieJar(dir:cookieDir.path);
+ this.http.interceptors.add(CookieManager(cookieJar));
+ PackageInfo packageInfo = await PackageInfo.fromPlatform();
+ addHeader('Origin', 'appwrite-' + type + '://' + packageInfo.packageName);
+ }else{
+ // if web set httpClientAdapter as BrowserHttpClientAdapter with withCredentials true to make cookies work
+ this.http.options.extra['withCredentials'] = true;
+ }
this.http.options.baseUrl = this.endPoint;
this.http.options.validateStatus = (status) => status < 400;
- this.http.interceptors.add(CookieManager(cookieJar));
-
- PackageInfo packageInfo = await PackageInfo.fromPlatform();
-
- addHeader('Origin', 'appwrite-' + type + '://' + packageInfo.packageName);
}
}
@@ -114,6 +122,10 @@ class Client {
}
if (method == HttpMethod.get) {
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
return http.get(path, queryParameters: params, options: options);
} else {
return http.request(path, data: params, options: options);
diff --git a/app/sdks/client-flutter-dev/lib/services/avatars.dart b/app/sdks/client-flutter-dev/lib/services/avatars.dart
index fc9c403d90..828ea7dfb0 100644
--- a/app/sdks/client-flutter-dev/lib/services/avatars.dart
+++ b/app/sdks/client-flutter-dev/lib/services/avatars.dart
@@ -27,6 +27,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@@ -55,6 +59,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@@ -79,6 +87,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@@ -106,6 +118,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@@ -134,6 +150,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@@ -161,6 +181,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
diff --git a/app/sdks/client-flutter-dev/lib/services/storage.dart b/app/sdks/client-flutter-dev/lib/services/storage.dart
index 696c15ee3a..51f9345050 100644
--- a/app/sdks/client-flutter-dev/lib/services/storage.dart
+++ b/app/sdks/client-flutter-dev/lib/services/storage.dart
@@ -124,6 +124,10 @@ class Storage extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@@ -154,6 +158,10 @@ class Storage extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@@ -178,6 +186,10 @@ class Storage extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
diff --git a/app/sdks/client-flutter-dev/pubspec.yaml b/app/sdks/client-flutter-dev/pubspec.yaml
index ea8f29d01e..7d3646b8ee 100644
--- a/app/sdks/client-flutter-dev/pubspec.yaml
+++ b/app/sdks/client-flutter-dev/pubspec.yaml
@@ -1,5 +1,5 @@
-name: appwrite
-version: 0.2.3
+name: appwrite_dev
+version: 0.3.2
description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API
homepage: https://appwrite.io
repository: https://github.com/appwrite/sdk-for-flutter-dev
@@ -9,30 +9,15 @@ environment:
sdk: '>=2.6.0 <3.0.0'
dependencies:
meta: ^1.1.8
- path_provider: ^1.6.5
- package_info: ^0.4.0+16
- dio: ^3.0.0
- cookie_jar: ^1.0.0
+ path_provider: ^1.6.14
+ package_info: ^0.4.3
+ dio: ^3.0.10
+ cookie_jar: ^1.0.1
dio_cookie_manager: ^1.0.0
flutter_web_auth: ^0.2.4
flutter:
sdk: flutter
- # The following adds the Cupertino Icons font to your application.
- # Use with the CupertinoIcons class for iOS style icons.
- cupertino_icons: ^0.1.2
-
dev_dependencies:
flutter_test:
- sdk: flutter
-
-# For information on the generic Dart part of this file, see the
-# following page: https://dart.dev/tools/pub/pubspec
-
-# The following section is specific to Flutter.
-flutter:
-
- # The following line ensures that the Material Icons font is
- # included with your application, so that you can use the icons in
- # the material Icons class.
- uses-material-design: true
\ No newline at end of file
+ sdk: flutter
\ No newline at end of file
diff --git a/app/sdks/client-flutter/CHANGELOG.md b/app/sdks/client-flutter/CHANGELOG.md
index c9013a17eb..a584ad8b9a 100644
--- a/app/sdks/client-flutter/CHANGELOG.md
+++ b/app/sdks/client-flutter/CHANGELOG.md
@@ -1,3 +1,12 @@
+## 0.3.0-dev.2
+
+- Fix for an error when using a self-signed certificate for Web
+
+## 0.3.0-dev.1
+
+- Updated package dependencies (@lohanidamodar)
+- Added Flutter for Web compatibility (@lohanidamodar)
+
## 0.2.3
- Fixed OAuth2 cookie bug, where a new session cookie couldn't overwrite an old cookie
diff --git a/app/sdks/client-flutter/README.md b/app/sdks/client-flutter/README.md
index 877cf5d30f..d272426ee3 100644
--- a/app/sdks/client-flutter/README.md
+++ b/app/sdks/client-flutter/README.md
@@ -20,7 +20,7 @@ Add this to your package's `pubspec.yaml` file:
```yml
dependencies:
- appwrite: ^0.2.3
+ appwrite: ^0.3.0-dev.2
```
You can install packages from the command line:
diff --git a/app/sdks/client-flutter/lib/client.dart b/app/sdks/client-flutter/lib/client.dart
index 7a53d0414b..ee55d8ba18 100644
--- a/app/sdks/client-flutter/lib/client.dart
+++ b/app/sdks/client-flutter/lib/client.dart
@@ -1,6 +1,7 @@
import 'dart:io';
import 'package:dio/dio.dart';
+import 'package:flutter/foundation.dart';
import 'package:dio/adapter.dart';
import 'package:dio_cookie_manager/dio_cookie_manager.dart';
import 'package:cookie_jar/cookie_jar.dart';
@@ -20,17 +21,21 @@ class Client {
PersistCookieJar cookieJar;
Client({this.endPoint = 'https://appwrite.io/v1', this.selfSigned = false, Dio http}) : this.http = http ?? Dio() {
-
- type = (Platform.isIOS) ? 'ios' : type;
- type = (Platform.isMacOS) ? 'macos' : type;
- type = (Platform.isAndroid) ? 'android' : type;
- type = (Platform.isLinux) ? 'linux' : type;
- type = (Platform.isWindows) ? 'windows' : type;
- type = (Platform.isFuchsia) ? 'fuchsia' : type;
+ // Platform is not supported in web so if web, set type to web automatically and skip Platform check
+ if(kIsWeb) {
+ type = 'web';
+ }else{
+ type = (Platform.isIOS) ? 'ios' : type;
+ type = (Platform.isMacOS) ? 'macos' : type;
+ type = (Platform.isAndroid) ? 'android' : type;
+ type = (Platform.isLinux) ? 'linux' : type;
+ type = (Platform.isWindows) ? 'windows' : type;
+ type = (Platform.isFuchsia) ? 'fuchsia' : type;
+ }
this.headers = {
'content-type': 'application/json',
- 'x-sdk-version': 'appwrite:dart:0.2.3',
+ 'x-sdk-version': 'appwrite:flutter:0.3.0-dev.2',
};
this.config = {};
@@ -78,22 +83,25 @@ class Client {
Future init() async {
if(!initialized) {
- final Directory cookieDir = await _getCookiePath();
-
- cookieJar = new PersistCookieJar(dir:cookieDir.path);
+ // if web skip cookie implementation and origin header as those are automatically handled by browsers
+ if(!kIsWeb) {
+ final Directory cookieDir = await _getCookiePath();
+ cookieJar = new PersistCookieJar(dir:cookieDir.path);
+ this.http.interceptors.add(CookieManager(cookieJar));
+ PackageInfo packageInfo = await PackageInfo.fromPlatform();
+ addHeader('Origin', 'appwrite-' + type + '://' + packageInfo.packageName);
+ }else{
+ // if web set httpClientAdapter as BrowserHttpClientAdapter with withCredentials true to make cookies work
+ this.http.options.extra['withCredentials'] = true;
+ }
this.http.options.baseUrl = this.endPoint;
this.http.options.validateStatus = (status) => status < 400;
- this.http.interceptors.add(CookieManager(cookieJar));
-
- PackageInfo packageInfo = await PackageInfo.fromPlatform();
-
- addHeader('Origin', 'appwrite-' + type + '://' + packageInfo.packageName);
}
}
Future call(HttpMethod method, {String path = '', Map headers = const {}, Map params = const {}}) async {
- if(selfSigned) {
+ if(selfSigned && !kIsWeb) {
// Allow self signed requests
(http.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (HttpClient client) {
client.badCertificateCallback = (X509Certificate cert, String host, int port) => true;
@@ -114,6 +122,10 @@ class Client {
}
if (method == HttpMethod.get) {
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
return http.get(path, queryParameters: params, options: options);
} else {
return http.request(path, data: params, options: options);
diff --git a/app/sdks/client-flutter/lib/services/account.dart b/app/sdks/client-flutter/lib/services/account.dart
index 617ea83b98..890303a9d6 100644
--- a/app/sdks/client-flutter/lib/services/account.dart
+++ b/app/sdks/client-flutter/lib/services/account.dart
@@ -1,8 +1,10 @@
import 'dart:io';
+import 'package:universal_html/html.dart' as html;
import 'package:dio/dio.dart';
import 'package:meta/meta.dart';
+import 'package:flutter/foundation.dart';
import 'package:flutter_web_auth/flutter_web_auth.dart';
import "../client.dart";
@@ -337,19 +339,26 @@ class Account extends Service {
query: query.join('&')
);
- return FlutterWebAuth.authenticate(
- url: url.toString(),
- callbackUrlScheme: "appwrite-callback-" + client.config['project']
- ).then((value) async {
- Uri url = Uri.parse(value);
- Cookie cookie = new Cookie(url.queryParameters['key'], url.queryParameters['secret']);
- cookie.domain = Uri.parse(client.endPoint).host;
- cookie.httpOnly = true;
- cookie.path = '/';
- List cookies = [cookie];
- await client.init();
- client.cookieJar.saveFromResponse(Uri.parse(client.endPoint), cookies);
- });
+ if(kIsWeb) {
+ html.window.location.href = url.toString();
+ return null;
+ }else{
+
+ return FlutterWebAuth.authenticate(
+ url: url.toString(),
+ callbackUrlScheme: "appwrite-callback-" + client.config['project']
+ ).then((value) async {
+ Uri url = Uri.parse(value);
+ Cookie cookie = new Cookie(url.queryParameters['key'], url.queryParameters['secret']);
+ cookie.domain = Uri.parse(client.endPoint).host;
+ cookie.httpOnly = true;
+ cookie.path = '/';
+ List cookies = [cookie];
+ await client.init();
+ client.cookieJar.saveFromResponse(Uri.parse(client.endPoint), cookies);
+ });
+ }
+
}
/// Delete Account Session
@@ -376,16 +385,17 @@ class Account extends Service {
/// Use this endpoint to send a verification message to your user email address
/// to confirm they are the valid owners of that address. Both the **userId**
/// and **secret** arguments will be passed as query parameters to the URL you
- /// have provider to be attached to the verification email. The provided URL
- /// should redirect the user back for your app and allow you to complete the
+ /// have provided to be attached to the verification email. The provided URL
+ /// should redirect the user back to your app and allow you to complete the
/// verification process by verifying both the **userId** and **secret**
/// parameters. Learn more about how to [complete the verification
/// process](/docs/client/account#updateAccountVerification).
///
/// Please note that in order to avoid a [Redirect
- /// Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
+ /// Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
/// the only valid redirect URLs are the ones from domains you have set when
/// adding your platforms in the console interface.
+ ///
///
Future createVerification({@required String url}) {
final String path = '/account/verification';
diff --git a/app/sdks/client-flutter/lib/services/avatars.dart b/app/sdks/client-flutter/lib/services/avatars.dart
index 16c7ce59ff..b7fa6393ef 100644
--- a/app/sdks/client-flutter/lib/services/avatars.dart
+++ b/app/sdks/client-flutter/lib/services/avatars.dart
@@ -27,6 +27,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@@ -55,6 +59,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@@ -79,6 +87,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@@ -106,6 +118,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@@ -134,6 +150,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@@ -170,6 +190,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@@ -186,7 +210,7 @@ class Avatars extends Service {
/// Converts a given plain text to a QR code image. You can use the query
/// parameters to change the size and style of the resulting image.
///
- String getQR({@required String text, int size = 400, int margin = 1, int download = 0}) {
+ String getQR({@required String text, int size = 400, int margin = 1, bool download = false}) {
final String path = '/avatars/qr';
final Map params = {
@@ -197,6 +221,10 @@ class Avatars extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
diff --git a/app/sdks/client-flutter/lib/services/database.dart b/app/sdks/client-flutter/lib/services/database.dart
index 88082feef7..0fec1fb4d6 100644
--- a/app/sdks/client-flutter/lib/services/database.dart
+++ b/app/sdks/client-flutter/lib/services/database.dart
@@ -17,7 +17,7 @@ class Database extends Service {
/// of the project documents. [Learn more about different API
/// modes](/docs/admin).
///
- Future listDocuments({@required String collectionId, List filters = const [], int offset = 0, int limit = 50, String orderField = '\$id', OrderType orderType = OrderType.asc, String orderCast = 'string', String search = '', int first = 0, int last = 0}) {
+ Future listDocuments({@required String collectionId, List filters = const [], int offset = 0, int limit = 50, String orderField = '\$id', OrderType orderType = OrderType.asc, String orderCast = 'string', String search = ''}) {
final String path = '/database/collections/{collectionId}/documents'.replaceAll(RegExp('{collectionId}'), collectionId);
final Map params = {
@@ -28,8 +28,6 @@ class Database extends Service {
'orderType': orderType.name(),
'orderCast': orderCast,
'search': search,
- 'first': first,
- 'last': last,
};
final Map headers = {
diff --git a/app/sdks/client-flutter/lib/services/storage.dart b/app/sdks/client-flutter/lib/services/storage.dart
index 696c15ee3a..51f9345050 100644
--- a/app/sdks/client-flutter/lib/services/storage.dart
+++ b/app/sdks/client-flutter/lib/services/storage.dart
@@ -124,6 +124,10 @@ class Storage extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@@ -154,6 +158,10 @@ class Storage extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
@@ -178,6 +186,10 @@ class Storage extends Service {
'project': client.config['project'],
};
+ params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
+ params[key] = params[key].toString();
+ }});
+
Uri endpoint = Uri.parse(client.endPoint);
Uri location = new Uri(scheme: endpoint.scheme,
host: endpoint.host,
diff --git a/app/sdks/client-flutter/pubspec.yaml b/app/sdks/client-flutter/pubspec.yaml
index 91a884cd2d..cabc271c5e 100644
--- a/app/sdks/client-flutter/pubspec.yaml
+++ b/app/sdks/client-flutter/pubspec.yaml
@@ -1,5 +1,5 @@
name: appwrite
-version: 0.2.3
+version: 0.3.0-dev.2
description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API
homepage: https://appwrite.io
repository: https://github.com/appwrite/sdk-for-flutter
@@ -9,30 +9,16 @@ environment:
sdk: '>=2.6.0 <3.0.0'
dependencies:
meta: ^1.1.8
- path_provider: ^1.6.5
- package_info: ^0.4.0+16
- dio: ^3.0.0
- cookie_jar: ^1.0.0
+ path_provider: ^1.6.14
+ package_info: ^0.4.3
+ dio: ^3.0.10
+ cookie_jar: ^1.0.1
dio_cookie_manager: ^1.0.0
flutter_web_auth: ^0.2.4
+ universal_html: ^1.2.3
flutter:
sdk: flutter
- # The following adds the Cupertino Icons font to your application.
- # Use with the CupertinoIcons class for iOS style icons.
- cupertino_icons: ^0.1.2
-
dev_dependencies:
flutter_test:
- sdk: flutter
-
-# For information on the generic Dart part of this file, see the
-# following page: https://dart.dev/tools/pub/pubspec
-
-# The following section is specific to Flutter.
-flutter:
-
- # The following line ensures that the Material Icons font is
- # included with your application, so that you can use the icons in
- # the material Icons class.
- uses-material-design: true
\ No newline at end of file
+ sdk: flutter
\ No newline at end of file
diff --git a/app/sdks/client-swift/CHANGELOG.md b/app/sdks/client-swift/CHANGELOG.md
new file mode 100644
index 0000000000..fa4d35e687
--- /dev/null
+++ b/app/sdks/client-swift/CHANGELOG.md
@@ -0,0 +1 @@
+# Change Log
\ No newline at end of file
diff --git a/app/sdks/client-swift/LICENSE b/app/sdks/client-swift/LICENSE
new file mode 100644
index 0000000000..fc7c051a91
--- /dev/null
+++ b/app/sdks/client-swift/LICENSE
@@ -0,0 +1,12 @@
+Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+ 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/app/sdks/client-swift/Package.swift b/app/sdks/client-swift/Package.swift
new file mode 100644
index 0000000000..5bea7f1c50
--- /dev/null
+++ b/app/sdks/client-swift/Package.swift
@@ -0,0 +1,35 @@
+// swift-tools-version:5.1
+// The swift-tools-version declares the minimum version of Swift required to build this package.
+//
+// Created by Armino
+// GitHub: https://github.com/armino-dev/sdk-generator
+//
+
+import PackageDescription
+
+let package = Package(
+ name: "Appwrite",
+ products: [
+ // Products define the executables and libraries produced by a package,
+ // and make them visible to other packages.
+ .library(
+ name: "Appwrite",
+ targets: ["Appwrite"]),
+ ],
+ dependencies: [
+ // Dependencies declare other packages that this package depends on.
+ // .package(url: /* package url */, from: "1.0.0"),
+ ],
+ targets: [
+ // Targets are the basic building blocks of a package.
+ // A target can define a module or a test suite.
+ // Targets can depend on other targets in this package,
+ // and on products in packages which this package depends on.
+ .target(
+ name: "Appwrite",
+ dependencies: []),
+ .testTarget(
+ name: "AppwriteTests",
+ dependencies: [Appwrite]),
+ ]
+)
diff --git a/app/sdks/client-swift/README.md b/app/sdks/client-swift/README.md
new file mode 100644
index 0000000000..d46757f068
--- /dev/null
+++ b/app/sdks/client-swift/README.md
@@ -0,0 +1,24 @@
+# Appwrite Swift SDK
+
+
+
+
+Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way.
+ Use the Swift SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
+ For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
+
+
+
+
+
+## Installation
+
+```
+ git clone appwrite/sdk-for-swift
+ cd sdk-for-swift
+ swift run
+```
+
+## License
+
+Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.
diff --git a/app/sdks/client-swift/Sources/Appwrite/Client.swift b/app/sdks/client-swift/Sources/Appwrite/Client.swift
new file mode 100644
index 0000000000..8748fbc0f9
--- /dev/null
+++ b/app/sdks/client-swift/Sources/Appwrite/Client.swift
@@ -0,0 +1,231 @@
+//
+// Client.swift
+//
+// Created by Armino
+// GitHub: https://github.com/armino-dev/sdk-generator
+//
+
+import Foundation
+
+open class Client {
+
+ // MARK: Properties
+
+ open var selfSigned = false
+
+ open var endpoint = "https://appwrite.io/v1"
+
+ open var headers: [String: String] = [
+ "content-type": "",
+ "x-sdk-version": "appwrite:swift:"
+ ]
+
+
+ // MARK: Methods
+
+ // default constructor
+ public init() {
+
+ }
+
+ ///
+ /// Set Project
+ ///
+ /// Your project ID
+ ///
+ /// @param String value
+ ///
+ /// @return Client
+ ///
+ open func setProject(value: String) -> Client {
+
+ self.addHeader(key: "X-Appwrite-Project", value: value)
+ return self
+ }
+
+ ///
+ /// Set Locale
+ ///
+ /// @param String value
+ ///
+ /// @return Client
+ ///
+ open func setLocale(value: String) -> Client {
+
+ self.addHeader(key: "X-Appwrite-Locale", value: value)
+ return self
+ }
+
+
+ ///
+ /// @param Bool status
+ /// @return Client
+ ///
+ open func setSelfSigned(status: Bool = true) -> Client {
+
+ self.selfSigned = status
+ return self
+ }
+
+ ///
+ /// @param String endpoint
+ /// @return Client
+ ///
+ open func setEndpoint(endpoint: String) -> Client {
+
+ self.endpoint = endpoint
+ return self
+ }
+
+ ///
+ /// @param String key
+ /// @param String value
+ ///
+ open func addHeader(key: String, value: String) -> Client {
+
+ self.headers[key.lowercased()] = value.lowercased()
+
+ return self
+ }
+
+ ///
+ open func httpBuildQuery(params: [String: Any], prefix: String = "") -> String {
+ var output: String = ""
+ for (key, value) in params {
+ let finalKey: String = prefix.isEmpty ? key : (prefix + "[" + key + "]")
+ if (value is AnyCollection) {
+ output += self.httpBuildQuery(params: value as! [String : Any], prefix: finalKey)
+ } else {
+ output += "\(value)"
+ }
+ output += "&"
+ }
+ return output
+ }
+
+ ///
+ /// Make an API call
+ ///
+ /// @param String method
+ /// @param String path
+ /// @param Array params
+ /// @param Array headers
+ /// @return Array|String
+ /// @throws Exception
+ ///
+ func call(method:String, path:String = "", headers:[String: String] = [:], params:[String: Any] = [:]) -> Any {
+
+ self.headers.merge(headers){(_, new) in new}
+ let targetURL:URL = URL(string: self.endpoint + path + (( method == HTTPMethod.get.rawValue && !params.isEmpty ) ? "?" + httpBuildQuery(params: params) : ""))!
+
+ var query: String = ""
+
+ var responseStatus: Int = HTTPStatus.unknown.rawValue
+ var responseType: String = ""
+ var responseBody: Any = ""
+
+ switch (self.headers["content-type"]) {
+ case "application/json":
+ do {
+ let json = try JSONSerialization.data(withJSONObject:params, options: [])
+ query = String( data: json, encoding: String.Encoding.utf8)!
+ } catch {
+ print("Failed to parse json: \(error.localizedDescription)")
+ }
+ break
+ default:
+ query = self.httpBuildQuery(params: params)
+ break
+ }
+
+ var request = URLRequest(url: targetURL)
+ let session = URLSession.shared
+
+ for (key, value) in self.headers {
+ request.setValue(value, forHTTPHeaderField: key)
+ }
+
+ request.httpMethod = method
+ if (method.uppercased() == "POST") {
+ request.httpBody = query.data(using: .utf8)
+ }
+
+ let semaphore = DispatchSemaphore(value: 0)
+
+ session.dataTask(with: request) { data, response, error in
+ if (error != nil) {
+ print(error!)
+ return
+ }
+ do {
+ let httpResponse = response as! HTTPURLResponse
+ responseStatus = httpResponse.statusCode
+
+ if (responseStatus == HTTPStatus.internalServerError.rawValue) {
+ print(responseStatus)
+ return
+ }
+
+ responseType = httpResponse.mimeType ?? ""
+
+ if (responseType == "application/json") {
+ let json = try JSONSerialization.jsonObject(with: data!, options: [])
+ responseBody = json
+ } else {
+ responseBody = String(data: data!, encoding: String.Encoding.utf8)!
+ }
+ } catch {
+ print(error)
+ }
+
+ semaphore.signal()
+ }.resume()
+
+ _ = semaphore.wait(wallTimeout: .distantFuture)
+
+ return responseBody
+ }
+
+}
+
+extension Client {
+
+ public enum HTTPStatus: Int {
+ case unknown = -1
+
+ case ok = 200
+ case created = 201
+ case accepted = 202
+
+ case movedPermanently = 301
+ case found = 302
+
+ case badRequest = 400
+ case notAuthorized = 401
+ case paymentRequired = 402
+ case forbidden = 403
+ case notFound = 404
+ case methodNotAllowed = 405
+ case notAcceptable = 406
+
+ case internalServerError = 500
+ case notImplemented = 501
+ }
+
+ public enum HTTPMethod: String {
+ case get
+
+ case post
+ case put
+ case patch
+
+ case delete
+
+ case head
+ case options
+ case connect
+ case trace
+ }
+
+
+}
diff --git a/app/sdks/client-swift/Sources/Appwrite/Service.swift b/app/sdks/client-swift/Sources/Appwrite/Service.swift
new file mode 100644
index 0000000000..b11a067a5d
--- /dev/null
+++ b/app/sdks/client-swift/Sources/Appwrite/Service.swift
@@ -0,0 +1,16 @@
+//
+// Service.swift
+//
+// Created by Armino
+// GitHub: https://github.com/armino-dev/sdk-generator
+//
+
+open class Service {
+
+ open var client: Client;
+
+ public init(client: Client)
+ {
+ self.client = client
+ }
+}
diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Account.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Account.swift
new file mode 100644
index 0000000000..0ffb74df52
--- /dev/null
+++ b/app/sdks/client-swift/Sources/Appwrite/Services/Account.swift
@@ -0,0 +1,491 @@
+
+
+class Account: Service
+{
+ /**
+ * Get Account
+ *
+ * Get currently logged in user data as JSON object.
+ *
+ * @throws Exception
+ * @return array
+ */
+
+ func get() -> Array {
+ let path: String = "/account"
+
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Create Account
+ *
+ * Use this endpoint to allow a new user to register a new account in your
+ * project. After the user registration completes successfully, you can use
+ * the [/account/verfication](/docs/client/account#createVerification) route
+ * to start verifying the user email address. To allow your new user to login
+ * to his new account, you need to create a new [account
+ * session](/docs/client/account#createSession).
+ *
+ * @param String _email
+ * @param String _password
+ * @param String _name
+ * @throws Exception
+ * @return array
+ */
+
+ func create(_email: String, _password: String, _name: String = "") -> Array {
+ let path: String = "/account"
+
+
+ var params: [String: Any] = [:]
+
+ params["email"] = _email
+ params["password"] = _password
+ params["name"] = _name
+
+ return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Delete Account
+ *
+ * Delete a currently logged in user account. Behind the scene, the user
+ * record is not deleted but permanently blocked from any access. This is done
+ * to avoid deleted accounts being overtaken by new users with the same email
+ * address. Any user-related resources like documents or storage files should
+ * be deleted separately.
+ *
+ * @throws Exception
+ * @return array
+ */
+
+ func delete() -> Array {
+ let path: String = "/account"
+
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Update Account Email
+ *
+ * Update currently logged in user account email address. After changing user
+ * address, user confirmation status is being reset and a new confirmation
+ * mail is sent. For security measures, user password is required to complete
+ * this request.
+ *
+ * @param String _email
+ * @param String _password
+ * @throws Exception
+ * @return array
+ */
+
+ func updateEmail(_email: String, _password: String) -> Array {
+ let path: String = "/account/email"
+
+
+ var params: [String: Any] = [:]
+
+ params["email"] = _email
+ params["password"] = _password
+
+ return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Get Account Logs
+ *
+ * Get currently logged in user list of latest security activity logs. Each
+ * log returns user IP address, location and date and time of log.
+ *
+ * @throws Exception
+ * @return array
+ */
+
+ func getLogs() -> Array {
+ let path: String = "/account/logs"
+
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Update Account Name
+ *
+ * Update currently logged in user account name.
+ *
+ * @param String _name
+ * @throws Exception
+ * @return array
+ */
+
+ func updateName(_name: String) -> Array {
+ let path: String = "/account/name"
+
+
+ var params: [String: Any] = [:]
+
+ params["name"] = _name
+
+ return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Update Account Password
+ *
+ * Update currently logged in user password. For validation, user is required
+ * to pass the password twice.
+ *
+ * @param String _password
+ * @param String _oldPassword
+ * @throws Exception
+ * @return array
+ */
+
+ func updatePassword(_password: String, _oldPassword: String) -> Array {
+ let path: String = "/account/password"
+
+
+ var params: [String: Any] = [:]
+
+ params["password"] = _password
+ params["oldPassword"] = _oldPassword
+
+ return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Get Account Preferences
+ *
+ * Get currently logged in user preferences as a key-value object.
+ *
+ * @throws Exception
+ * @return array
+ */
+
+ func getPrefs() -> Array {
+ let path: String = "/account/prefs"
+
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Update Account Preferences
+ *
+ * Update currently logged in user account preferences. You can pass only the
+ * specific settings you wish to update.
+ *
+ * @param object _prefs
+ * @throws Exception
+ * @return array
+ */
+
+ func updatePrefs(_prefs: object) -> Array {
+ let path: String = "/account/prefs"
+
+
+ var params: [String: Any] = [:]
+
+ params["prefs"] = _prefs
+
+ return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Create Password Recovery
+ *
+ * Sends the user an email with a temporary secret key for password reset.
+ * When the user clicks the confirmation link he is redirected back to your
+ * app password reset URL with the secret key and email address values
+ * attached to the URL query string. Use the query string params to submit a
+ * request to the [PUT /account/recovery](/docs/client/account#updateRecovery)
+ * endpoint to complete the process.
+ *
+ * @param String _email
+ * @param String _url
+ * @throws Exception
+ * @return array
+ */
+
+ func createRecovery(_email: String, _url: String) -> Array {
+ let path: String = "/account/recovery"
+
+
+ var params: [String: Any] = [:]
+
+ params["email"] = _email
+ params["url"] = _url
+
+ return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Complete Password Recovery
+ *
+ * Use this endpoint to complete the user account password reset. Both the
+ * **userId** and **secret** arguments will be passed as query parameters to
+ * the redirect URL you have provided when sending your request to the [POST
+ * /account/recovery](/docs/client/account#createRecovery) endpoint.
+ *
+ * Please note that in order to avoid a [Redirect
+ * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
+ * the only valid redirect URLs are the ones from domains you have set when
+ * adding your platforms in the console interface.
+ *
+ * @param String _userId
+ * @param String _secret
+ * @param String _password
+ * @param String _passwordAgain
+ * @throws Exception
+ * @return array
+ */
+
+ func updateRecovery(_userId: String, _secret: String, _password: String, _passwordAgain: String) -> Array {
+ let path: String = "/account/recovery"
+
+
+ var params: [String: Any] = [:]
+
+ params["userId"] = _userId
+ params["secret"] = _secret
+ params["password"] = _password
+ params["passwordAgain"] = _passwordAgain
+
+ return [self.client.call(method: Client.HTTPMethod.put.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Get Account Sessions
+ *
+ * Get currently logged in user list of active sessions across different
+ * devices.
+ *
+ * @throws Exception
+ * @return array
+ */
+
+ func getSessions() -> Array {
+ let path: String = "/account/sessions"
+
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Create Account Session
+ *
+ * Allow the user to login into his account by providing a valid email and
+ * password combination. This route will create a new session for the user.
+ *
+ * @param String _email
+ * @param String _password
+ * @throws Exception
+ * @return array
+ */
+
+ func createSession(_email: String, _password: String) -> Array {
+ let path: String = "/account/sessions"
+
+
+ var params: [String: Any] = [:]
+
+ params["email"] = _email
+ params["password"] = _password
+
+ return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Delete All Account Sessions
+ *
+ * Delete all sessions from the user account and remove any sessions cookies
+ * from the end client.
+ *
+ * @throws Exception
+ * @return array
+ */
+
+ func deleteSessions() -> Array {
+ let path: String = "/account/sessions"
+
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Create Account Session with OAuth2
+ *
+ * Allow the user to login to his account using the OAuth2 provider of his
+ * choice. Each OAuth2 provider should be enabled from the Appwrite console
+ * first. Use the success and failure arguments to provide a redirect URL's
+ * back to your app when login is completed.
+ *
+ * @param String _provider
+ * @param String _success
+ * @param String _failure
+ * @param Array _scopes
+ * @throws Exception
+ * @return array
+ */
+
+ func createOAuth2Session(_provider: String, _success: String = "https://appwrite.io/auth/oauth2/success", _failure: String = "https://appwrite.io/auth/oauth2/failure", _scopes: Array = []) -> Array {
+ var path: String = "/account/sessions/oauth2/{provider}"
+
+ path = path.replacingOccurrences(
+ of: "{provider}",
+ with: _provider
+ )
+
+ var params: [String: Any] = [:]
+
+ params["success"] = _success
+ params["failure"] = _failure
+ params["scopes"] = _scopes
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Delete Account Session
+ *
+ * Use this endpoint to log out the currently logged in user from all his
+ * account sessions across all his different devices. When using the option id
+ * argument, only the session unique ID provider will be deleted.
+ *
+ * @param String _sessionId
+ * @throws Exception
+ * @return array
+ */
+
+ func deleteSession(_sessionId: String) -> Array {
+ var path: String = "/account/sessions/{sessionId}"
+
+ path = path.replacingOccurrences(
+ of: "{sessionId}",
+ with: _sessionId
+ )
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Create Email Verification
+ *
+ * Use this endpoint to send a verification message to your user email address
+ * to confirm they are the valid owners of that address. Both the **userId**
+ * and **secret** arguments will be passed as query parameters to the URL you
+ * have provided to be attached to the verification email. The provided URL
+ * should redirect the user back to your app and allow you to complete the
+ * verification process by verifying both the **userId** and **secret**
+ * parameters. Learn more about how to [complete the verification
+ * process](/docs/client/account#updateAccountVerification).
+ *
+ * Please note that in order to avoid a [Redirect
+ * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
+ * the only valid redirect URLs are the ones from domains you have set when
+ * adding your platforms in the console interface.
+ *
+ *
+ * @param String _url
+ * @throws Exception
+ * @return array
+ */
+
+ func createVerification(_url: String) -> Array {
+ let path: String = "/account/verification"
+
+
+ var params: [String: Any] = [:]
+
+ params["url"] = _url
+
+ return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Complete Email Verification
+ *
+ * Use this endpoint to complete the user email verification process. Use both
+ * the **userId** and **secret** parameters that were attached to your app URL
+ * to verify the user email ownership. If confirmed this route will return a
+ * 200 status code.
+ *
+ * @param String _userId
+ * @param String _secret
+ * @throws Exception
+ * @return array
+ */
+
+ func updateVerification(_userId: String, _secret: String) -> Array {
+ let path: String = "/account/verification"
+
+
+ var params: [String: Any] = [:]
+
+ params["userId"] = _userId
+ params["secret"] = _secret
+
+ return [self.client.call(method: Client.HTTPMethod.put.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+}
diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Avatars.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Avatars.swift
new file mode 100644
index 0000000000..867841bafd
--- /dev/null
+++ b/app/sdks/client-swift/Sources/Appwrite/Services/Avatars.swift
@@ -0,0 +1,233 @@
+
+
+class Avatars: Service
+{
+ /**
+ * Get Browser Icon
+ *
+ * You can use this endpoint to show different browser icons to your users.
+ * The code argument receives the browser code as it appears in your user
+ * /account/sessions endpoint. Use width, height and quality arguments to
+ * change the output settings.
+ *
+ * @param String _code
+ * @param Int _width
+ * @param Int _height
+ * @param Int _quality
+ * @throws Exception
+ * @return array
+ */
+
+ func getBrowser(_code: String, _width: Int = 100, _height: Int = 100, _quality: Int = 100) -> Array {
+ var path: String = "/avatars/browsers/{code}"
+
+ path = path.replacingOccurrences(
+ of: "{code}",
+ with: _code
+ )
+
+ var params: [String: Any] = [:]
+
+ params["width"] = _width
+ params["height"] = _height
+ params["quality"] = _quality
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Get Credit Card Icon
+ *
+ * Need to display your users with your billing method or their payment
+ * methods? The credit card endpoint will return you the icon of the credit
+ * card provider you need. Use width, height and quality arguments to change
+ * the output settings.
+ *
+ * @param String _code
+ * @param Int _width
+ * @param Int _height
+ * @param Int _quality
+ * @throws Exception
+ * @return array
+ */
+
+ func getCreditCard(_code: String, _width: Int = 100, _height: Int = 100, _quality: Int = 100) -> Array {
+ var path: String = "/avatars/credit-cards/{code}"
+
+ path = path.replacingOccurrences(
+ of: "{code}",
+ with: _code
+ )
+
+ var params: [String: Any] = [:]
+
+ params["width"] = _width
+ params["height"] = _height
+ params["quality"] = _quality
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Get Favicon
+ *
+ * Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote
+ * website URL.
+ *
+ * @param String _url
+ * @throws Exception
+ * @return array
+ */
+
+ func getFavicon(_url: String) -> Array {
+ let path: String = "/avatars/favicon"
+
+
+ var params: [String: Any] = [:]
+
+ params["url"] = _url
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Get Country Flag
+ *
+ * You can use this endpoint to show different country flags icons to your
+ * users. The code argument receives the 2 letter country code. Use width,
+ * height and quality arguments to change the output settings.
+ *
+ * @param String _code
+ * @param Int _width
+ * @param Int _height
+ * @param Int _quality
+ * @throws Exception
+ * @return array
+ */
+
+ func getFlag(_code: String, _width: Int = 100, _height: Int = 100, _quality: Int = 100) -> Array {
+ var path: String = "/avatars/flags/{code}"
+
+ path = path.replacingOccurrences(
+ of: "{code}",
+ with: _code
+ )
+
+ var params: [String: Any] = [:]
+
+ params["width"] = _width
+ params["height"] = _height
+ params["quality"] = _quality
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Get Image from URL
+ *
+ * Use this endpoint to fetch a remote image URL and crop it to any image size
+ * you want. This endpoint is very useful if you need to crop and display
+ * remote images in your app or in case you want to make sure a 3rd party
+ * image is properly served using a TLS protocol.
+ *
+ * @param String _url
+ * @param Int _width
+ * @param Int _height
+ * @throws Exception
+ * @return array
+ */
+
+ func getImage(_url: String, _width: Int = 400, _height: Int = 400) -> Array {
+ let path: String = "/avatars/image"
+
+
+ var params: [String: Any] = [:]
+
+ params["url"] = _url
+ params["width"] = _width
+ params["height"] = _height
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Get User Initials
+ *
+ * Use this endpoint to show your user initials avatar icon on your website or
+ * app. By default, this route will try to print your logged-in user name or
+ * email initials. You can also overwrite the user name if you pass the 'name'
+ * parameter. If no name is given and no user is logged, an empty avatar will
+ * be returned.
+ *
+ * You can use the color and background params to change the avatar colors. By
+ * default, a random theme will be selected. The random theme will persist for
+ * the user's initials when reloading the same theme will always return for
+ * the same initials.
+ *
+ * @param String _name
+ * @param Int _width
+ * @param Int _height
+ * @param String _color
+ * @param String _background
+ * @throws Exception
+ * @return array
+ */
+
+ func getInitials(_name: String = "", _width: Int = 500, _height: Int = 500, _color: String = "", _background: String = "") -> Array {
+ let path: String = "/avatars/initials"
+
+
+ var params: [String: Any] = [:]
+
+ params["name"] = _name
+ params["width"] = _width
+ params["height"] = _height
+ params["color"] = _color
+ params["background"] = _background
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Get QR Code
+ *
+ * Converts a given plain text to a QR code image. You can use the query
+ * parameters to change the size and style of the resulting image.
+ *
+ * @param String _text
+ * @param Int _size
+ * @param Int _margin
+ * @param Bool _download
+ * @throws Exception
+ * @return array
+ */
+
+ func getQR(_text: String, _size: Int = 400, _margin: Int = 1, _download: Bool = false) -> Array {
+ let path: String = "/avatars/qr"
+
+
+ var params: [String: Any] = [:]
+
+ params["text"] = _text
+ params["size"] = _size
+ params["margin"] = _margin
+ params["download"] = _download
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+}
diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Database.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Database.swift
new file mode 100644
index 0000000000..8436985582
--- /dev/null
+++ b/app/sdks/client-swift/Sources/Appwrite/Services/Database.swift
@@ -0,0 +1,183 @@
+
+
+class Database: Service
+{
+ /**
+ * List Documents
+ *
+ * Get a list of all the user documents. You can use the query params to
+ * filter your results. On admin mode, this endpoint will return a list of all
+ * of the project documents. [Learn more about different API
+ * modes](/docs/admin).
+ *
+ * @param String _collectionId
+ * @param Array _filters
+ * @param Int _limit
+ * @param Int _offset
+ * @param String _orderField
+ * @param String _orderType
+ * @param String _orderCast
+ * @param String _search
+ * @throws Exception
+ * @return array
+ */
+
+ func listDocuments(_collectionId: String, _filters: Array = [], _limit: Int = 25, _offset: Int = 0, _orderField: String = "$id", _orderType: String = "ASC", _orderCast: String = "string", _search: String = "") -> Array {
+ var path: String = "/database/collections/{collectionId}/documents"
+
+ path = path.replacingOccurrences(
+ of: "{collectionId}",
+ with: _collectionId
+ )
+
+ var params: [String: Any] = [:]
+
+ params["filters"] = _filters
+ params["limit"] = _limit
+ params["offset"] = _offset
+ params["orderField"] = _orderField
+ params["orderType"] = _orderType
+ params["orderCast"] = _orderCast
+ params["search"] = _search
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Create Document
+ *
+ * Create a new Document. Before using this route, you should create a new
+ * collection resource using either a [server
+ * integration](/docs/server/database?sdk=nodejs#createCollection) API or
+ * directly from your database console.
+ *
+ * @param String _collectionId
+ * @param object _data
+ * @param Array _read
+ * @param Array _write
+ * @throws Exception
+ * @return array
+ */
+
+ func createDocument(_collectionId: String, _data: object, _read: Array, _write: Array) -> Array {
+ var path: String = "/database/collections/{collectionId}/documents"
+
+ path = path.replacingOccurrences(
+ of: "{collectionId}",
+ with: _collectionId
+ )
+
+ var params: [String: Any] = [:]
+
+ params["data"] = _data
+ params["read"] = _read
+ params["write"] = _write
+
+ return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Get Document
+ *
+ * Get document by its unique ID. This endpoint response returns a JSON object
+ * with the document data.
+ *
+ * @param String _collectionId
+ * @param String _documentId
+ * @throws Exception
+ * @return array
+ */
+
+ func getDocument(_collectionId: String, _documentId: String) -> Array {
+ var path: String = "/database/collections/{collectionId}/documents/{documentId}"
+
+ path = path.replacingOccurrences(
+ of: "{collectionId}",
+ with: _collectionId
+ )
+ path = path.replacingOccurrences(
+ of: "{documentId}",
+ with: _documentId
+ )
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Update Document
+ *
+ * @param String _collectionId
+ * @param String _documentId
+ * @param object _data
+ * @param Array _read
+ * @param Array _write
+ * @throws Exception
+ * @return array
+ */
+
+ func updateDocument(_collectionId: String, _documentId: String, _data: object, _read: Array, _write: Array) -> Array {
+ var path: String = "/database/collections/{collectionId}/documents/{documentId}"
+
+ path = path.replacingOccurrences(
+ of: "{collectionId}",
+ with: _collectionId
+ )
+ path = path.replacingOccurrences(
+ of: "{documentId}",
+ with: _documentId
+ )
+
+ var params: [String: Any] = [:]
+
+ params["data"] = _data
+ params["read"] = _read
+ params["write"] = _write
+
+ return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Delete Document
+ *
+ * Delete document by its unique ID. This endpoint deletes only the parent
+ * documents, his attributes and relations to other documents. Child documents
+ * **will not** be deleted.
+ *
+ * @param String _collectionId
+ * @param String _documentId
+ * @throws Exception
+ * @return array
+ */
+
+ func deleteDocument(_collectionId: String, _documentId: String) -> Array {
+ var path: String = "/database/collections/{collectionId}/documents/{documentId}"
+
+ path = path.replacingOccurrences(
+ of: "{collectionId}",
+ with: _collectionId
+ )
+ path = path.replacingOccurrences(
+ of: "{documentId}",
+ with: _documentId
+ )
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+}
diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Locale.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Locale.swift
new file mode 100644
index 0000000000..ef21554cbc
--- /dev/null
+++ b/app/sdks/client-swift/Sources/Appwrite/Services/Locale.swift
@@ -0,0 +1,164 @@
+
+
+class Locale: Service
+{
+ /**
+ * Get User Locale
+ *
+ * Get the current user location based on IP. Returns an object with user
+ * country code, country name, continent name, continent code, ip address and
+ * suggested currency. You can use the locale header to get the data in a
+ * supported language.
+ *
+ * ([IP Geolocation by DB-IP](https://db-ip.com))
+ *
+ * @throws Exception
+ * @return array
+ */
+
+ func get() -> Array {
+ let path: String = "/locale"
+
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * List Continents
+ *
+ * List of all continents. You can use the locale header to get the data in a
+ * supported language.
+ *
+ * @throws Exception
+ * @return array
+ */
+
+ func getContinents() -> Array {
+ let path: String = "/locale/continents"
+
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * List Countries
+ *
+ * List of all countries. You can use the locale header to get the data in a
+ * supported language.
+ *
+ * @throws Exception
+ * @return array
+ */
+
+ func getCountries() -> Array {
+ let path: String = "/locale/countries"
+
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * List EU Countries
+ *
+ * List of all countries that are currently members of the EU. You can use the
+ * locale header to get the data in a supported language.
+ *
+ * @throws Exception
+ * @return array
+ */
+
+ func getCountriesEU() -> Array {
+ let path: String = "/locale/countries/eu"
+
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * List Countries Phone Codes
+ *
+ * List of all countries phone codes. You can use the locale header to get the
+ * data in a supported language.
+ *
+ * @throws Exception
+ * @return array
+ */
+
+ func getCountriesPhones() -> Array {
+ let path: String = "/locale/countries/phones"
+
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * List Currencies
+ *
+ * List of all currencies, including currency symbol, name, plural, and
+ * decimal digits for all major and minor currencies. You can use the locale
+ * header to get the data in a supported language.
+ *
+ * @throws Exception
+ * @return array
+ */
+
+ func getCurrencies() -> Array {
+ let path: String = "/locale/currencies"
+
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * List Languages
+ *
+ * List of all languages classified by ISO 639-1 including 2-letter code, name
+ * in English, and name in the respective language.
+ *
+ * @throws Exception
+ * @return array
+ */
+
+ func getLanguages() -> Array {
+ let path: String = "/locale/languages"
+
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+}
diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Storage.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Storage.swift
new file mode 100644
index 0000000000..b6e98145f7
--- /dev/null
+++ b/app/sdks/client-swift/Sources/Appwrite/Services/Storage.swift
@@ -0,0 +1,246 @@
+
+
+class Storage: Service
+{
+ /**
+ * List Files
+ *
+ * Get a list of all the user files. You can use the query params to filter
+ * your results. On admin mode, this endpoint will return a list of all of the
+ * project files. [Learn more about different API modes](/docs/admin).
+ *
+ * @param String _search
+ * @param Int _limit
+ * @param Int _offset
+ * @param String _orderType
+ * @throws Exception
+ * @return array
+ */
+
+ func listFiles(_search: String = "", _limit: Int = 25, _offset: Int = 0, _orderType: String = "ASC") -> Array {
+ let path: String = "/storage/files"
+
+
+ var params: [String: Any] = [:]
+
+ params["search"] = _search
+ params["limit"] = _limit
+ params["offset"] = _offset
+ params["orderType"] = _orderType
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Create File
+ *
+ * Create a new file. The user who creates the file will automatically be
+ * assigned to read and write access unless he has passed custom values for
+ * read and write arguments.
+ *
+ * @param Array _file
+ * @param Array _read
+ * @param Array _write
+ * @throws Exception
+ * @return array
+ */
+
+ func createFile(_file: Array, _read: Array, _write: Array) -> Array {
+ let path: String = "/storage/files"
+
+
+ var params: [String: Any] = [:]
+
+ params["file"] = _file
+ params["read"] = _read
+ params["write"] = _write
+
+ return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [
+ "content-type": "multipart/form-data",
+ ], params: params)];
+ }
+
+ /**
+ * Get File
+ *
+ * Get file by its unique ID. This endpoint response returns a JSON object
+ * with the file metadata.
+ *
+ * @param String _fileId
+ * @throws Exception
+ * @return array
+ */
+
+ func getFile(_fileId: String) -> Array {
+ var path: String = "/storage/files/{fileId}"
+
+ path = path.replacingOccurrences(
+ of: "{fileId}",
+ with: _fileId
+ )
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Update File
+ *
+ * Update file by its unique ID. Only users with write permissions have access
+ * to update this resource.
+ *
+ * @param String _fileId
+ * @param Array _read
+ * @param Array _write
+ * @throws Exception
+ * @return array
+ */
+
+ func updateFile(_fileId: String, _read: Array, _write: Array) -> Array {
+ var path: String = "/storage/files/{fileId}"
+
+ path = path.replacingOccurrences(
+ of: "{fileId}",
+ with: _fileId
+ )
+
+ var params: [String: Any] = [:]
+
+ params["read"] = _read
+ params["write"] = _write
+
+ return [self.client.call(method: Client.HTTPMethod.put.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Delete File
+ *
+ * Delete a file by its unique ID. Only users with write permissions have
+ * access to delete this resource.
+ *
+ * @param String _fileId
+ * @throws Exception
+ * @return array
+ */
+
+ func deleteFile(_fileId: String) -> Array {
+ var path: String = "/storage/files/{fileId}"
+
+ path = path.replacingOccurrences(
+ of: "{fileId}",
+ with: _fileId
+ )
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Get File for Download
+ *
+ * Get file content by its unique ID. The endpoint response return with a
+ * 'Content-Disposition: attachment' header that tells the browser to start
+ * downloading the file to user downloads directory.
+ *
+ * @param String _fileId
+ * @throws Exception
+ * @return array
+ */
+
+ func getFileDownload(_fileId: String) -> Array {
+ var path: String = "/storage/files/{fileId}/download"
+
+ path = path.replacingOccurrences(
+ of: "{fileId}",
+ with: _fileId
+ )
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Get File Preview
+ *
+ * Get a file preview image. Currently, this method supports preview for image
+ * files (jpg, png, and gif), other supported formats, like pdf, docs, slides,
+ * and spreadsheets, will return the file icon image. You can also pass query
+ * string arguments for cutting and resizing your preview image.
+ *
+ * @param String _fileId
+ * @param Int _width
+ * @param Int _height
+ * @param Int _quality
+ * @param String _background
+ * @param String _output
+ * @throws Exception
+ * @return array
+ */
+
+ func getFilePreview(_fileId: String, _width: Int = 0, _height: Int = 0, _quality: Int = 100, _background: String = "", _output: String = "") -> Array {
+ var path: String = "/storage/files/{fileId}/preview"
+
+ path = path.replacingOccurrences(
+ of: "{fileId}",
+ with: _fileId
+ )
+
+ var params: [String: Any] = [:]
+
+ params["width"] = _width
+ params["height"] = _height
+ params["quality"] = _quality
+ params["background"] = _background
+ params["output"] = _output
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Get File for View
+ *
+ * Get file content by its unique ID. This endpoint is similar to the download
+ * method but returns with no 'Content-Disposition: attachment' header.
+ *
+ * @param String _fileId
+ * @param String _as
+ * @throws Exception
+ * @return array
+ */
+
+ func getFileView(_fileId: String, _as: String = "") -> Array {
+ var path: String = "/storage/files/{fileId}/view"
+
+ path = path.replacingOccurrences(
+ of: "{fileId}",
+ with: _fileId
+ )
+
+ var params: [String: Any] = [:]
+
+ params["as"] = _as
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+}
diff --git a/app/sdks/client-swift/Sources/Appwrite/Services/Teams.swift b/app/sdks/client-swift/Sources/Appwrite/Services/Teams.swift
new file mode 100644
index 0000000000..50bee60273
--- /dev/null
+++ b/app/sdks/client-swift/Sources/Appwrite/Services/Teams.swift
@@ -0,0 +1,298 @@
+
+
+class Teams: Service
+{
+ /**
+ * List Teams
+ *
+ * Get a list of all the current user teams. You can use the query params to
+ * filter your results. On admin mode, this endpoint will return a list of all
+ * of the project teams. [Learn more about different API modes](/docs/admin).
+ *
+ * @param String _search
+ * @param Int _limit
+ * @param Int _offset
+ * @param String _orderType
+ * @throws Exception
+ * @return array
+ */
+
+ func list(_search: String = "", _limit: Int = 25, _offset: Int = 0, _orderType: String = "ASC") -> Array {
+ let path: String = "/teams"
+
+
+ var params: [String: Any] = [:]
+
+ params["search"] = _search
+ params["limit"] = _limit
+ params["offset"] = _offset
+ params["orderType"] = _orderType
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Create Team
+ *
+ * Create a new team. The user who creates the team will automatically be
+ * assigned as the owner of the team. The team owner can invite new members,
+ * who will be able add new owners and update or delete the team from your
+ * project.
+ *
+ * @param String _name
+ * @param Array _roles
+ * @throws Exception
+ * @return array
+ */
+
+ func create(_name: String, _roles: Array = ["owner"]) -> Array {
+ let path: String = "/teams"
+
+
+ var params: [String: Any] = [:]
+
+ params["name"] = _name
+ params["roles"] = _roles
+
+ return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Get Team
+ *
+ * Get team by its unique ID. All team members have read access for this
+ * resource.
+ *
+ * @param String _teamId
+ * @throws Exception
+ * @return array
+ */
+
+ func get(_teamId: String) -> Array {
+ var path: String = "/teams/{teamId}"
+
+ path = path.replacingOccurrences(
+ of: "{teamId}",
+ with: _teamId
+ )
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Update Team
+ *
+ * Update team by its unique ID. Only team owners have write access for this
+ * resource.
+ *
+ * @param String _teamId
+ * @param String _name
+ * @throws Exception
+ * @return array
+ */
+
+ func update(_teamId: String, _name: String) -> Array {
+ var path: String = "/teams/{teamId}"
+
+ path = path.replacingOccurrences(
+ of: "{teamId}",
+ with: _teamId
+ )
+
+ var params: [String: Any] = [:]
+
+ params["name"] = _name
+
+ return [self.client.call(method: Client.HTTPMethod.put.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Delete Team
+ *
+ * Delete team by its unique ID. Only team owners have write access for this
+ * resource.
+ *
+ * @param String _teamId
+ * @throws Exception
+ * @return array
+ */
+
+ func delete(_teamId: String) -> Array {
+ var path: String = "/teams/{teamId}"
+
+ path = path.replacingOccurrences(
+ of: "{teamId}",
+ with: _teamId
+ )
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Get Team Memberships
+ *
+ * Get team members by the team unique ID. All team members have read access
+ * for this list of resources.
+ *
+ * @param String _teamId
+ * @param String _search
+ * @param Int _limit
+ * @param Int _offset
+ * @param String _orderType
+ * @throws Exception
+ * @return array
+ */
+
+ func getMemberships(_teamId: String, _search: String = "", _limit: Int = 25, _offset: Int = 0, _orderType: String = "ASC") -> Array {
+ var path: String = "/teams/{teamId}/memberships"
+
+ path = path.replacingOccurrences(
+ of: "{teamId}",
+ with: _teamId
+ )
+
+ var params: [String: Any] = [:]
+
+ params["search"] = _search
+ params["limit"] = _limit
+ params["offset"] = _offset
+ params["orderType"] = _orderType
+
+ return [self.client.call(method: Client.HTTPMethod.get.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Create Team Membership
+ *
+ * Use this endpoint to invite a new member to join your team. An email with a
+ * link to join the team will be sent to the new member email address if the
+ * member doesn't exist in the project it will be created automatically.
+ *
+ * Use the 'URL' parameter to redirect the user from the invitation email back
+ * to your app. When the user is redirected, use the [Update Team Membership
+ * Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the
+ * user to accept the invitation to the team.
+ *
+ * Please note that in order to avoid a [Redirect
+ * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
+ * the only valid redirect URL's are the once from domains you have set when
+ * added your platforms in the console interface.
+ *
+ * @param String _teamId
+ * @param String _email
+ * @param Array _roles
+ * @param String _url
+ * @param String _name
+ * @throws Exception
+ * @return array
+ */
+
+ func createMembership(_teamId: String, _email: String, _roles: Array, _url: String, _name: String = "") -> Array {
+ var path: String = "/teams/{teamId}/memberships"
+
+ path = path.replacingOccurrences(
+ of: "{teamId}",
+ with: _teamId
+ )
+
+ var params: [String: Any] = [:]
+
+ params["email"] = _email
+ params["name"] = _name
+ params["roles"] = _roles
+ params["url"] = _url
+
+ return [self.client.call(method: Client.HTTPMethod.post.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Delete Team Membership
+ *
+ * This endpoint allows a user to leave a team or for a team owner to delete
+ * the membership of any other team member. You can also use this endpoint to
+ * delete a user membership even if he didn't accept it.
+ *
+ * @param String _teamId
+ * @param String _inviteId
+ * @throws Exception
+ * @return array
+ */
+
+ func deleteMembership(_teamId: String, _inviteId: String) -> Array {
+ var path: String = "/teams/{teamId}/memberships/{inviteId}"
+
+ path = path.replacingOccurrences(
+ of: "{teamId}",
+ with: _teamId
+ )
+ path = path.replacingOccurrences(
+ of: "{inviteId}",
+ with: _inviteId
+ )
+
+ let params: [String: Any] = [:]
+
+
+ return [self.client.call(method: Client.HTTPMethod.delete.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+ /**
+ * Update Team Membership Status
+ *
+ * Use this endpoint to allow a user to accept an invitation to join a team
+ * after he is being redirected back to your app from the invitation email he
+ * was sent.
+ *
+ * @param String _teamId
+ * @param String _inviteId
+ * @param String _userId
+ * @param String _secret
+ * @throws Exception
+ * @return array
+ */
+
+ func updateMembershipStatus(_teamId: String, _inviteId: String, _userId: String, _secret: String) -> Array {
+ var path: String = "/teams/{teamId}/memberships/{inviteId}/status"
+
+ path = path.replacingOccurrences(
+ of: "{teamId}",
+ with: _teamId
+ )
+ path = path.replacingOccurrences(
+ of: "{inviteId}",
+ with: _inviteId
+ )
+
+ var params: [String: Any] = [:]
+
+ params["userId"] = _userId
+ params["secret"] = _secret
+
+ return [self.client.call(method: Client.HTTPMethod.patch.rawValue, path: path, headers: [
+ "content-type": "application/json",
+ ], params: params)];
+ }
+
+}
diff --git a/app/sdks/client-swift/docs/account.md b/app/sdks/client-swift/docs/account.md
new file mode 100644
index 0000000000..48bc91d213
--- /dev/null
+++ b/app/sdks/client-swift/docs/account.md
@@ -0,0 +1,240 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+# Account Service
+
+## Get Account
+
+```http request
+GET https://appwrite.io/v1/account
+```
+
+** Get currently logged in user data as JSON object. **
+
+## Create Account
+
+```http request
+POST https://appwrite.io/v1/account
+```
+
+** Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](/docs/client/account#createVerification) route to start verifying the user email address. To allow your new user to login to his new account, you need to create a new [account session](/docs/client/account#createSession). **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| email | string | User email. | |
+| password | string | User password. Must be between 6 to 32 chars. | |
+| name | string | User name. | |
+
+## Delete Account
+
+```http request
+DELETE https://appwrite.io/v1/account
+```
+
+** Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately. **
+
+## Update Account Email
+
+```http request
+PATCH https://appwrite.io/v1/account/email
+```
+
+** Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| email | string | User email. | |
+| password | string | User password. Must be between 6 to 32 chars. | |
+
+## Get Account Logs
+
+```http request
+GET https://appwrite.io/v1/account/logs
+```
+
+** Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log. **
+
+## Update Account Name
+
+```http request
+PATCH https://appwrite.io/v1/account/name
+```
+
+** Update currently logged in user account name. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| name | string | User name. | |
+
+## Update Account Password
+
+```http request
+PATCH https://appwrite.io/v1/account/password
+```
+
+** Update currently logged in user password. For validation, user is required to pass the password twice. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| password | string | New user password. Must be between 6 to 32 chars. | |
+| oldPassword | string | Old user password. Must be between 6 to 32 chars. | |
+
+## Get Account Preferences
+
+```http request
+GET https://appwrite.io/v1/account/prefs
+```
+
+** Get currently logged in user preferences as a key-value object. **
+
+## Update Account Preferences
+
+```http request
+PATCH https://appwrite.io/v1/account/prefs
+```
+
+** Update currently logged in user account preferences. You can pass only the specific settings you wish to update. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| prefs | object | Prefs key-value JSON object. | |
+
+## Create Password Recovery
+
+```http request
+POST https://appwrite.io/v1/account/recovery
+```
+
+** Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](/docs/client/account#updateRecovery) endpoint to complete the process. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| email | string | User email. | |
+| url | string | URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | |
+
+## Complete Password Recovery
+
+```http request
+PUT https://appwrite.io/v1/account/recovery
+```
+
+** Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](/docs/client/account#createRecovery) endpoint.
+
+Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| userId | string | User account UID address. | |
+| secret | string | Valid reset token. | |
+| password | string | New password. Must be between 6 to 32 chars. | |
+| passwordAgain | string | New password again. Must be between 6 to 32 chars. | |
+
+## Get Account Sessions
+
+```http request
+GET https://appwrite.io/v1/account/sessions
+```
+
+** Get currently logged in user list of active sessions across different devices. **
+
+## Create Account Session
+
+```http request
+POST https://appwrite.io/v1/account/sessions
+```
+
+** Allow the user to login into his account by providing a valid email and password combination. This route will create a new session for the user. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| email | string | User email. | |
+| password | string | User password. Must be between 6 to 32 chars. | |
+
+## Delete All Account Sessions
+
+```http request
+DELETE https://appwrite.io/v1/account/sessions
+```
+
+** Delete all sessions from the user account and remove any sessions cookies from the end client. **
+
+## Create Account Session with OAuth2
+
+```http request
+GET https://appwrite.io/v1/account/sessions/oauth2/{provider}
+```
+
+** Allow the user to login to his account using the OAuth2 provider of his choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| provider | string | **Required** OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, twitch, vk, yahoo, yandex. | |
+| success | string | URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | https://appwrite.io/auth/oauth2/success |
+| failure | string | URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | https://appwrite.io/auth/oauth2/failure |
+| scopes | array | A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. | [] |
+
+## Delete Account Session
+
+```http request
+DELETE https://appwrite.io/v1/account/sessions/{sessionId}
+```
+
+** Use this endpoint to log out the currently logged in user from all his account sessions across all his different devices. When using the option id argument, only the session unique ID provider will be deleted. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| sessionId | string | **Required** Session unique ID. Use the string 'current' to delete the current device session. | |
+
+## Create Email Verification
+
+```http request
+POST https://appwrite.io/v1/account/verification
+```
+
+** Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](/docs/client/account#updateAccountVerification).
+
+Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
+ **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| url | string | URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | |
+
+## Complete Email Verification
+
+```http request
+PUT https://appwrite.io/v1/account/verification
+```
+
+** Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| userId | string | User unique ID. | |
+| secret | string | Valid verification token. | |
+
diff --git a/app/sdks/client-swift/docs/avatars.md b/app/sdks/client-swift/docs/avatars.md
new file mode 100644
index 0000000000..1e17a8e14a
--- /dev/null
+++ b/app/sdks/client-swift/docs/avatars.md
@@ -0,0 +1,124 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+# Avatars Service
+
+## Get Browser Icon
+
+```http request
+GET https://appwrite.io/v1/avatars/browsers/{code}
+```
+
+** You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user /account/sessions endpoint. Use width, height and quality arguments to change the output settings. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| code | string | **Required** Browser Code. | |
+| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 |
+| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 |
+| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 |
+
+## Get Credit Card Icon
+
+```http request
+GET https://appwrite.io/v1/avatars/credit-cards/{code}
+```
+
+** Need to display your users with your billing method or their payment methods? The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| code | string | **Required** Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa. | |
+| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 |
+| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 |
+| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 |
+
+## Get Favicon
+
+```http request
+GET https://appwrite.io/v1/avatars/favicon
+```
+
+** Use this endpoint to fetch the favorite icon (AKA favicon) of a any remote website URL. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| url | string | **Required** Website URL which you want to fetch the favicon from. | |
+
+## Get Country Flag
+
+```http request
+GET https://appwrite.io/v1/avatars/flags/{code}
+```
+
+** You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| code | string | **Required** Country Code. ISO Alpha-2 country code format. | |
+| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 100 |
+| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 100 |
+| quality | integer | Image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 |
+
+## Get Image from URL
+
+```http request
+GET https://appwrite.io/v1/avatars/image
+```
+
+** Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| url | string | **Required** Image URL which you want to crop. | |
+| width | integer | Resize preview image width, Pass an integer between 0 to 2000. | 400 |
+| height | integer | Resize preview image height, Pass an integer between 0 to 2000. | 400 |
+
+## Get User Initials
+
+```http request
+GET https://appwrite.io/v1/avatars/initials
+```
+
+** Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
+
+You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| name | string | Full Name. When empty, current user name or email will be used. | |
+| width | integer | Image width. Pass an integer between 0 to 2000. Defaults to 100. | 500 |
+| height | integer | Image height. Pass an integer between 0 to 2000. Defaults to 100. | 500 |
+| color | string | Changes text color. By default a random color will be picked and stay will persistent to the given name. | |
+| background | string | Changes background color. By default a random color will be picked and stay will persistent to the given name. | |
+
+## Get QR Code
+
+```http request
+GET https://appwrite.io/v1/avatars/qr
+```
+
+** Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| text | string | **Required** Plain text to be converted to QR code image. | |
+| size | integer | QR code size. Pass an integer between 0 to 1000. Defaults to 400. | 400 |
+| margin | integer | Margin from edge. Pass an integer between 0 to 10. Defaults to 1. | 1 |
+| download | boolean | Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0. | |
+
diff --git a/app/sdks/client-swift/docs/database.md b/app/sdks/client-swift/docs/database.md
new file mode 100644
index 0000000000..d734cb3c1c
--- /dev/null
+++ b/app/sdks/client-swift/docs/database.md
@@ -0,0 +1,90 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+# Database Service
+
+## List Documents
+
+```http request
+GET https://appwrite.io/v1/database/collections/{collectionId}/documents
+```
+
+** Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project documents. [Learn more about different API modes](/docs/admin). **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | |
+| filters | array | Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'. | [] |
+| limit | integer | Maximum number of documents to return in response. Use this value to manage pagination. | 25 |
+| offset | integer | Offset value. Use this value to manage pagination. | 0 |
+| orderField | string | Document field that results will be sorted by. | $id |
+| orderType | string | Order direction. Possible values are DESC for descending order, or ASC for ascending order. | ASC |
+| orderCast | string | Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string. | string |
+| search | string | Search query. Enter any free text search. The database will try to find a match against all document attributes and children. | |
+
+## Create Document
+
+```http request
+POST https://appwrite.io/v1/database/collections/{collectionId}/documents
+```
+
+** Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](/docs/server/database?sdk=nodejs#createCollection) API or directly from your database console. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | |
+| data | object | Document data as JSON object. | |
+| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
+| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
+
+## Get Document
+
+```http request
+GET https://appwrite.io/v1/database/collections/{collectionId}/documents/{documentId}
+```
+
+** Get document by its unique ID. This endpoint response returns a JSON object with the document data. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | |
+| documentId | string | **Required** Document unique ID. | |
+
+## Update Document
+
+```http request
+PATCH https://appwrite.io/v1/database/collections/{collectionId}/documents/{documentId}
+```
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | |
+| documentId | string | **Required** Document unique ID. | |
+| data | object | Document data as JSON object. | |
+| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
+| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
+
+## Delete Document
+
+```http request
+DELETE https://appwrite.io/v1/database/collections/{collectionId}/documents/{documentId}
+```
+
+** Delete document by its unique ID. This endpoint deletes only the parent documents, his attributes and relations to other documents. Child documents **will not** be deleted. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| collectionId | string | **Required** Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection). | |
+| documentId | string | **Required** Document unique ID. | |
+
diff --git a/app/sdks/client-swift/docs/examples/account/create-o-auth2session.md b/app/sdks/client-swift/docs/examples/account/create-o-auth2session.md
new file mode 100644
index 0000000000..0b67257890
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/create-o-auth2session.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.createOAuth2Session(_provider: "amazon");
diff --git a/app/sdks/client-swift/docs/examples/account/create-recovery.md b/app/sdks/client-swift/docs/examples/account/create-recovery.md
new file mode 100644
index 0000000000..04fdcae541
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/create-recovery.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.createRecovery(_email: "email@example.com", _url: "https://example.com");
diff --git a/app/sdks/client-swift/docs/examples/account/create-session.md b/app/sdks/client-swift/docs/examples/account/create-session.md
new file mode 100644
index 0000000000..477b20199c
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/create-session.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.createSession(_email: "email@example.com", _password: "password");
diff --git a/app/sdks/client-swift/docs/examples/account/create-verification.md b/app/sdks/client-swift/docs/examples/account/create-verification.md
new file mode 100644
index 0000000000..b0f8d6444e
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/create-verification.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.createVerification(_url: "https://example.com");
diff --git a/app/sdks/client-swift/docs/examples/account/create.md b/app/sdks/client-swift/docs/examples/account/create.md
new file mode 100644
index 0000000000..176b192c5e
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/create.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.create(_email: "email@example.com", _password: "password");
diff --git a/app/sdks/client-swift/docs/examples/account/delete-session.md b/app/sdks/client-swift/docs/examples/account/delete-session.md
new file mode 100644
index 0000000000..6f2373dc79
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/delete-session.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.deleteSession(_sessionId: "[SESSION_ID]");
diff --git a/app/sdks/client-swift/docs/examples/account/delete-sessions.md b/app/sdks/client-swift/docs/examples/account/delete-sessions.md
new file mode 100644
index 0000000000..6df71814c6
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/delete-sessions.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.deleteSessions();
diff --git a/app/sdks/client-swift/docs/examples/account/delete.md b/app/sdks/client-swift/docs/examples/account/delete.md
new file mode 100644
index 0000000000..f4123b0197
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/delete.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.delete();
diff --git a/app/sdks/client-swift/docs/examples/account/get-logs.md b/app/sdks/client-swift/docs/examples/account/get-logs.md
new file mode 100644
index 0000000000..8d3d965723
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/get-logs.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.getLogs();
diff --git a/app/sdks/client-swift/docs/examples/account/get-prefs.md b/app/sdks/client-swift/docs/examples/account/get-prefs.md
new file mode 100644
index 0000000000..e9746ab34b
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/get-prefs.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.getPrefs();
diff --git a/app/sdks/client-swift/docs/examples/account/get-sessions.md b/app/sdks/client-swift/docs/examples/account/get-sessions.md
new file mode 100644
index 0000000000..988e91c8e5
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/get-sessions.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.getSessions();
diff --git a/app/sdks/client-swift/docs/examples/account/get.md b/app/sdks/client-swift/docs/examples/account/get.md
new file mode 100644
index 0000000000..b84096bdb8
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/get.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.get();
diff --git a/app/sdks/client-swift/docs/examples/account/update-email.md b/app/sdks/client-swift/docs/examples/account/update-email.md
new file mode 100644
index 0000000000..cec700b330
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/update-email.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.updateEmail(_email: "email@example.com", _password: "password");
diff --git a/app/sdks/client-swift/docs/examples/account/update-name.md b/app/sdks/client-swift/docs/examples/account/update-name.md
new file mode 100644
index 0000000000..dbc6f7d2b8
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/update-name.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.updateName(_name: "[NAME]");
diff --git a/app/sdks/client-swift/docs/examples/account/update-password.md b/app/sdks/client-swift/docs/examples/account/update-password.md
new file mode 100644
index 0000000000..1346102a32
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/update-password.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.updatePassword(_password: "password", _oldPassword: "password");
diff --git a/app/sdks/client-swift/docs/examples/account/update-prefs.md b/app/sdks/client-swift/docs/examples/account/update-prefs.md
new file mode 100644
index 0000000000..fea1a8d6ff
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/update-prefs.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.updatePrefs(_prefs: );
diff --git a/app/sdks/client-swift/docs/examples/account/update-recovery.md b/app/sdks/client-swift/docs/examples/account/update-recovery.md
new file mode 100644
index 0000000000..6009d62e2c
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/update-recovery.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.updateRecovery(_userId: "[USER_ID]", _secret: "[SECRET]", _password: "password", _passwordAgain: "password");
diff --git a/app/sdks/client-swift/docs/examples/account/update-verification.md b/app/sdks/client-swift/docs/examples/account/update-verification.md
new file mode 100644
index 0000000000..376a87a9c3
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/account/update-verification.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var account: Account = Account(client: client);
+
+var result = account.updateVerification(_userId: "[USER_ID]", _secret: "[SECRET]");
diff --git a/app/sdks/client-swift/docs/examples/avatars/get-browser.md b/app/sdks/client-swift/docs/examples/avatars/get-browser.md
new file mode 100644
index 0000000000..874ef96d31
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/avatars/get-browser.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var avatars: Avatars = Avatars(client: client);
+
+var result = avatars.getBrowser(_code: "aa");
diff --git a/app/sdks/client-swift/docs/examples/avatars/get-credit-card.md b/app/sdks/client-swift/docs/examples/avatars/get-credit-card.md
new file mode 100644
index 0000000000..797431f3dc
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/avatars/get-credit-card.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var avatars: Avatars = Avatars(client: client);
+
+var result = avatars.getCreditCard(_code: "amex");
diff --git a/app/sdks/client-swift/docs/examples/avatars/get-favicon.md b/app/sdks/client-swift/docs/examples/avatars/get-favicon.md
new file mode 100644
index 0000000000..5623468481
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/avatars/get-favicon.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var avatars: Avatars = Avatars(client: client);
+
+var result = avatars.getFavicon(_url: "https://example.com");
diff --git a/app/sdks/client-swift/docs/examples/avatars/get-flag.md b/app/sdks/client-swift/docs/examples/avatars/get-flag.md
new file mode 100644
index 0000000000..fba93ae4d4
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/avatars/get-flag.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var avatars: Avatars = Avatars(client: client);
+
+var result = avatars.getFlag(_code: "af");
diff --git a/app/sdks/client-swift/docs/examples/avatars/get-image.md b/app/sdks/client-swift/docs/examples/avatars/get-image.md
new file mode 100644
index 0000000000..4ebe561b3b
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/avatars/get-image.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var avatars: Avatars = Avatars(client: client);
+
+var result = avatars.getImage(_url: "https://example.com");
diff --git a/app/sdks/client-swift/docs/examples/avatars/get-initials.md b/app/sdks/client-swift/docs/examples/avatars/get-initials.md
new file mode 100644
index 0000000000..d317cfc5a8
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/avatars/get-initials.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var avatars: Avatars = Avatars(client: client);
+
+var result = avatars.getInitials();
diff --git a/app/sdks/client-swift/docs/examples/avatars/get-q-r.md b/app/sdks/client-swift/docs/examples/avatars/get-q-r.md
new file mode 100644
index 0000000000..737acfc258
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/avatars/get-q-r.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var avatars: Avatars = Avatars(client: client);
+
+var result = avatars.getQR(_text: "[TEXT]");
diff --git a/app/sdks/client-swift/docs/examples/database/create-document.md b/app/sdks/client-swift/docs/examples/database/create-document.md
new file mode 100644
index 0000000000..ebd59adc47
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/database/create-document.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var database: Database = Database(client: client);
+
+var result = database.createDocument(_collectionId: "[COLLECTION_ID]", _data: , _read: [], _write: []);
diff --git a/app/sdks/client-swift/docs/examples/database/delete-document.md b/app/sdks/client-swift/docs/examples/database/delete-document.md
new file mode 100644
index 0000000000..faec2ceee9
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/database/delete-document.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var database: Database = Database(client: client);
+
+var result = database.deleteDocument(_collectionId: "[COLLECTION_ID]", _documentId: "[DOCUMENT_ID]");
diff --git a/app/sdks/client-swift/docs/examples/database/get-document.md b/app/sdks/client-swift/docs/examples/database/get-document.md
new file mode 100644
index 0000000000..0f3a05bfa5
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/database/get-document.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var database: Database = Database(client: client);
+
+var result = database.getDocument(_collectionId: "[COLLECTION_ID]", _documentId: "[DOCUMENT_ID]");
diff --git a/app/sdks/client-swift/docs/examples/database/list-documents.md b/app/sdks/client-swift/docs/examples/database/list-documents.md
new file mode 100644
index 0000000000..2c9f4a2efa
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/database/list-documents.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var database: Database = Database(client: client);
+
+var result = database.listDocuments(_collectionId: "[COLLECTION_ID]");
diff --git a/app/sdks/client-swift/docs/examples/database/update-document.md b/app/sdks/client-swift/docs/examples/database/update-document.md
new file mode 100644
index 0000000000..bddaf61111
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/database/update-document.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var database: Database = Database(client: client);
+
+var result = database.updateDocument(_collectionId: "[COLLECTION_ID]", _documentId: "[DOCUMENT_ID]", _data: , _read: [], _write: []);
diff --git a/app/sdks/client-swift/docs/examples/locale/get-continents.md b/app/sdks/client-swift/docs/examples/locale/get-continents.md
new file mode 100644
index 0000000000..3f57d5eb0d
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/locale/get-continents.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var locale: Locale = Locale(client: client);
+
+var result = locale.getContinents();
diff --git a/app/sdks/client-swift/docs/examples/locale/get-countries-e-u.md b/app/sdks/client-swift/docs/examples/locale/get-countries-e-u.md
new file mode 100644
index 0000000000..9f2a26213c
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/locale/get-countries-e-u.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var locale: Locale = Locale(client: client);
+
+var result = locale.getCountriesEU();
diff --git a/app/sdks/client-swift/docs/examples/locale/get-countries-phones.md b/app/sdks/client-swift/docs/examples/locale/get-countries-phones.md
new file mode 100644
index 0000000000..2cc9c4a9a0
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/locale/get-countries-phones.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var locale: Locale = Locale(client: client);
+
+var result = locale.getCountriesPhones();
diff --git a/app/sdks/client-swift/docs/examples/locale/get-countries.md b/app/sdks/client-swift/docs/examples/locale/get-countries.md
new file mode 100644
index 0000000000..df52194af1
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/locale/get-countries.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var locale: Locale = Locale(client: client);
+
+var result = locale.getCountries();
diff --git a/app/sdks/client-swift/docs/examples/locale/get-currencies.md b/app/sdks/client-swift/docs/examples/locale/get-currencies.md
new file mode 100644
index 0000000000..cf5f403eba
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/locale/get-currencies.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var locale: Locale = Locale(client: client);
+
+var result = locale.getCurrencies();
diff --git a/app/sdks/client-swift/docs/examples/locale/get-languages.md b/app/sdks/client-swift/docs/examples/locale/get-languages.md
new file mode 100644
index 0000000000..e8296dd7ca
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/locale/get-languages.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var locale: Locale = Locale(client: client);
+
+var result = locale.getLanguages();
diff --git a/app/sdks/client-swift/docs/examples/locale/get.md b/app/sdks/client-swift/docs/examples/locale/get.md
new file mode 100644
index 0000000000..5685e89440
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/locale/get.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var locale: Locale = Locale(client: client);
+
+var result = locale.get();
diff --git a/app/sdks/client-swift/docs/examples/storage/create-file.md b/app/sdks/client-swift/docs/examples/storage/create-file.md
new file mode 100644
index 0000000000..b4e15a4ec1
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/storage/create-file.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var storage: Storage = Storage(client: client);
+
+var result = storage.createFile(_file: nil, _read: [], _write: []);
diff --git a/app/sdks/client-swift/docs/examples/storage/delete-file.md b/app/sdks/client-swift/docs/examples/storage/delete-file.md
new file mode 100644
index 0000000000..83152d9194
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/storage/delete-file.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var storage: Storage = Storage(client: client);
+
+var result = storage.deleteFile(_fileId: "[FILE_ID]");
diff --git a/app/sdks/client-swift/docs/examples/storage/get-file-download.md b/app/sdks/client-swift/docs/examples/storage/get-file-download.md
new file mode 100644
index 0000000000..023f1a2243
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/storage/get-file-download.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var storage: Storage = Storage(client: client);
+
+var result = storage.getFileDownload(_fileId: "[FILE_ID]");
diff --git a/app/sdks/client-swift/docs/examples/storage/get-file-preview.md b/app/sdks/client-swift/docs/examples/storage/get-file-preview.md
new file mode 100644
index 0000000000..faaacd8e8c
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/storage/get-file-preview.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var storage: Storage = Storage(client: client);
+
+var result = storage.getFilePreview(_fileId: "[FILE_ID]");
diff --git a/app/sdks/client-swift/docs/examples/storage/get-file-view.md b/app/sdks/client-swift/docs/examples/storage/get-file-view.md
new file mode 100644
index 0000000000..d480377b06
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/storage/get-file-view.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var storage: Storage = Storage(client: client);
+
+var result = storage.getFileView(_fileId: "[FILE_ID]");
diff --git a/app/sdks/client-swift/docs/examples/storage/get-file.md b/app/sdks/client-swift/docs/examples/storage/get-file.md
new file mode 100644
index 0000000000..15bf5f7241
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/storage/get-file.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var storage: Storage = Storage(client: client);
+
+var result = storage.getFile(_fileId: "[FILE_ID]");
diff --git a/app/sdks/client-swift/docs/examples/storage/list-files.md b/app/sdks/client-swift/docs/examples/storage/list-files.md
new file mode 100644
index 0000000000..bfce4293e5
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/storage/list-files.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var storage: Storage = Storage(client: client);
+
+var result = storage.listFiles();
diff --git a/app/sdks/client-swift/docs/examples/storage/update-file.md b/app/sdks/client-swift/docs/examples/storage/update-file.md
new file mode 100644
index 0000000000..6a14e47773
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/storage/update-file.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var storage: Storage = Storage(client: client);
+
+var result = storage.updateFile(_fileId: "[FILE_ID]", _read: [], _write: []);
diff --git a/app/sdks/client-swift/docs/examples/teams/create-membership.md b/app/sdks/client-swift/docs/examples/teams/create-membership.md
new file mode 100644
index 0000000000..4af13ae6ee
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/teams/create-membership.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var teams: Teams = Teams(client: client);
+
+var result = teams.createMembership(_teamId: "[TEAM_ID]", _email: "email@example.com", _roles: [], _url: "https://example.com");
diff --git a/app/sdks/client-swift/docs/examples/teams/create.md b/app/sdks/client-swift/docs/examples/teams/create.md
new file mode 100644
index 0000000000..a5cf829019
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/teams/create.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var teams: Teams = Teams(client: client);
+
+var result = teams.create(_name: "[NAME]");
diff --git a/app/sdks/client-swift/docs/examples/teams/delete-membership.md b/app/sdks/client-swift/docs/examples/teams/delete-membership.md
new file mode 100644
index 0000000000..19bf8b2f7d
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/teams/delete-membership.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var teams: Teams = Teams(client: client);
+
+var result = teams.deleteMembership(_teamId: "[TEAM_ID]", _inviteId: "[INVITE_ID]");
diff --git a/app/sdks/client-swift/docs/examples/teams/delete.md b/app/sdks/client-swift/docs/examples/teams/delete.md
new file mode 100644
index 0000000000..50cc25892b
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/teams/delete.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var teams: Teams = Teams(client: client);
+
+var result = teams.delete(_teamId: "[TEAM_ID]");
diff --git a/app/sdks/client-swift/docs/examples/teams/get-memberships.md b/app/sdks/client-swift/docs/examples/teams/get-memberships.md
new file mode 100644
index 0000000000..089ea8f717
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/teams/get-memberships.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var teams: Teams = Teams(client: client);
+
+var result = teams.getMemberships(_teamId: "[TEAM_ID]");
diff --git a/app/sdks/client-swift/docs/examples/teams/get.md b/app/sdks/client-swift/docs/examples/teams/get.md
new file mode 100644
index 0000000000..25bf212a45
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/teams/get.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var teams: Teams = Teams(client: client);
+
+var result = teams.get(_teamId: "[TEAM_ID]");
diff --git a/app/sdks/client-swift/docs/examples/teams/list.md b/app/sdks/client-swift/docs/examples/teams/list.md
new file mode 100644
index 0000000000..8333d1fe43
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/teams/list.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var teams: Teams = Teams(client: client);
+
+var result = teams.list();
diff --git a/app/sdks/client-swift/docs/examples/teams/update-membership-status.md b/app/sdks/client-swift/docs/examples/teams/update-membership-status.md
new file mode 100644
index 0000000000..ae72e4c799
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/teams/update-membership-status.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var teams: Teams = Teams(client: client);
+
+var result = teams.updateMembershipStatus(_teamId: "[TEAM_ID]", _inviteId: "[INVITE_ID]", _userId: "[USER_ID]", _secret: "[SECRET]");
diff --git a/app/sdks/client-swift/docs/examples/teams/update.md b/app/sdks/client-swift/docs/examples/teams/update.md
new file mode 100644
index 0000000000..fafd98b881
--- /dev/null
+++ b/app/sdks/client-swift/docs/examples/teams/update.md
@@ -0,0 +1,14 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+
+var client: Client = Client()
+
+client
+ .setEndpoint(endpoint: "https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
+ .setProject(value: "5df5acd0d48c2") // Your project ID
+
+var teams: Teams = Teams(client: client);
+
+var result = teams.update(_teamId: "[TEAM_ID]", _name: "[NAME]");
diff --git a/app/sdks/client-swift/docs/locale.md b/app/sdks/client-swift/docs/locale.md
new file mode 100644
index 0000000000..efe5a690e2
--- /dev/null
+++ b/app/sdks/client-swift/docs/locale.md
@@ -0,0 +1,64 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+# Locale Service
+
+## Get User Locale
+
+```http request
+GET https://appwrite.io/v1/locale
+```
+
+** Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
+
+([IP Geolocation by DB-IP](https://db-ip.com)) **
+
+## List Continents
+
+```http request
+GET https://appwrite.io/v1/locale/continents
+```
+
+** List of all continents. You can use the locale header to get the data in a supported language. **
+
+## List Countries
+
+```http request
+GET https://appwrite.io/v1/locale/countries
+```
+
+** List of all countries. You can use the locale header to get the data in a supported language. **
+
+## List EU Countries
+
+```http request
+GET https://appwrite.io/v1/locale/countries/eu
+```
+
+** List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language. **
+
+## List Countries Phone Codes
+
+```http request
+GET https://appwrite.io/v1/locale/countries/phones
+```
+
+** List of all countries phone codes. You can use the locale header to get the data in a supported language. **
+
+## List Currencies
+
+```http request
+GET https://appwrite.io/v1/locale/currencies
+```
+
+** List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language. **
+
+## List Languages
+
+```http request
+GET https://appwrite.io/v1/locale/languages
+```
+
+** List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language. **
+
diff --git a/app/sdks/client-swift/docs/storage.md b/app/sdks/client-swift/docs/storage.md
new file mode 100644
index 0000000000..f902ebd2e9
--- /dev/null
+++ b/app/sdks/client-swift/docs/storage.md
@@ -0,0 +1,131 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+# Storage Service
+
+## List Files
+
+```http request
+GET https://appwrite.io/v1/storage/files
+```
+
+** Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project files. [Learn more about different API modes](/docs/admin). **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| search | string | Search term to filter your list results. | |
+| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 |
+| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 |
+| orderType | string | Order result by ASC or DESC order. | ASC |
+
+## Create File
+
+```http request
+POST https://appwrite.io/v1/storage/files
+```
+
+** Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| file | file | Binary file. | |
+| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
+| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
+
+## Get File
+
+```http request
+GET https://appwrite.io/v1/storage/files/{fileId}
+```
+
+** Get file by its unique ID. This endpoint response returns a JSON object with the file metadata. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| fileId | string | **Required** File unique ID. | |
+
+## Update File
+
+```http request
+PUT https://appwrite.io/v1/storage/files/{fileId}
+```
+
+** Update file by its unique ID. Only users with write permissions have access to update this resource. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| fileId | string | **Required** File unique ID. | |
+| read | array | An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
+| write | array | An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions. | |
+
+## Delete File
+
+```http request
+DELETE https://appwrite.io/v1/storage/files/{fileId}
+```
+
+** Delete a file by its unique ID. Only users with write permissions have access to delete this resource. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| fileId | string | **Required** File unique ID. | |
+
+## Get File for Download
+
+```http request
+GET https://appwrite.io/v1/storage/files/{fileId}/download
+```
+
+** Get file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| fileId | string | **Required** File unique ID. | |
+
+## Get File Preview
+
+```http request
+GET https://appwrite.io/v1/storage/files/{fileId}/preview
+```
+
+** Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| fileId | string | **Required** File unique ID | |
+| width | integer | Resize preview image width, Pass an integer between 0 to 4000. | 0 |
+| height | integer | Resize preview image height, Pass an integer between 0 to 4000. | 0 |
+| quality | integer | Preview image quality. Pass an integer between 0 to 100. Defaults to 100. | 100 |
+| background | string | Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. | |
+| output | string | Output format type (jpeg, jpg, png, gif and webp). | |
+
+## Get File for View
+
+```http request
+GET https://appwrite.io/v1/storage/files/{fileId}/view
+```
+
+** Get file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| fileId | string | **Required** File unique ID. | |
+| as | string | Choose a file format to convert your file to. Currently you can only convert word and pdf files to pdf or txt. This option is currently experimental only, use at your own risk. | |
+
diff --git a/app/sdks/client-swift/docs/teams.md b/app/sdks/client-swift/docs/teams.md
new file mode 100644
index 0000000000..7f8b4238a7
--- /dev/null
+++ b/app/sdks/client-swift/docs/teams.md
@@ -0,0 +1,153 @@
+/// Swift Appwrite SDK
+/// Produced by Appwrite SDK Generator
+///
+
+# Teams Service
+
+## List Teams
+
+```http request
+GET https://appwrite.io/v1/teams
+```
+
+** Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project teams. [Learn more about different API modes](/docs/admin). **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| search | string | Search term to filter your list results. | |
+| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 |
+| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 |
+| orderType | string | Order result by ASC or DESC order. | ASC |
+
+## Create Team
+
+```http request
+POST https://appwrite.io/v1/teams
+```
+
+** Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| name | string | Team name. | |
+| roles | array | Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions). | ["owner"] |
+
+## Get Team
+
+```http request
+GET https://appwrite.io/v1/teams/{teamId}
+```
+
+** Get team by its unique ID. All team members have read access for this resource. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| teamId | string | **Required** Team unique ID. | |
+
+## Update Team
+
+```http request
+PUT https://appwrite.io/v1/teams/{teamId}
+```
+
+** Update team by its unique ID. Only team owners have write access for this resource. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| teamId | string | **Required** Team unique ID. | |
+| name | string | Team name. | |
+
+## Delete Team
+
+```http request
+DELETE https://appwrite.io/v1/teams/{teamId}
+```
+
+** Delete team by its unique ID. Only team owners have write access for this resource. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| teamId | string | **Required** Team unique ID. | |
+
+## Get Team Memberships
+
+```http request
+GET https://appwrite.io/v1/teams/{teamId}/memberships
+```
+
+** Get team members by the team unique ID. All team members have read access for this list of resources. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| teamId | string | **Required** Team unique ID. | |
+| search | string | Search term to filter your list results. | |
+| limit | integer | Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request. | 25 |
+| offset | integer | Results offset. The default value is 0. Use this param to manage pagination. | 0 |
+| orderType | string | Order result by ASC or DESC order. | ASC |
+
+## Create Team Membership
+
+```http request
+POST https://appwrite.io/v1/teams/{teamId}/memberships
+```
+
+** Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.
+
+Use the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/client/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
+
+Please note that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| teamId | string | **Required** Team unique ID. | |
+| email | string | New team member email. | |
+| name | string | New team member name. | |
+| roles | array | Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). | |
+| url | string | URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | |
+
+## Delete Team Membership
+
+```http request
+DELETE https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}
+```
+
+** This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if he didn't accept it. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| teamId | string | **Required** Team unique ID. | |
+| inviteId | string | **Required** Invite unique ID. | |
+
+## Update Team Membership Status
+
+```http request
+PATCH https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}/status
+```
+
+** Use this endpoint to allow a user to accept an invitation to join a team after he is being redirected back to your app from the invitation email he was sent. **
+
+### Parameters
+
+| Field Name | Type | Description | Default |
+| --- | --- | --- | --- |
+| teamId | string | **Required** Team unique ID. | |
+| inviteId | string | **Required** Invite unique ID. | |
+| userId | string | User unique ID. | |
+| secret | string | Secret key. | |
+
diff --git a/app/sdks/client-web/README.md b/app/sdks/client-web/README.md
index 093783ab41..41e939b017 100644
--- a/app/sdks/client-web/README.md
+++ b/app/sdks/client-web/README.md
@@ -1,7 +1,7 @@
# Appwrite Web SDK

-
+
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way.
Use the Web SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
diff --git a/app/sdks/console-web/README.md b/app/sdks/console-web/README.md
index 68b7e8ff9c..000e4988f1 100644
--- a/app/sdks/console-web/README.md
+++ b/app/sdks/console-web/README.md
@@ -1,7 +1,7 @@
# Appwrite Console SDK

-
+
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way.
Use the Console SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
diff --git a/app/sdks/console-web/docs/examples/users/delete-user.md b/app/sdks/console-web/docs/examples/users/delete-user.md
new file mode 100644
index 0000000000..40f33e34c2
--- /dev/null
+++ b/app/sdks/console-web/docs/examples/users/delete-user.md
@@ -0,0 +1,15 @@
+let sdk = new Appwrite();
+
+sdk
+ .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
+ .setProject('5df5acd0d48c2') // Your project ID
+ .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
+;
+
+let promise = sdk.users.deleteUser('[USER_ID]');
+
+promise.then(function (response) {
+ console.log(response); // Success
+}, function (error) {
+ console.log(error); // Failure
+});
\ No newline at end of file
diff --git a/app/sdks/console-web/src/sdk.js b/app/sdks/console-web/src/sdk.js
index b246db4cc5..fc8da5a1c2 100644
--- a/app/sdks/console-web/src/sdk.js
+++ b/app/sdks/console-web/src/sdk.js
@@ -4750,6 +4750,30 @@
}, payload);
},
+ /**
+ * Delete User
+ *
+ * Delete a user by its unique ID.
+ *
+ * @param {string} userId
+ * @throws {Error}
+ * @return {Promise}
+ */
+ deleteUser: function(userId) {
+ if(userId === undefined) {
+ throw new Error('Missing required parameter: "userId"');
+ }
+
+ let path = '/users/{userId}'.replace(new RegExp('{userId}', 'g'), userId);
+
+ let payload = {};
+
+ return http
+ .delete(path, {
+ 'content-type': 'application/json',
+ }, payload);
+ },
+
/**
* Get User Logs
*
diff --git a/app/sdks/console-web/src/sdk.min.js b/app/sdks/console-web/src/sdk.min.js
index 6501248b84..2413458654 100644
--- a/app/sdks/console-web/src/sdk.min.js
+++ b/app/sdks/console-web/src/sdk.min.js
@@ -415,7 +415,8 @@ let path='/users';let payload={};if(email){payload.email=email}
if(password){payload.password=password}
if(name){payload.name=name}
return http.post(path,{'content-type':'application/json',},payload)},get:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
-let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},getLogs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
+let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},deleteUser:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
+let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.delete(path,{'content-type':'application/json',},payload)},getLogs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
let path='/users/{userId}/logs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},getPrefs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload)},updatePrefs:function(userId,prefs){if(userId===undefined){throw new Error('Missing required parameter: "userId"')}
if(prefs===undefined){throw new Error('Missing required parameter: "prefs"')}
diff --git a/app/sdks/console-web/types/index.d.ts b/app/sdks/console-web/types/index.d.ts
index b34f32c5bc..e6e7ba776a 100644
--- a/app/sdks/console-web/types/index.d.ts
+++ b/app/sdks/console-web/types/index.d.ts
@@ -1706,6 +1706,17 @@ declare namespace Appwrite {
*/
get(userId: string): Promise